mbox series

[v5,net-next,0/3] ipv6: avoid atomic fragment on GSO output

Message ID cover.1698156966.git.yan@cloudflare.com (mailing list archive)
Headers show
Series ipv6: avoid atomic fragment on GSO output | expand

Message

Yan Zhai Oct. 24, 2023, 2:26 p.m. UTC
When the ipv6 stack output a GSO packet, if its gso_size is larger than
dst MTU, then all segments would be fragmented. However, it is possible
for a GSO packet to have a trailing segment with smaller actual size
than both gso_size as well as the MTU, which leads to an "atomic
fragment". Atomic fragments are considered harmful in RFC-8021. An
Existing report from APNIC also shows that atomic fragments are more
likely to be dropped even it is equivalent to a no-op [1].

The series contains following changes:
* drop feature RTAX_FEATURE_ALLFRAG, which has been broken. This helps
  simplifying other changes in this set.
* refactor __ip6_finish_output code to separate GSO and non-GSO packet
  processing, mirroring IPv4 side logic.
* avoid generating atomic fragment on GSO packets.

Link: https://www.potaroo.net/presentations/2022-03-01-ipv6-frag.pdf [1]

change log:
V4 -> V5: minor fixup
V3 -> V4: cleaned up all RTAX_FEATURE_ALLFRAG code, rather than just
drop the check at IPv6 output.
V2 -> V3: split the changes to separate commits as Willem de Bruijn suggested
V1 is incorrect and omitted

V4: https://lore.kernel.org/netdev/cover.1698114636.git.yan@cloudflare.com/
V3: https://lore.kernel.org/netdev/cover.1697779681.git.yan@cloudflare.com/
V2: https://lore.kernel.org/netdev/ZS1%2Fqtr0dZJ35VII@debian.debian/

Yan Zhai (3):
  ipv6: drop feature RTAX_FEATURE_ALLFRAG
  ipv6: refactor ip6_finish_output for GSO handling
  ipv6: avoid atomic fragment on GSO packets

 include/net/dst.h                  |  7 -----
 include/net/inet_connection_sock.h |  1 -
 include/net/inet_sock.h            |  1 -
 include/uapi/linux/rtnetlink.h     |  2 +-
 net/ipv4/tcp_output.c              | 20 +------------
 net/ipv6/ip6_output.c              | 45 ++++++++++++++++--------------
 net/ipv6/tcp_ipv6.c                |  1 -
 net/ipv6/xfrm6_output.c            |  2 +-
 net/mptcp/subflow.c                |  1 -
 9 files changed, 27 insertions(+), 53 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 26, 2023, 1:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 24 Oct 2023 07:26:28 -0700 you wrote:
> When the ipv6 stack output a GSO packet, if its gso_size is larger than
> dst MTU, then all segments would be fragmented. However, it is possible
> for a GSO packet to have a trailing segment with smaller actual size
> than both gso_size as well as the MTU, which leads to an "atomic
> fragment". Atomic fragments are considered harmful in RFC-8021. An
> Existing report from APNIC also shows that atomic fragments are more
> likely to be dropped even it is equivalent to a no-op [1].
> 
> [...]

Here is the summary with links:
  - [v5,net-next,1/3] ipv6: drop feature RTAX_FEATURE_ALLFRAG
    https://git.kernel.org/netdev/net-next/c/e57a34478586
  - [v5,net-next,2/3] ipv6: refactor ip6_finish_output for GSO handling
    https://git.kernel.org/netdev/net-next/c/1f7ec1b3721d
  - [v5,net-next,3/3] ipv6: avoid atomic fragment on GSO packets
    https://git.kernel.org/netdev/net-next/c/03d6c848bfb4

You are awesome, thank you!