[PATCH net] selftests: set sysctl bc_forwarding properly in router_broadcast.sh

2019-06-02 Thread Xin Long
ep "bytes from $from" instead. Fixes: 40f98b9af943 ("selftests: add a selftest for directed broadcast forwarding") Signed-off-by: Xin Long --- tools/testing/selftests/net/forwarding/router_broadcast.sh | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH net] ipv4: not do cache for local delivery if bc_forwarding is enabled

2019-06-02 Thread Xin Long
d broadcast forwarding") Reported-by: Jianlin Shi Signed-off-by: Xin Long --- net/ipv4/route.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 11ddc27..91bf75b 100644 --- a/net/ipv4/route.c +++ b

[PATCH net] ipv6: fix the check before getting the cookie in rt6_get_cookie

2019-06-02 Thread Xin Long
7;from' cookie, this patch is to remove the c1 check in rt6_get_cookie(), so that the dst_cookie can always be set properly. c1: (rt->rt6i_flags & RTF_PCPU || unlikely(!list_empty(&rt->rt6i_uncached))) Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst base

Re: [PATCH V2] Fix memory leak in sctp_process_init

2019-06-04 Thread Xin Long
On Tue, Jun 4, 2019 at 4:34 AM Neil Horman wrote: > > syzbot found the following leak in sctp_process_init > BUG: memory leak > unreferenced object 0x88810ef68400 (size 1024): > comm "syz-executor273", pid 7046, jiffies 4294945598 (age 28.770s) > hex dump (first 32 bytes): > 1d de 28 8

Re: [PATCH net] ipv6: fix the check before getting the cookie in rt6_get_cookie

2019-06-06 Thread Xin Long
On Thu, Jun 6, 2019 at 11:35 PM David Ahern wrote: > > On 6/2/19 5:10 AM, Xin Long wrote: > > In Jianlin's testing, netperf was broken with 'Connection reset by peer', > > as the cookie check failed in rt6_check() and ip6_dst_check() always > > returned NULL

Re: [PATCH V2] Fix memory leak in sctp_process_init

2019-06-08 Thread Xin Long
gt; > > > On Wed, Jun 05, 2019 at 04:16:24AM +0800, Xin Long wrote: > > > > > On Tue, Jun 4, 2019 at 4:34 AM Neil Horman > > > > > wrote: > > > > > > > > > > > > syzbot found the following leak in sctp_process_init > > &g

Re: [PATCH] Free cookie before we memdup a new one

2019-06-10 Thread Xin Long
27;t leak cookie memory, free any previously > allocated cookie first. Hi, Neil, I think we should also do the same thing to the other 2 kmemdups in sctp_process_param(): asoc->peer.peer_random asoc->peer.peer_hmacs > > Signed-off-by: Neil Horman > CC: Marcelo Ricardo Leitne

[PATCH net-next 0/4] sctp: clean up __sctp_connect function

2019-07-22 Thread Xin Long
This patchset is to factor out some common code for sctp_sendmsg_new_asoc() and __sctp_connect() into 2 new functioins. Xin Long (4): sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx sctp: clean up __sctp_connect sctp: factor out sctp_connect_new_asoc sctp

[PATCH net-next 3/4] sctp: factor out sctp_connect_new_asoc

2019-07-22 Thread Xin Long
In this function factored out from sctp_sendmsg_new_asoc() and __sctp_connect(), it creates the asoc and adds a peer with the 1st addr. Signed-off-by: Xin Long --- net/sctp/socket.c | 160 ++ 1 file changed, 76 insertions(+), 84 deletions

[PATCH net-next 2/4] sctp: clean up __sctp_connect

2019-07-22 Thread Xin Long
-off-by: Xin Long --- net/sctp/socket.c | 211 +++--- 1 file changed, 75 insertions(+), 136 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 5f92e4a..49837e9 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -1049,154

[PATCH net-next 1/4] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-22 Thread Xin Long
. So before doing that, __sctp_setsockopt_connectx() should do this check first, as sctp_inet_connect() does. Signed-off-by: Xin Long --- net/sctp/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index aa80cda..5f92e4a 100644 --- a

[PATCH net-next 4/4] sctp: factor out sctp_connect_add_peer

2019-07-22 Thread Xin Long
In this function factored out from sctp_sendmsg_new_asoc() and __sctp_connect(), it adds a peer with the other addr into the asoc after this asoc is created with the 1st addr. Signed-off-by: Xin Long --- net/sctp/socket.c | 76 +++ 1 file

Re: [PATCH net-next 1/4] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-24 Thread Xin Long
On Tue, Jul 23, 2019 at 11:25 PM Neil Horman wrote: > > On Tue, Jul 23, 2019 at 01:37:57AM +0800, Xin Long wrote: > > Now __sctp_connect() is called by __sctp_setsockopt_connectx() and > > sctp_inet_connect(), the latter has done addr_size check with size > > of sa_famil

Re: [PATCH] net: sctp: fix memory leak in sctp_send_reset_streams

2019-07-24 Thread Xin Long
On Sun, Jun 2, 2019 at 9:36 PM Xin Long wrote: > > On Sun, Jun 2, 2019 at 6:52 PM Neil Horman wrote: > > > > On Sun, Jun 02, 2019 at 11:44:29AM +0800, Hillf Danton wrote: > > > > > > syzbot found the following crash on: > > > > > > HEAD com

Re: [PATCH net-next 1/4] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-26 Thread Xin Long
gt; > > > On Wed, Jul 24, 2019 at 09:49:07AM -0300, Marcelo Ricardo Leitner wrote: > > > > > On Wed, Jul 24, 2019 at 09:36:50AM -0300, Marcelo Ricardo Leitner > > > > > wrote: > > > > > > On Wed, Jul 24, 2019 at 07:22:35AM -0400, Neil Hor

[PATCHv2 net-next 1/5] sctp: only copy the available addr data in sctp_transport_init

2019-07-30 Thread Xin Long
length of data only to sctp_assoc_add_peer(). So sctp_transport_init() should copy the only available data from addr to peer->ipaddr, instead of 'peer->ipaddr = *addr' which may cause slab-out-of-bounds. Signed-off-by: Xin Long --- net/sctp/transport.c | 2 +- 1 file changed, 1 i

[PATCHv2 net-next 0/5] sctp: clean up __sctp_connect function

2019-07-30 Thread Xin Long
rcelo noticed in patch 3/5. Xin Long (5): sctp: only copy the available addr data in sctp_transport_init sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx sctp: clean up __sctp_connect sctp: factor out sctp_connect_new_asoc sctp: factor out sctp_connect_add_pe

[PATCHv2 net-next 2/5] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-30 Thread Xin Long
. So before doing that, __sctp_setsockopt_connectx() should do this check first, as sctp_inet_connect() does. Signed-off-by: Xin Long --- net/sctp/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index aa80cda..e9c5b39 100644

[PATCHv2 net-next 3/5] sctp: clean up __sctp_connect

2019-07-30 Thread Xin Long
at it, also remove the unused 'addrcnt'. Signed-off-by: Xin Long --- net/sctp/socket.c | 209 +++--- 1 file changed, 73 insertions(+), 136 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index e9c5b39..b9804e5 100644 ---

[PATCHv2 net-next 5/5] sctp: factor out sctp_connect_add_peer

2019-07-30 Thread Xin Long
In this function factored out from sctp_sendmsg_new_asoc() and __sctp_connect(), it adds a peer with the other addr into the asoc after this asoc is created with the 1st addr. Signed-off-by: Xin Long --- net/sctp/socket.c | 76 +++ 1 file

[PATCHv2 net-next 4/5] sctp: factor out sctp_connect_new_asoc

2019-07-30 Thread Xin Long
In this function factored out from sctp_sendmsg_new_asoc() and __sctp_connect(), it creates the asoc and adds a peer with the 1st addr. Signed-off-by: Xin Long --- net/sctp/socket.c | 160 ++ 1 file changed, 76 insertions(+), 84 deletions

Re: [net 1/1] tipc: fix unitilized skb list crash

2019-07-30 Thread Xin Long
eate(struct net *net, struct socket > *sock, > tsk_set_unreturnable(tsk, true); > if (sock->type == SOCK_DGRAM) > tsk_set_unreliable(tsk, true); > - __skb_queue_head_init(&tsk->mc_method.deferredq); > } > - > + __skb_queue_head_init(&tsk->mc_method.deferredq); > trace_tipc_sk_create(sk, NULL, TIPC_DUMP_NONE, " "); > return 0; > } > -- > 2.1.4 > > Reviewed-by: Xin Long

[PATCH net] sctp: fix the transport error_count check

2019-08-12 Thread Xin Long
"sctp: Implement quick failover draft from tsvwg") Signed-off-by: Xin Long --- net/sctp/sm_sideeffect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index a554d6d..1cf5bb5 100644 --- a/net/sctp/sm_sideeffect.c +++

Re: [Patch net] cls_flower: call nla_ok() before nla_next()

2021-01-12 Thread Xin Long
On Wed, Jan 13, 2021 at 1:43 AM Cong Wang wrote: > > On Tue, Jan 12, 2021 at 3:52 AM Xin Long wrote: > > > > On Tue, Jan 12, 2021 at 10:56 AM Cong Wang wrote: > > > > > > From: Cong Wang > > > > > > fl_set_enc_opt() simply checks if ther

Re: [PATCHv2 net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2021-01-13 Thread Xin Long
On Wed, Jan 13, 2021 at 10:11 AM Alexander Duyck wrote: > > On Mon, Jan 11, 2021 at 9:14 PM Xin Long wrote: > > > > On Tue, Jan 12, 2021 at 12:48 AM Alexander Duyck > > wrote: > > > > > > On Mon, Jan 11, 2021 at 5:22 AM Xin Long wrote: > > &

[PATCHv2 net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP GRO

2021-01-14 Thread Xin Long
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. v1->v2: - see Patch 1/2. Xin Long (2): udp: c

[PATCHv2 net-next 1/2] udp: call udp_encap_enable for v6 sockets when enabling encap

2021-01-14 Thread Xin Long
, and correspondingly decrease udp_encap_needed_key in udpv6_destroy_sock(). v1->v2: - add udp_encap_disable() and export it. Signed-off-by: Xin Long --- include/net/udp.h| 1 + include/net/udp_tunnel.h | 3 +-- net/ipv4/udp.c | 6 ++ net/ipv6/udp.c | 4 +++- 4 files cha

[PATCHv2 net-next 2/2] Revert "bareudp: Fixed bareudp receive handling"

2021-01-14 Thread Xin Long
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(-) diff --git a/drivers/net/bareud

[PATCHv2 net-next 0/2] net: fix the features flag in sctp_gso_segment

2021-01-15 Thread Xin Long
Patch 1/2 is to improve the code in skb_segment(), and it is needed by Patch 2/2. v1->v2: - see Patch 1/2. Xin Long (2): net: move the hsize check to the else block in skb_segment udp: remove CRC flag from dev features in __skb_udp_tunnel_segment net/core/skbuff.c |

[PATCHv2 net-next 2/2] udp: remove CRC flag from dev features in __skb_udp_tunnel_segment

2021-01-15 Thread Xin Long
Signed-off-by: Xin Long --- net/ipv4/udp_offload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index ff39e94..1168d18 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -68,8 +68,8 @@ static struct

[PATCHv2 net-next 1/2] net: move the hsize check to the else block in skb_segment

2021-01-15 Thread Xin Long
< 0" into else block, to save some cycles, as Alex suggested. Signed-off-by: Xin Long --- net/core/skbuff.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 6039069..e835193 100644 --- a/net/core/skbuff.c +++ b/net/core/

Re: [PATCHv2 net-next 0/2] net: fix the features flag in sctp_gso_segment

2021-01-15 Thread Xin Long
Please drop this patchset, the second one is incorrect. I will post v3, thanks. On Fri, Jan 15, 2021 at 4:21 PM Xin Long wrote: > > Patch 1/2 is to improve the code in skb_segment(), and it is needed > by Patch 2/2. > > v1->v2: > - see Patch 1/2. > > Xin Long (2): &g

[PATCHv3 net-next 1/2] net: move the hsize check to the else block in skb_segment

2021-01-15 Thread Xin Long
< 0" into else block, to save some cycles, as Alex suggested. Signed-off-by: Xin Long --- net/core/skbuff.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 6039069..e835193 100644 --- a/net/core/skbuff.c +++ b/net/core/

[PATCHv3 net-next 2/2] sctp: remove the NETIF_F_SG flag before calling skb_segment

2021-01-15 Thread Xin Long
It makes more sense to clear NETIF_F_SG instead of set it when calling skb_segment() in sctp_gso_segment(), since SCTP GSO is using head_skb's fraglist, of which all frags are linear skbs. This will make SCTP GSO code more understandable. Suggested-by: Alexander Duyck Signed-off-by: Xin

[PATCHv3 net-next 0/2] net: fix the features flag in sctp_gso_segment

2021-01-15 Thread Xin Long
Patch 1/2 is to improve the code in skb_segment(), and it is needed by Patch 2/2. v1->v2: - see Patch 1/2. v2->v3: - change Patch 2/2 to the right patch. Xin Long (2): net: move the hsize check to the else block in skb_segment sctp: remove the NETIF_F_SG flag before calling skb_s

[PATCH net-next 1/3] vxlan: add NETIF_F_FRAGLIST flag for dev features

2021-01-15 Thread Xin Long
this patch is to add it for vxlan. Signed-off-by: Xin Long --- drivers/net/vxlan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index b936443..3929e43 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -3283,12 +3283,13

[PATCH net-next 0/3] net: make udp tunnel devices support fraglist

2021-01-15 Thread Xin Long
Like GRE device, UDP tunnel devices should also support fraglist, so that some protocol (like SCTP) HW GSO that requires NETIF_F_FRAGLIST in the dev can work. Especially when the lower device support both NETIF_F_GSO_UDP_TUNNEL and NETIF_F_GSO_SCTP. Xin Long (3): vxlan: add NETIF_F_FRAGLIST

[PATCH net-next 2/3] geneve: add NETIF_F_FRAGLIST flag for dev features

2021-01-15 Thread Xin Long
this patch is to add it for geneve. Signed-off-by: Xin Long --- drivers/net/geneve.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 6aa775d..4ac0373 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -1197,11

[PATCH net-next 3/3] bareudp: add NETIF_F_FRAGLIST flag for dev features

2021-01-15 Thread Xin Long
Like vxlan and geneve, bareudp also needs this dev feature to support some protocol's HW GSO. Signed-off-by: Xin Long --- drivers/net/bareudp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c index 57dfaf4..7511bca 1

[PATCHv3 net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP GRO

2021-01-15 Thread Xin Long
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. v1->v2: - see Patch 1/2. v2->v3: - see Patch 2/2

[PATCHv3 net-next 1/2] udp: call udp_encap_enable for v6 sockets when enabling encap

2021-01-15 Thread Xin Long
, and correspondingly decrease udp_encap_needed_key in udpv6_destroy_sock(). v1->v2: - add udp_encap_disable() and export it. Signed-off-by: Xin Long --- include/net/udp.h| 1 + include/net/udp_tunnel.h | 3 +-- net/ipv4/udp.c | 6 ++ net/ipv6/udp.c | 4 +++- 4 files cha

[PATCHv3 net-next 2/2] Revert "bareudp: Fixed bareudp receive handling"

2021-01-15 Thread Xin Long
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. v1->v2: - no change. v2->v3: - add the missing signoff. Signed-off-by: Xin Long ---

[PATCHv3 net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2021-01-15 Thread Xin Long
can still leave CRC checksum of SCTP to HW by not clearing this CRC flag if it's supported, as Jakub and Alex noticed. v1->v2: - improve the changelog. - fix "rev xmas tree" in varibles declaration. v2->v3: - remove CRC flag from dev features only when need_csum is true

[PATCH net-next] udp: not remove the CRC flag from dev features when need_csum is false

2021-01-15 Thread Xin Long
e CRC flag from dev features when need_csum is false. Signed-off-by: Xin Long --- net/ipv4/udp_offload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index ff39e94..1168d18 100644 --- a/net/ipv4/udp_offload.c +++

[PATCH net-next 0/6] net: support SCTP CRC csum offload for tunneling packets in some drivers

2021-01-15 Thread Xin Long
This patchset introduces inline function skb_csum_is_sctp(), and uses it to validate it's a sctp CRC csum offload packet, to make SCTP CRC csum offload for tunneling packets supported in some HW drivers. Xin Long (6): net: add inline function skb_csum_is_sctp net: igb: use skb_csum_is

[PATCH net-next 1/6] net: add inline function skb_csum_is_sctp

2021-01-15 Thread Xin Long
This patch is to define a inline function skb_csum_is_sctp(), and also replace all places where it checks if it's a SCTP CSUM skb. This function would be used later in many networking drivers in the following patches. Suggested-by: Alexander Duyck Signed-off-by: Xin Long --- driver

[PATCH net-next 3/6] net: igbvf: use skb_csum_is_sctp instead of protocol check

2021-01-15 Thread Xin Long
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC checksum offload packet, and yet it also makes igbvf support SCTP CRC checksum offload for UDP and GRE encapped packets, just as it does in igb driver. Signed-off-by: Xin Long --- drivers/net/ethernet/intel/igbvf/netdev.c

[PATCH net-next 4/6] net: igc: use skb_csum_is_sctp instead of protocol check

2021-01-15 Thread Xin Long
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC checksum offload packet, and yet it also makes igc support SCTP CRC checksum offload for UDP and GRE encapped packets, just as it does in igb driver. Signed-off-by: Xin Long --- drivers/net/ethernet/intel/igc/igc_main.c

[PATCH net-next 6/6] net: ixgbevf: use skb_csum_is_sctp instead of protocol check

2021-01-15 Thread Xin Long
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC checksum offload packet, and yet it also makes ixgbevf support SCTP CRC checksum offload for UDP and GRE encapped packets, just as it does in igb driver. Signed-off-by: Xin Long --- drivers/net/ethernet/intel/ix

[PATCH net-next 2/6] net: igb: use skb_csum_is_sctp instead of protocol check

2021-01-15 Thread Xin Long
E encapped packets. Signed-off-by: Xin Long --- drivers/net/ethernet/intel/igb/igb_main.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 03f78fd..8757ad0 100644 --- a/d

[PATCH net-next 5/6] net: ixgbe: use skb_csum_is_sctp instead of protocol check

2021-01-15 Thread Xin Long
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC checksum offload packet, and yet it also makes ixgbe support SCTP CRC checksum offload for UDP and GRE encapped packets, just as it does in igb driver. Signed-off-by: Xin Long --- drivers/net/ethernet/intel/ixgbe/ixgbe_m

Re: [PATCH v2 net-next] net: fix GSO for SG-enabled devices.

2021-01-19 Thread Xin Long
d with 'len'. > > v1 -> v2: > - reorder hsize checks instead of explicit cast (Alex) > > Bisected-by: Matthieu Baerts > Fixes: dbd50f238dec ("net: move the hsize check to the else block in > skb_segment") > Signed-off-by: Paolo Abeni Reviewed-by: Xi

Re: [PATCHv3 net-next 1/2] udp: call udp_encap_enable for v6 sockets when enabling encap

2021-01-19 Thread Xin Long
On Wed, Jan 20, 2021 at 6:17 AM Alexander Duyck wrote: > > On Fri, Jan 15, 2021 at 8:34 PM Xin Long wrote: > > > > 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 > >

[PATCH net-next 0/3] net: add support for ip generic checksum offload for gre

2021-01-21 Thread Xin Long
s to extend the csum_not_inet/csum_type of sk_buff in Patch 1/3, and define new type of CSUM_T_IP_GENERIC to get ip generic checksum processed in skb_csum_hwoffload_help() in Patch 2/3, then implement it on TX path and GSO path in Patch 3/3. Xin Long (3): net: rename csum_not_inet to csum_

[PATCH net-next 3/3] ip_gre: add csum offload support for gre header

2021-01-21 Thread Xin Long
e, it will do csum for outer proto by calling gso_make_checksum(). Note that SCTP has to do the csum by itself for non GSO path in sctp_packet_pack(), as gre_build_header() can't handle the csum with CHECKSUM_PARTIAL set for SCTP CRC csum offload. Signed-off-by: Xin Long --- include

[PATCH net-next 1/3] net: rename csum_not_inet to csum_type

2021-01-21 Thread Xin Long
This patch is to rename csum_not_inet to csum_type, as later more csum type would be introduced in the next patch. Signed-off-by: Xin Long --- include/linux/skbuff.h | 19 +++ net/core/dev.c | 2 +- net/sched/act_csum.c | 2 +- net/sctp/offload.c | 2 +- net

[PATCH net-next 2/3] net: add CSUM_T_IP_GENERIC csum_type

2021-01-21 Thread Xin Long
This patch is to extend csum_type field to 2 bits, and introduce CSUM_T_IP_GENERIC csum type, and add the support for this in skb_csum_hwoffload_help(), just like CSUM_T_SCTP_CRC. Note here it moves dst_pending_confirm field below ndisc_nodetype to avoid a memory hole. Signed-off-by: Xin Long

Re: [PATCH net-next 1/3] net: rename csum_not_inet to csum_type

2021-01-21 Thread Xin Long
On Fri, Jan 22, 2021 at 10:50 AM Jakub Kicinski wrote: > > On Thu, 21 Jan 2021 16:45:36 +0800 Xin Long wrote: > > This patch is to rename csum_not_inet to csum_type, as later > > more csum type would be introduced in the next patch. > > > > Signed-off-by: Xin

Re: [PATCH net-next 2/3] net: add CSUM_T_IP_GENERIC csum_type

2021-01-21 Thread Xin Long
On Fri, Jan 22, 2021 at 2:13 AM Alexander Duyck wrote: > > On Thu, Jan 21, 2021 at 12:46 AM Xin Long wrote: > > > > This patch is to extend csum_type field to 2 bits, and introduce > > CSUM_T_IP_GENERIC csum type, and add the support for this in > > skb_cs

[PATCH net-next] net: hns3: replace skb->csum_not_inet with skb_csum_is_sctp

2021-01-22 Thread Xin Long
Commit fa8211701043 ("net: add inline function skb_csum_is_sctp") missed replacing skb->csum_not_inet check in hns3. This patch is to replace it with skb_csum_is_sctp(). Reported-by: Jakub Kicinski Signed-off-by: Xin Long --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c |

[PATCH net] udp: fix the proto value passed to ip_protocol_deliver_rcu for the segments

2020-12-06 Thread Xin Long
ipproto 4 # ethtool -K eth1 rx-gro-list on Fixes: cf329aa42b66 ("udp: cope with UDP GRO packet misdirection") Reported-by: Guillaume Nault Signed-off-by: Xin Long --- net/ipv4/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c in

Re: [PATCH net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2020-11-18 Thread Xin Long
On Thu, Nov 19, 2020 at 12:44 AM Jakub Kicinski wrote: > > On Wed, 18 Nov 2020 14:14:49 +0800 Xin Long wrote: > > On Wed, Nov 18, 2020 at 8:29 AM Jakub Kicinski wrote: > > > On Mon, 16 Nov 2020 17:15:47 +0800 Xin Long wrote: > > > > This patch is to

Re: [PATCH net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2020-11-18 Thread Xin Long
On Thu, Nov 19, 2020 at 4:35 AM Alexander Duyck wrote: > > On Mon, Nov 16, 2020 at 1:17 AM Xin Long wrote: > > > > This patch is to let it always do CRC checksum in sctp_gso_segment() > > by removing CRC flag from the dev features in gre_gso_segment() for > > SCT

Re: [PATCH net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2020-11-20 Thread Xin Long
On Fri, Nov 20, 2020 at 1:24 AM Alexander Duyck wrote: > > On Wed, Nov 18, 2020 at 9:53 PM Xin Long wrote: > > > > On Thu, Nov 19, 2020 at 4:35 AM Alexander Duyck > > wrote: > > > > > > On Mon, Nov 16, 2020 at 1:17 AM Xin Long wrote: > > &

Re: [PATCH net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2020-11-23 Thread Xin Long
On Sat, Nov 21, 2020 at 12:10 AM Alexander Duyck wrote: > > On Fri, Nov 20, 2020 at 2:23 AM Xin Long wrote: > > > > On Fri, Nov 20, 2020 at 1:24 AM Alexander Duyck > > wrote: > > > > > > On Wed, Nov 18, 2020 at 9:53 PM Xin Long wrote: > > >

Re: [PATCH net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2020-11-24 Thread Xin Long
On Tue, Nov 24, 2020 at 6:23 AM Alexander Duyck wrote: > > On Mon, Nov 23, 2020 at 1:14 AM Xin Long wrote: > > > > On Sat, Nov 21, 2020 at 12:10 AM Alexander Duyck > > wrote: > > > > > > On Fri, Nov 20, 2020 at 2:23 AM Xin Long wrote: > > >

[PATCH net] sctp: change to hold/put transport for proto_unreach_timer

2020-11-13 Thread Xin Long
2 ("sctp: Fix a race between ICMP protocol unreachable and connect()") Reported-by: Hangbin Liu Signed-off-by: Xin Long --- net/sctp/input.c | 4 ++-- net/sctp/sm_sideeffect.c | 2 +- net/sctp/transport.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCHv2 net] sctp: change to hold/put transport for proto_unreach_timer

2020-11-13 Thread Xin Long
- Also use sctp_transport_put() for the "out_unlock:" path in sctp_generate_proto_unreach_event(), as Marcelo noticed. Fixes: 50b5d6ad6382 ("sctp: Fix a race between ICMP protocol unreachable and connect()") Reported-by: Hangbin Liu Signed-off-by: Xin Long --- net/sctp/inp

Re: [PATCH net] sctp: change to hold/put transport for proto_unreach_timer

2020-11-13 Thread Xin Long
On Fri, Nov 13, 2020 at 8:35 PM Marcelo Ricardo Leitner wrote: > > Hi, > > On Fri, Nov 13, 2020 at 05:18:24PM +0800, Xin Long wrote: > ... > > diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c > > index 813d307..0a51150 100644 > > --- a/net/sctp/s

[PATCH net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2020-11-16 Thread Xin Long
csum_start in GSO CB properly in sctp_gso_segment() after that commit, so it would do checksum with gso_make_checksum() in gre_gso_segment(), and Commit 622e32b7d4a6 ("net: gre: recompute gre csum for sctp over gre tunnels") can be reverted now. Signed-off-by: Xin Long --- net/ipv

Re: [PATCH net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2020-11-17 Thread Xin Long
On Wed, Nov 18, 2020 at 8:29 AM Jakub Kicinski wrote: > > On Mon, 16 Nov 2020 17:15:47 +0800 Xin Long wrote: > > This patch is to let it always do CRC checksum in sctp_gso_segment() > > by removing CRC flag from the dev features in gre_gso_segment() for > > SCTP over

[PATCH net-next 0/2] net: enable udp v6 sockets receiving v4 packets with UDP GRO

2021-01-11 Thread Xin Long
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

[PATCH net-next 1/2] udp: call udp_encap_enable for v6 sockets when enabling encap

2021-01-11 Thread Xin Long
, and correspondingly decrease udp_encap_needed_key in udpv6_destroy_sock(). Reported-by: Chen Yi Signed-off-by: Xin Long --- include/net/udp_tunnel.h | 3 +-- net/ipv6/udp.c | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h

[PATCH net-next 2/2] Revert "bareudp: Fixed bareudp receive handling"

2021-01-11 Thread Xin Long
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(-) diff --git a/drivers/net/bareud

[PATCH net-next 1/2] net: move the hsize check to the else block in skb_segment

2021-01-11 Thread Xin Long
go to frag_list processing code. So the right thing to do is move the hsize check to the else block, so that it won't affect the !hsize check for frag_list processing. Signed-off-by: Xin Long --- net/core/skbuff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net

[PATCH net-next 0/2] net: fix the features flag in sctp_gso_segment

2021-01-11 Thread Xin Long
Patch 1/2 is to improve the code in skb_segment(), and it is needed by Patch 2/2. Xin Long (2): net: move the hsize check to the else block in skb_segment sctp: remove the NETIF_F_SG flag before calling skb_segment net/core/skbuff.c | 5 +++-- net/sctp/offload.c | 2 +- 2 files changed, 4

[PATCH net-next 2/2] sctp: remove the NETIF_F_SG flag before calling skb_segment

2021-01-11 Thread Xin Long
It makes more sense to clear NETIF_F_SG instead of set it when calling skb_segment() in sctp_gso_segment(), since SCTP GSO is using head_skb's fraglist, of which all frags are linear skbs. This will make SCTP GSO code more understandable. Suggested-by: Alexander Duyck Signed-off-by: Xin

[PATCHv2 net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2021-01-11 Thread Xin Long
only handle the SCTP CRC when it's in the outer packet, not in the inner packet like in this case, so here it removes CRC flag from the dev features even when need_csum is false. v1->v2: - improve the changelog. - fix "rev xmas tree" in varibles declaration. Signed-off-by: Xin

Re: [PATCHv2 net-next] ip_gre: remove CRC flag from dev features in gre_gso_segment

2021-01-11 Thread Xin Long
On Tue, Jan 12, 2021 at 12:48 AM Alexander Duyck wrote: > > On Mon, Jan 11, 2021 at 5:22 AM Xin Long wrote: > > > > This patch is to let it always do CRC checksum in sctp_gso_segment() > > by removing CRC flag from the dev features in gre_gso_segment() for > > SCT

Re: [PATCH net-next 1/2] net: move the hsize check to the else block in skb_segment

2021-01-11 Thread Xin Long
On Tue, Jan 12, 2021 at 12:26 AM Alexander Duyck wrote: > > On Mon, Jan 11, 2021 at 4:45 AM Xin Long wrote: > > > > After commit 89319d3801d1 ("net: Add frag_list support to skb_segment"), > > it goes to process frag_list when !hsize in skb_segment(). However

Re: [PATCH net-next 1/2] udp: call udp_encap_enable for v6 sockets when enabling encap

2021-01-11 Thread Xin Long
On Tue, Jan 12, 2021 at 2:02 AM kernel test robot wrote: > > Hi Xin, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on net-next/master] > > url: > https://github.com/0day-ci/linux/commits/Xin-Long/net-enable-udp-v6-sockets-receiv

Re: [Patch net] cls_flower: call nla_ok() before nla_next()

2021-01-12 Thread Xin Long
97...@syzkaller.appspotmail.com > Fixes: 0a6e77784f49 ("net/sched: allow flower to match tunnel options") > Fixes: 79b1011cb33d ("net: sched: allow flower to match erspan options") > Cc: Pieter Jansen van Vuuren > Cc: Jamal Hadi Salim > Cc: Xin Long > Cc: Jiri Pirko

Re: [PATCHv3 net-next 16/16] sctp: enable udp tunneling socks

2020-10-19 Thread Xin Long
On Fri, Oct 16, 2020 at 3:08 PM Xin Long wrote: > > On Fri, Oct 16, 2020 at 1:42 AM Marcelo Ricardo Leitner > wrote: > > > > Actually.. > > > > On Tue, Oct 13, 2020 at 03:27:41PM +0800, Xin Long wrote: > > ... > > > Also add sysctl udp_port to a

[PATCHv4 net-next 01/16] udp: check udp sock encap_type in __udp_lib_err

2020-10-19 Thread Xin Long
check encap_type in __udp_lib_err() for the further validation for a encap sock. Signed-off-by: Xin Long --- net/ipv4/udp.c | 2 +- net/ipv6/udp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 09f0a23..ca04a8a 100644 --- a/net/ipv4

[PATCHv4 net-next 00/16] sctp: Implement RFC6951: UDP Encapsulation of SCTP

2020-10-19 Thread Xin Long
16 type cast warning in patch 8. - fix the wrong endian orders when setting values in 14,16. v3->v4: - add entries in ip-sysctl.rst in patch 7,16, as Marcelo Suggested. - not create udp socks when udp_port is set to 0 in patch 16, as Marcelo noticed. Xin Long (16): udp: check udp sock encap_

[PATCHv4 net-next 04/16] sctp: create udp4 sock and add its encap_rcv

2020-10-19 Thread Xin Long
t patch of this patchset when enabling this feature. v1->v2: - Add pr_err() when fails to create udp v4 sock. v2->v3: - Add 'select NET_UDP_TUNNEL' in sctp Kconfig. Signed-off-by: Xin Long --- include/net/netns/sctp.h | 5 + include/net/sctp/constants.h | 2 ++ include/ne

[PATCHv4 net-next 07/16] sctp: add encap_port for netns sock asoc and transport

2020-10-19 Thread Xin Long
' encap_port by sysctl. v1->v2: - Change to define encap_port as __be16 for sctp_sock, asoc and transport. v2->v3: - No change. v3->v4: - Add 'encap_port' entry in ip-sysctl.rst. Signed-off-by: Xin Long --- Documentation/networking/ip-sysctl.rst | 9 + incl

[PATCHv4 net-next 06/16] sctp: add encap_err_lookup for udp encap socks

2020-10-19 Thread Xin Long
responding asoc and transport exist. Note that icmp packet process for sctp over udp is done by udp sock .encap_err_lookup(), and it means for now we can't do as much as sctp_v4/6_err() does. Also we can't do the two mappings mentioned in rfc6951#section-5.5. Signed-off-by: Xin

[PATCHv4 net-next 10/16] sctp: add udphdr to overhead when udp_port is set

2020-10-19 Thread Xin Long
e issue, it will be used in xmit path in the next patch. Signed-off-by: Xin Long --- include/net/sctp/sctp.h| 7 +-- include/net/sctp/structs.h | 1 + net/sctp/socket.c | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/net/sctp/sctp.h b/include/net/

[PATCHv4 net-next 05/16] sctp: create udp6 sock and set its encap_rcv

2020-10-19 Thread Xin Long
- Add pr_err() when fails to create udp v6 sock. - Add #if IS_ENABLED(CONFIG_IPV6) not to create v6 sock when ipv6 is disabled. Signed-off-by: Xin Long --- include/net/netns/sctp.h | 1 + net/sctp/protocol.c | 26 ++ 2 files changed, 27 insertions(+) diff --

[PATCHv4 net-next 02/16] udp6: move the mss check after udp gso tunnel processing

2020-10-19 Thread Xin Long
unnel processing, the same as udp4_ufo_fragment() does. v1->v2: - no change. v2->v3: - not do any cleanup. Signed-off-by: Xin Long Acked-by: Willem de Bruijn --- net/ipv6/udp_offload.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv6/udp_offload.c b/

[PATCHv4 net-next 03/16] udp: support sctp over udp in skb_udp_tunnel_segment

2020-10-19 Thread Xin Long
h this one. v1->v2: - no change. v2->v3: - remove the he NETIF_F_SCTP_CRC flag from the features. - set csum and csum_start in sctp_gso_make_checksum(). Signed-off-by: Xin Long --- net/ipv4/udp_offload.c | 3 +++ net/sctp/offload.c | 6 +- 2 files changed, 8 insertions(+), 1 d

[PATCHv4 net-next 08/16] sctp: add SCTP_REMOTE_UDP_ENCAPS_PORT sockopt

2020-10-19 Thread Xin Long
transport can be changed by users, which also means it allows the different transports of the same asoc to have different encap_port value. v1->v2: - no change. v2->v3: - fix the endian warning when setting values between encap_port and sue_port. Signed-off-by: Xin Long --- includ

[PATCHv4 net-next 09/16] sctp: allow changing transport encap_port by peer packets

2020-10-19 Thread Xin Long
er is removed, as it's not used any more in sctp. v1->v2: - Change encap_port as __be16 for sctp_input_cb. Signed-off-by: Xin Long --- include/net/sctp/sm.h | 1 + include/net/sctp/structs.h | 7 +-- net/sctp/ipv6.c| 1 + net/sctp/protocol.c| 11 +

[PATCHv4 net-next 12/16] sctp: support for sending packet over udp4 sock

2020-10-19 Thread Xin Long
as "the UDP checksum SHOULD be computed for IPv4 and IPv6", says in rfc6951#section-5.3. v1->v2: - Use sp->udp_port instead in sctp_v4_xmit(), which is more safe. Signed-off-by: Xin Long --- net/sctp/output.c | 9 +++-- net/sctp/protocol.c | 41 +

[PATCHv4 net-next 13/16] sctp: support for sending packet over udp6 sock

2020-10-19 Thread Xin Long
by RFC. v1->v2: - Use sp->udp_port instead in sctp_v6_xmit(), which is more safe. Signed-off-by: Xin Long --- net/sctp/ipv6.c | 43 --- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index a064bf2.

[PATCHv4 net-next 14/16] sctp: add the error cause for new encapsulation port restart

2020-10-19 Thread Xin Long
off-by: Xin Long --- include/linux/sctp.h | 20 include/net/sctp/sm.h| 3 +++ net/sctp/sm_make_chunk.c | 20 3 files changed, 43 insertions(+) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 7673123..bb19265 100644 --- a/include

[PATCHv4 net-next 11/16] sctp: call sk_setup_caps in sctp_packet_transmit instead

2020-10-19 Thread Xin Long
e tied to gso, so move it out of gso part and before sctp_packet_pack(). Signed-off-by: Xin Long --- net/sctp/output.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/net/sctp/output.c b/net/sctp/output.c index 1441eaf..fb16500 100644 --- a/net/sctp/output.

[PATCHv4 net-next 15/16] sctp: handle the init chunk matching an existing asoc

2020-10-19 Thread Xin Long
This is from Section 4 of draft-tuexen-tsvwg-sctp-udp-encaps-cons-03, and it requires responding with an abort chunk with an error cause when the udp source port of the received init chunk doesn't match the encap port of the transport. Signed-off-by: Xin Long --- net/sctp/sm_statefuns.c

[PATCHv4 net-next 16/16] sctp: enable udp tunneling socks

2020-10-19 Thread Xin Long
l.rst. Signed-off-by: Xin Long --- Documentation/networking/ip-sysctl.rst | 6 net/sctp/protocol.c| 5 net/sctp/sysctl.c | 52 ++ 3 files changed, 63 insertions(+) diff --git a/Documentation/networking/ip

  1   2   3   4   5   6   7   8   9   10   >