[PATCH] mac80211: fix enumeration type

2017-04-20 Thread Stefan Agner
Use enum nl80211_channel_type for cfg80211_chandef_create function calls. This does not has an effect in practise since the enum values are equal. This fixes a warning when compiling with clang: warning: implicit conversion from enumeration type 'enum nl80211_chan_width' to different enumeratio

Re: mwifiex: MAC randomization should not be persistent

2017-04-20 Thread Kalle Valo
Brian Norris wrote: > nl80211 provides the NL80211_SCAN_FLAG_RANDOM_ADDR for every scan > request that should be randomized; the absence of such a flag means we > should not randomize. However, mwifiex was stashing the latest > randomization request and *always* using it for future scans, even tho

Re: [PATCH] nl80211: fix enumeration type

2017-04-20 Thread Johannes Berg
On Wed, 2017-04-19 at 23:55 -0700, Stefan Agner wrote: > Use type enum nl80211_rate_info for bitrate information. This fixes > a warning when compiling with clang: >   warning: implicit conversion from enumeration type 'enum > nl80211_rate_info' >   to different enumeration type 'enum nl80211_attrs

[PATCH net] Fix net/hsr/hsr_device to check for freed skb buffer.

2017-04-20 Thread Peter Heise
Fixed an unchecked call of skb_put_padto. Return value was ignored before, however, skb_put_padto frees skb buffer in case of error. As reported by Dan Carpenter on kernel-janitors. Signed-off-by: Peter Heise --- net/hsr/hsr_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

Re: [PATCH] mdio_bus: Issue GPIO RESET to PHYs.

2017-04-20 Thread Roger Quadros
On 19/04/17 16:38, Andrew Lunn wrote: > On Wed, Apr 19, 2017 at 02:56:48PM +0300, Roger Quadros wrote: >> Hi, >> >> On 19/04/17 14:39, Andrew Lunn wrote: >>> On Wed, Apr 19, 2017 at 12:24:26PM +0300, Roger Quadros wrote: Some boards [1] leave the PHYs at an invalid state during system pow

Re: net: heap out-of-bounds in fib6_clean_node/rt6_fill_node/fib6_age/fib6_prune_clone

2017-04-20 Thread Dmitry Vyukov
On Thu, Apr 20, 2017 at 1:51 AM, David Ahern wrote: > On 4/19/17 5:47 PM, Cong Wang wrote: >> On Wed, Apr 19, 2017 at 9:12 AM, Andrey Konovalov >> wrote: >>> >>> Anyway, I just finished simplifying the reproducer. Give this one a try. >> >> Thanks for providing such a minimal reproducer! >> >> T

[PATCH net] MAINTAINERS: Add new IPsec offloading files.

2017-04-20 Thread Steffen Klassert
This adds two new files to IPsec maintenance scope: net/ipv4/esp4_offload.c net/ipv6/ip6_offload.c Signed-off-by: Steffen Klassert --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 5397f54..b01f923 100644 --- a/MAINTAINERS ++

[PATCH v2] mdio_bus: Issue GPIO RESET to PHYs.

2017-04-20 Thread Roger Quadros
Some boards [1] leave the PHYs at an invalid state during system power-up or reset thus causing unreliability issues with the PHY which manifests as PHY not being detected or link not functional. To fix this, these PHYs need to be RESET via a GPIO connected to the PHY's RESET pin. Some boards have

Re: [net-next 00/15][pull request] 10GbE Intel Wired LAN Driver Updates 2017-04-18

2017-04-20 Thread Jeff Kirsher
On Wed, 2017-04-19 at 22:25 -0700, Alexei Starovoitov wrote: > On Tue, Apr 18, 2017 at 04:01:50PM -0700, Jeff Kirsher wrote: > > The following are changes since commit > > 4116c97689b9b1732ac5b68afd922406f9fc842e: > >    Merge branch 'ftgmac100-batch5-features' > > and are available in the git repo

[PATCH 04/16] xfrm: Add mode handlers for IPsec on layer 2

2017-04-20 Thread Steffen Klassert
This patch adds a gso_segment and xmit callback for the xfrm_mode and implement these functions for tunnel and transport mode. Signed-off-by: Steffen Klassert --- include/net/xfrm.h | 10 ++ net/ipv4/xfrm4_mode_transport.c | 32 net/ipv4/xfrm

[PATCH 02/16] xfrm: Add a xfrm type offload.

2017-04-20 Thread Steffen Klassert
We add a struct xfrm_type_offload so that we have the offloaded codepath separated to the non offloaded codepath. With this the non offloade and the offloaded codepath can coexist. Signed-off-by: Steffen Klassert --- include/net/xfrm.h| 28 +++- net/xfrm/xfrm_state.c | 73 ++

[PATCH 05/16] xfrm: Add an IPsec hardware offloading API

2017-04-20 Thread Steffen Klassert
This patch adds all the bits that are needed to do IPsec hardware offload for IPsec states and ESP packets. We add xfrmdev_ops to the net_device. xfrmdev_ops has function pointers that are needed to manage the xfrm states in the hardware and to do a per packet offloading decision. Joint work with:

pull request (net-next): ipsec-next 2017-04-20

2017-04-20 Thread Steffen Klassert
This adds the basic infrastructure for IPsec hardware offloading, it creates a configuration API and adjusts the packet path. 1) Add the needed netdev features to configure IPsec offloads. 2) Add the IPsec hardware offloading API. 3) Prepare the ESP packet path for hardware offloading. 4) Add g

[PATCH 03/16] xfrm: Move device notifications to a sepatate file

2017-04-20 Thread Steffen Klassert
This is needed for the upcomming IPsec device offloading. Signed-off-by: Steffen Klassert --- include/net/xfrm.h | 1 + net/xfrm/Makefile | 2 +- net/xfrm/xfrm_device.c | 43 +++ net/xfrm/xfrm_policy.c | 17 + 4 files changed, 46

[PATCH 01/16] net: Add ESP offload features

2017-04-20 Thread Steffen Klassert
This patch adds netdev features to configure IPsec offloads. Signed-off-by: Steffen Klassert --- include/linux/netdev_features.h | 8 +++- include/linux/netdevice.h | 1 + include/linux/skbuff.h | 2 ++ net/core/ethtool.c | 3 +++ 4 files changed, 13 insertions(+)

[PATCH 06/16] esp6: Remame esp_input_done2

2017-04-20 Thread Steffen Klassert
We are going to export the ipv4 and the ipv6 version of esp_input_done2. They are not static anymore and can't have the same name. So rename the ipv6 version to esp6_input_done2. Signed-off-by: Steffen Klassert --- net/ipv6/esp6.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 07/16] esp4: Reorganize esp_output

2017-04-20 Thread Steffen Klassert
We need a fallback for ESP at layer 2, so split esp_output into generic functions that can be used at layer 3 and layer 2 and use them in esp_output. We also add esp_xmit which is used for the layer 2 fallback. Signed-off-by: Steffen Klassert --- include/net/esp.h | 16 +++ net/ipv4/esp4.

[PATCH 09/16] esp: Add gso handlers for esp4 and esp6

2017-04-20 Thread Steffen Klassert
This patch extends the xfrm_type by an encap function pointer and implements esp4_gso_encap and esp6_gso_encap. These functions doing the basic esp encapsulation for a GSO packet. In case the GSO packet needs to be segmented in software, we add gso_segment functions. This codepath is going to be us

[PATCH 08/16] esp6: Reorganize esp_output

2017-04-20 Thread Steffen Klassert
We need a fallback for ESP at layer 2, so split esp6_output into generic functions that can be used at layer 3 and layer 2 and use them in esp_output. We also add esp6_xmit which is used for the layer 2 fallback. Signed-off-by: Steffen Klassert --- include/net/esp.h | 3 + net/ipv6/esp6.

[PATCH 15/16] esp6: fix incorrect null pointer check on xo

2017-04-20 Thread Steffen Klassert
From: Colin Ian King The check for xo being null is incorrect, currently it is checking for non-null, it should be checking for null. Detected with CoverityScan, CID#1429349 ("Dereference after null check") Fixes: 7862b4058b9f ("esp: Add gso handlers for esp4 and esp6") Signed-off-by: Colin Ian

[PATCH 12/16] net: Add a xfrm validate function to validate_xmit_skb

2017-04-20 Thread Steffen Klassert
When we do IPsec offloading, we need a fallback for packets that were targeted to be IPsec offloaded but rerouted to a device that does not support IPsec offload. For that we add a function that checks the offloading features of the sending device and and flags the requirement of a fallback before

[PATCH 16/16] esp4/6: Fix GSO path for non-GSO SW-crypto packets

2017-04-20 Thread Steffen Klassert
From: Ilan Tayari If esp*_offload module is loaded, outbound packets take the GSO code path, being encapsulated at layer 3, but encrypted in layer 2. validate_xmit_xfrm calls esp*_xmit for that. esp*_xmit was wrongfully detecting these packets as going through hardware crypto offload, while in f

[PATCH 10/16] xfrm: Add xfrm_replay_overflow functions for offloading

2017-04-20 Thread Steffen Klassert
This patch adds functions that handles IPsec sequence numbers for GSO segments and TSO offloading. We need to calculate and update the sequence numbers based on the segments that GSO/TSO will generate. We need this to keep software and hardware sequence number counter in sync. Signed-off-by: Steff

[PATCH 14/16] xfrm: Prepare the GRO codepath for hardware offloading.

2017-04-20 Thread Steffen Klassert
On IPsec hardware offloading, we already get a secpath with valid state attached when the packet enters the GRO handlers. So check for hardware offload and skip the state lookup in this case. Signed-off-by: Steffen Klassert --- net/ipv4/esp4_offload.c | 42 ++-

[PATCH 13/16] xfrm: Add encapsulation header offsets while SKB is not encrypted

2017-04-20 Thread Steffen Klassert
From: Ilan Tayari Both esp4 and esp6 used to assume that the SKB payload is encrypted and therefore the inner_network and inner_transport offsets are not relevant. When doing crypto offload in the NIC, this is no longer the case and the NIC driver needs these offsets so it can do TX TCP checksum

[PATCH 11/16] esp: Use a synchronous crypto algorithm on offloading.

2017-04-20 Thread Steffen Klassert
We need a fallback algorithm for crypto offloading to a NIC. This is because packets can be rerouted to other NICs that don't support crypto offloading. The fallback is going to be implemented at layer2 where we know the final output device but can't handle asynchronous returns fron the crypto laye

Heads-up: two regressions in v4.11-rc series

2017-04-20 Thread Jesper Dangaard Brouer
Hi Linus, Just wanted to give a heads-up on two regressions in 4.11-rc series. (1) page allocator optimization revert Mel Gorman and I have been playing with optimizing the page allocator, but Tariq spotted that we caused a regression for (NIC) drivers that refill DMA RX rings in softirq context

Re: [PATCH 1/1] drivers: net: usb: qmi_wwan: add QMI_QUIRK_SET_DTR for Telit PID 0x1201

2017-04-20 Thread Bjørn Mork
Aleksander Morgado writes: > I'm just running --dms-get-operating-mode multiple times, and getting > errors frequently: Could you retry that with cdc-wdm debugging enabled (e.g. "echo 'module cdc_wdm +fp' > /sys/kernel/debug/dynamic_debug/control") and something like this: diff --git a/drivers

[PATCH 1/1] bonding: use 'M' or 'G' based on the speed

2017-04-20 Thread Zhu Yanjun
If the speed of the slave netdev is more than 1000M, it is better to use 'G' instead of 'M'. Signed-off-by: Zhu Yanjun --- drivers/net/bonding/bond_main.c | 8 ++-- drivers/net/bonding/bond_procfs.c | 6 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/bon

Re: [PATCH 11/16] esp: Use a synchronous crypto algorithm on offloading.

2017-04-20 Thread Herbert Xu
On Thu, Apr 20, 2017 at 10:55:10AM +0200, Steffen Klassert wrote: > We need a fallback algorithm for crypto offloading to a NIC. > This is because packets can be rerouted to other NICs that > don't support crypto offloading. The fallback is going to be > implemented at layer2 where we know the fina

Re: [Patch net-next v4 1/2] net_sched: move the empty tp check from ->destroy() to ->delete()

2017-04-20 Thread Daniel Borkmann
On 04/19/2017 11:21 PM, Cong Wang wrote: We could have a race condition where in ->classify() path we dereference tp->root and meanwhile a parallel ->destroy() makes it a NULL. Daniel cured this bug in commit d936377414fa ("net, sched: respect rcu grace period on cls destruction"). This happens

Re: [PATCH 11/16] esp: Use a synchronous crypto algorithm on offloading.

2017-04-20 Thread Steffen Klassert
On Thu, Apr 20, 2017 at 05:06:17PM +0800, Herbert Xu wrote: > On Thu, Apr 20, 2017 at 10:55:10AM +0200, Steffen Klassert wrote: > > We need a fallback algorithm for crypto offloading to a NIC. > > This is because packets can be rerouted to other NICs that > > don't support crypto offloading. The fa

Re: [PATCH] net: phy: fix auto-negotiation stall due to unavailable interrupt

2017-04-20 Thread Roger Quadros
Hi, On 19/04/17 19:53, Alexander Kochetkov wrote: > >> 19 апр. 2017 г., в 19:32, Florian Fainelli написал(а): >> >> http://patchwork.ozlabs.org/patch/743773/ >> >> Roger can you also test Alexander's patch? This patch fixes my problem and doesn't have the 1 second delay that my patch had. So,

[PATCH] ipvs: explicitly forbid ipv6 service/dest creation if ipv6 mod is disabled

2017-04-20 Thread Paolo Abeni
When creating a new ipvs service, ipv6 addresses are always accepted if CONFIG_IP_VS_IPV6 is enabled. On dest creation the address family is not explicitly checked. This allows the user-space to configure ipvs services even if the system is booted with ipv6.disable=1. On specific configuration, ip

Re: [PATCH net] xfrm: calculate L4 checksums also for GSO case before encrypting packets

2017-04-20 Thread Steffen Klassert
On Tue, Apr 18, 2017 at 07:10:03PM -0700, Ansis Atteka wrote: > > However, after taking pointers from your patch I came up with this one > that may solve this problem once and for all (note, that I was seeing > this bug only with ixgbe NIC that supports tx csum offloads). I hope > it does not brea

Re: [PATCH 11/16] esp: Use a synchronous crypto algorithm on offloading.

2017-04-20 Thread Herbert Xu
On Thu, Apr 20, 2017 at 11:17:52AM +0200, Steffen Klassert wrote: > > I tried to use async algorithms but it lead to serveral problems. > The GSO layer can't handle async returns, we'd need callbacks > for all the GSO handlers. Also we need something where we can > requeue packets if the driver is

RE: [net-next 04/14] i40e: dump VF information in debugfs

2017-04-20 Thread Mintz, Yuval
> > Dump some internal state about VFs through debugfs. This provides > > information not available with 'ip link show'. > > such as? > > donnwantobethedebugfspolice, but still, in the 2-3 times we tried to push > debugfs to MLNX NIC drivers, Dave disallowed that, and lately the switch > team eve

[PATCH] usb: plusb: Add support for PL-27A1

2017-04-20 Thread Roman Spychała
From: Roman Spychała This patch adds support for the PL-27A1 by adding the appropriate USB ID's. This chip is used in the goobay Active USB 3.0 Data Link and Unitek Y-3501 cables. Signed-off-by: Roman Spychała --- drivers/net/usb/Kconfig | 2 +- drivers/net/usb/plusb.c | 15 +-- 2

Re: [PATCH net] Fix net/hsr/hsr_device to check for freed skb buffer.

2017-04-20 Thread Sergei Shtylyov
Hello! On 4/20/2017 10:28 AM, Peter Heise wrote: Fixed an unchecked call of skb_put_padto. Return value was ignored before, however, skb_put_padto frees skb buffer in case of error. As reported by Dan Carpenter on kernel-janitors. Signed-off-by: Peter Heise --- net/hsr/hsr_device.c | 3 ++-

Re: [PATCH block-tree] net: off by one in inet6_pton()

2017-04-20 Thread Sagi Grimberg
Thanks Dan, Reviewed-by: Sagi Grimberg

[PATCH] net: qrtr: potential use after free in qrtr_sendmsg()

2017-04-20 Thread Dan Carpenter
If skb_pad() fails then it frees the skb so we should check for errors. Fixes: bdabad3e363d ("net: Add Qualcomm IPC router") Signed-off-by: Dan Carpenter diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index c36b0ec364a4..a9a8c7d5a4a9 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -658,7 +

Re: [PATCH v2 net 2/2] net sched actions: decrement module refcount earlier

2017-04-20 Thread Jamal Hadi Salim
On 17-04-19 01:25 PM, Cong Wang wrote: On Wed, Apr 19, 2017 at 4:32 AM, Jamal Hadi Salim wrote: This solves one issue, but I am afraid the issue Cong mentioned is a possibility still. Lets say user did a replace and tried to also replace the cookie in that transaction. The init() succeeds but t

Re: [PATCH v2 net 2/2] net sched actions: decrement module refcount earlier

2017-04-20 Thread Jamal Hadi Salim
On 17-04-19 11:03 AM, Wolfgang Bumiller wrote: On April 19, 2017 at 1:32 PM Jamal Hadi Salim wrote: On 17-04-19 04:09 AM, Wolfgang Bumiller wrote: This solves one issue, but I am afraid the issue Cong mentioned is a possibility still. Lets say user did a replace and tried to also replace the

Re: [PATCH v4 3/3] VSOCK: Add virtio vsock vsockmon hooks

2017-04-20 Thread Stefan Hajnoczi
On Thu, Apr 13, 2017 at 09:47:08PM +0300, Michael S. Tsirkin wrote: > On Thu, Apr 13, 2017 at 05:18:11PM +0100, Stefan Hajnoczi wrote: > > diff --git a/net/vmw_vsock/virtio_transport_common.c > > b/net/vmw_vsock/virtio_transport_common.c > > index af087b4..aae60c1 100644 > > --- a/net/vmw_vsock/vi

Re: [PATCH net-next v4 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-20 Thread Jamal Hadi Salim
On 17-04-19 12:17 PM, Jiri Pirko wrote: Wed, Apr 19, 2017 at 06:07:48PM CEST, j...@mojatatu.com wrote: On 17-04-19 11:54 AM, Jiri Pirko wrote: Wed, Apr 19, 2017 at 05:37:15PM CEST, j...@mojatatu.com wrote: On 17-04-19 09:13 AM, Jiri Pirko wrote: Wed, Apr 19, 2017 at 03:03:59PM CEST, j...@moja

Re: [PATCH 11/16] esp: Use a synchronous crypto algorithm on offloading.

2017-04-20 Thread Steffen Klassert
On Thu, Apr 20, 2017 at 05:52:35PM +0800, Herbert Xu wrote: > On Thu, Apr 20, 2017 at 11:17:52AM +0200, Steffen Klassert wrote: > > > > I tried to use async algorithms but it lead to serveral problems. > > The GSO layer can't handle async returns, we'd need callbacks > > for all the GSO handlers. A

[PATCH v1] net: phy: fix auto-negotiation stall due to unavailable interrupt

2017-04-20 Thread Alexander Kochetkov
Hello Florian, Roger and Madalin! This is slightly modified version of previous patch[1]. It take into account that phy_start_aneg() may be called from differend places not only from PHY state machine. So the patch use phy_trigger_machine() to schedule link state update correctly. I borrow some

[PATCH v1] net: phy: fix auto-negotiation stall due to unavailable interrupt

2017-04-20 Thread Alexander Kochetkov
The Ethernet link on an interrupt driven PHY was not coming up if the Ethernet cable was plugged before the Ethernet interface was brought up. The patch trigger PHY state machine to update link state if PHY was requested to do auto-negotiation and auto-negotiation complete flag already set. Durin

Re: [PATCH net-next 2/3] net: hns: support deferred probe when no mdio

2017-04-20 Thread Matthias Brugger
, so we not init DSAF when there is no mdio, and free all resource, to later learn that we need to defer the probe. Signed-off-by: lipeng on which kernel version is this patch based? I checked against next-20170420 and it does not apply. --- drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c

[PATCH] brcm80211: brcmfmac: Ensure that incoming skb's are writable

2017-04-20 Thread James Hughes
The driver was adding header information to incoming skb without ensuring the head was uncloned and hence writable. skb_cow_head has been used to ensure they are writable, however, this required some changes to error handling to ensure that if skb_cow_head failed it was not ignored. This really n

Re: [PATCH] brcm80211: brcmfmac: Ensure that incoming skb's are writable

2017-04-20 Thread Kalle Valo
+ linux-wireless James Hughes writes: > The driver was adding header information to incoming skb > without ensuring the head was uncloned and hence writable. > > skb_cow_head has been used to ensure they are writable, however, > this required some changes to error handling to ensure that > if sk

Re: [PATCH net-next v4 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-20 Thread Jiri Pirko
Thu, Apr 20, 2017 at 12:42:55PM CEST, j...@mojatatu.com wrote: >On 17-04-19 12:17 PM, Jiri Pirko wrote: >> Wed, Apr 19, 2017 at 06:07:48PM CEST, j...@mojatatu.com wrote: >> > On 17-04-19 11:54 AM, Jiri Pirko wrote: >> > > Wed, Apr 19, 2017 at 05:37:15PM CEST, j...@mojatatu.com wrote: >> > > > On 17

Re: [net-next 04/14] i40e: dump VF information in debugfs

2017-04-20 Thread Jiri Pirko
Thu, Apr 20, 2017 at 12:09:28PM CEST, yuval.mi...@cavium.com wrote: >> > Dump some internal state about VFs through debugfs. This provides >> > information not available with 'ip link show'. >> >> such as? >> >> donnwantobethedebugfspolice, but still, in the 2-3 times we tried to push >> debugfs

[PATCH v3 net] net sched actions: allocate act cookie early

2017-04-20 Thread Wolfgang Bumiller
Policing filters do not use the TCA_ACT_* enum and the tb[] nlattr array in tcf_action_init_1() doesn't get filled for them so we should not try to look for a TCA_ACT_COOKIE attribute in the then uninitialized array. The error handling in cookie allocation then calls tcf_hash_release() leading to i

Re: [PATCH net] net: ipv6: RTF_PCPU should not be settable from userspace

2017-04-20 Thread Andrey Konovalov
Thanks! Tested-by: Andrey Konovalov On Wed, Apr 19, 2017 at 11:52 PM, Martin KaFai Lau wrote: > On Wed, Apr 19, 2017 at 02:19:43PM -0700, David Ahern wrote: >> Andrey reported a fault in the IPv6 route code: >> >> kasan: GPF could be caused by NULL-ptr deref or user memory access >> general pro

Re: [PATCH] brcm80211: brcmfmac: Ensure that incoming skb's are writable

2017-04-20 Thread James Hughes
On 20 April 2017 at 12:31, Kalle Valo wrote: > + linux-wireless > > James Hughes writes: > >> The driver was adding header information to incoming skb >> without ensuring the head was uncloned and hence writable. >> >> skb_cow_head has been used to ensure they are writable, however, >> this requi

Re: net: heap out-of-bounds in fib6_clean_node/rt6_fill_node/fib6_age/fib6_prune_clone

2017-04-20 Thread Andrey Konovalov
On Thu, Apr 20, 2017 at 10:35 AM, Dmitry Vyukov wrote: > On Thu, Apr 20, 2017 at 1:51 AM, David Ahern wrote: >> On 4/19/17 5:47 PM, Cong Wang wrote: >>> On Wed, Apr 19, 2017 at 9:12 AM, Andrey Konovalov >>> wrote: Anyway, I just finished simplifying the reproducer. Give this one a try

Re: [PATCH net-next v4 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-20 Thread Eric Dumazet
On Thu, 2017-04-20 at 06:42 -0400, Jamal Hadi Salim wrote: > > They are not the same issue Jiri. We have used bitmasks fine on netlink > message for a millenia. Nobody sets garbage on a bitmask they are not > supposed to touch. The struct padding thing is a shame the way it > turned out - now net

Re: [PATCH v4 1/3] VSOCK: Add vsockmon tap functions

2017-04-20 Thread Jorgen S. Hansen
> On Apr 13, 2017, at 6:18 PM, Stefan Hajnoczi wrote: > > + > +static void __vsock_deliver_tap(struct sk_buff *skb) > +{ > + int ret; > + struct vsock_tap *tmp; > + > + list_for_each_entry_rcu(tmp, &vsock_tap_all, list) { > + ret = __vsock_deliver_tap_skb(skb, tmp->dev);

Re: sctp: deny peeloff operation on asocs with threads sleeping on it

2017-04-20 Thread Salvatore Bonaccorso
Hi According to the documentation I should have sent this to netdev@vger.kernel.org rather than sta...@vger.kernel.org. Rationale: Whilst 00eff2ebbd229758e90659907724c14dd5a18339 went to stable, the dfcb9f4f99f1e9a49e43398a7bfbf56927544af1 commit is missing. Full quoting, my original misleaded

Re: [PATCH v4 3/3] VSOCK: Add virtio vsock vsockmon hooks

2017-04-20 Thread Jorgen S. Hansen
> > +/* Packet capture */ > +void virtio_transport_deliver_tap_pkt(struct virtio_vsock_pkt *pkt) > +{ > + struct sk_buff *skb; > + struct af_vsockmon_hdr *hdr; > + unsigned char *t_hdr, *payload; > + > + skb = alloc_skb(sizeof(*hdr) + sizeof(pkt->hdr) + pkt->len, > +

Re: [PATCH] brcm80211: brcmfmac: Ensure that incoming skb's are writable

2017-04-20 Thread Eric Dumazet
On Thu, 2017-04-20 at 12:16 +0100, James Hughes wrote: > The driver was adding header information to incoming skb > without ensuring the head was uncloned and hence writable. > > skb_cow_head has been used to ensure they are writable, however, > this required some changes to error handling to ensu

macvlan: Fix device ref leak when purging bc_queue

2017-04-20 Thread Herbert Xu
When a parent macvlan device is destroyed we end up purging its broadcast queue without dropping the device reference count on the packet source device. This causes the source device to linger. This patch drops that reference count. Fixes: 260916dfb48c ("macvlan: Fix potential use-after free for

[PATCH net] ipv4: Avoid caching dsts when lookup skipped nh oif check

2017-04-20 Thread Robert Shearman
David reported that doing the following: ip li add red type vrf table 10 ip link set dev eth1 vrf red ip addr add 127.0.0.1/8 dev red ip link set dev eth1 up ip li set red up ping -c1 -w1 -I red 127.0.0.1 ip li del red results in a hang with this message: unregist

Re: [PATCH net-next 0/3] l3mdev: Improve use with main table

2017-04-20 Thread Robert Shearman
On 13/04/17 15:36, David Ahern wrote: On 4/13/17 6:48 AM, Robert Shearman wrote: the patches look ok to me, but in testing them I see I refcnt problem. simple reproducer: ip li add red type vrf table 254 ip link set dev eth1 vrf red ip addr add 127.0.0.1/8 dev red ip link set dev eth1 up ip li

[PATCH net-next v5 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-20 Thread Jamal Hadi Salim
From: Jamal Hadi Salim When you dump hundreds of thousands of actions, getting only 32 per dump batch even when the socket buffer and memory allocations allow is inefficient. With this change, the user will get as many as possibly fitting within the given constraints available to the kernel. A

[PATCH net-next v5 2/2] net sched actions: add time filter for action dumping

2017-04-20 Thread Jamal Hadi Salim
From: Jamal Hadi Salim This adds support for filtering based on time since last used. When we are dumping a large number of actions it is useful to have the option of filtering based on when the action was last used to reduce the amount of data crossing to user space. With this patch the user sp

[PATCH net-next v5 0/2] net sched actions: improve action dump performance

2017-04-20 Thread Jamal Hadi Salim
From: Jamal Hadi Salim Changes since v4: 1) Eric D. pointed out that when all skb space is used up by the dump there will be no space to insert the TCAA_ACT_COUNT attribute. 2) Jiri: i) Change: enum { TCAA_UNSPEC, TCAA_ACT_TAB, TCAA_ACT_FLAGS, TCAA_ACT_COUNT,

Re: [PATCH v2] mdio_bus: Issue GPIO RESET to PHYs.

2017-04-20 Thread Andrew Lunn
On Thu, Apr 20, 2017 at 11:39:20AM +0300, Roger Quadros wrote: > Some boards [1] leave the PHYs at an invalid state > during system power-up or reset thus causing unreliability > issues with the PHY which manifests as PHY not being detected > or link not functional. To fix this, these PHYs need to

raw patch for iproute2 fast action dumping

2017-04-20 Thread Jamal Hadi Salim
Not to be used in production. cheers, jamal diff --git a/tc/f_basic.c b/tc/f_basic.c index d663668..8370ea6 100644 --- a/tc/f_basic.c +++ b/tc/f_basic.c @@ -135,7 +135,7 @@ static int basic_print_opt(struct filter_util *qu, FILE *f, } if (tb[TCA_BASIC_ACT]) { - tc

Re: [RFC PATCH net] net/mlx5e: Race between mlx5e_update_stats() and getting the stats

2017-04-20 Thread Saeed Mahameed
On Thu, Apr 20, 2017 at 2:35 AM, Eric Dumazet wrote: > On Wed, 2017-04-19 at 14:53 -0700, Martin KaFai Lau wrote: > >> Right, a temp and a memcpy should be enough to solve our spike problem. >> It may be the right fix for net. >> >> Agree that using a spinlock is better (likely changing state_lock

Re: Heads-up: two regressions in v4.11-rc series

2017-04-20 Thread Frederic Weisbecker
On Thu, Apr 20, 2017 at 11:00:42AM +0200, Jesper Dangaard Brouer wrote: > Hi Linus, > > Just wanted to give a heads-up on two regressions in 4.11-rc series. > > (1) page allocator optimization revert > > Mel Gorman and I have been playing with optimizing the page allocator, > but Tariq spotted t

Re: [PATCH net-next v4 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-20 Thread Jamal Hadi Salim
On 17-04-20 08:18 AM, Eric Dumazet wrote: On Thu, 2017-04-20 at 06:42 -0400, Jamal Hadi Salim wrote: They are not the same issue Jiri. We have used bitmasks fine on netlink message for a millenia. Nobody sets garbage on a bitmask they are not supposed to touch. The struct padding thing is a sh

[PATCH v2] net: arc_emac: switch to phy_start()/phy_stop()

2017-04-20 Thread Alexander Kochetkov
Currently driver use phy_start_aneg() in arc_emac_open() to bring up PHY. But phy_start() function is more appropriate for this purposes. Besides that it call phy_start_aneg() as part of PHY startup sequence it also can correctly bring up PHY from error and suspended states. So the patch replace ph

[PATCH RFC net-next v4 0/7] net: improve support for SCTP checksums

2017-04-20 Thread Davide Caratti
hello Tom, On Fri, 2017-04-07 at 11:11 -0700, Tom Herbert wrote: > maybe just call it csum_not_ip then. Then just do "if > (unlikely(skb->csum_not_ip)) ..." Ok, done. V4 uses this bit for SCTP only and leaves unmodified behavior when offloaded FCoE frames are processed. Further work is still poss

[PATCH RFC net-next v4 2/7] net: introduce skb_crc32c_csum_help

2017-04-20 Thread Davide Caratti
skb_crc32c_csum_help is like skb_checksum_help, but it is designed for checksumming SCTP packets using crc32c (see RFC3309), provided that libcrc32c.ko has been loaded before. In case libcrc32c is not loaded, invoking skb_crc32c_csum_help on a skb results in one the following printouts: warn_crc32

[PATCH RFC net-next v4 1/7] skbuff: add stub to help computing crc32c on SCTP packets

2017-04-20 Thread Davide Caratti
sctp_compute_checksum requires crc32c symbol (provided by libcrc32c), so it can't be used in net core. Like it has been done previously with other symbols (e.g. ipv6_dst_lookup), introduce a stub struct skb_checksum_ops to allow computation of crc32c checksum in net core after sctp.ko (and thus lib

[PATCH RFC net-next v4 5/7] net: more accurate checksumming in validate_xmit_skb()

2017-04-20 Thread Davide Caratti
skb_csum_hwoffload_help() uses netdev features and skb->csum_not_inet to determine if skb needs software computation of Internet Checksum or crc32c (or nothing, if this computation can be done by the hardware). Use it in place of skb_checksum_help() in validate_xmit_skb() to avoid corruption of non

[PATCH RFC net-next v4 6/7] openvswitch: more accurate checksumming in queue_userspace_packet()

2017-04-20 Thread Davide Caratti
if skb carries an SCTP packet and ip_summed is CHECKSUM_PARTIAL, it needs CRC32c in place of Internet Checksum: use skb_csum_hwoffload_help to avoid corrupting such packets while queueing them towards userspace. Signed-off-by: Davide Caratti --- net/openvswitch/datapath.c | 2 +- 1 file changed,

[PATCH RFC net-next v4 4/7] net: use skb->csum_not_inet to identify packets needing crc32c

2017-04-20 Thread Davide Caratti
skb->csum_not_inet carries the indication on which algorithm is needed to compute checksum on skb in the transmit path, when skb->ip_summed is equal to CHECKSUM_PARTIAL. If skb carries a SCTP packet and crc32c hasn't been yet written in L4 header, skb->csum_not_inet is assigned to 1; otherwise, ass

[PATCH RFC net-next v4 7/7] sk_buff.h: improve description of CHECKSUM_{COMPLETE,UNNECESSARY}

2017-04-20 Thread Davide Caratti
Add FCoE to the list of protocols that can set CHECKSUM_UNNECESSARY; add a note to CHECKSUM_COMPLETE section to specify that it does not apply to SCTP and FCoE protocols. Suggested-by: Tom Herbert Signed-off-by: Davide Caratti --- include/linux/skbuff.h | 7 +-- 1 file changed, 5 insertions

[PATCH RFC net-next v4 3/7] sk_buff: remove support for csum_bad in sk_buff

2017-04-20 Thread Davide Caratti
This bit was introduced with 5a21232983aa ("net: Support for csum_bad in skbuff") to reduce the stack workload when processing RX packets carrying a wrong Internet Checksum. Up to now, only one driver (besides GRO core) are setting it. The test on NAPI_GRO_CB(skb)->flush in dev_gro_receive() is now

Re: sctp: deny peeloff operation on asocs with threads sleeping on it

2017-04-20 Thread Marcelo Ricardo Leitner
Em 20-04-2017 09:32, Salvatore Bonaccorso escreveu: Hi According to the documentation I should have sent this to netdev@vger.kernel.org rather than sta...@vger.kernel.org. Rationale: Whilst 00eff2ebbd229758e90659907724c14dd5a18339 went to stable, the dfcb9f4f99f1e9a49e43398a7bfbf56927544af1 com

RE: [net-next 04/14] i40e: dump VF information in debugfs

2017-04-20 Thread Mintz, Yuval
> >> > Dump some internal state about VFs through debugfs. This provides > >> > information not available with 'ip link show'. > >> > >> such as? > >> > >> donnwantobethedebugfspolice, but still, in the 2-3 times we tried to > >> push debugfs to MLNX NIC drivers, Dave disallowed that, and lately >

Re: [PATCH v2] mdio_bus: Issue GPIO RESET to PHYs.

2017-04-20 Thread Roger Quadros
On 20/04/17 16:13, Andrew Lunn wrote: > On Thu, Apr 20, 2017 at 11:39:20AM +0300, Roger Quadros wrote: >> Some boards [1] leave the PHYs at an invalid state >> during system power-up or reset thus causing unreliability >> issues with the PHY which manifests as PHY not being detected >> or link not

Re: [PATCH net-next v2 2/5] virtio-net: transmit napi

2017-04-20 Thread Willem de Bruijn
On Thu, Apr 20, 2017 at 2:27 AM, Jason Wang wrote: > > > On 2017年04月19日 04:21, Willem de Bruijn wrote: >> >> +static void virtnet_napi_tx_enable(struct virtnet_info *vi, >> + struct virtqueue *vq, >> + struct napi_struct *napi) >> +

Re: [PATCH net-next v5 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-20 Thread Jiri Pirko
Thu, Apr 20, 2017 at 03:06:21PM CEST, j...@mojatatu.com wrote: >From: Jamal Hadi Salim > >When you dump hundreds of thousands of actions, getting only 32 per >dump batch even when the socket buffer and memory allocations allow >is inefficient. > >With this change, the user will get as many as poss

Re: [PATCH net v2] net/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats

2017-04-20 Thread Saeed Mahameed
On Thu, Apr 20, 2017 at 2:32 AM, Martin KaFai Lau wrote: > We have observed a sudden spike in rx/tx_packets and rx/tx_bytes > reported under /proc/net/dev. There is a race in mlx5e_update_stats() > and some of the get-stats functions (the one that we hit is the > mlx5e_get_stats() which is called

Re: [PATCH net-next v4 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-20 Thread Jamal Hadi Salim
On 17-04-20 07:35 AM, Jiri Pirko wrote: Thu, Apr 20, 2017 at 12:42:55PM CEST, j...@mojatatu.com wrote: On 17-04-19 12:17 PM, Jiri Pirko wrote: Ha. So the current code is wrong, I see it now. Following is needed: diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 82b1d48..c432b22 100

Re: [PATCH net-next v2 5/5] virtio-net: keep tx interrupts disabled unless kick

2017-04-20 Thread Willem de Bruijn
>> - if (!use_napi) >> + if (use_napi) { >> + if (kick) >> + virtqueue_enable_cb_delayed(sq->vq); >> + else >> + virtqueue_disable_cb(sq->vq); > > > Since virtqueue_disable_cb() do nothing for event idx. I wonder wh

Re: __sk_buff.data_end

2017-04-20 Thread Daniel Borkmann
On 04/20/2017 08:01 AM, Johannes Berg wrote: On Thu, 2017-04-20 at 02:01 +0200, Daniel Borkmann wrote: Yeah, should work as well for the 32 bit archs, on 64 bit we have this effectively already: Right. [...] Can you elaborate on why this works for mac80211? It uses cb only up to that point

[PATCH v3 net-next] mdio_bus: Issue GPIO RESET to PHYs.

2017-04-20 Thread Roger Quadros
Some boards [1] leave the PHYs at an invalid state during system power-up or reset thus causing unreliability issues with the PHY which manifests as PHY not being detected or link not functional. To fix this, these PHYs need to be RESET via a GPIO connected to the PHY's RESET pin. Some boards have

Re: [PATCH net v2] net/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats

2017-04-20 Thread Martin KaFai Lau
On Thu, Apr 20, 2017 at 05:00:13PM +0300, Saeed Mahameed wrote: > On Thu, Apr 20, 2017 at 2:32 AM, Martin KaFai Lau wrote: > > We have observed a sudden spike in rx/tx_packets and rx/tx_bytes > > reported under /proc/net/dev. There is a race in mlx5e_update_stats() > > and some of the get-stats f

Re: __sk_buff.data_end

2017-04-20 Thread Johannes Berg
On Thu, 2017-04-20 at 16:10 +0200, Daniel Borkmann wrote: > > I think this would be a rather more complex operation on the BPF > side, it would need changes from LLVM (which assumes initial ctx sits > in r1), verifier for tracking this ctx2, all the way down to JITs > plus some way to handle 1 and

Re: [PATCH net-next v5 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch

2017-04-20 Thread Jamal Hadi Salim
On 17-04-20 09:59 AM, Jiri Pirko wrote: Thu, Apr 20, 2017 at 03:06:21PM CEST, j...@mojatatu.com wrote: From: Jamal Hadi Salim When you dump hundreds of thousands of actions, getting only 32 per dump batch even when the socket buffer and memory allocations allow is inefficient. With this chang

Re: [PATCH net] ipv4: Avoid caching dsts when lookup skipped nh oif check

2017-04-20 Thread David Ahern
On 4/20/17 6:58 AM, Robert Shearman wrote: > David reported that doing the following: > > ip li add red type vrf table 10 > ip link set dev eth1 vrf red > ip addr add 127.0.0.1/8 dev red > ip link set dev eth1 up > ip li set red up > ping -c1 -w1 -I red 127.0.0.1 > ip l

Re: [PATCH] nl80211: fix enumeration type

2017-04-20 Thread Stefan Agner
On 2017-04-20 00:22, Johannes Berg wrote: > On Wed, 2017-04-19 at 23:55 -0700, Stefan Agner wrote: >> Use type enum nl80211_rate_info for bitrate information. This fixes >> a warning when compiling with clang: >>   warning: implicit conversion from enumeration type 'enum >> nl80211_rate_info' >>  

Re: [PATCH net v2] net/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats

2017-04-20 Thread Saeed Mahameed
On Thu, Apr 20, 2017 at 5:15 PM, Martin KaFai Lau wrote: > On Thu, Apr 20, 2017 at 05:00:13PM +0300, Saeed Mahameed wrote: >> On Thu, Apr 20, 2017 at 2:32 AM, Martin KaFai Lau wrote: >> > We have observed a sudden spike in rx/tx_packets and rx/tx_bytes >> > reported under /proc/net/dev. There is

Re: [PATCH v4 1/3] VSOCK: Add vsockmon tap functions

2017-04-20 Thread Stefan Hajnoczi
On Thu, Apr 20, 2017 at 12:27:37PM +, Jorgen S. Hansen wrote: > > > On Apr 13, 2017, at 6:18 PM, Stefan Hajnoczi wrote: > > > > + > > +static void __vsock_deliver_tap(struct sk_buff *skb) > > +{ > > + int ret; > > + struct vsock_tap *tmp; > > + > > + list_for_each_entry_rcu(tmp, &vsock

Re: [PATCH v4 3/3] VSOCK: Add virtio vsock vsockmon hooks

2017-04-20 Thread Stefan Hajnoczi
On Thu, Apr 20, 2017 at 12:35:40PM +, Jorgen S. Hansen wrote: > > > > +/* Packet capture */ > > +void virtio_transport_deliver_tap_pkt(struct virtio_vsock_pkt *pkt) > > +{ > > + struct sk_buff *skb; > > + struct af_vsockmon_hdr *hdr; > > + unsigned char *t_hdr, *payload; > > + > > + sk

  1   2   3   4   >