aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-03-01 19:37:39 +0000
committerPaolo Abeni <pabeni@redhat.com>2024-03-05 13:30:11 +0100
commitc7583e9f768eeb82f2531c8372584ba89cfade8b (patch)
treedaada686e3890d7c1b85d191bd51140821364e50 /include/net
parentbd56a29c7a4ebcd3ca69505a2e676449e60965f3 (diff)
downloadlinux-c7583e9f768eeb82f2531c8372584ba89cfade8b.tar.gz
net: gro: enable fast path for more cases
Currently the so-called GRO fast path is only enabled for napi_frags_skb() callers. After the prior patch, we no longer have to clear frag0 whenever we pulled bytes to skb->head. We therefore can initialize frag0 to skb->data so that GRO fast path can be used in the following additional cases: - Drivers using header split (populating skb->data with headers, and having payload in one or more page fragments). - Drivers not using any page frag (entire packet is in skb->data) Add a likely() in skb_gro_may_pull() to help the compiler to generate better code if possible. 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')
-rw-r--r--include/net/gro.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/gro.h b/include/net/gro.h
index 3c3666e46b305..2b58671a65492 100644
--- a/include/net/gro.h
+++ b/include/net/gro.h
@@ -148,7 +148,7 @@ static inline void *skb_gro_header_fast(const struct sk_buff *skb,
static inline bool skb_gro_may_pull(const struct sk_buff *skb,
unsigned int hlen)
{
- return hlen <= NAPI_GRO_CB(skb)->frag0_len;
+ return likely(hlen <= NAPI_GRO_CB(skb)->frag0_len);
}
static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,