summaryrefslogtreecommitdiff
path: root/include/net/gro.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-03-01 19:37:37 +0000
committerPaolo Abeni <pabeni@redhat.com>2024-03-05 13:30:11 +0100
commit93e16ea025d234d0ed01d9dc9c819257a2159bb6 (patch)
tree9e8191fedfa92d780b9b9dc90008576ebaf1483a /include/net/gro.h
parent9452c8b459f4641156a09c2212a835a6df2a137e (diff)
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>
Diffstat (limited to 'include/net/gro.h')
-rw-r--r--include/net/gro.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/net/gro.h b/include/net/gro.h
index b435f0ddbf64..ffc2c96d263b 100644
--- a/include/net/gro.h
+++ b/include/net/gro.h
@@ -145,9 +145,10 @@ static inline void *skb_gro_header_fast(struct sk_buff *skb,
return NAPI_GRO_CB(skb)->frag0 + offset;
}
-static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen)
+static inline bool skb_gro_may_pull(const struct sk_buff *skb,
+ unsigned int hlen)
{
- return NAPI_GRO_CB(skb)->frag0_len < hlen;
+ return hlen <= NAPI_GRO_CB(skb)->frag0_len;
}
static inline void skb_gro_frag0_invalidate(struct sk_buff *skb)
@@ -172,7 +173,7 @@ static inline void *skb_gro_header(struct sk_buff *skb,
void *ptr;
ptr = skb_gro_header_fast(skb, offset);
- if (skb_gro_header_hard(skb, hlen))
+ if (!skb_gro_may_pull(skb, hlen))
ptr = skb_gro_header_slow(skb, hlen, offset);
return ptr;
}