Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipv6: reorganise struct ipv6_pinfo

Move fields used in tx fast path at the beginning of the structure,
and seldom used ones at the end.

Note that rxopt is also in the first cache line.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250916160951.541279-5-edumazet@google.com
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Eric Dumazet and committed by
Paolo Abeni
b76543b2 9fba1eb3

+16 -17
+16 -17
include/linux/ipv6.h
··· 214 214 215 215 /* struct ipv6_pinfo - ipv6 private area */ 216 216 struct ipv6_pinfo { 217 + /* Used in tx path (inet6_csk_route_socket(), ip6_xmit()) */ 217 218 struct in6_addr saddr; 218 - struct in6_pktinfo sticky_pktinfo; 219 + __be32 flow_label; 220 + u32 dst_cookie; 221 + struct ipv6_txoptions __rcu *opt; 222 + s16 hop_limit; 223 + u8 pmtudisc; 224 + u8 tclass; 219 225 #ifdef CONFIG_IPV6_SUBTREES 220 226 bool saddr_cache; 221 227 #endif 222 228 bool daddr_cache; 223 229 224 - __be32 flow_label; 225 - __u32 frag_size; 226 - 227 - s16 hop_limit; 228 230 u8 mcast_hops; 231 + u32 frag_size; 229 232 230 233 int ucast_oif; 231 234 int mcast_oif; ··· 236 233 /* pktoption flags */ 237 234 union { 238 235 struct { 239 - __u16 srcrt:1, 236 + u16 srcrt:1, 240 237 osrcrt:1, 241 238 rxinfo:1, 242 239 rxoinfo:1, ··· 253 250 recvfragsize:1; 254 251 /* 1 bits hole */ 255 252 } bits; 256 - __u16 all; 253 + u16 all; 257 254 } rxopt; 258 255 259 256 /* sockopt flags */ 260 - __u8 srcprefs; /* 001: prefer temporary address 257 + u8 srcprefs; /* 001: prefer temporary address 261 258 * 010: prefer public address 262 259 * 100: prefer care-of address 263 260 */ 264 - __u8 pmtudisc; 265 - __u8 min_hopcount; 266 - __u8 tclass; 261 + u8 min_hopcount; 267 262 __be32 rcv_flowinfo; 263 + struct in6_pktinfo sticky_pktinfo; 268 264 269 - __u32 dst_cookie; 265 + struct sk_buff *pktoptions; 266 + struct sk_buff *rxpmtu; 267 + struct inet6_cork cork; 270 268 271 269 struct ipv6_mc_socklist __rcu *ipv6_mc_list; 272 270 struct ipv6_ac_socklist *ipv6_ac_list; 273 271 struct ipv6_fl_socklist __rcu *ipv6_fl_list; 274 - 275 - struct ipv6_txoptions __rcu *opt; 276 - struct sk_buff *pktoptions; 277 - struct sk_buff *rxpmtu; 278 - struct inet6_cork cork; 279 272 }; 280 273 281 274 /* We currently use available bits from inet_sk(sk)->inet_flags,