ipv6: avoid atomic fragment on GSO packets
Subsystems (3)
PATCH v2 1/1 ipv6: avoid atomic fragment on GSO packets
GSO packets can contain a trailing segment that is smaller than gso_size. When examining the dst MTU for such packet, if its gso_size is too large, then all segments would be fragmented. However, there is a good chance the trailing segment has smaller actual size than both gso_size as well as the MTU, which leads to an "atomic fragment". It is 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].
Refactor __ip6_finish_output code to separate GSO and non-GSO packet processing. It mirrors __ip_finish_output logic now. Add an extra check in GSO handling to avoid atomic fragments. Lastly, drop dst_allfrag check, which is no longer true since commit 9d289715eb5c ("ipv6: stop sending PTB packets for MTU < 1280").
--- net/ipv6/ip6_output.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)
net/ipv6/ip6_output.c +23 -10
@@ -162,7 +162,14 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,int err;skb_mark_not_on_list (segs); - err =ip6_fragment (net, sk, segs, ip6_finish_output2); +/* Last gso segment might be smaller than actual MTU. Adding +* a fragment header to it would produce an "atomic fragment", +* which is considered harmful (RFC-8021) +*/ + err = segs->len > mtu ? +ip6_fragment (net, sk, segs, ip6_finish_output2) : +ip6_finish_output2 (net, sk, segs); +if (err && ret ==0 ) ret = err; }
@@ -170,10 +177,19 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,return ret; } +static int ip6_finish_output_gso (struct net *net,struct sock *sk, +struct sk_buff *skb,unsigned int mtu) +{ +if (!(IP6CB (skb)->flags &IP6SKB_FAKEJUMBO ) && + !skb_gso_validate_network_len (skb, mtu)) +return ip6_finish_output_gso_slowpath_drop (net, sk, skb, mtu); + +return ip6_finish_output2 (net, sk, skb); +} +static int __ip6_finish_output (struct net *net,struct sock *sk,struct sk_buff *skb) {unsigned int mtu; -#if defined(CONFIG_NETFILTER ) && defined(CONFIG_XFRM )/* Policy lookup after SNAT yielded a new policy */ if (skb_dst (skb)->xfrm) {
@@ -183,17 +199,14 @@ static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff#endif mtu =ip6_skb_dst_mtu (skb); -if (skb_is_gso (skb) && - !(IP6CB (skb)->flags &IP6SKB_FAKEJUMBO ) && - !skb_gso_validate_network_len (skb, mtu)) -return ip6_finish_output_gso_slowpath_drop (net, sk, skb, mtu); +if (skb_is_gso (skb)) +return ip6_finish_output_gso (net, sk, skb, mtu); -if ((skb->len > mtu && !skb_is_gso (skb)) || -dst_allfrag (skb_dst (skb)) || +if (skb->len > mtu || (IP6CB (skb)->frag_max_size && skb->len >IP6CB (skb)->frag_max_size))return ip6_fragment (net, sk, skb, ip6_finish_output2); -else -return ip6_finish_output2 (net, sk, skb); + +return ip6_finish_output2 (net, sk, skb); }static int ip6_finish_output (struct net *net,struct sock *sk,struct sk_buff *skb)
Signature · 1 line
2.30.2
Quoted 16 lines · Yan Zhai
GSO packets can contain a trailing segment that is smaller than
gso_size. When examining the dst MTU for such packet, if itsgso_sizeis too large, then all segments would be fragmented. However, there is a good chance the trailing segment has smaller actual size than bothgso_sizeas well as the MTU, which leads to an "atomic fragment". It is 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].Refactor
__ip6_finish_outputcode to separate GSO and non-GSO packet processing. It mirrors__ip_finish_outputlogic now. Add an extra check in GSO handling to avoid atomic fragments. Lastly, dropdst_allfragcheck, which is no longer true since commit9d289715eb5c("ipv6: stop sending PTB packets for MTU < 1280").
Quoted 6 lines
Fixes b210de4f8c97 ("net: ipv6: Validate GSO SKB before finish IPv6 processing")Suggested-by Florian Westphal <[email protected]>Reported-by David Wragg <[email protected]>Signed-off-by Yan Zhai <[email protected]>---
Forgot to add v1 thread:
https://lore.kernel.org/lkml/[email protected]/. It was wrongly implemented though without considering max_frag_size for non-GSO packets though, so not really useful in fact.
Quoted 70 lines
net/ipv6/ip6_output.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)net/ipv6/ip6_output.c +23
-11@@ -162,7 +162,14 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,int err;skb_mark_not_on_list (segs); - err =ip6_fragment (net, sk, segs, ip6_finish_output2); +/* Last gso segment might be smaller than actual MTU. Adding +* a fragment header to it would produce an "atomic fragment", +* which is considered harmful (RFC-8021) +*/ + err = segs->len > mtu ? +ip6_fragment (net, sk, segs, ip6_finish_output2) : +ip6_finish_output2 (net, sk, segs); +if (err && ret ==0 ) ret = err; }@@ -170,10 +177,19 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,return ret; } +static int ip6_finish_output_gso (struct net *net,struct sock *sk, +struct sk_buff *skb,unsigned int mtu) +{ +if (!(IP6CB (skb)->flags &IP6SKB_FAKEJUMBO ) && + !skb_gso_validate_network_len (skb, mtu)) +return ip6_finish_output_gso_slowpath_drop (net, sk, skb, mtu); + +return ip6_finish_output2 (net, sk, skb); +} +static int __ip6_finish_output (struct net *net,struct sock *sk,struct sk_buff *skb) {unsigned int mtu; -#if defined(CONFIG_NETFILTER ) && defined(CONFIG_XFRM )/* Policy lookup after SNAT yielded a new policy */ if (skb_dst (skb)->xfrm) {@@ -183,17 +199,14 @@ static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff#endif mtu =ip6_skb_dst_mtu (skb); -if (skb_is_gso (skb) && - !(IP6CB (skb)->flags &IP6SKB_FAKEJUMBO ) && - !skb_gso_validate_network_len (skb, mtu)) -return ip6_finish_output_gso_slowpath_drop (net, sk, skb, mtu); +if (skb_is_gso (skb)) +return ip6_finish_output_gso (net, sk, skb, mtu); -if ((skb->len > mtu && !skb_is_gso (skb)) || -dst_allfrag (skb_dst (skb)) || +if (skb->len > mtu || (IP6CB (skb)->frag_max_size && skb->len >IP6CB (skb)->frag_max_size))return ip6_fragment (net, sk, skb, ip6_finish_output2); -else -return ip6_finish_output2 (net, sk, skb); + +return ip6_finish_output2 (net, sk, skb); }static int ip6_finish_output (struct net *net,struct sock *sk,struct sk_buff *skb) --2.30.2
Quoted 45 lines · Yan Zhai
GSO packets can contain a trailing segment that is smaller than
gso_size. When examining the dst MTU for such packet, if itsgso_sizeis too large, then all segments would be fragmented. However, there is a good chance the trailing segment has smaller actual size than bothgso_sizeas well as the MTU, which leads to an "atomic fragment". It is 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].Refactor
__ip6_finish_outputcode to separate GSO and non-GSO packet processing. It mirrors__ip_finish_outputlogic now. Add an extra check in GSO handling to avoid atomic fragments. Lastly, dropdst_allfragcheck, which is no longer true since commit9d289715eb5c("ipv6: stop sending PTB packets for MTU < 1280").Fixes b210de4f8c97 ("net: ipv6: Validate GSO SKB before finish IPv6 processing")Suggested-by Florian Westphal <[email protected]>Reported-by David Wragg <[email protected]>Signed-off-by Yan Zhai <[email protected]>--- net/ipv6/ip6_output.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)net/ipv6/ip6_output.c +8
-1@@ -162,7 +162,14 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,int err;skb_mark_not_on_list (segs); - err =ip6_fragment (net, sk, segs, ip6_finish_output2); +/* Last gso segment might be smaller than actual MTU. Adding +* a fragment header to it would produce an "atomic fragment", +* which is considered harmful (RFC-8021) +*/ + err = segs->len > mtu ? +ip6_fragment (net, sk, segs, ip6_finish_output2) : +ip6_finish_output2 (net, sk, segs); +if (err && ret ==0 ) ret = err; }
net/ipv6/ip6_output.c ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk, · line 185
Quoted 9 lines
net/ipv6/ip6_output.c +6
-0@@ -170,10 +177,19 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,return ret; } +static int ip6_finish_output_gso (struct net *net,struct sock *sk, +struct sk_buff *skb,unsigned int mtu) +{ +if (!(IP6CB (skb)->flags &IP6SKB_FAKEJUMBO ) && + !skb_gso_validate_network_len (skb, mtu)) +return ip6_finish_output_gso_slowpath_drop (net, sk, skb, mtu);
If we are sending fakejumbo or have a frame that doesn't pass the muster it is just going immediately to ip6_finish_output. I think the checks that you removed are needed to keep the socket from getting stuck sending frames that will probably be discarded.
net/ipv6/ip6_output.c ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk, · line 176
Quoted 8 lines
net/ipv6/ip6_output.c +4
-1+ +return ip6_finish_output2 (net, sk, skb); +} +static int __ip6_finish_output (struct net *net,struct sock *sk,struct sk_buff *skb) {unsigned int mtu; -
This blank line can probably be left there to separate variable declarations from code.
Quoted 7 lines
net/ipv6/ip6_output.c +0
-0#if defined(CONFIG_NETFILTER ) && defined(CONFIG_XFRM )/* Policy lookup after SNAT yielded a new policy */ if (skb_dst (skb)->xfrm) {@@ -183,17 +199,14 @@ static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff#endif mtu =ip6_skb_dst_mtu (skb);
net/ipv6/ip6_output.c static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff · line 205
Quoted 10 lines
net/ipv6/ip6_output.c +3
-6-if (skb_is_gso (skb) && - !(IP6CB (skb)->flags &IP6SKB_FAKEJUMBO ) && - !skb_gso_validate_network_len (skb, mtu)) -return ip6_finish_output_gso_slowpath_drop (net, sk, skb, mtu); +if (skb_is_gso (skb)) +return ip6_finish_output_gso (net, sk, skb, mtu); - if ((skb->len > mtu && !skb_is_gso(skb)) || - dst_allfrag(skb_dst(skb)) || + if (skb->len > mtu ||
This change looks a bit too aggressive to me. Basically if the frame is gso you now bypass the ip6_fragment entirely and are ignoring the dst_allfrag and frag_max_size case below. See the fail_toobig code in ip6_fragment.
Quoted 9 lines
net/ipv6/ip6_output.c +2
-2(IP6CB(skb)->frag_max_size && skb->len > IP6CB(skb)->frag_max_size))return ip6_fragment (net, sk, skb, ip6_finish_output2); - else - return ip6_finish_output2(net, sk, skb); + +return ip6_finish_output2 (net, sk, skb); }static int ip6_finish_output (struct net *net,struct sock *sk,struct sk_buff *skb)
Quoted 50 lines · Alexander H Duyck
Quoted 48 lines · Yan Zhai
GSO packets can contain a trailing segment that is smaller than
gso_size. When examining the dst MTU for such packet, if itsgso_sizeis too large, then all segments would be fragmented. However, there is a good chance the trailing segment has smaller actual size than bothgso_sizeas well as the MTU, which leads to an "atomic fragment". It is 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].Refactor
__ip6_finish_outputcode to separate GSO and non-GSO packet processing. It mirrors__ip_finish_outputlogic now. Add an extra check in GSO handling to avoid atomic fragments. Lastly, dropdst_allfragcheck, which is no longer true since commit9d289715eb5c("ipv6: stop sending PTB packets for MTU < 1280").Fixes b210de4f8c97 ("net: ipv6: Validate GSO SKB before finish IPv6 processing")Suggested-by Florian Westphal <[email protected]>Reported-by David Wragg <[email protected]>Signed-off-by Yan Zhai <[email protected]>--- net/ipv6/ip6_output.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)net/ipv6/ip6_output.c +8
-1@@ -162,7 +162,14 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,int err;skb_mark_not_on_list (segs); - err =ip6_fragment (net, sk, segs, ip6_finish_output2); +/* Last gso segment might be smaller than actual MTU. Adding +* a fragment header to it would produce an "atomic fragment", +* which is considered harmful (RFC-8021) +*/ + err = segs->len > mtu ? +ip6_fragment (net, sk, segs, ip6_finish_output2) : +ip6_finish_output2 (net, sk, segs); +if (err && ret ==0 ) ret = err; }@@ -170,10 +177,19 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,return ret; }
Quoted 12 lines
net/ipv6/ip6_output.c ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk, · line 185
Quoted 6 lines
net/ipv6/ip6_output.c +6
-0+static int ip6_finish_output_gso (struct net *net,struct sock *sk, +struct sk_buff *skb,unsigned int mtu) +{ +if (!(IP6CB (skb)->flags &IP6SKB_FAKEJUMBO ) && + !skb_gso_validate_network_len (skb, mtu)) +return ip6_finish_output_gso_slowpath_drop (net, sk, skb, mtu);If we are sending fakejumbo or have a frame that doesn't pass the muster it is just going immediately to
ip6_finish_output. I think the checks that you removed are needed to keep the socket from getting stuck sending frames that will probably be discarded.
Hi Alexander,
Thanks for the feedback! But I am not sure I follow the situation you mentioned here. If it is a fake jumbo but non GSO packet, it won't enter ip6_finish_output_gso. What I am really skipping are the dst_allfrag and frag_max_size checks on GSO packets, and dst_allfrag on non-GSO packets.
As to dst_allfrag, I looked back at the case when this was added:
https://www.mail-archive.com/[email protected]/msg03399.html
The actual feature was set only when a PMTU message carries a value smaller than 1280 byte. But the main line kernel just drops such messages now since the commit I pointed to in the change log (which makes sense because the feature was set based on old RFC-2460 guidelines, and those have been deprecated in RFC-8200). Iproute2 also doesn't expose this option as well. Is there any case that I am not aware of here that still relies on it?
For frag_max_size, I might be wrong but to my best knowledge it only applies when netfilter defrags packets. However, when dealing with fragments, both local output and GRO code won't produce GSO packets in the first place. Similarly, if we look at IPv4 implementation, it also does not consider frag_max_size in GSO handling. So I intentionally skip this for GSO packets in the change. WDYT?
Quoted 12 lines
net/ipv6/ip6_output.c ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk, · line 176
Quoted 8 lines
net/ipv6/ip6_output.c +4
-1+ +return ip6_finish_output2 (net, sk, skb); +} +static int __ip6_finish_output (struct net *net,struct sock *sk,struct sk_buff *skb) {unsigned int mtu; -This blank line can probably be left there to separate variable declarations from code.
my bad, should not have included it. I'll revise this.
thanks
Yan
Quoted 33 lines
Quoted 7 lines
net/ipv6/ip6_output.c +0
-0#if defined(CONFIG_NETFILTER ) && defined(CONFIG_XFRM )/* Policy lookup after SNAT yielded a new policy */ if (skb_dst (skb)->xfrm) {@@ -183,17 +199,14 @@ static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff#endif mtu =ip6_skb_dst_mtu (skb);net/ipv6/ip6_output.c static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff · line 205
Quoted 10 lines
net/ipv6/ip6_output.c +3
-6-if (skb_is_gso (skb) && - !(IP6CB (skb)->flags &IP6SKB_FAKEJUMBO ) && - !skb_gso_validate_network_len (skb, mtu)) -return ip6_finish_output_gso_slowpath_drop (net, sk, skb, mtu); +if (skb_is_gso (skb)) +return ip6_finish_output_gso (net, sk, skb, mtu); - if ((skb->len > mtu && !skb_is_gso(skb)) || - dst_allfrag(skb_dst(skb)) || + if (skb->len > mtu ||This change looks a bit too aggressive to me. Basically if the frame is gso you now bypass the
ip6_fragmententirely and are ignoring thedst_allfragandfrag_max_sizecase below. See thefail_toobigcode inip6_fragment.Quoted 9 lines
net/ipv6/ip6_output.c +2
-2(IP6CB(skb)->frag_max_size && skb->len > IP6CB(skb)->frag_max_size))return ip6_fragment (net, sk, skb, ip6_finish_output2); - else - return ip6_finish_output2(net, sk, skb); + +return ip6_finish_output2 (net, sk, skb); }static int ip6_finish_output (struct net *net,struct sock *sk,struct sk_buff *skb)
Quoted 86 lines · Yan Zhai
Quoted 50 lines · Alexander H Duyck
Quoted 48 lines · Yan Zhai
GSO packets can contain a trailing segment that is smaller than
gso_size. When examining the dst MTU for such packet, if itsgso_sizeis too large, then all segments would be fragmented. However, there is a good chance the trailing segment has smaller actual size than bothgso_sizeas well as the MTU, which leads to an "atomic fragment". It is 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].Refactor
__ip6_finish_outputcode to separate GSO and non-GSO packet processing. It mirrors__ip_finish_outputlogic now. Add an extra check in GSO handling to avoid atomic fragments. Lastly, dropdst_allfragcheck, which is no longer true since commit9d289715eb5c("ipv6: stop sending PTB packets for MTU < 1280").Fixes b210de4f8c97 ("net: ipv6: Validate GSO SKB before finish IPv6 processing")Suggested-by Florian Westphal <[email protected]>Reported-by David Wragg <[email protected]>Signed-off-by Yan Zhai <[email protected]>--- net/ipv6/ip6_output.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)net/ipv6/ip6_output.c +8
-1@@ -162,7 +162,14 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,int err;skb_mark_not_on_list (segs); - err =ip6_fragment (net, sk, segs, ip6_finish_output2); +/* Last gso segment might be smaller than actual MTU. Adding +* a fragment header to it would produce an "atomic fragment", +* which is considered harmful (RFC-8021) +*/ + err = segs->len > mtu ? +ip6_fragment (net, sk, segs, ip6_finish_output2) : +ip6_finish_output2 (net, sk, segs); +if (err && ret ==0 ) ret = err; }@@ -170,10 +177,19 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,return ret; }Quoted 12 lines
net/ipv6/ip6_output.c ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk, · line 185
Quoted 6 lines
net/ipv6/ip6_output.c +6
-0+static int ip6_finish_output_gso (struct net *net,struct sock *sk, +struct sk_buff *skb,unsigned int mtu) +{ +if (!(IP6CB (skb)->flags &IP6SKB_FAKEJUMBO ) && + !skb_gso_validate_network_len (skb, mtu)) +return ip6_finish_output_gso_slowpath_drop (net, sk, skb, mtu);If we are sending fakejumbo or have a frame that doesn't pass the muster it is just going immediately to
ip6_finish_output. I think the checks that you removed are needed to keep the socket from getting stuck sending frames that will probably be discarded.Hi Alexander,
Thanks for the feedback! But I am not sure I follow the situation you mentioned here. If it is a fake jumbo but non GSO packet, it won't enter
ip6_finish_output_gso. What I am really skipping are thedst_allfragandfrag_max_sizechecks on GSO packets, anddst_allfragon non-GSO packets.As to
dst_allfrag, I looked back at the case when this was added:https://www.mail-archive.com/[email protected]/msg03399.html
The actual feature was set only when a PMTU message carries a value smaller than 1280 byte. But the main line kernel just drops such messages now since the commit I pointed to in the change log (which makes sense because the feature was set based on old RFC-2460 guidelines, and those have been deprecated in RFC-8200). Iproute2 also doesn't expose this option as well. Is there any case that I am not aware of here that still relies on it?
Quoted 6 lines
For
frag_max_size, I might be wrong but to my best knowledge it only applies when netfilter defrags packets. However, when dealing with fragments, both local output and GRO code won't produce GSO packets in the first place. Similarly, if we look at IPv4 implementation, it also does not considerfrag_max_sizein GSO handling. So I intentionally skip this for GSO packets in the change. WDYT?
I am not certain. Just looking at the code it seems like there were a number of corner cases handled that this is getting rid of the code for. Specifically my main concern is GSO being enabled for a path where the MTU is incorrect due to something such as a tunnel being between the system and the endpoint. In such a case it would normally send back an ICMP message triggering a path MTU update which would then have to ripple through.
I'm not an IPv6 expert though so perhaps I will leave that for somebody else to provide feedback on.
net/ipv6/ip6_output.c static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff · line 192
Quoted 9 lines · Yan Zhai
Refactor
__ip6_finish_outputcode to separate GSO and non-GSO packet processing. It mirrors__ip_finish_outputlogic now. Add an extra check in GSO handling to avoid atomic fragments. Lastly, dropdst_allfragcheck, which is no longer true since commit9d289715eb5c("ipv6: stop sending PTB packets for MTU < 1280").net/ipv6/ip6_output.c +0
-2- if ((skb->len > mtu && !skb_is_gso(skb)) || - dst_allfrag(skb_dst(skb)) ||
My preference is to first remove dst_allfrag, i.e. do this in a separate change.
Quoted 9 lines · Florian Westphal
Quoted 5 lines · Yan Zhai
Refactor
__ip6_finish_outputcode to separate GSO and non-GSO packet processing. It mirrors__ip_finish_outputlogic now. Add an extra check in GSO handling to avoid atomic fragments. Lastly, dropdst_allfragcheck, which is no longer true since commit9d289715eb5c("ipv6: stop sending PTB packets for MTU < 1280").
Quoted 5 lines
net/ipv6/ip6_output.c static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff · line 192
Quoted 2 lines
net/ipv6/ip6_output.c +0
-2- if ((skb->len > mtu && !skb_is_gso(skb)) || - dst_allfrag(skb_dst(skb)) ||My preference is to first remove
dst_allfrag, i.e. do this in a separate change.
You mean completely removing all dst_allfrag references and related stuff such like IP cork flags/socket flags? I was debating, it might be cleaner that way but it does not fit so well with the subject of this patch. I can open a new patchset to clean that up separately. For this one, I guess I can keep dst_allfrag for now and come back with a V3. Does that sound good to you?
Yan
Quoted 17 lines · Yan Zhai
Quoted 9 lines · Florian Westphal
Quoted 5 lines · Yan Zhai
Refactor
__ip6_finish_outputcode to separate GSO and non-GSO packet processing. It mirrors__ip_finish_outputlogic now. Add an extra check in GSO handling to avoid atomic fragments. Lastly, dropdst_allfragcheck, which is no longer true since commit9d289715eb5c("ipv6: stop sending PTB packets for MTU < 1280").Quoted 5 lines
net/ipv6/ip6_output.c static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff · line 192
Quoted 2 lines
net/ipv6/ip6_output.c +0
-2- if ((skb->len > mtu && !skb_is_gso(skb)) || - dst_allfrag(skb_dst(skb)) ||My preference is to first remove
dst_allfrag, i.e. do this in a separate change.
Quoted 6 lines
You mean completely removing all
dst_allfragreferences and related stuff such like IP cork flags/socket flags? I was debating, it might be cleaner that way but it does not fit so well with the subject of this patch. I can open a new patchset to clean that up separately. For this one, I guess I can keepdst_allfragfor now and come back with a V3. Does that sound good to you?
The second paragraph in the commit message really makes clear that this combines three changes in one patch. Of which the largest one in terms of code churn is supposed to be a NOOP.
Separating into three patches will make all three more clear. They can be pushed as one series, conceivably.
Quoted 8 lines · Willem de Bruijn
The second paragraph in the commit message really makes clear that this combines three changes in one patch. Of which the largest one in terms of code churn is supposed to be a NOOP.
Separating into three patches will make all three more clear. They can be pushed as one series, conceivably.
Thanks for clarifying. In that case I am just gonna remove dst_allfrag in ip6_finish_output rather than everywhere for the series. Remaining cleanup can come later then. In fact there were some past considerations already on this:
https://lkml.kernel.org/netdev/1335348157.3274.30.camel@edumazet-glaptop/
Could be a good base to work on later.
Yan