From: Xin Long <lucien.xin@gmail.com> Date: 2021-01-11 12:39:40
Currently, udp v6 socket can not process v4 packets with UDP GRO, as
udp_encap_needed_key is not increased when udp_tunnel_encap_enable()
is called for v6 socket. This patchset is to increase it and remove
the unnecessary code in bareudp.
Xin Long (2):
udp: call udp_encap_enable for v6 sockets when enabling encap
Revert "bareudp: Fixed bareudp receive handling"
drivers/net/bareudp.c | 6 ------
include/net/udp_tunnel.h | 3 +--
net/ipv6/udp.c | 4 +++-
3 files changed, 4 insertions(+), 9 deletions(-)
--
2.1.0
From: Xin Long <lucien.xin@gmail.com> Date: 2021-01-11 12:40:03
As udp_encap_enable() is already called in udp_tunnel_encap_enable()
since the last patch, and we don't need it any more. So remove it by
reverting commit 81f954a44567567c7d74a97b1db78fb43afc253d.
---
drivers/net/bareudp.c | 6 ------
1 file changed, 6 deletions(-)
@@ -240,12 +240,6 @@ static int bareudp_socket_create(struct bareudp_dev *bareudp, __be16 port)tunnel_cfg.encap_destroy=NULL;setup_udp_tunnel_sock(bareudp->net,sock,&tunnel_cfg);-/* As the setup_udp_tunnel_sock does not call udp_encap_enable if the-*sockettypeisv6anexplicitcalltoudp_encap_enableisneeded.-*/-if(sock->sk->sk_family==AF_INET6)-udp_encap_enable();-rcu_assign_pointer(bareudp->sock,sock);return0;}
From: Xin Long <lucien.xin@gmail.com> Date: 2021-01-11 12:40:03
When enabling encap for a ipv6 socket without udp_encap_needed_key
increased, UDP GRO won't work for v4 mapped v6 address packets as
sk will be NULL in udp4_gro_receive().
This patch is to enable it by increasing udp_encap_needed_key for
v6 sockets in udp_tunnel_encap_enable(), and correspondingly
decrease udp_encap_needed_key in udpv6_destroy_sock().
Reported-by: Chen Yi <redacted>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/net/udp_tunnel.h | 3 +--
net/ipv6/udp.c | 4 +++-
2 files changed, 4 insertions(+), 3 deletions(-)