ipv6: gro: flush instead of assuming different flows on hop_limit mismatch
authorJakub Kicinski <kuba@kernel.org>
Tue, 25 Jan 2022 04:44:44 +0000 (20:44 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Jan 2022 13:05:11 +0000 (13:05 +0000)
commit6fc2f3832d36d74289680a1bf4484def8321f6e0
treee077ef05f168076713ff4fd8ecc1b111fc8605db
parent10cdc794dae890fb3149e90854e8440cf5bf615e
ipv6: gro: flush instead of assuming different flows on hop_limit mismatch

IPv6 GRO considers packets to belong to different flows when their
hop_limit is different. This seems counter-intuitive, the flow is
the same. hop_limit may vary because of various bugs or hacks but
that doesn't mean it's okay for GRO to reorder packets.

Practical impact of this problem on overall TCP performance
is unclear, but TCP itself detects this reordering and bumps
TCPSACKReorder resulting in user complaints.

Eric warns that there may be performance regressions in setups
which do packet spraying across links with similar RTT but different
hop count. To be safe let's target -next and not treat this
as a fix. If the packet spraying is using flow label there should
be no difference in behavior as flow label is checked first.

Note that the code plays an easy to miss trick by upcasting next_hdr
to a u16 pointer and compares next_hdr and hop_limit in one go.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_offload.c