Skip to content

Commit

Permalink
net: gro: no longer use skb_vlan_tag_present()
Browse files Browse the repository at this point in the history
We can remove a conditional test in gro_list_prepare()
by comparing vlan_all fields of the two skbs.

Notes:

While comparing the vlan_proto is not strictly needed,
because part of the following compare_ether_header() call,
using 32bit word is actually faster than using 16bit values.

napi_reuse_skb() makes sure to clear skb->vlan_all,
as it already calls __vlan_hwaccel_clear_tag()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Eric Dumazet authored and Jakub Kicinski committed Nov 12, 2022
1 parent 354259f commit be3ed48
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/core/gro.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,7 @@ static void gro_list_prepare(const struct list_head *head,
}

diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
diffs |= skb_vlan_tag_present(p) ^ skb_vlan_tag_present(skb);
if (skb_vlan_tag_present(p))
diffs |= skb_vlan_tag_get(p) ^ skb_vlan_tag_get(skb);
diffs |= p->vlan_all ^ skb->vlan_all;
diffs |= skb_metadata_differs(p, skb);
if (maclen == ETH_HLEN)
diffs |= compare_ether_header(skb_mac_header(p),
Expand Down

0 comments on commit be3ed48

Please sign in to comment.