Re: [patch net-next 07/10] net: tipc: have genetlink code to parse the attrs during dumpit

2021-04-15 Thread Xin Long
On Sat, Oct 5, 2019 at 2:09 PM Jiri Pirko wrote: > > From: Jiri Pirko > > Benefit from the fact that the generic netlink code can parse the attrs > for dumpit op and avoid need to parse it in the op callback. > > Signed-off-by: Jiri Pirko > --- > net/tipc/netlink.c | 9 ++--- > net/tipc/n

[PATCH net] tipc: increment the tmp aead refcnt before attaching it

2021-04-05 Thread Xin Long
other thread. This patch is to fix it by incrementing the tmp's refcnt before attaching it instead of calling tipc_aead_get() after attaching it. Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication") Reported-by: Li Shuang Signed-off-by: Xin Long --- ne

[PATCH ipsec] xfrm: BEET mode doesn't support fragments for inner packets

2021-03-19 Thread Xin Long
efore decapping with ESP, which is incorrect. In Xiumei's testing, these fragments went over an xfrm interface and got encapped with ESP in the device driver, and the traffic was broken. I don't have a good way to fix it, but only to warn this out in dmesg. Reported-by: Xiumei Mu Sig

[PATCH ipsec] esp: delete NETIF_F_SCTP_CRC bit from features for esp offload

2021-03-19 Thread Xin Long
r esp4 and esp6") Signed-off-by: Xin Long --- net/ipv4/esp4_offload.c | 6 -- net/ipv6/esp6_offload.c | 6 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c index 601f5fb..ed3de48 100644 --- a/net/ipv4/esp4_offl

[PATCH] sctp: move sk_route_caps check and set into sctp_outq_flush_transports

2021-03-18 Thread Xin Long
hich will cause this dev's deleting to hang and dmesg error occurs: unregister_netdevice: waiting for xxx to become free. Usage count = 1 Reported-by: Chen Yi Fixes: bcd623d8e9fa ("sctp: call sk_setup_caps in sctp_packet_transmit instead") Signed-off-by: Xin Long --- net/sctp/ou

Re: [RFC PATCH net] rxrpc: Fix missing dependency on NET_UDP_TUNNEL

2021-02-09 Thread Xin Long
quot;rxrpc: use udp tunnel APIs instead of open code in > rxrpc_open_socket") > Reported-by: kernel test robot > Suggested-by: Vadim Fedorenko > Signed-off-by: David Howells > cc: Xin Long > cc: a...@dev.mellanox.co.il > cc: Jakub Kicinski > --- > > net/rxrp

[PATCH net-next] rxrpc: use udp tunnel APIs instead of open code in rxrpc_open_socket

2021-02-07 Thread Xin Long
with this patch, the udp tunnel socket will always bind to a random port if transport is not provided by users, which is suggested by David Howells, thanks! Acked-by: David Howells Signed-off-by: Xin Long --- net/rxrpc/local_object.c | 69 +--- 1 fi

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

2021-02-05 Thread Xin Long
On Fri, Feb 5, 2021 at 5:14 PM David Howells wrote: > > Xin Long wrote: > > > Subject: [PATCH net-next] rxrpc: use udp tunnel APIs instead of open code in > > rxrpc_open_socket > > > > Signed-off-by: Xin Long > > You can add "Acked-by: David Howells " if you want. > OK, Thank you so much!

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

2021-02-03 Thread Xin Long
On Wed, Feb 3, 2021 at 5:14 PM David Howells wrote: > > Xin Long wrote: > > > BTW, I'm also thinking to use udp_sock_create(), the only problem I can > > see is it may not do bind() in rxrpc_open_socket(), is that true? or we > > can actually bind to some add

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

2021-02-03 Thread Xin Long
, and correspondingly decrease udp_encap_needed_key in udpv6_destroy_sock(). v1->v2: - add udp_encap_disable() and export it. v2->v3: - add the change for rxrpc and bareudp into one patch, as Alex suggested. v3->v4: - move rxrpc part to another patch. Acked-by: Willem de Bruijn Signed-of

[PATCHv5 net-next 2/2] rxrpc: call udp_tunnel_encap_enable in rxrpc_open_socket

2021-02-03 Thread Xin Long
Pv6 encap_needed_key and sets up->encap_enabled. v4->v5: - add the missing '#include ', as David Howells noticed. Acked-and-tested-by: David Howells Signed-off-by: Xin Long --- net/rxrpc/local_object.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) dif

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

2021-02-03 Thread Xin Long
udp_tunnel_encap_enable(). v1->v4: - See patch 1/2. v4->v5: - See patch 2/2. Xin Long (2): udp: call udp_encap_enable for v6 sockets when enabling encap rxrpc: call udp_tunnel_encap_enable in rxrpc_open_socket drivers/net/bareudp.c| 6 -- include/net/udp.h| 1 + inclu

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

2021-02-03 Thread Xin Long
On Wed, Feb 3, 2021 at 4:00 PM David Howells wrote: > > Xin Long wrote: > > > I saw the state of this patchset is still new, should I repost it? > > It needs a fix in patch 2 (see my response to that patch). > Sorry, my mistake, I forgot to enable rxrpc when building ke

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

2021-02-02 Thread Xin Long
Hi, Jakub, I saw the state of this patchset is still new, should I repost it? On Tue, Jan 26, 2021 at 1:10 PM Xin Long wrote: > > 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 f

[PATCHv3 net-next 1/2] net: support ip generic csum processing in skb_csum_hwoffload_help

2021-01-28 Thread Xin Long
requesting Tx csum offload, we'd better fix this until a new protocol comes with a same csum offset. v1->v2: - not extend skb->csum_not_inet, but use skb->csum_offset to tell if it's an UDP/TCP csum packet. v2->v3: - add a note in the changelog, as Willem suggested.

[PATCHv3 net-next 2/2] ip_gre: add csum offload support for gre header

2021-01-28 Thread Xin Long
E dev doesn't support SCTP CRC CSUM and it will always do checksum for SCTP in sctp_packet_pack() when it's not a GSO packet. Signed-off-by: Xin Long --- include/net/gre.h | 19 +++ net/ipv4/gre_offload.c | 15 +-- 2 files changed, 20 insertions(+)

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

2021-01-28 Thread Xin Long
This patchset it to add ip generic csum processing first in skb_csum_hwoffload_help() in Patch 1/2 and then add csum offload support for GRE header in Patch 2/2. v1->v2: - See each patch's changelog. v2->v3: - See the 1st patch. Xin Long (2): net: support ip generic csum pr

Re: [PATCH net-next 1/2] net: support ip generic csum processing in skb_csum_hwoffload_help

2021-01-28 Thread Xin Long
On Tue, Jan 26, 2021 at 9:59 AM Willem de Bruijn wrote: > > On Sun, Jan 24, 2021 at 3:47 AM Xin Long wrote: > > > > NETIF_F_IP|IPV6_CSUM feature flag indicates UDP and TCP csum offload > > while NETIF_F_HW_CSUM feature flag indicates ip generic csum offload > > f

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

2021-01-27 Thread Xin Long
udp_tunnel_encap_enable(). Xin Long (2): udp: call udp_encap_enable for v6 sockets when enabling encap rxrpc: call udp_tunnel_encap_enable in rxrpc_open_socket drivers/net/bareudp.c| 6 -- include/net/udp.h| 1 + include/net/udp_tunnel.h | 3 +-- net/ipv4/udp.c | 6

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

2021-01-27 Thread Xin Long
, and correspondingly decrease udp_encap_needed_key in udpv6_destroy_sock(). v1->v2: - add udp_encap_disable() and export it. v2->v3: - add the change for rxrpc and bareudp into one patch, as Alex suggested. v3->v4: - move rxrpc part to another patch. Signed-off-by: Xin Long --- drivers

[PATCHv4 net-next 2/2] rxrpc: call udp_tunnel_encap_enable in rxrpc_open_socket

2021-01-26 Thread Xin Long
Pv6 encap_needed_key and sets up->encap_enabled. Signed-off-by: Xin Long --- net/rxrpc/local_object.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index 8c28810..93e05d2 100644 --- a/net/rxrpc/local_object.c +++ b/net

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

2021-01-26 Thread Xin Long
On Tue, Jan 26, 2021 at 10:35 AM Willem de Bruijn wrote: > > On Sun, Jan 24, 2021 at 3:57 AM 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 > >

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

2021-01-24 Thread Xin Long
, and correspondingly decrease udp_encap_needed_key in udpv6_destroy_sock(). v1->v2: - add udp_encap_disable() and export it. v2->v3: - add the change for rxrpc and bareudp into one patch, as Alex suggested. Signed-off-by: Xin Long --- drivers/net/bareudp.c| 6 -- include/net/udp.h

[PATCH net-next 1/2] net: support ip generic csum processing in skb_csum_hwoffload_help

2021-01-24 Thread Xin Long
ocessing by checking NETIF_F_HW_CSUM for all protocols, and check (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM) only for TCP and UDP. v1->v2: - not extend skb->csum_not_inet, but use skb->csum_offset to tell if it's an UDP/TCP csum packet. Suggested-by: Alexander Duyck Signed-off-by:

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

2021-01-24 Thread Xin Long
E dev doesn't support SCTP CRC CSUM and it will always do checksum for SCTP in sctp_packet_pack() when it's not a GSO packet. Signed-off-by: Xin Long --- include/net/gre.h | 19 +++ net/ipv4/gre_offload.c | 15 +-- 2 files changed, 20 insertions(+)

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

2021-01-24 Thread Xin Long
This patchset it to add ip generic csum processing first in skb_csum_hwoffload_help() in Patch 1/2 and then add csum offload support for GRE header in Patch 2/2. v1->v2: - See each patch's changelog. Xin Long (2): net: support ip generic csum processing in skb_csum_hwoffload_help

[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 |

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

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

[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

[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 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 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_

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 > >

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

[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 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 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

[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 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 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] 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 +++

[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

[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 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 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

[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

[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 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

[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

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

[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/

[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] 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 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 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

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: > > &

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: [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: [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-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: [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

[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

[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

[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] 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] 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 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] 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-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: > > >

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-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-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-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-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] 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] 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

[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

[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

[PATCH net-next] sctp: bring inet(6)_skb_parm back to sctp_input_cb

2020-11-03 Thread Xin Long
verwriting it in sctp4/6_rcv() and sctp_udp_rcv(). Reported-by: syzbot+5be8aebb1b7dfa90e...@syzkaller.appspotmail.com Fixes: a1dd2cf2f1ae ("sctp: allow changing transport encap_port by peer packets") Signed-off-by: Xin Long --- include/net/sctp/structs.h | 6 ++ net/sctp/ipv6.c

Re: KASAN: use-after-free Read in decode_session6

2020-11-03 Thread Xin Long
On Tue, Nov 3, 2020 at 9:14 PM Xin Long wrote: > > On Sun, Nov 1, 2020 at 1:40 PM syzbot > wrote: > > > > syzbot has bisected this issue to: > > > > commit bcd623d8e9fa5f82bbd8cd464dc418d24139157b > > Author: Xin Long > > Date: Thu Oct

Re: KASAN: use-after-free Read in decode_session6

2020-11-03 Thread Xin Long
On Sun, Nov 1, 2020 at 1:40 PM syzbot wrote: > > syzbot has bisected this issue to: > > commit bcd623d8e9fa5f82bbd8cd464dc418d24139157b > Author: Xin Long > Date: Thu Oct 29 07:05:05 2020 + > > sctp: call sk_setup_caps in sctp_packet_transmit instead &

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

2020-10-29 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 +

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

2020-10-29 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.

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

2020-10-29 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.

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

2020-10-29 Thread Xin Long
tl.rst. v4->v5: - Not call sctp_udp_sock_start/stop() in sctp_ctrlsock_init/exit(). - Improve the description of udp_port in ip-sysctl.rst. Signed-off-by: Xin Long --- Documentation/networking/ip-sysctl.rst | 15 ++ net/sctp/sysctl.c | 52

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

2020-10-29 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

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

2020-10-29 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/

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

2020-10-29 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

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

2020-10-29 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

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

2020-10-29 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 +

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

2020-10-29 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

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

2020-10-29 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 --

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

2020-10-29 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. v4->v5: - Improve the description of encap_port in ip-sysctl.rst. Signed-off-by:

  1   2   3   4   5   6   7   8   9   10   >