Re: broken behaviour of TC filter delete

2018-08-24 Thread Jiri Pirko
Thu, Aug 23, 2018 at 11:39:22PM CEST, m...@mojatatu.com wrote: > > >It appears that the following commit changed the behaviour of scenario where a >filter is deleted twice: > >commit f71e0ca4db187af7c44987e9d21e9042c3046070 >Author: Jiri Pirko >Date: Mon Jul 23 09:23:05 2018 +0200 > >net:

Re: [net 07/13] ice: Use order_base_2 to calculate higher power of 2

2018-08-24 Thread Sergei Shtylyov
Hello! On 8/23/2018 10:14 PM, Jeff Kirsher wrote: From: Jacob Keller Currently, we use a combination of ilog2 and is_power_of_2() to calculate the next power of 2 for the qcount. This appears to be causing a warning on some combinations of GCC and the Linux kernel: MODPOST 1 modules

Re: [PATCH v2] net: macb: do not disable MDIO bus at open/close time

2018-08-24 Thread Claudiu Beznea
On 23.08.2018 10:45, Anssi Hannula wrote: > macb_reset_hw() is called from macb_close() and indirectly from > macb_open(). macb_reset_hw() zeroes the NCR register, including the MPE > (Management Port Enable) bit. > > This will prevent accessing any other PHYs for other Ethernet MACs on > the

[PATCH net] mlxsw: spectrum_switchdev: Do not leak RIFs when removing bridge

2018-08-24 Thread Ido Schimmel
When a bridge device is removed, the VLANs are flushed from each configured port. This causes the ports to decrement the reference count on the associated FIDs (filtering identifier). If the reference count of a FID is 1 and it has a RIF (router interface), then this RIF is destroyed. However, if

Re: should __LINK_STATE_* enums really be restricted to generic queueing layer?

2018-08-24 Thread Andrew Lunn
On Fri, Aug 24, 2018 at 07:17:38AM -0400, rpj...@crashcourse.ca wrote: > more curious pedantry ... in netdevice.h, one reads: > > /* These flag bits are private to the generic network queueing >* layer; they may not be explicitly referenced by any other >* code. >*/ > > enum

Re: [PATCH] i40e: report correct statistics when XDP is enabled

2018-08-24 Thread Jesper Dangaard Brouer
On Fri, 24 Aug 2018 13:21:59 +0200 Björn Töpel wrote: > When XDP is enabled, the driver will report incorrect > statistics. Received frames will reported as transmitted frames. > > This commits fixes the i40e implementation of ndo_get_stats64 (struct > net_device_ops), so that iproute2 will

Re: ixgbe hangs when XDP_TX is enabled

2018-08-24 Thread Jesper Dangaard Brouer
On Wed, 22 Aug 2018 09:22:58 -0700 Jeff Kirsher wrote: > On Tue, 2018-08-21 at 11:13 -0700, Alexander Duyck wrote: > > On Tue, Aug 21, 2018 at 9:59 AM Nikita V. Shirokov > > wrote: > > > > > > On Tue, Aug 21, 2018 at 08:58:15AM -0700, Alexander Duyck wrote: > > > > On Mon, Aug 20, 2018 at

Re: broken behaviour of TC filter delete

2018-08-24 Thread Cong Wang
On Fri, Aug 24, 2018 at 9:21 AM Roman Mashak wrote: > > So _before_ commit f71e0ca4db187af7c44987e9d21e9042c3046070 step 6 would > return -ENOENT with "Error: Filter with specified priority/protocol not > found." and _after_ the commit it returns -EINVAL (Error: Cannot find > specified filter

RE: [net 07/13] ice: Use order_base_2 to calculate higher power of 2

2018-08-24 Thread Keller, Jacob E
> -Original Message- > From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] > On Behalf Of Sergei Shtylyov > Sent: Friday, August 24, 2018 2:03 AM > To: Kirsher, Jeffrey T ; da...@davemloft.net > Cc: Keller, Jacob E ; netdev@vger.kernel.org; > nhor...@redhat.com;

Re: [net 07/13] ice: Use order_base_2 to calculate higher power of 2

2018-08-24 Thread Sergei Shtylyov
On 08/24/2018 06:39 PM, Keller, Jacob E wrote: >>> From: Jacob Keller >>> >>> Currently, we use a combination of ilog2 and is_power_of_2() to >>> calculate the next power of 2 for the qcount. This appears to be causing >>> a warning on some combinations of GCC and the Linux kernel: >>> >>>

[net 05/11] igb: Replace GFP_ATOMIC with GFP_KERNEL in igb_sw_init()

2018-08-24 Thread Jeff Kirsher
From: Jia-Ju Bai igb_sw_init() is never called in atomic context. It calls kzalloc() and kcalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Tested-by:

Re: broken behaviour of TC filter delete

2018-08-24 Thread Roman Mashak
Jiri Pirko writes: > Thu, Aug 23, 2018 at 11:39:22PM CEST, m...@mojatatu.com wrote: >> >> >>It appears that the following commit changed the behaviour of scenario where a >>filter is deleted twice: >> >>commit f71e0ca4db187af7c44987e9d21e9042c3046070 >>Author: Jiri Pirko >>Date: Mon Jul 23

[net 01/11] ixgb: use dma_zalloc_coherent instead of allocator/memset

2018-08-24 Thread Jeff Kirsher
From: YueHaibing Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. Signed-off-by: YueHaibing Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/ixgb/ixgb_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[net 11/11] i40e: fix condition of WARN_ONCE for stat strings

2018-08-24 Thread Jeff Kirsher
From: Jacob Keller Commit 9b10df596bd4 ("i40e: use WARN_ONCE to replace the commented BUG_ON size check") introduced a warning check to make sure that the size of the stat strings was always the expected value. This code accidentally inverted the check of the data pointer. Fix this so that we

[net 02/11] e1000: check on netif_running() before calling e1000_up()

2018-08-24 Thread Jeff Kirsher
From: Bo Chen When the device is not up, the call to 'e1000_up()' from the error handling path of 'e1000_set_ringparam()' causes a kernel oops with a null-pointer dereference. The null-pointer dereference is triggered in function 'e1000_alloc_rx_buffers()' at line 'buffer_info =

[net 04/11] igb: Use an advanced ctx descriptor for launchtime

2018-08-24 Thread Jeff Kirsher
From: Jesus Sanchez-Palencia On i210, Launchtime (TxTime) requires the usage of an "Advanced Transmit Context Descriptor" for retrieving the timestamp of a packet. The igb driver correctly builds such descriptor on the segmentation flow (i.e. igb_tso()) or on the checksum one (i.e.

[net 09/11] ixgbe: fix driver behaviour after issuing VFLR

2018-08-24 Thread Jeff Kirsher
From: Sebastian Basierski Since VFLR doesn't clear VFMBMEM (VF Mailbox Memory) and is not re-enabling queues correctly we should fix this behavior. Signed-off-by: Sebastian Basierski Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- .../net/ethernet/intel/ixgbe/ixgbe_sriov.c| 26

[net 08/11] ixgbe: Prevent unsupported configurations with XDP

2018-08-24 Thread Jeff Kirsher
From: Tony Nguyen These changes address comments by Jakub Kicinski on commit 38b7e7f8ae82 ("ixgbe: Do not allow LRO or MTU change with XDP"). Change the MTU check with XDP to allow any supported value and only reject those outside of the range as opposed to rejecting any change when XDP is

[net 10/11] i40e: Fix for Tx timeouts when interface is brought up if DCB is enabled

2018-08-24 Thread Jeff Kirsher
From: Martyna Szapar If interface is connected to switch port configured for DCB there are TX timeouts when bringing up interface. Problem started appearing after adding in i40e driver code mqprio hardware offload mode. In function i40e_vsi_configure_bw_alloc was added resetting BW rate which

[net 07/11] ixgbe: Replace GFP_ATOMIC with GFP_KERNEL

2018-08-24 Thread Jeff Kirsher
From: Jia-Ju Bai ixgbe_fcoe_ddp_setup(), ixgbe_setup_fcoe_ddp_resources() and ixgbe_sw_init() are never called in atomic context. They call kmalloc(), dma_pool_alloc() and kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static

[net 06/11] igb: Replace mdelay() with msleep() in igb_integrated_phy_loopback()

2018-08-24 Thread Jeff Kirsher
From: Jia-Ju Bai igb_integrated_phy_loopback() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Tested-by: Aaron

[net 03/11] e1000: ensure to free old tx/rx rings in set_ringparam()

2018-08-24 Thread Jeff Kirsher
From: Bo Chen In 'e1000_set_ringparam()', the tx_ring and rx_ring are updated with new value and the old tx/rx rings are freed only when the device is up. There are resource leaks on old tx/rx rings when the device is not up. This bug is reported by COD, a tool for testing kernel module binaries

[net 00/11][pull request] Intel Wired LAN Driver Updates 2018-08-24

2018-08-24 Thread Jeff Kirsher
This series contains fixes to e1000, igb, ixgb, ixgbe and i40e. YueHaibing from Huawei provides a change to use dma_zalloc_coherent() instead of calls to allocator followed by a memset for ixgb. Bo Chen provides a couple of fixes for e1000, first by adding a check to prevent a NULL pointer

ethtool 4.18 released

2018-08-24 Thread John W. Linville
ethtool version 4.18 has been released. Home page: https://www.kernel.org/pub/software/network/ethtool/ Download link: https://www.kernel.org/pub/software/network/ethtool/ethtool-4.18.tar.xz Release notes: * Feature: Add support for WAKE_FILTER (WoL using filters) * Feature: Add

Re: oops with ip6_rt_cache_alloc

2018-08-24 Thread David Ahern
On 8/24/18 4:26 PM, Yonghong Song wrote: > Hi, > > We got a kernel oops with the following stack trace: > > CPU: 24 PID: 0 Comm: swapper/24 Not tainted > 4.16.0-10_fbk1_1183_g7e4ee4c8171c #10 > "Hardware name: Quanta Leopard-DDR3/Leopard-DDR3, BIOS F06_3A16.DDR3 > 11/19/2015" > RIP:

Re: [PATCH bpf 1/2] bpf, sockmap: fix potential use after free in bpf_tcp_close

2018-08-24 Thread John Fastabend
On 08/24/2018 01:08 PM, Daniel Borkmann wrote: > bpf_tcp_close() we pop the psock linkage to a map via psock_map_pop(). > A parallel update on the sock hash map can happen between psock_map_pop() > and lookup_elem_raw() where we override the element under link->hash / > link->key. In

Re: [PATCH bpf 0/2] Two BPF sockmap fixes

2018-08-24 Thread Alexei Starovoitov
On Fri, Aug 24, 2018 at 10:08:49PM +0200, Daniel Borkmann wrote: > This series contains two fixes found while working with the BPF > sockmap code. One refcount leakage and one case for a small window > of use after free. See patches for more info. Thanks! Applied, Thanks

oops with ip6_rt_cache_alloc

2018-08-24 Thread Yonghong Song
Hi, We got a kernel oops with the following stack trace: CPU: 24 PID: 0 Comm: swapper/24 Not tainted 4.16.0-10_fbk1_1183_g7e4ee4c8171c #10 "Hardware name: Quanta Leopard-DDR3/Leopard-DDR3, BIOS F06_3A16.DDR3 11/19/2015" RIP: 0010:ip6_rt_get_dev_rcu+0x6/0x60 RSP: 0018:88046fb03c78 EFLAGS:

[bpf PATCH] bpf: sockmap, decrement copied count correctly in redirect error case

2018-08-24 Thread John Fastabend
Currently, when a redirect occurs in sockmap and an error occurs in the redirect call we unwind the scatterlist once in the error path of bpf_tcp_sendmsg_do_redirect() and then again in sendmsg(). Then in the error path of sendmsg we decrement the copied count by the send size. However, its

Re: [PATCH] correct comments for flags, priv flags in netdevice.h

2018-08-24 Thread Andrew Lunn
On Fri, Aug 24, 2018 at 07:10:20PM -0400, Robert P. J. Day wrote: > Correct the references for both flags and priv flags since they both > refer to the incorrect file which contains their explanations. Hi Robert I'm guessing this is your first patch for Linux? Please use git send-email to

Re: [PATCH bpf 2/2] bpf, sockmap: fix psock refcount leak in bpf_tcp_recvmsg

2018-08-24 Thread John Fastabend
On 08/24/2018 01:08 PM, Daniel Borkmann wrote: > In bpf_tcp_recvmsg() we first took a reference on the psock, however > once we find that there are skbs in the normal socket's receive queue > we return with processing them through tcp_recvmsg(). Problem is that > we leak the taken reference on the

[PATCH bpf 1/2] bpf, sockmap: fix potential use after free in bpf_tcp_close

2018-08-24 Thread Daniel Borkmann
bpf_tcp_close() we pop the psock linkage to a map via psock_map_pop(). A parallel update on the sock hash map can happen between psock_map_pop() and lookup_elem_raw() where we override the element under link->hash / link->key. In bpf_tcp_close()'s lookup_elem_raw() we subsequently only test

[PATCH bpf 2/2] bpf, sockmap: fix psock refcount leak in bpf_tcp_recvmsg

2018-08-24 Thread Daniel Borkmann
In bpf_tcp_recvmsg() we first took a reference on the psock, however once we find that there are skbs in the normal socket's receive queue we return with processing them through tcp_recvmsg(). Problem is that we leak the taken reference on the psock in that path. Given we don't really do anything

[PATCH bpf 0/2] Two BPF sockmap fixes

2018-08-24 Thread Daniel Borkmann
This series contains two fixes found while working with the BPF sockmap code. One refcount leakage and one case for a small window of use after free. See patches for more info. Thanks! Daniel Borkmann (2): bpf, sockmap: fix potential use after free in bpf_tcp_close bpf, sockmap: fix psock

[PATCH] correct comments for flags, priv flags in netdevice.h

2018-08-24 Thread Robert P. J. Day
Correct the references for both flags and priv flags since they both refer to the incorrect file which contains their explanations. Signed-off-by: Robert P. J. Day --- diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ca5ab98053c8..f01f3473bb91 100644 ---

Re: [RFC v3 net-next 3/5] ebpf: fix bpf_msg_pull_data

2018-08-24 Thread John Fastabend
On 08/17/2018 04:08 PM, Tushar Dave wrote: > Like sockmap (sk_msg), socksg also deals with struct scatterlist > therefore socksg programs can use existing bpf helper bpf_msg_pull_data > to access packet data contained in struct scatterlist. While doing some > prelimnary testing, there are couple

what exactly does "volatile" mean WRT net_device_flags?

2018-08-24 Thread rpjday
i'm still unclear what the qualifier "volatile" means when used WRT net_device_flags. the explanation given in include/uapi/linux/if.h: "Flags which can be toggled through sysfs are annotated below, note that only a few flags can be toggled and some other flags are always preserved from the

misleading comment in netdevice.h?

2018-08-24 Thread rpjday
just pedantry here ... was perusing include/linux/netdevice.h, and in the declaration for struct net_device, the kerneldoc, one reads: * @flags: Interface flags (a la BSD) * @priv_flags:Like 'flags' but invisible to userspace, * see if.h for the

should __LINK_STATE_* enums really be restricted to generic queueing layer?

2018-08-24 Thread rpjday
more curious pedantry ... in netdevice.h, one reads: /* These flag bits are private to the generic network queueing * layer; they may not be explicitly referenced by any other * code. */ enum netdev_state_t { __LINK_STATE_START, __LINK_STATE_PRESENT,

Re: misleading comment in netdevice.h?

2018-08-24 Thread Michal Kubecek
On Fri, Aug 24, 2018 at 06:58:38AM -0400, rpj...@crashcourse.ca wrote: > just pedantry here ... was perusing include/linux/netdevice.h, and in the > declaration for struct net_device, the kerneldoc, one reads: > > * @flags: Interface flags (a la BSD) > * @priv_flags:Like

Re: misleading comment in netdevice.h?

2018-08-24 Thread rpjday
Quoting Michal Kubecek : On Fri, Aug 24, 2018 at 06:58:38AM -0400, rpj...@crashcourse.ca wrote: just pedantry here ... was perusing include/linux/netdevice.h, and in the declaration for struct net_device, the kerneldoc, one reads: * @flags: Interface flags (a la BSD) *