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

net: gro: rename skb_gro_header_hard()

skb_gro_header_hard() is renamed to skb_gro_may_pull() to match
the convention used by common helpers like pskb_may_pull().

This means the condition is inverted:

if (skb_gro_header_hard(skb, hlen))
slow_path();

becomes:

if (!skb_gro_may_pull(skb, hlen))
slow_path();

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Eric Dumazet and committed by
Paolo Abeni
93e16ea0 9452c8b4

+9 -8
+1 -1
drivers/net/geneve.c
··· 508 508 gh_len = geneve_hlen(gh); 509 509 510 510 hlen = off_gnv + gh_len; 511 - if (skb_gro_header_hard(skb, hlen)) { 511 + if (!skb_gro_may_pull(skb, hlen)) { 512 512 gh = skb_gro_header_slow(skb, hlen, off_gnv); 513 513 if (unlikely(!gh)) 514 514 goto out;
+4 -3
include/net/gro.h
··· 145 145 return NAPI_GRO_CB(skb)->frag0 + offset; 146 146 } 147 147 148 - static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen) 148 + static inline bool skb_gro_may_pull(const struct sk_buff *skb, 149 + unsigned int hlen) 149 150 { 150 - return NAPI_GRO_CB(skb)->frag0_len < hlen; 151 + return hlen <= NAPI_GRO_CB(skb)->frag0_len; 151 152 } 152 153 153 154 static inline void skb_gro_frag0_invalidate(struct sk_buff *skb) ··· 173 172 void *ptr; 174 173 175 174 ptr = skb_gro_header_fast(skb, offset); 176 - if (skb_gro_header_hard(skb, hlen)) 175 + if (!skb_gro_may_pull(skb, hlen)) 177 176 ptr = skb_gro_header_slow(skb, hlen, offset); 178 177 return ptr; 179 178 }
+1 -1
net/core/gro.c
··· 700 700 skb_reset_mac_header(skb); 701 701 skb_gro_reset_offset(skb, hlen); 702 702 703 - if (unlikely(skb_gro_header_hard(skb, hlen))) { 703 + if (unlikely(!skb_gro_may_pull(skb, hlen))) { 704 704 eth = skb_gro_header_slow(skb, hlen, 0); 705 705 if (unlikely(!eth)) { 706 706 net_warn_ratelimited("%s: dropping impossible skb from %s\n",
+1 -1
net/ipv4/fou_core.c
··· 351 351 optlen = guehdr->hlen << 2; 352 352 len += optlen; 353 353 354 - if (skb_gro_header_hard(skb, len)) { 354 + if (!skb_gro_may_pull(skb, len)) { 355 355 guehdr = skb_gro_header_slow(skb, len, off); 356 356 if (unlikely(!guehdr)) 357 357 goto out;
+1 -1
net/ipv4/gre_offload.c
··· 174 174 grehlen += GRE_HEADER_SECTION; 175 175 176 176 hlen = off + grehlen; 177 - if (skb_gro_header_hard(skb, hlen)) { 177 + if (!skb_gro_may_pull(skb, hlen)) { 178 178 greh = skb_gro_header_slow(skb, hlen, off); 179 179 if (unlikely(!greh)) 180 180 goto out;
+1 -1
net/ipv4/tcp_offload.c
··· 204 204 goto out; 205 205 206 206 hlen = off + thlen; 207 - if (skb_gro_header_hard(skb, hlen)) { 207 + if (!skb_gro_may_pull(skb, hlen)) { 208 208 th = skb_gro_header_slow(skb, hlen, off); 209 209 if (unlikely(!th)) 210 210 goto out;