Commit 7ad18ff
gro: fix napi_gro_frags() Fast GRO breakage due to IP alignment check
Commit 38ec494 ("gro: ensure frag0 meets IP header alignment")
did the right thing, but missed the fact that napi_gro_frags() logics
calls for skb_gro_reset_offset() *before* pulling Ethernet header
to the skb linear space.
That said, the introduced check for frag0 address being aligned to 4
always fails for it as Ethernet header is obviously 14 bytes long,
and in case with NET_IP_ALIGN its start is not aligned to 4.
Fix this by adding @nhoff argument to skb_gro_reset_offset() which
tells if an IP header is placed right at the start of frag0 or not.
This restores Fast GRO for napi_gro_frags() that became very slow
after the mentioned commit, and preserves the introduced check to
avoid silent unaligned accesses.
From v1 [0]:
- inline tiny skb_gro_reset_offset() to let the code be optimized
more efficively (esp. for the !NET_IP_ALIGN case) (Eric);
- pull in Reviewed-by from Eric.
[0] https://lore.kernel.org/netdev/20210418114200.5839-1-alobakin@pm.me
Fixes: 38ec494 ("gro: ensure frag0 meets IP header alignment")
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 8d892d6 commit 7ad18ff
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5914 | 5914 | | |
5915 | 5915 | | |
5916 | 5916 | | |
5917 | | - | |
| 5917 | + | |
5918 | 5918 | | |
5919 | 5919 | | |
5920 | 5920 | | |
| |||
5925 | 5925 | | |
5926 | 5926 | | |
5927 | 5927 | | |
5928 | | - | |
| 5928 | + | |
5929 | 5929 | | |
5930 | 5930 | | |
5931 | 5931 | | |
| |||
6143 | 6143 | | |
6144 | 6144 | | |
6145 | 6145 | | |
6146 | | - | |
| 6146 | + | |
6147 | 6147 | | |
6148 | 6148 | | |
6149 | 6149 | | |
| |||
6232 | 6232 | | |
6233 | 6233 | | |
6234 | 6234 | | |
6235 | | - | |
| 6235 | + | |
6236 | 6236 | | |
6237 | 6237 | | |
6238 | 6238 | | |
| |||
0 commit comments