diff options
author | Eric Dumazet <edumazet@google.com> | 2024-03-01 22:37:39 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-03-05 15:30:11 +0300 |
commit | c7583e9f768eeb82f2531c8372584ba89cfade8b (patch) | |
tree | daada686e3890d7c1b85d191bd51140821364e50 /include/net/gro.h | |
parent | bd56a29c7a4ebcd3ca69505a2e676449e60965f3 (diff) | |
download | linux-c7583e9f768eeb82f2531c8372584ba89cfade8b.tar.xz |
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/gro.h')
-rw-r--r-- | include/net/gro.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/gro.h b/include/net/gro.h index 3c3666e46b30..2b58671a6549 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, |