RE: [PATCH V4 net 5/5] net: stmmac: re-init rx buffers when mac resume back

2021-02-19 Thread Joakim Zhang
> -Original Message- > From: Jakub Kicinski > Sent: 2021年2月7日 4:38 > To: Joakim Zhang > Cc: peppe.cavall...@st.com; alexandre.tor...@st.com; > joab...@synopsys.com; da...@davemloft.net; netdev@vger.kernel.org; > dl-linux-imx > Subject: Re: [PATCH V4 net 5/5] net: stmmac: re-init rx buff

RE: [PATCH V4 net 3/5] net: stmmac: fix dma physical address of descriptor when display ring

2021-02-19 Thread Joakim Zhang
> -Original Message- > From: Jakub Kicinski > Sent: 2021年2月7日 4:29 > To: Joakim Zhang > Cc: peppe.cavall...@st.com; alexandre.tor...@st.com; > joab...@synopsys.com; da...@davemloft.net; netdev@vger.kernel.org; > dl-linux-imx > Subject: Re: [PATCH V4 net 3/5] net: stmmac: fix dma physica

WARNING in netlbl_cipsov4_add

2021-02-19 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:4773acf3 b43: N-PHY: Fix the update of coef for the PHY re.. git tree: net console output: https://syzkaller.appspot.com/x/log.txt?x=13290cb0d0 kernel config: https://syzkaller.appspot.com/x/.config?x=8cb23303ddb9411f dashboar

[PATCH 1/1] net: fec: ptp: avoid register access when ipg clock is disabled

2021-02-19 Thread Heiko Thiery
When accessing the timecounter register on an i.MX8MQ the kernel hangs. This is only the case when the interface is down. This can be reproduced by reading with 'phc_ctrl eth0 get'. Like described in the change in 91c0d987a9788dcc5fe26baafd73bf9242b68900 the igp clock is disabled when the interfac

[Patch bpf-next v6 1/8] bpf: clean up sockmap related Kconfigs

2021-02-19 Thread Cong Wang
From: Cong Wang As suggested by John, clean up sockmap related Kconfigs: Reduce the scope of CONFIG_BPF_STREAM_PARSER down to TCP stream parser, to reflect its name. Make the rest sockmap code simply depend on CONFIG_BPF_SYSCALL and CONFIG_INET, the latter is still needed at this point because

[Patch bpf-next v6 8/8] skmsg: get rid of sk_psock_bpf_run()

2021-02-19 Thread Cong Wang
From: Cong Wang It is now nearly identical to bpf_prog_run_pin_on_cpu() and it has an unused parameter 'psock', so we can just get rid of it and call bpf_prog_run_pin_on_cpu() directly. Cc: Jakub Sitnicki Cc: Daniel Borkmann Cc: Lorenz Bauer Cc: John Fastabend Signed-off-by: Cong Wang ---

[Patch bpf-next v6 6/8] sock_map: make sock_map_prog_update() static

2021-02-19 Thread Cong Wang
From: Cong Wang It is only used within sock_map.c so can become static. Suggested-by: Jakub Sitnicki Cc: Daniel Borkmann Cc: Lorenz Bauer Cc: John Fastabend Signed-off-by: Cong Wang --- include/linux/bpf.h | 9 - net/core/sock_map.c | 7 +-- 2 files changed, 5 insertions(+), 11

[Patch bpf-next v6 5/8] sock_map: rename skb_parser and skb_verdict

2021-02-19 Thread Cong Wang
From: Cong Wang These two eBPF programs are tied to BPF_SK_SKB_STREAM_PARSER and BPF_SK_SKB_STREAM_VERDICT, rename them to reflect the fact they are only used for TCP. And save the name 'skb_verdict' for general use later. Cc: Daniel Borkmann Cc: Jakub Sitnicki Reviewed-by: Lorenz Bauer Acked

[Patch bpf-next v6 2/8] skmsg: get rid of struct sk_psock_parser

2021-02-19 Thread Cong Wang
From: Cong Wang struct sk_psock_parser is embedded in sk_psock, it is unnecessary as skb verdict also uses ->saved_data_ready. We can simply fold these fields into sk_psock, and get rid of ->enabled. Cc: Daniel Borkmann Cc: Lorenz Bauer Acked-by: John Fastabend Acked-by: Jakub Sitnicki Signe

[Patch bpf-next v6 3/8] bpf: compute data_end dynamically with JIT code

2021-02-19 Thread Cong Wang
From: Cong Wang Currently, we compute ->data_end with a compile-time constant offset of skb. But as Jakub pointed out, we can actually compute it in eBPF JIT code at run-time, so that we can competely get rid of ->data_end. This is similar to skb_shinfo(skb) computation in bpf_convert_shinfo_acce

[Patch bpf-next v6 4/8] skmsg: move sk_redir from TCP_SKB_CB to skb

2021-02-19 Thread Cong Wang
From: Cong Wang Currently TCP_SKB_CB() is hard-coded in skmsg code, it certainly does not work for any other non-TCP protocols. We can move them to skb ext, but it introduces a memory allocation on fast path. Fortunately, we only need to a word-size to store all the information, because the flag

[Patch bpf-next v6 0/8] sock_map: clean up and refactor code for BPF_SK_SKB_VERDICT

2021-02-19 Thread Cong Wang
From: Cong Wang This patchset is the first series of patches separated out from the original large patchset, to make reviews easier. This patchset does not add any new feature or change any functionality but merely cleans up the existing sockmap and skmsg code and refactors it, to prepare for the

[Patch bpf-next v6 7/8] skmsg: make __sk_psock_purge_ingress_msg() static

2021-02-19 Thread Cong Wang
From: Cong Wang It is only used within skmsg.c so can become static. Cc: Jakub Sitnicki Cc: Daniel Borkmann Cc: Lorenz Bauer Cc: John Fastabend Signed-off-by: Cong Wang --- include/linux/skmsg.h | 2 -- net/core/skmsg.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --g

Re: [PATCH net-next] net: dsa: Fix dependencies with HSR

2021-02-19 Thread Florian Fainelli
On 2/19/2021 9:12 PM, Florian Fainelli wrote: > The core DSA framework uses hsr_is_master() which would not resolve to a > valid symbol if HSR is built-into the kernel and DSA is a module. > > Fixes: 18596f504a3e ("net: dsa: add support for offloading HSR") > Reported-by: kernel test robot > S

[PATCH net-next] net: dsa: Fix dependencies with HSR

2021-02-19 Thread Florian Fainelli
The core DSA framework uses hsr_is_master() which would not resolve to a valid symbol if HSR is built-into the kernel and DSA is a module. Fixes: 18596f504a3e ("net: dsa: add support for offloading HSR") Reported-by: kernel test robot Signed-off-by: Florian Fainelli --- David, Jakub, This showe

[PATCH] arp: Remove the arp_hh_ops structure

2021-02-19 Thread Yejune Deng
The 'arp_hh_ops' structure is similar to the 'arp_generic_ops' structure. So remove the 'arp_hh_ops' structure. Signed-off-by: Yejune Deng --- net/ipv4/arp.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 922dd73e574

[PATCH v2] xfrm: Fix incorrect types in assignment

2021-02-19 Thread Yang Li
Fix the following sparse warnings: net/xfrm/xfrm_policy.c:1303:22: warning: incorrect type in assignment (different address spaces) Reported-by: Abaci Robot Signed-off-by: Yang Li --- net/xfrm/xfrm_policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_poli

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-19 Thread Si-Wei Liu
On 2/19/2021 6:38 PM, Jason Wang wrote: Right now the value is exposed to userspace via GET_VRING_BASE, so only last_avail_idx is synced. If we need sync last_used_idx, we should also sync pending indices which requires more thoughts. Technically it doesn't sound right - crossing the bound

Re: [PATCH 1/2] vdpa/mlx5: Fix suspend/resume index restoration

2021-02-19 Thread Si-Wei Liu
On 2/17/2021 11:42 AM, Si-Wei Liu wrote: On 2/16/2021 8:20 AM, Eli Cohen wrote: When we suspend the VM, the VDPA interface will be reset. When the VM is resumed again, clear_virtqueues() will clear the available and used indices resulting in hardware virqtqueue objects becoming out of sync.

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-19 Thread Jason Wang
On 2021/2/20 10:05 上午, Si-Wei Liu wrote: On 2/18/2021 7:10 PM, Jason Wang wrote: On 2021/2/18 8:43 下午, Si-Wei Liu wrote: On 2/17/2021 8:44 PM, Jason Wang wrote: On 2021/2/10 下午4:59, Si-Wei Liu wrote: On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote:

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-19 Thread Si-Wei Liu
On 2/18/2021 7:10 PM, Jason Wang wrote: On 2021/2/18 8:43 下午, Si-Wei Liu wrote: On 2/17/2021 8:44 PM, Jason Wang wrote: On 2021/2/10 下午4:59, Si-Wei Liu wrote: On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote: On 2/8/2021 10:37 PM, Jason Wang wrote:

[PATCH net] tcp: fix keepalive when data remain undelivered

2021-02-19 Thread Enke Chen
From: Enke Chen TCP keepalive does not timeout under the condition that network connection is lost and data remain undelivered (incl. retransmit). A very simple scenarios of the failure is to write data to a tcp socket after the network connection is lost. Under the specified condition the keepa

[Patch bpf-next v5 1/8] bpf: clean up sockmap related Kconfigs

2021-02-19 Thread Cong Wang
From: Cong Wang As suggested by John, clean up sockmap related Kconfigs: Reduce the scope of CONFIG_BPF_STREAM_PARSER down to TCP stream parser, to reflect its name. Make the rest sockmap code simply depend on CONFIG_BPF_SYSCALL. And leave CONFIG_NET_SOCK_MSG untouched, as it is used by non-soc

[Patch bpf-next v5 2/8] skmsg: get rid of struct sk_psock_parser

2021-02-19 Thread Cong Wang
From: Cong Wang struct sk_psock_parser is embedded in sk_psock, it is unnecessary as skb verdict also uses ->saved_data_ready. We can simply fold these fields into sk_psock, and get rid of ->enabled. Cc: Daniel Borkmann Cc: Lorenz Bauer Acked-by: John Fastabend Acked-by: Jakub Sitnicki Signe

[Patch bpf-next v5 3/8] bpf: compute data_end dynamically with JIT code

2021-02-19 Thread Cong Wang
From: Cong Wang Currently, we compute ->data_end with a compile-time constant offset of skb. But as Jakub pointed out, we can actually compute it in eBPF JIT code at run-time, so that we can competely get rid of ->data_end. This is similar to skb_shinfo(skb) computation in bpf_convert_shinfo_acce

[Patch bpf-next v5 0/8] sock_map: clean up and refactor code for BPF_SK_SKB_VERDICT

2021-02-19 Thread Cong Wang
From: Cong Wang This patchset is the first series of patches separated out from the original large patchset, to make reviews easier. This patchset does not add any new feature or change any functionality but merely cleans up the existing sockmap and skmsg code and refactors it, to prepare for the

[Patch bpf-next v5 7/8] skmsg: make __sk_psock_purge_ingress_msg() static

2021-02-19 Thread Cong Wang
From: Cong Wang It is only used within skmsg.c so can become static. Cc: Jakub Sitnicki Cc: Daniel Borkmann Cc: Lorenz Bauer Cc: John Fastabend Signed-off-by: Cong Wang --- include/linux/skmsg.h | 2 -- net/core/skmsg.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --g

[Patch bpf-next v5 8/8] skmsg: get rid of sk_psock_bpf_run()

2021-02-19 Thread Cong Wang
From: Cong Wang It is now nearly identical to bpf_prog_run_pin_on_cpu() and it has an unused parameter 'psock', so we can just get rid of it and call bpf_prog_run_pin_on_cpu() directly. Cc: Jakub Sitnicki Cc: Daniel Borkmann Cc: Lorenz Bauer Cc: John Fastabend Signed-off-by: Cong Wang ---

[Patch bpf-next v5 5/8] sock_map: rename skb_parser and skb_verdict

2021-02-19 Thread Cong Wang
From: Cong Wang These two eBPF programs are tied to BPF_SK_SKB_STREAM_PARSER and BPF_SK_SKB_STREAM_VERDICT, rename them to reflect the fact they are only used for TCP. And save the name 'skb_verdict' for general use later. Cc: Daniel Borkmann Cc: Jakub Sitnicki Reviewed-by: Lorenz Bauer Acked

[Patch bpf-next v5 4/8] skmsg: move sk_redir from TCP_SKB_CB to skb

2021-02-19 Thread Cong Wang
From: Cong Wang Currently TCP_SKB_CB() is hard-coded in skmsg code, it certainly does not work for any other non-TCP protocols. We can move them to skb ext, but it introduces a memory allocation on fast path. Fortunately, we only need to a word-size to store all the information, because the flag

[Patch bpf-next v5 6/8] sock_map: make sock_map_prog_update() static

2021-02-19 Thread Cong Wang
From: Cong Wang It is only used within sock_map.c so can become static. Suggested-by: Jakub Sitnicki Cc: Daniel Borkmann Cc: Lorenz Bauer Cc: John Fastabend Signed-off-by: Cong Wang --- include/linux/bpf.h | 9 - net/core/sock_map.c | 7 +-- 2 files changed, 5 insertions(+), 11

Re: [Patch bpf-next v4 1/5] bpf: clean up sockmap related Kconfigs

2021-02-19 Thread Jakub Sitnicki
On Fri, Feb 19, 2021 at 07:46 PM CET, Cong Wang wrote: > On Fri, Feb 19, 2021 at 10:25 AM Jakub Sitnicki wrote: >> >> On Tue, Feb 16, 2021 at 07:42 AM CET, Cong Wang wrote: >> > From: Cong Wang >> > >> > As suggested by John, clean up sockmap related Kconfigs: >> > >> > Reduce the scope of CONFIG

[PATCH net v2 1/8] i40e: Fix flow for IPv6 next header (extension header)

2021-02-19 Thread Tony Nguyen
From: Slawomir Laba When a packet contains an IPv6 header with next header which is an extension header and not a protocol one, the kernel function skb_transport_header called with such sk_buff will return a pointer to the extension header and not to the TCP one. The above explained call caused

[PATCH net v2 4/8] i40e: Fix overwriting flow control settings during driver loading

2021-02-19 Thread Tony Nguyen
From: Mateusz Palczewski During driver loading flow control settings were written to FW using a variable which was always zero, since it was being set only by ethtool. This behavior has been corrected and driver no longer overwrites the default FW/NVM settings. Fixes: 373149fc99a0 ("i40e: Decrea

[PATCH net v2 5/8] i40e: Fix addition of RX filters after enabling FW LLDP agent

2021-02-19 Thread Tony Nguyen
From: Mateusz Palczewski Fix addition of VLAN filter for PF after enabling FW LLDP agent. Changing LLDP Agent causes FW to re-initialize per NVM settings. Remove default PF filter and move "Enable/Disable" to currently used reset flag. Without this patch PF would try to add MAC VLAN filter with d

[PATCH net v2 6/8] i40e: Fix VFs not created

2021-02-19 Thread Tony Nguyen
From: Sylwester Dziedziuch When creating VFs they were sometimes not getting resources. It was caused by not executing i40e_reset_all_vfs due to flag __I40E_VF_DISABLE being set on PF. Because of this IAVF was never able to finish setup sequence never getting reset indication from PF. Changed tes

[PATCH net v2 3/8] i40e: Add zero-initialization of AQ command structures

2021-02-19 Thread Tony Nguyen
From: Mateusz Palczewski Zero-initialize AQ command data structures to comply with API specifications. Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower") Fixes: f4492db16df8 ("i40e: Add NPAR BW get and set functions") Signed-off-by: Andrzej Sawuła Signed-off-by: Mateusz Palczewski

[PATCH net v2 2/8] i40e: Fix memory leak in i40e_probe

2021-02-19 Thread Tony Nguyen
From: Keita Suzuki Struct i40e_veb is allocated in function i40e_setup_pf_switch, and stored to an array field veb inside struct i40e_pf. However when i40e_setup_misc_vector fails, this memory leaks. Fix this by calling exit and teardown functions. Signed-off-by: Keita Suzuki Tested-by: Tony B

[PATCH net v2 8/8] i40e: Fix endianness conversions

2021-02-19 Thread Tony Nguyen
From: Norbert Ciosek Fixes the following sparse warnings: i40e_main.c:5953:32: warning: cast from restricted __le16 i40e_main.c:8008:29: warning: incorrect type in assignment (different base types) i40e_main.c:8008:29:expected unsigned int [assigned] [usertype] ipa i40e_main.c:8008:29:go

[PATCH net v2 7/8] i40e: Fix add TC filter for IPv6

2021-02-19 Thread Tony Nguyen
From: Mateusz Palczewski Fix insufficient distinction between IPv4 and IPv6 addresses when creating a filter. IPv4 and IPv6 are kept in the same memory area. If IPv6 is added, then it's caught by IPv4 check, which leads to err -95. Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower")

[PATCH net v2 0/8][pull request] Intel Wired LAN Driver Updates 2021-02-19

2021-02-19 Thread Tony Nguyen
This series contains updates to i40e driver only. Slawomir resolves an issue with the IPv6 extension headers being processed incorrectly. Keita Suzuki fixes a memory leak on probe failure. Mateusz initializes AQ command structures to zero to comply with spec, fixes FW flow control settings being

RE: [EXT] Re: [RFC PATCH v3 00/11] NVMeTCP Offload ULP and QEDN Device Driver

2021-02-19 Thread Ariel Elior
> On Thu, Feb 18, 2021 at 06:38:07PM +, Shai Malin wrote: > > So, as there are no more comments / questions, we understand the > > direction is acceptable and will proceed to the full series. > > I do not think we should support offloads at all, and certainly not onces > requiring extra driver

[PATCH iproute2-next] mptcp: add support for port based endpoint

2021-02-19 Thread Paolo Abeni
The feature is supported by the kernel since 5.11-net-next, let's allow user-space to use it. Just parse and dump an additional, per endpoint, u16 attribute Signed-off-by: Paolo Abeni --- ip/ipmptcp.c| 16 ++-- man/man8/ip-mptcp.8 | 8 2 files changed, 22 insertion

Re: [PATCH net-next RFC v4] net: hdlc_x25: Queue outgoing LAPB frames

2021-02-19 Thread Xie He
On Fri, Feb 19, 2021 at 10:39 AM Jakub Kicinski wrote: > > Not entirely sure what the argument is about but adding constants would > certainly help. Leon wants me to replace this: dev->needed_headroom = 3 - 1; with this: /* 2 is the result of 3 - 1 */ dev->needed_headroom = 2; But I don't fee

Re: general protection fault in mptcp_sendmsg_frag

2021-02-19 Thread syzbot
syzbot has bisected this issue to: commit 40947e13997a1cba4e875893ca6e5d5e61a0689d Author: Florian Westphal Date: Fri Feb 12 23:59:56 2021 + mptcp: schedule worker when subflow is closed bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1541a434d0 start commit: 773dc5

Re: [PATCH net] net: l2tp: reduce log level when passing up invalid packets

2021-02-19 Thread Tom Parkin
Hi Matthias, Thanks for your patch! On Fri, Feb 19, 2021 at 20:06:15 +0100, Matthias Schiffer wrote: > Before commit 5ee759cda51b ("l2tp: use standard API for warning log > messages"), it was possible for userspace applications to use their own > control protocols on the backing sockets of an L2

[PATCH net] net: l2tp: reduce log level when passing up invalid packets

2021-02-19 Thread Matthias Schiffer
Before commit 5ee759cda51b ("l2tp: use standard API for warning log messages"), it was possible for userspace applications to use their own control protocols on the backing sockets of an L2TP kernel device, and as long as a packet didn't look like a proper L2TP data packet, it would be passed up to

Re: [Patch bpf-next v4 1/5] bpf: clean up sockmap related Kconfigs

2021-02-19 Thread Cong Wang
On Fri, Feb 19, 2021 at 10:25 AM Jakub Sitnicki wrote: > > On Tue, Feb 16, 2021 at 07:42 AM CET, Cong Wang wrote: > > From: Cong Wang > > > > As suggested by John, clean up sockmap related Kconfigs: > > > > Reduce the scope of CONFIG_BPF_STREAM_PARSER down to TCP stream > > parser, to reflect its

Re: [PATCH net-next RFC v4] net: hdlc_x25: Queue outgoing LAPB frames

2021-02-19 Thread Jakub Kicinski
On Thu, 18 Feb 2021 12:23:28 -0800 Xie He wrote: > On Thu, Feb 18, 2021 at 12:06 PM Xie He wrote: > > > > On Thu, Feb 18, 2021 at 11:55 AM Leon Romanovsky wrote: > > > > > > This is how we write code, we use defines instead of constant numbers, > > > comments to describe tricky parts and assign

Re: [PATCH net] octeontx2-af: Fix an off by one in rvu_dbg_qsize_write()

2021-02-19 Thread Sunil Kovvuri
On Fri, Feb 19, 2021 at 3:31 PM Dan Carpenter wrote: > > This code does not allocate enough memory for the NUL terminator so it > ends up putting it one character beyond the end of the buffer. > > Fixes: 8756828a8148 ("octeontx2-af: Add NPA aura and pool contexts to > debugfs") > Signed-off-by: D

Re: [PATCH net] octeontx2-af: Fix an off by one in rvu_dbg_qsize_write()

2021-02-19 Thread Jakub Kicinski
On Fri, 19 Feb 2021 12:56:32 +0300 Dan Carpenter wrote: > This code does not allocate enough memory for the NUL terminator so it > ends up putting it one character beyond the end of the buffer. > > Fixes: 8756828a8148 ("octeontx2-af: Add NPA aura and pool contexts to > debugfs") > Signed-off-by:

Re: [Patch bpf-next v4 1/5] bpf: clean up sockmap related Kconfigs

2021-02-19 Thread Jakub Sitnicki
On Tue, Feb 16, 2021 at 07:42 AM CET, Cong Wang wrote: > From: Cong Wang > > As suggested by John, clean up sockmap related Kconfigs: > > Reduce the scope of CONFIG_BPF_STREAM_PARSER down to TCP stream > parser, to reflect its name. > > Make the rest sockmap code simply depend on CONFIG_BPF_SYSCAL

Re: [PATCH net] r8152: move r8153_mac_clk_spd

2021-02-19 Thread Jakub Kicinski
On Fri, 19 Feb 2021 17:38:03 +0800 Hayes Wang wrote: > Move calling r8153_mac_clk_spd() from r8153_first_init() to rtl8153_up(), > and from r8153_enter_oob() to rtl8153_down(). > > r8153_mac_clk_spd() is used for RTL8153A. However, RTL8153B use > r8153_first_init() and r8153_enter_oob(), too. Ther

Re: [PATCH bpf-next 1/2] bpf, xdp: per-map bpf_redirect_map functions for XDP

2021-02-19 Thread kernel test robot
Hi "Björn, I love your patch! Yet something to improve: [auto build test ERROR on 7b1e385c9a488de9291eaaa412146d3972e9dec5] url: https://github.com/0day-ci/linux/commits/Bj-rn-T-pel/Optimize-bpf_redirect_map-xdp_do_redirect/20210219-230349 base: 7b1e385c9a488de9291eaaa412146d3972e

Re: [PATCH net 7/8] i40e: Fix add TC filter for IPv6

2021-02-19 Thread Nguyen, Anthony L
On Fri, 2021-02-19 at 09:31 -0800, Jakub Kicinski wrote: > On Thu, 18 Feb 2021 15:25:03 -0800 Tony Nguyen wrote: > > From: Mateusz Palczewski > > > > Fix insufficient distinction between IPv4 and IPv6 addresses > > when creating a filter. > > IPv4 and IPv6 are kept in the same memory area. If IPv

Re: [PATCH bpf-next 2/2] bpf, xdp: restructure redirect actions

2021-02-19 Thread Björn Töpel
On 2021-02-19 18:10, Toke Høiland-Jørgensen wrote: + case XDP_REDIR_DEV_MAP: { struct bpf_dtab_netdev *dst = fwd; I thought the braces around the case body looked a bit odd. I guess that's to get a local scope for the dst var (and xs var below), right? This is basically a c

Re: [PATCH bpf-next 1/2] bpf, xdp: per-map bpf_redirect_map functions for XDP

2021-02-19 Thread Björn Töpel
On 2021-02-19 18:05, Toke Høiland-Jørgensen wrote: Björn Töpel writes: [...] @@ -4110,22 +4094,17 @@ static const struct bpf_func_proto bpf_xdp_redirect_proto = { .arg2_type = ARG_ANYTHING, }; -BPF_CALL_3(bpf_xdp_redirect_map, struct bpf_map *, map, u32, ifindex, -

[PATCH net 1/4] mptcp: fix DATA_FIN processing for orphaned sockets

2021-02-19 Thread Paolo Abeni
Currently we move orphaned msk sockets directly from FIN_WAIT2 state to CLOSE, with the rationale that incoming additional data could be just dropped by the TCP stack/TW sockets. Anyhow we miss sending MPTCP-level ack on incoming DATA_FIN, and that may hang the peers. Fixes: e16163b6e2b7 ("mptcp:

[PATCH net 3/4] mptcp: provide subflow aware release function

2021-02-19 Thread Paolo Abeni
From: Florian Westphal mptcp re-used inet(6)_release, so the subflow sockets are ignored. Need to invoke ip(v6)_mc_drop_socket function to ensure mcast join resources get free'd. Fixes: 717e79c867ca5 ("mptcp: Add setsockopt()/getsockopt() socket operations") Closes: https://github.com/multipath-

[PATCH net 4/4] mptcp: do not wakeup listener for MPJ subflows

2021-02-19 Thread Paolo Abeni
MPJ subflows are not exposed as fds to user spaces. As such, incoming MPJ subflows are removed from the accept queue by tcp_check_req()/tcp_get_cookie_sock(). Later tcp_child_process() invokes subflow_data_ready() on the parent socket regardless of the subflow kind, leading to poll wakeups even if

[PATCH net 2/4] mptcp: fix DATA_FIN generation on early shutdown

2021-02-19 Thread Paolo Abeni
If the msk is closed before sending or receiving any data, no DATA_FIN is generated, instead an MPC ack packet is crafted out. In the above scenario, the MPTCP protocol creates and sends a pure ack and such packets matches also the criteria for an MPC ack and the protocol tries first to insert MPC

[PATCH net 0/4] mptcp: a bunch of fixes

2021-02-19 Thread Paolo Abeni
This series bundle a few MPTCP fixes for the current net tree. They have been detected via syzkaller and packetdrill Patch 1 fixes a slow close for orphaned sockets Patch 2 fixes another hangup at close time, when no data was actually transmitted before close Patch 3 fixes a memory leak with unu

Re: [PATCH net 7/8] i40e: Fix add TC filter for IPv6

2021-02-19 Thread Jakub Kicinski
On Thu, 18 Feb 2021 15:25:03 -0800 Tony Nguyen wrote: > From: Mateusz Palczewski > > Fix insufficient distinction between IPv4 and IPv6 addresses > when creating a filter. > IPv4 and IPv6 are kept in the same memory area. If IPv6 is added, > then it's caught by IPv4 check, which leads to err -95.

[PATCH ipsec] xfrm: interface: fix ipv4 pmtu check to honor ip header df

2021-02-19 Thread Eyal Birger
Frag needed should only be sent if the header enables DF. This fix allows packets larger than MTU to pass the xfrm interface and be fragmented after encapsulation, aligning behavior with non-interface xfrm. Fixes: f203b76d7809 ("xfrm: Add virtual xfrm interfaces") Signed-off-by: Eyal Birger ---

Re: [PATCH bpf-next 2/2] bpf, xdp: restructure redirect actions

2021-02-19 Thread Toke Høiland-Jørgensen
Björn Töpel writes: > From: Björn Töpel > > The XDP_REDIRECT implementations for maps and non-maps are fairly > similar, but obviously need to take different code paths depending on > if the target is using a map or not. Today, the redirect targets for > XDP either uses a map, or is based on ifi

Re: [PATCH bpf-next 1/2] bpf, xdp: per-map bpf_redirect_map functions for XDP

2021-02-19 Thread kernel test robot
Hi "Björn, I love your patch! Perhaps something to improve: [auto build test WARNING on 7b1e385c9a488de9291eaaa412146d3972e9dec5] url: https://github.com/0day-ci/linux/commits/Bj-rn-T-pel/Optimize-bpf_redirect_map-xdp_do_redirect/20210219-230349

Re: [PATCH bpf-next 1/2] bpf, xdp: per-map bpf_redirect_map functions for XDP

2021-02-19 Thread Toke Høiland-Jørgensen
Björn Töpel writes: > From: Björn Töpel > > Currently the bpf_redirect_map() implementation dispatches to the > correct map-lookup function via a switch-statement. To avoid the > dispatching, this change adds one bpf_redirect_map() implementation per > map. Correct function is automatically sele

Re: [PATCH mlx5-next v6 1/4] PCI: Add sysfs callback to allow MSI-X table size change of SR-IOV VFs

2021-02-19 Thread Leon Romanovsky
On Fri, Feb 19, 2021 at 09:20:18AM +0100, Greg Kroah-Hartman wrote: > On Fri, Feb 19, 2021 at 09:52:12AM +0200, Leon Romanovsky wrote: > > On Thu, Feb 18, 2021 at 04:39:50PM -0600, Bjorn Helgaas wrote: > > > On Thu, Feb 18, 2021 at 12:15:51PM +0200, Leon Romanovsky wrote: > > > > On Wed, Feb 17, 20

[PATCH bpf-next v3 4/4] tools/testing: add a selftest for SO_NETNS_COOKIE

2021-02-19 Thread Lorenz Bauer
Make sure that SO_NETNS_COOKIE returns a non-zero value, and that sockets from different namespaces have a distinct cookie value. Signed-off-by: Lorenz Bauer --- tools/testing/selftests/net/.gitignore| 1 + tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/n

[PATCH bpf-next v3 0/4] Expose network namespace cookies to user space

2021-02-19 Thread Lorenz Bauer
We're working on a user space control plane for the BPF sk_lookup hook [1]. The hook attaches to a network namespace and allows control over which socket receives a new connection / packet. I'm proposing to add a new getsockopt and a netns ioctl to retrieve netns cookies, which allows identifying

[PATCH bpf-next v3 3/4] tools/testing: add test for NS_GET_COOKIE

2021-02-19 Thread Lorenz Bauer
Check that NS_GET_COOKIE returns a non-zero value, and that distinct network namespaces have different cookies. Signed-off-by: Lorenz Bauer --- tools/testing/selftests/nsfs/.gitignore | 1 + tools/testing/selftests/nsfs/Makefile | 2 +- tools/testing/selftests/nsfs/config | 1 + tools/t

[PATCH bpf-next v3 2/4] nsfs: add an ioctl to discover the network namespace cookie

2021-02-19 Thread Lorenz Bauer
Network namespaces have a globally unique non-zero identifier aka a cookie, in line with socket cookies. Add an ioctl to retrieve the cookie from user space without going via BPF. Signed-off-by: Lorenz Bauer --- fs/nsfs.c | 7 +++ include/uapi/linux/nsfs.h | 2 ++ 2 files cha

[PATCH bpf-next v3 1/4] net: add SO_NETNS_COOKIE socket option

2021-02-19 Thread Lorenz Bauer
We need to distinguish which network namespace a socket belongs to. BPF has the useful bpf_get_netns_cookie helper for this, but accessing it from user space isn't possible. Add a read-only socket option that returns the netns cookie, similar to SO_COOKIE. If network namespaces are disabled, SO_NET

[PATCH v3 5/8] xen/events: link interdomain events to associated xenbus device

2021-02-19 Thread Juergen Gross
In order to support the possibility of per-device event channel settings (e.g. lateeoi spurious event thresholds) add a xenbus device pointer to struct irq_info() and modify the related event channel binding interfaces to take the pointer to the xenbus device as a parameter instead of the domain id

[PATCH v3 4/8] xen/netback: fix spurious event detection for common event case

2021-02-19 Thread Juergen Gross
In case of a common event for rx and tx queue the event should be regarded to be spurious if no rx and no tx requests are pending. Unfortunately the condition for testing that is wrong causing to decide a event being spurious if no rx OR no tx requests are pending. Fix that plus using local varia

[PATCH v3 0/8] xen/events: bug fixes and some diagnostic aids

2021-02-19 Thread Juergen Gross
The first four patches are fixes for XSA-332. The avoid WARN splats and a performance issue with interdomain events. Patches 5 and 6 are some additions to event handling in order to add some per pv-device statistics to sysfs and the ability to have a per backend device spurious event delay control

Re: [PATCH bpf-next v2 1/4] net: add SO_NETNS_COOKIE socket option

2021-02-19 Thread Eric Dumazet
On 2/19/21 1:23 PM, Lorenz Bauer wrote: > On Fri, 19 Feb 2021 at 11:49, Eric Dumazet wrote: >> >>> + case SO_NETNS_COOKIE: >>> + lv = sizeof(u64); >>> + if (len < lv) >>> + return -EINVAL; >> >> if (len != lv) >> return -EI

Re: [PATCH net v4] net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending

2021-02-19 Thread Willem de Bruijn
On Thu, Feb 18, 2021 at 9:25 PM Jason A. Donenfeld wrote: > > The icmp{,v6}_send functions make all sorts of use of skb->cb, casting > it with IPCB or IP6CB, assuming the skb to have come directly from the > inet layer. But when the packet comes from the ndo layer, especially > when forwarded, the

[PATCH bpf-next 1/2] bpf, xdp: per-map bpf_redirect_map functions for XDP

2021-02-19 Thread Björn Töpel
From: Björn Töpel Currently the bpf_redirect_map() implementation dispatches to the correct map-lookup function via a switch-statement. To avoid the dispatching, this change adds one bpf_redirect_map() implementation per map. Correct function is automatically selected by the BPF verifier. rfc->v

[PATCH bpf-next 2/2] bpf, xdp: restructure redirect actions

2021-02-19 Thread Björn Töpel
From: Björn Töpel The XDP_REDIRECT implementations for maps and non-maps are fairly similar, but obviously need to take different code paths depending on if the target is using a map or not. Today, the redirect targets for XDP either uses a map, or is based on ifindex. Here, an explicit redirect

[PATCH bpf-next 0/2] Optimize bpf_redirect_map()/xdp_do_redirect()

2021-02-19 Thread Björn Töpel
Hi XDP-folks, This two patch series contain two optimizations for the bpf_redirect_map() helper and the xdp_do_redirect() function. The bpf_redirect_map() optimization is about avoiding the map lookup dispatching. Instead of having a switch-statement and selecting the correct lookup function, we

Re: linux-next: build warnings after merge of the net-next tree

2021-02-19 Thread Kalle Valo
Stephen Rothwell writes: > Hi all, > > On Fri, 19 Feb 2021 07:52:56 +1100 Stephen Rothwell > wrote: >> >> After merging the net-next tree, today's linux-next build (htmldocs) >> produced these warnings: >> >> Documentation/networking/filter.rst:1053: WARNING: Inline emphasis >> start-string w

Re: [PATCH] net: check if protocol extracted by virtio_net_hdr_set_proto is correct

2021-02-19 Thread Willem de Bruijn
On Fri, Feb 19, 2021 at 3:53 AM Jason Wang wrote: > > > On 2021/2/18 11:50 下午, Willem de Bruijn wrote: > > On Thu, Feb 18, 2021 at 10:01 AM Balazs Nemeth wrote: > >> For gso packets, virtio_net_hdr_set_proto sets the protocol (if it isn't > >> set) based on the type in the virtio net hdr, but the

Re: [PATCH] xfrm: Fix incorrect types in assignment

2021-02-19 Thread Florian Westphal
Yang Li wrote: > Fix the following sparse warnings: > net/xfrm/xfrm_policy.c:1303:22: warning: incorrect type in assignment > (different address spaces) > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > net/xfrm/xfrm_policy.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >

Re: [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal

2021-02-19 Thread Jesper Dangaard Brouer
On Thu, 18 Feb 2021 20:21:06 +0200 Camelia Groza wrote: > The current use of container_of is flawed and unnecessary. Obtain > the dpaa_napi_portal reference from the private percpu data instead. > > Fixes: a1e031ffb422 ("dpaa_eth: add XDP_REDIRECT support") > Reported-by: Sascha Hauer > Signed-

Re: [PATCH] net: hsr: add support for EntryForgetTime

2021-02-19 Thread George McCollister
On Fri, Feb 19, 2021 at 2:27 AM Wenzel, Marco wrote: > > On Thu, Feb 18, 2021 at 6:06 PM : George McCollister > wrote: > > > > On Thu, Feb 18, 2021 at 9:01 AM Marco Wenzel > eberle.de> wrote: > > > > > > In IEC 62439-3 EntryForgetTime is defined with a value of 400 ms. When > > > a node does no

Re: [PATCH bpf-next 2/4] selftests/bpf: expose debug arg to shell script for xsk tests

2021-02-19 Thread Magnus Karlsson
On Wed, Feb 17, 2021 at 5:36 PM Ciara Loftus wrote: > > Launching xdpxceiver with -D enables debug mode. Make it possible Would be clearer if the option was the same both in the shell and in the xdpreceiver app, so please pick -d or -D and stick with it. And how about calling the mode "dump packe

Re: [PATCH bpf-next v2 1/4] net: add SO_NETNS_COOKIE socket option

2021-02-19 Thread Lorenz Bauer
On Fri, 19 Feb 2021 at 11:49, Eric Dumazet wrote: > > > + case SO_NETNS_COOKIE: > > + lv = sizeof(u64); > > + if (len < lv) > > + return -EINVAL; > > if (len != lv) > return -EINVAL; > > (There is no reason to support bigger v

[PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-19 Thread Si-Wei Liu
Commit 452639a64ad8 ("vdpa: make sure set_features is invoked for legacy") made an exception for legacy guests to reset features to 0, when config space is accessed before features are set. We should relieve the verify_min_features() check and allow features reset to 0 for this case. It's worth no

Re: [PATCH bpf-next v2 1/4] net: add SO_NETNS_COOKIE socket option

2021-02-19 Thread Eric Dumazet
On 2/19/21 10:51 AM, Lorenz Bauer wrote: > We need to distinguish which network namespace a socket belongs to. > BPF has the useful bpf_get_netns_cookie helper for this, but accessing > it from user space isn't possible. Add a read-only socket option that > returns the netns cookie, similar to S

Re: [PATCH v2 net-next] net: phy: icplus: call phy_restore_page() when phy_select_page() fails

2021-02-19 Thread Russell King - ARM Linux admin
On Fri, Feb 19, 2021 at 01:10:44PM +0300, Dan Carpenter wrote: > The comments to phy_select_page() say that "phy_restore_page() must > always be called after this, irrespective of success or failure of this > call." If we don't call phy_restore_page() then we are still holding > the phy_lock_mdio_

Re: [PATCH v2 net-next] net: phy: icplus: call phy_restore_page() when phy_select_page() fails

2021-02-19 Thread Dan Carpenter
On Fri, Feb 19, 2021 at 11:46:23AM +0100, Michael Walle wrote: > Am 2021-02-19 11:10, schrieb Dan Carpenter: > > The comments to phy_select_page() say that "phy_restore_page() must > > always be called after this, irrespective of success or failure of this > > call." If we don't call phy_restore_p

Re: [PATCH v2 net-next] net: phy: icplus: call phy_restore_page() when phy_select_page() fails

2021-02-19 Thread Michael Walle
Am 2021-02-19 11:10, schrieb Dan Carpenter: The comments to phy_select_page() say that "phy_restore_page() must always be called after this, irrespective of success or failure of this call." If we don't call phy_restore_page() then we are still holding the phy_lock_mdio_bus() so it eventually le

RE: [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal

2021-02-19 Thread Madalin Bucur (OSS)
> -Original Message- > From: Camelia Alexandra Groza > Sent: 18 February 2021 20:21 > To: k...@kernel.org; da...@davemloft.net; s.ha...@pengutronix.de > Cc: bro...@redhat.com; Madalin Bucur (OSS) ; > netdev@vger.kernel.org; Camelia Alexandra Groza > Subject: [PATCH net] dpaa_eth: fix the

[PATCH v2 net-next] net: phy: icplus: call phy_restore_page() when phy_select_page() fails

2021-02-19 Thread Dan Carpenter
The comments to phy_select_page() say that "phy_restore_page() must always be called after this, irrespective of success or failure of this call." If we don't call phy_restore_page() then we are still holding the phy_lock_mdio_bus() so it eventually leads to a dead lock. Fixes: 32ab60e53920 ("net

[PATCH mellanox-tree] net/mlx5: prevent an integer underflow in mlx5_perout_configure()

2021-02-19 Thread Dan Carpenter
The value of "sec" comes from the user. Negative values will lead to shift wrapping inside the perout_conf_real_time() function and triggger a UBSan warning. Add a check and return -EINVAL to prevent that from happening. Fixes: 432119de33d9 ("net/mlx5: Add cyc2time HW translation mode support")

[PATCH net] octeontx2-af: Fix an off by one in rvu_dbg_qsize_write()

2021-02-19 Thread Dan Carpenter
This code does not allocate enough memory for the NUL terminator so it ends up putting it one character beyond the end of the buffer. Fixes: 8756828a8148 ("octeontx2-af: Add NPA aura and pool contexts to debugfs") Signed-off-by: Dan Carpenter --- drivers/net/ethernet/marvell/octeontx2/af/rvu_deb

[PATCH bpf-next v2 4/4] tools/testing: add a selftest for SO_NETNS_COOKIE

2021-02-19 Thread Lorenz Bauer
Make sure that SO_NETNS_COOKIE returns a non-zero value, and that sockets from different namespaces have a distinct cookie value. Signed-off-by: Lorenz Bauer --- tools/testing/selftests/net/.gitignore| 1 + tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/n

[PATCH bpf-next v2 3/4] tools/testing: add test for NS_GET_COOKIE

2021-02-19 Thread Lorenz Bauer
Check that NS_GET_COOKIE returns a non-zero value, and that distinct network namespaces have different cookies. Signed-off-by: Lorenz Bauer --- tools/testing/selftests/nsfs/.gitignore | 1 + tools/testing/selftests/nsfs/Makefile | 2 +- tools/testing/selftests/nsfs/config | 1 + tools/t

[PATCH bpf-next v2 0/4] Expose network namespace cookies to user space

2021-02-19 Thread Lorenz Bauer
We're working on a user space control plane for the BPF sk_lookup hook [1]. The hook attaches to a network namespace and allows control over which socket receives a new connection / packet. Roughly, applications can give a socket to our user space component to participate in custom bind semantics.

  1   2   >