Message ID | fcc82c64961666cd10c5e275156f80396a709205.1626882513.git.pabeni@redhat.com (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | sk_buff: optimize layout for GRO | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Guessed tree name to be net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 10 maintainers not CCed: linmiaohe@huawei.com jonathan.lemon@gmail.com gnault@redhat.com wenxu@ucloud.cn cong.wang@bytedance.com elver@google.com willemb@google.com alobakin@pm.me nogikh@google.com haokexin@gmail.com |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 6051 this patch: 6051 |
netdev/kdoc | fail | Errors and warnings before: 1 this patch: 2 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 44 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 6111 this patch: 6111 |
netdev/header_inline | success | Link |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a3e756575aa7..7acf2a203918 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -897,8 +897,6 @@ struct sk_buff { __u32 priority; int skb_iif; __u32 hash; - __be16 vlan_proto; - __u16 vlan_tci; #if defined(CONFIG_NET_RX_BUSY_POLL) || defined(CONFIG_XPS) union { unsigned int napi_id; @@ -955,6 +953,14 @@ struct sk_buff { }; __u64 inner_headers; }; + + union { + struct { + __be16 vlan_proto; + __u16 vlan_tci; + }; + __u32 vlan_info; + }; }; #ifdef __KERNEL__ diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 53b8db10e567..c59e90db80d5 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -996,6 +996,8 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old) __skb_ext_copy(new, old); __nf_copy(new, old, false); __skb_copy_inner_headers(new, old); + if (old->vlan_present) + new->vlan_info = old->vlan_info; /* Note : this field could be in headers_start/headers_end section * It is not yet because we do not want to have a 16 bit hole @@ -1007,13 +1009,12 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old) offsetof(struct sk_buff, headers_start)); CHECK_SKB_FIELD(_state); CHECK_SKB_FIELD(__pkt_encapsulation_offset); + CHECK_SKB_FIELD(__pkt_vlan_present_offset); CHECK_SKB_FIELD(protocol); CHECK_SKB_FIELD(csum); CHECK_SKB_FIELD(hash); CHECK_SKB_FIELD(priority); CHECK_SKB_FIELD(skb_iif); - CHECK_SKB_FIELD(vlan_proto); - CHECK_SKB_FIELD(vlan_tci); CHECK_SKB_FIELD(transport_header); CHECK_SKB_FIELD(network_header); CHECK_SKB_FIELD(mac_header);
Such field validity is already tracked by the existing 'vlan_present' bit. Move them after tail and conditinally copy as needed. Signed-off-by: Paolo Abeni <pabeni@redhat.com> --- include/linux/skbuff.h | 10 ++++++++-- net/core/skbuff.c | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-)