[PATCH net-next] sock: avoid dirtying sk_stamp, if possible

2017-03-30 Thread Paolo Abeni
sock_recv_ts_and_drops() unconditionally set sk->sk_stamp for every packet, even if the SOCK_TIMESTAMP flag is not set in the related socket. If selinux is enabled, this cause a cache miss for every packet since sk->sk_stamp and sk->sk_security share the same cacheline. With this change sk_stamp

Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance if its free list is empty

2017-03-30 Thread Alban Crequy
On Thu, Mar 30, 2017 at 8:53 AM, Ingo Molnar wrote: > > * Masami Hiramatsu wrote: > >> > So this is something I missed while the original code was merged, but the >> > concept >> > looks a bit weird: why do we do any "allocation" while a handler is >> >

Re: [PATCH net-next 2/9] net: dsa: mv88e6xxx: use 4-bit port for PVT data

2017-03-30 Thread Andrew Lunn
On Wed, Mar 29, 2017 at 04:30:13PM -0400, Vivien Didelot wrote: > The Cross-chip Port Based VLAN Table (PVT) supports two indexing modes, > one using 5-bit for device and 4-bit for port, the other using 4-bit for > device and 5-bit for port, configured via the Global 2 Misc register. > > Only 4

RE: [PATCH v3 1/2] net: phy: Fix PHY AN done state machine for interrupt driven PHYs

2017-03-30 Thread Madalin-Cristian Bucur
On March 27, 2017 2:59 PM, Roger Quadros wrote: > 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 PHY state machine seems to be stuck from RUNNING to AN state > with no new interrupts from the

[PATCH] fsl/fman: take into account all RGMII modes

2017-03-30 Thread Madalin Bucur
Accept the internal delay RGMII variants. Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/fman/fman_dtsec.c | 8 +++- drivers/net/ethernet/freescale/fman/fman_memac.c | 5 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git

Re: [PATCH net-next 1/9] net: dsa: mv88e6xxx: move PVT description in info

2017-03-30 Thread Andrew Lunn
On Wed, Mar 29, 2017 at 04:30:12PM -0400, Vivien Didelot wrote: > Not all Marvell switch chips feature a Cross-chip Port VLAN Table (PVT). > > Chips with a PVT use the same implementation, so a new mv88e6xxx_ops > member won't be necessary yet. Add a "pvt" boolean member to the > mv88e6xxx_info

Re: [PATCH net-next] rtnl: Add support for netdev event to link messages

2017-03-30 Thread Vlad Yasevich
On 03/30/2017 09:39 AM, Vlad Yasevich wrote: > On 03/29/2017 03:11 PM, David Ahern wrote: >> On 3/29/17 11:05 AM, Vlad Yasevich wrote: >>> On 03/29/2017 12:37 PM, Roopa Prabhu wrote: On 3/29/17, 5:23 AM, Vlad Yasevich wrote: > [ resending to list. hit the wrong reply button last time ]

Re: [PATCH 0/2] ARM: am335x-icev2: Add ethernet support

2017-03-30 Thread Roger Quadros
Hi Tony & Dave, On 13/03/17 15:42, Roger Quadros wrote: > Hi, > > This series adds ethernet support to am335x-icev2 board. > > The ethernet PHYs on the board need an explicit GPIO reset pulse > to ensure they bootstrap to the correct mode. Without the > GPIO reset they just don't work. > >

Re: [PATCH v2] net: netfilter: remove unused variable

2017-03-30 Thread Simon Horman
On Wed, Mar 29, 2017 at 08:27:52PM +0530, Arushi Singhal wrote: > This patch uses the following coccinelle script to remove > a variable that was simply used to store the return > value of a function call before returning it: > > @@ > identifier len,f; > @@ > > -int len; > ... when != len >

Re: in_irq_or_nmi() and RFC patch

2017-03-30 Thread Mel Gorman
On Wed, Mar 29, 2017 at 09:44:41PM +0200, Jesper Dangaard Brouer wrote: > > Regardless or using in_irq() (or in combi with in_nmi()) I get the > > following warning below: > > > > [0.00] Kernel command line: > > BOOT_IMAGE=/vmlinuz-4.11.0-rc3-net-next-page-alloc-softirq+ > >

[PATCH] dpaa_eth: use AVOIDBLOCK for Tx confirmation queues

2017-03-30 Thread Madalin Bucur
The AVOIDBLOCK flag determines the Tx confirmation queues processing to be redirected to any available CPU when the current one is slow in processing them. This may result in a higher Tx confirmation interrupt count but may reduce pressure on a certain CPU that with the previous setting would

Re: [PATCH net-next 3/9] net: dsa: mv88e6xxx: program the PVT with all ones

2017-03-30 Thread Andrew Lunn
> + for (dev = 0; dev < 32; ++dev) { > + for (port = 0; port < 16; ++port) { > + err = mv88e6xxx_pvt_map(chip, dev, port); > + if (err) > + return err; > + } > + } > + > + return 0; Hi Vivien

Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance if its free list is empty

2017-03-30 Thread Masami Hiramatsu
On Thu, 30 Mar 2017 08:53:32 +0200 Ingo Molnar wrote: > > * Masami Hiramatsu wrote: > > > > So this is something I missed while the original code was merged, but the > > > concept > > > looks a bit weird: why do we do any "allocation" while a handler

Re: [PATCH][V2] VSOCK: remove unnecessary ternary operator on return value

2017-03-30 Thread Jorgen S. Hansen
> On Mar 29, 2017, at 5:33 PM, Colin King wrote: > > From: Colin Ian King > > Rather than assign the positive errno values to ret and then > checking if it is positive and flip the sign, just return the > errno value. > > Detected by

Re: [PATCH][V2] VSOCK: remove unnecessary ternary operator on return value

2017-03-30 Thread Michael S. Tsirkin
On Wed, Mar 29, 2017 at 04:33:55PM +0100, Colin King wrote: > From: Colin Ian King > > Rather than assign the positive errno values to ret and then > checking if it is positive and flip the sign, just return the > errno value. > > Detected by CoverityScan, CID#986649

Re: [PATCH net] openvswitch: Fix ovs_flow_key_update()

2017-03-30 Thread Jiri Benc
On Wed, 29 Mar 2017 17:14:10 -0700, Yi-Hung Wei wrote: > ovs_flow_key_update() is called when the flow key is invalid, and it is > used to update and revalidate the flow key. Commit 329f45bc4f19 > ("openvswitch: add mac_proto field to the flow key") introduces mac_proto > field to flow key and use

Re: [PATCH net-next] rtnl: Add support for netdev event to link messages

2017-03-30 Thread Vlad Yasevich
On 03/29/2017 03:11 PM, David Ahern wrote: > On 3/29/17 11:05 AM, Vlad Yasevich wrote: >> On 03/29/2017 12:37 PM, Roopa Prabhu wrote: >>> On 3/29/17, 5:23 AM, Vlad Yasevich wrote: [ resending to list. hit the wrong reply button last time ] On 03/27/2017 06:58 PM, David Miller

Re: [PATCH] ezchip: nps_enet: check if napi has been completed

2017-03-30 Thread Eric Dumazet
On Thu, Mar 30, 2017 at 2:16 AM, Vlad Zakharov wrote: > I am not sure what is happening with other drivers, but in case of ezchip > nps_enet driver after the following commit: > 39e6c8208d7b6fb9d2047850fb3327db567b564b > > if we got into NAPI_STATE_MISSED state

Re: [net-next v2] vxlan: fix ND proxy when skb doesn't have transport header offset

2017-03-30 Thread Eric Dumazet
On Wed, Mar 29, 2017 at 11:41 PM, Vincent Bernat wrote: > ❦ 29 mars 2017 22:47 +0200, Vincent Bernat : > >> Parsing of neighbor discovery options is done earlier to ignore the >> whole packet in case of a malformed option. Moreover, the assumption the >>

Re: [PATCH] ezchip: nps_enet: check if napi has been completed

2017-03-30 Thread Vlad Zakharov
Hi Eric, On Wed, 2017-03-29 at 14:41 -0700, Eric Dumazet wrote: > On Wed, Mar 29, 2017 at 2:30 PM, David Miller wrote: > Signed-off-by: Vlad Zakharov > > > > > > Applied. > > > > Eric, if this is really required now, we have 148 broken drivers

Re: [next-queue v6 PATCH 2/7] i40e: Introduce Port Representor netdevs and switchdev mode.

2017-03-30 Thread Or Gerlitz
On Thu, Mar 30, 2017 at 3:22 AM, Sridhar Samudrala wrote: > Port Representator netdevs are created for each PF and VF if the switch > mode is set to 'switchdev'. These netdevs can be used to control and > configure VFs and PFs when they are moved to a different

Re: [next-queue v6 PATCH 5/7] i40e: Add TX and RX support over port netdev's in switchdev mode

2017-03-30 Thread Or Gerlitz
On Thu, Mar 30, 2017 at 3:22 AM, Sridhar Samudrala wrote: > Any frames sent via port netdevs are sent as directed transmits to the > corresponding VFs. okay, cool > In switchdev mode, broadcasts from VFs are received by the PF and passed > to corresponding port

[PATCH v2 3/8] NFC: nfcmrvl: do not use device-managed resources

2017-03-30 Thread Johan Hovold
This specifically fixes resource leaks in the registration error paths. Device-managed resources is a bad fit for this driver as devices can be registered from the n_nci line discipline. Firstly, a tty may not even have a corresponding device (should it be part of a Unix98 pty) something which

[PATCH v2 0/8] NFC: fix device allocation and nfcmrvl crashes

2017-03-30 Thread Johan Hovold
This started out with the observation that the nfcmrvl_uart driver unconditionally dereferenced the tty class device despite the fact that not every tty has an associated struct device (Unix98 ptys). Some further changes were needed in the common nfcmrvl code to fully address this, some of which

[PATCH v2 2/8] NFC: nfcmrvl_uart: add missing tty-device sanity check

2017-03-30 Thread Johan Hovold
Make sure to check the tty-device pointer before trying to access the parent device to avoid dereferencing a NULL-pointer when the tty is one end of a Unix98 pty. Fixes: e097dc624f78 ("NFC: nfcmrvl: add UART driver") Cc: stable # 4.2 Cc: Vincent Cuissard

[PATCH v2 6/8] NFC: nfcmrvl_uart: fix device-node leak during probe

2017-03-30 Thread Johan Hovold
Make sure to release the device-node reference when done parsing the node. Fixes: e097dc624f78 ("NFC: nfcmrvl: add UART driver") Cc: Vincent Cuissard Signed-off-by: Johan Hovold --- drivers/nfc/nfcmrvl/uart.c | 3 +++ 1 file changed, 3 insertions(+)

Re: [PATCH 1/2] virtio: allow drivers to validate features

2017-03-30 Thread Cornelia Huck
On Wed, 29 Mar 2017 20:14:44 +0300 "Michael S. Tsirkin" wrote: > Some drivers can't support all features in all configurations. At the > moment we blindly set FEATURES_OK and later FAILED. Support this better > by adding a callback drivers can use to do some early checks.

RE: [PATCH 22/22] usb: document that URB transfer_buffer should be aligned

2017-03-30 Thread David Laight
From: Mauro Carvalho Chehab > Sent: 30 March 2017 11:28 ... > While debugging this issue, I saw *a lot* of network-generated URB > traffic from RPi3 Ethernet port drivers that were using non-aligned > buffers and were subject to the temporary buffer conversion. Buffers from the network stack will

[PATCH v2 1/8] NFC: fix broken device allocation

2017-03-30 Thread Johan Hovold
Commit 7eda8b8e9677 ("NFC: Use IDR library to assing NFC devices IDs") moved device-id allocation and struct-device initialisation from nfc_allocate_device() to nfc_register_device(). This broke just about every nfc-device-registration error path, which continue to call nfc_free_device() that

Re: in_irq_or_nmi() and RFC patch

2017-03-30 Thread Jesper Dangaard Brouer
On Thu, 30 Mar 2017 09:35:02 +0200 Peter Zijlstra wrote: > On Thu, Mar 30, 2017 at 09:12:23AM +0200, Jesper Dangaard Brouer wrote: > > On Thu, 30 Mar 2017 08:49:58 +0200 > > Peter Zijlstra wrote: > > > > > On Wed, Mar 29, 2017 at 09:44:41PM +0200,

[PATCH v2 4/8] NFC: nfcmrvl: use nfc-device for firmware download

2017-03-30 Thread Johan Hovold
Use the nfc- rather than phy-device in firmware-management code that needs a valid struct device. This specifically fixes a NULL-pointer dereference in nfcmrvl_fw_dnld_init() during registration when the underlying tty is one end of a Unix98 pty. Note that the driver still uses the phy device

[PATCH v2 7/8] NFC: nfcmrvl_usb: use interface as phy device

2017-03-30 Thread Johan Hovold
Use the USB-interface rather than parent USB-device device, which is what this driver binds to, when registering the nci device. Note that using the right device is important when dealing with device- managed resources as the interface can be unbound independently of the parent device. Also note

[PATCH v2 8/8] NFC: nfcmrvl: allow gpio 0 for reset signalling

2017-03-30 Thread Johan Hovold
Allow gpio 0 to be used for reset signalling, and instead use negative errnos to disable the reset functionality. Signed-off-by: Johan Hovold --- drivers/nfc/nfcmrvl/main.c| 9 - include/linux/platform_data/nfcmrvl.h | 2 +- 2 files changed, 5

[PATCH v2 5/8] NFC: nfcmrvl: fix firmware-management initialisation

2017-03-30 Thread Johan Hovold
The nci-device was never deregistered in the event that fw-initialisation failed. Fix this by moving the firmware initialisation before device registration since the firmware work queue should be available before registering. Note that this depends on a recent fix that moved device-name

Re: [PATCH] [net-next] stmmac: use netif_set_real_num_{rx,tx}_queues

2017-03-30 Thread Corentin Labbe
On Tue, Mar 28, 2017 at 06:01:05PM -0700, David Miller wrote: > From: Arnd Bergmann > Date: Tue, 28 Mar 2017 11:48:21 +0200 > > > A driver must not access the two fields directly but should instead use > > the helper functions to set the values and keep a consistent internal > >

Re: [PATCH net-next] sock: avoid dirtying sk_stamp, if possible

2017-03-30 Thread Eric Dumazet
On Thu, 2017-03-30 at 14:03 +0200, Paolo Abeni wrote: > sock_recv_ts_and_drops() unconditionally set sk->sk_stamp for > every packet, even if the SOCK_TIMESTAMP flag is not set in the > related socket. > If selinux is enabled, this cause a cache miss for every packet > since sk->sk_stamp and

Re: [PATCH net-next 6/9] net: dsa: mv88e6xxx: factorize in-chip bridge map

2017-03-30 Thread Andrew Lunn
On Wed, Mar 29, 2017 at 04:30:17PM -0400, Vivien Didelot wrote: > Factorize the code in the DSA port_bridge_{join,leave} routines used to > program the port VLAN map of all local ports of a given bridge group. > > In the meantime shorten the _mv88e6xxx_port_based_vlan_map to get rid of > the old

Re: [PATCH v2] net: netfilter: remove unused variable

2017-03-30 Thread Pablo Neira Ayuso
On Thu, Mar 30, 2017 at 07:38:08PM +0530, Arushi Singhal wrote: > On Thu, Mar 30, 2017 at 6:25 PM, Simon Horman wrote: > > > On Wed, Mar 29, 2017 at 08:27:52PM +0530, Arushi Singhal wrote: > > > This patch uses the following coccinelle script to remove > > > a variable that

[PATCH net 18/19] net: hns: Avoid Hip06 chip TX packet line bug

2017-03-30 Thread Salil Mehta
From: lipeng There is a bug on Hip06 that tx ring interrupts packets count will be clear when drivers send data to tx ring, so that the tx packets count will never upgrade to packets line, and cause the interrupts engendered was delayed. Sometimes, it will cause sending

[PATCH net 17/19] net: hns: Adjust the SBM module buffer threshold

2017-03-30 Thread Salil Mehta
From: Kejian Yan HNS needs SMB Buffers to store at least two packets after sending pause frame because of the link delay. The MTU of HNS is 9728. As the processor user manual described, the SBM buffer threshold should be modified. Reported-by: Ping Zhang

Re: [PATCH net-next] sock: avoid dirtying sk_stamp, if possible

2017-03-30 Thread Eric Dumazet
On Thu, 2017-03-30 at 16:23 +0200, Paolo Abeni wrote: > That way, if the net timestamp is enable, we will record the timestamp > of the first packet received by the socket (it can be far away in the > past). > I think is just a different kind of approximation. I see. This (64bit) sk_stamp stuff

[PATCH net 01/19] net: hns: Fix the implementation of irq affinity function

2017-03-30 Thread Salil Mehta
From: lipeng This patch fixes the implementation of the IRQ affinity function. This function is used to create the cpu mask which eventually is used to initialize the cpu<->queue association for XPS(Transmit Packet Steering). Signed-off-by: lipeng

[PATCH net 00/19] net: hns: Misc. HNS Bug Fixes & Code Improvements

2017-03-30 Thread Salil Mehta
This patch set introduces various HNS bug fixes, optimizations and code improvements. Daode Huang (1): net: hns: bug fix of ethtool show the speed Kejian Yan (7): net: hns: Remove the redundant adding and deleting mac function net: hns: Remove redundant mac_get_id() net: hns: Remove

Re: [PATCH net-next 4/9] net: dsa: mv88e6xxx: allocate the number of ports

2017-03-30 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Wed, Mar 29, 2017 at 04:30:15PM -0400, Vivien Didelot wrote: >> The current code allocates DSA_MAX_PORTS ports for a Marvell dsa_switch >> structure. Provide the exact number of ports so the corresponding >> ds->num_ports is accurate. > > Is

Re: [PATCH net-next 3/9] net: dsa: mv88e6xxx: program the PVT with all ones

2017-03-30 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> +for (dev = 0; dev < 32; ++dev) { >> +for (port = 0; port < 16; ++port) { >> +err = mv88e6xxx_pvt_map(chip, dev, port); >> +if (err) >> +return err; >> +

Re: [PATCH 1/6] virtio: wrap find_vqs

2017-03-30 Thread Michael S. Tsirkin
On Thu, Mar 30, 2017 at 02:00:08PM +0800, Jason Wang wrote: > > > On 2017年03月30日 04:48, Michael S. Tsirkin wrote: > > We are going to add more parameters to find_vqs, let's wrap the call so > > we don't need to tweak all drivers every time. > > > > Signed-off-by: Michael S.

[PATCH net 05/19] net: hns: Remove redundant memset during buffer release

2017-03-30 Thread Salil Mehta
From: lipeng Because all members of desc_cb is assigned when xmit one package, so it can delete in hnae_free_buffer, as follows: - "dma, priv, length, type" are assigned in fill_v2_desc. - "page_offset, reuse_flag, buf" are not used in tx direction.

[PATCH net 02/19] net: hns: Modify GMAC init TX threshold value

2017-03-30 Thread Salil Mehta
From: lipeng This patch reduces GMAC TX threshold value to avoid gmac hang-up with speed 100M/duplex half. Signed-off-by: lipeng Signed-off-by: JinchuanTian Reviewed-by: Yisen Zhuang Signed-off-by:

[PATCH net 19/19] net: hns: Some checkpatch.pl script & warning fixes

2017-03-30 Thread Salil Mehta
This patch fixes some checkpatch.pl script caught errors and warnings during the compilation time. Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns/hnae.h | 1 - drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 11 +--

[PATCH net 11/19] net: hns: Remove the redundant adding and deleting mac function

2017-03-30 Thread Salil Mehta
From: Kejian Yan The functions (hns_dsaf_set_mac_mc_entry() and hns_mac_del_mac()) are not called by any functions. They are dead code in hns. And the same features are implemented by the patch (the id is 66355f5). Reported-by: Weiwei Deng

Re: [PATCH net-next 5/9] net: dsa: mv88e6xxx: rework in-chip bridging

2017-03-30 Thread Andrew Lunn
On Wed, Mar 29, 2017 at 04:30:16PM -0400, Vivien Didelot wrote: > All ports -- internal and external, for chips featuring a PVT -- have a > mask restricting to which internal ports a frame is allowed to egress. > > Now that DSA exposes the number of ports and their bridge devices, it is >

Re: [PATCH net-next 7/9] net: dsa: mv88e6xxx: remap existing bridge members

2017-03-30 Thread Andrew Lunn
On Wed, Mar 29, 2017 at 04:30:18PM -0400, Vivien Didelot wrote: > When a local port of a switch chip becomes a member of a bridge group, > we need to reprogram the Cross-chip Port Based VLAN Table (PVT) to allow > existing cross-chip bridge members to egress frames on the new ports. > > There is

Re: [PATCH 4/6] virtio_net: allow specifying context for rx

2017-03-30 Thread Cornelia Huck
On Thu, 30 Mar 2017 17:31:37 +0300 "Michael S. Tsirkin" wrote: > On Thu, Mar 30, 2017 at 09:26:51AM +0200, Cornelia Huck wrote: > > On Wed, 29 Mar 2017 23:48:54 +0300 > > "Michael S. Tsirkin" wrote: > > > > > With mergeable buffers we never use s/g for rx, > >

Re: [PATCH V2 net-next 5/7] tun: support receiving skb through msg_control

2017-03-30 Thread Michael S. Tsirkin
On Thu, Mar 30, 2017 at 03:22:28PM +0800, Jason Wang wrote: > This patch makes tun_recvmsg() can receive from skb from its caller > through msg_control. Vhost_net will be the first user. > > Signed-off-by: Jason Wang Do we need to bother with tun? I didn't realize one can

[PATCH net 15/19] net: hns: Optimise the code in hns_mdio_wait_ready()

2017-03-30 Thread Salil Mehta
From: Kejian Yan This patch fixes the code to clear pclint warning/info. Reported-by: Ping Zhang Signed-off-by: Kejian Yan Reviewed-by: Salil Mehta Signed-off-by: Salil Mehta

[PATCH net 12/19] net: hns: Remove redundant mac_get_id()

2017-03-30 Thread Salil Mehta
From: Kejian Yan There is a mac_id in mac control block structure, so the callback function mac_get_id() is useless. Here we remove this function. Reported-by: Weiwei Deng Signed-off-by: Kejian Yan Reviewed-by: Salil Mehta

[PATCH net 16/19] net: hns: Simplify the exception sequence in hns_ppe_init()

2017-03-30 Thread Salil Mehta
From: Kejian Yan We need to free all ppe submodule if it fails to initialize ppe by any fault, so this patch will free all ppe resource before hns_ppe_init() returns exception situation Reported-by: JinchuanTian Signed-off-by: Kejian Yan

[PATCH net 06/19] net: hns: bug fix of ethtool show the speed

2017-03-30 Thread Salil Mehta
From: Daode Huang When run ethtool ethX on hns driver, the speed will show as "Unknown". The base.speed is not correct assigned, this patch fix this bug. Signed-off-by: Daode Huang Reviewed-by: Yisen Zhuang

[PATCH net 03/19] net: hns: Optimize the code for GMAC pad and crc Config

2017-03-30 Thread Salil Mehta
From: lipeng This patch optimises the init configuration code leg for gmac pad and crc set interface. Signed-off-by: lipeng Signed-off-by: JinchuanTian Reviewed-by: Yisen Zhuang Signed-off-by:

Re: [PATCH 1/2] virtio: allow drivers to validate features

2017-03-30 Thread Michael S. Tsirkin
On Thu, Mar 30, 2017 at 11:06:27AM +0200, Cornelia Huck wrote: > On Wed, 29 Mar 2017 20:14:44 +0300 > "Michael S. Tsirkin" wrote: > > > Some drivers can't support all features in all configurations. At the > > moment we blindly set FEATURES_OK and later FAILED. Support this

Re: [net-next v2] vxlan: fix ND proxy when skb doesn't have transport header offset

2017-03-30 Thread Vincent Bernat
❦ 30 mars 2017 06:36 -0700, Eric Dumazet  : >>> Parsing of neighbor discovery options is done earlier to ignore the >>> whole packet in case of a malformed option. Moreover, the assumption the >>> skb was linear is removed and options are extracted with >>>

Re: [PATCH V2 net-next 6/7] tap: support receiving skb from msg_control

2017-03-30 Thread Michael S. Tsirkin
On Thu, Mar 30, 2017 at 03:22:29PM +0800, Jason Wang wrote: > This patch makes tap_recvmsg() can receive from skb from its caller > through msg_control. Vhost_net will be the first user. > > Signed-off-by: Jason Wang > --- > drivers/net/tap.c | 12 > 1 file

Re: [PATCH net-next] sock: avoid dirtying sk_stamp, if possible

2017-03-30 Thread Paolo Abeni
On Thu, 2017-03-30 at 06:52 -0700, Eric Dumazet wrote: > On Thu, 2017-03-30 at 14:03 +0200, Paolo Abeni wrote: > > sock_recv_ts_and_drops() unconditionally set sk->sk_stamp for > > every packet, even if the SOCK_TIMESTAMP flag is not set in the > > related socket. > > If selinux is enabled, this

Re: [PATCH] [net-next] stmmac: use netif_set_real_num_{rx,tx}_queues

2017-03-30 Thread Thierry Reding
On Thu, Mar 30, 2017 at 09:45:36AM +0200, Corentin Labbe wrote: > On Tue, Mar 28, 2017 at 06:01:05PM -0700, David Miller wrote: > > From: Arnd Bergmann > > Date: Tue, 28 Mar 2017 11:48:21 +0200 > > > > > A driver must not access the two fields directly but should instead use > > >

Re: [PATCH net-next] rtnl: Add support for netdev event to link messages

2017-03-30 Thread Vladislav Yasevich
On 03/30/2017 10:11 AM, David Ahern wrote: > On 3/30/17 7:47 AM, Vlad Yasevich wrote: >> But, NETDEV_PRECHANGEMTU will be a unnecessary notification to userspace >> without >> changes. There are already enough notifications generated for links (I >> know you are not >>

[PATCH net 08/19] net: hns: Fix to adjust buf_size of ring according to mtu

2017-03-30 Thread Salil Mehta
From: lipeng Because buf_size of ring set to 2048, the process of rx_poll_one can reuse the page, therefore the performance of XGE can improve. But the chip only supports three bds in one package, so the max mtu is 6K when it sets to 2048. For better performane in litter

[PATCH net 04/19] net: hns: Change the TX queue selection algorithm

2017-03-30 Thread Salil Mehta
From: lipeng This patch changes the TX queue selection algorithm from default to based on tuple {sport,dport,sip,dip}/indirection table similar to used during RX with Receive Side Scaling. Signed-off-by: lipeng Signed-off-by: Weiwei Deng

[PATCH net 07/19] net: hns: Optimize hns_nic_common_poll for better performance

2017-03-30 Thread Salil Mehta
From: lipeng After polling less than buget packages, we need check again. If there are still some packages, we call napi_schedule add softirq queue, this is not better way. So we return buget value instead of napi_schedule. Signed-off-by: lipeng

Re: [PATCH V2 net-next 1/7] ptr_ring: introduce batch dequeuing

2017-03-30 Thread Michael S. Tsirkin
On Thu, Mar 30, 2017 at 03:22:24PM +0800, Jason Wang wrote: > This patch introduce a batched version of consuming, consumer can > dequeue more than one pointers from the ring at a time. We don't care > about the reorder of reading here so no need for compiler barrier. > > Signed-off-by: Jason

Re: [PATCH net-next] rtnl: Add support for netdev event to link messages

2017-03-30 Thread David Ahern
On 3/30/17 7:47 AM, Vlad Yasevich wrote: > But, NETDEV_PRECHANGEMTU will be a unnecessary notification to userspace > without > changes. There are already enough notifications generated for links (I > know you are not > suggesting adding it here) Actually, this one

Re: in_irq_or_nmi() and RFC patch

2017-03-30 Thread Jesper Dangaard Brouer
On Thu, 30 Mar 2017 14:04:36 +0100 Mel Gorman wrote: > On Wed, Mar 29, 2017 at 09:44:41PM +0200, Jesper Dangaard Brouer wrote: > > > Regardless or using in_irq() (or in combi with in_nmi()) I get the > > > following warning below: > > > > > > [0.00] Kernel

[PATCH net 14/19] net: hns: Clean redundant code from hns_mdio.c file

2017-03-30 Thread Salil Mehta
From: Kejian Yan This patch cleans the redundant code from hns_mdio.c. Reported-by: Ping Zhang Signed-off-by: Kejian Yan Reviewed-by: Salil Mehta Signed-off-by: Salil Mehta

[PATCH net 09/19] net: hns: Replace netif_tx_lock to ring spin lock

2017-03-30 Thread Salil Mehta
From: lipeng netif_tx_lock is a global spin lock, it will take affect in all rings in the netdevice. In tx_poll_one process, it can only lock the current ring, in this case, we define a spin lock in hnae_ring struct for it. Signed-off-by: lipeng

[PATCH net 13/19] net: hns: Remove redundant mac table operations

2017-03-30 Thread Salil Mehta
From: Kejian Yan This patch removes redundant functions used only for debugging purposes. Reported-by: Weiwei Deng Signed-off-by: Kejian Yan Reviewed-by: Salil Mehta Signed-off-by: Salil Mehta

[PATCH net 10/19] net: hns: Correct HNS RSS key set function

2017-03-30 Thread Salil Mehta
From: lipeng This patch fixes below ethtool configuration error: localhost:~ # ethtool -X eth0 hkey XX:XX:XX... Cannot set Rx flow hash configuration: Operation not supported Signed-off-by: lipeng Reviewed-by: Yisen Zhuang

Re: [PATCH net-next 4/9] net: dsa: mv88e6xxx: allocate the number of ports

2017-03-30 Thread Andrew Lunn
On Wed, Mar 29, 2017 at 04:30:15PM -0400, Vivien Didelot wrote: > The current code allocates DSA_MAX_PORTS ports for a Marvell dsa_switch > structure. Provide the exact number of ports so the corresponding > ds->num_ports is accurate. Hi Vivien Is net/dsa/dsa.c: dsa_switch_setup() still used?

Re: arch: arm: bpf: Converting cBPF to eBPF for arm 32 bit

2017-03-30 Thread Shubham Bansal
Thanks Daniel. Can you tell me how to test the eBPF JIT compiler? It would be great if you could tell me starting from compiling to proper testing. Best, Shubham Bansal On Wed, Mar 29, 2017 at 5:30 AM, Daniel Borkmann wrote: > Hi Shubham, > > On 03/28/2017 10:49 PM,

Re: [PATCH V2 net-next 7/7] vhost_net: try batch dequing from skb array

2017-03-30 Thread Michael S. Tsirkin
On Thu, Mar 30, 2017 at 03:22:30PM +0800, Jason Wang wrote: > We used to dequeue one skb during recvmsg() from skb_array, this could > be inefficient because of the bad cache utilization which cache does this refer to btw? > and spinlock > touching for each packet. Do you mean the effect of

Re: [PATCH 4/6] virtio_net: allow specifying context for rx

2017-03-30 Thread Michael S. Tsirkin
On Thu, Mar 30, 2017 at 09:26:51AM +0200, Cornelia Huck wrote: > On Wed, 29 Mar 2017 23:48:54 +0300 > "Michael S. Tsirkin" wrote: > > > With mergeable buffers we never use s/g for rx, > > so allow specifying context in that case. > > > > Signed-off-by: Michael S. Tsirkin

[PATCH net] net: hns: Add ACPI support to check SFP present

2017-03-30 Thread Salil Mehta
From: Daode Huang The current code only supports DT to check SFP present. This patch adds ACPI support as well. Signed-off-by: Daode Huang Reviewed-by: Yisen Zhuang Signed-off-by: Salil Mehta

Re: [PATCH v2] net: stmmac: dwmac-rk: Add handling for RGMII_ID/RXID/TXID

2017-03-30 Thread David Miller
From: Wadim Egorov Date: Wed, 29 Mar 2017 14:12:19 +0200 > ATM dwmac-rk will always set and enable it's internal delay lines. > Using PHY internal delays in combination with the phy-mode > rgmii-id/rxid/txid was not possible. Only rgmii was supported. > > Now we can disable

Re: bond procfs hw addr prints

2017-03-30 Thread Jarod Wilson
On 2017-03-13 11:26 PM, Jarod Wilson wrote: On 2017-03-13 10:06 PM, Jarod Wilson wrote: On 2017-03-13 8:28 PM, Jay Vosburgh wrote: Jarod Wilson wrote: I've got a bug report for someone using a Intel OPA devices in a bond, and it appears these devices have a hardware

Re: [PATCH] virtio_net: fix mergeable bufs error handling

2017-03-30 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 29 Mar 2017 15:37:37 +0300 > @@ -570,7 +570,7 @@ static struct sk_buff *receive_mergeable(struct > net_device *dev, > u16 num_buf; > struct page *page; > int offset; > - struct sk_buff *head_skb, *curr_skb; > +

Re: [PATCH net v2 0/3] net/packet: fix multiple overflow issues in ring buffers

2017-03-30 Thread David Miller
From: Andrey Konovalov Date: Wed, 29 Mar 2017 16:11:19 +0200 > This patchset addresses multiple overflows and signedness-related issues > in packet socket ring buffers. > > Changes in v2: > - remove cleanup patches, will send in a separate patchset > - use a > UINT_MAX /

Re: [PATCH][V2] VSOCK: remove unnecessary ternary operator on return value

2017-03-30 Thread David Miller
From: Colin King Date: Wed, 29 Mar 2017 16:33:55 +0100 > From: Colin Ian King > > Rather than assign the positive errno values to ret and then > checking if it is positive and flip the sign, just return the > errno value. > > Detected by

Re: [PATCH net] openvswitch: Fix ovs_flow_key_update()

2017-03-30 Thread Jiri Benc
On Thu, 30 Mar 2017 11:39:35 -0700, Yi-Hung Wei wrote: > If we invalidate a flow key of a L3 packet, the flow's mac_proto is like this > (MAC_PROTO_NONE | SW_FLOW_KEY_INVALID), then key_extract() will > process the link layer of this L3 packet since mac_proto !=MAC_PROTO_NONE? > > In this case,

Re: [PATCH] r8152: The Microsoft Surface docks also use R8152.

2017-03-30 Thread Dan Williams
On Thu, 2017-03-30 at 19:47 +0200, René Rebe wrote: > Hi, > > On Mar 30, 2017, at 19:06, Dan Williams wrote: > > > On Tue, 2017-03-28 at 06:42 +0200, Rene Rebe wrote: > > > Without this the generic cdc_ether grabs the device, > > > and does not really work. > > > > Does this

RE: [PATCH net 00/19] net: hns: Misc. HNS Bug Fixes & Code Improvements

2017-03-30 Thread Salil Mehta
> -Original Message- > From: David Miller [mailto:da...@davemloft.net] > Sent: Thursday, March 30, 2017 6:09 PM > To: Salil Mehta > Cc: Zhuangyuzeng (Yisen); mehta.salil@gmail.com; > netdev@vger.kernel.org; linux-ker...@vger.kernel.org; Linuxarm > Subject: Re: [PATCH net 00/19] net:

Re: [PATCH] [net-next] stmmac: use netif_set_real_num_{rx,tx}_queues

2017-03-30 Thread David Miller
From: Thierry Reding Date: Thu, 30 Mar 2017 16:34:36 +0200 > On Thu, Mar 30, 2017 at 09:45:36AM +0200, Corentin Labbe wrote: >> On Tue, Mar 28, 2017 at 06:01:05PM -0700, David Miller wrote: >> > From: Arnd Bergmann >> > Date: Tue, 28 Mar 2017 11:48:21 +0200 >>

Re: [PATCH net] sctp: alloc stream info when initializing asoc

2017-03-30 Thread David Miller
From: Xin Long Date: Thu, 30 Mar 2017 01:00:53 +0800 > When sending a msg without asoc established, sctp will send INIT packet > first and then enqueue chunks. > > Before receiving INIT_ACK, stream info is not yet alloced. But enqueuing > chunks needs to access stream

Re: [PATCH net] openvswitch: Fix ovs_flow_key_update()

2017-03-30 Thread Yi-Hung Wei
On Thu, Mar 30, 2017 at 6:22 AM, Jiri Benc wrote: > On Wed, 29 Mar 2017 17:14:10 -0700, Yi-Hung Wei wrote: >> ovs_flow_key_update() is called when the flow key is invalid, and it is >> used to update and revalidate the flow key. Commit 329f45bc4f19 >> ("openvswitch: add

[PATCH] net/faraday: Explicitly include linux/of.h and linux/property.h

2017-03-30 Thread Mark Brown
This driver uses interfaces from linux/of.h and linux/property.h but relies on implict inclusion of those headers which means that changes in other headers could break the build, as happened in -next for arm today. Add a explicit includes. Signed-off-by: Mark Brown ---

Re: [RFC PATCH 0/6] virtio-net: Add support for virtio-net header extensions

2017-03-30 Thread Michael S. Tsirkin
On Sun, Mar 19, 2017 at 12:06:31AM -0400, Vladislav Yasevich wrote: > Curreclty virtion net header is fixed size and adding things to it is rather > difficult to do. This series attempt to add the infrastructure as well as > some > extensions that try to resolve some deficiencies we currently

Re: [PATCH] [net-next] stmmac: use netif_set_real_num_{rx,tx}_queues

2017-03-30 Thread Joao Pinto
Às 5:35 PM de 3/30/2017, Niklas Cassel escreveu: > On 03/30/2017 04:34 PM, Thierry Reding wrote: >> On Thu, Mar 30, 2017 at 09:45:36AM +0200, Corentin Labbe wrote: >>> On Tue, Mar 28, 2017 at 06:01:05PM -0700, David Miller wrote: From: Arnd Bergmann Date: Tue, 28 Mar 2017

Re: [PATCH net 00/19] net: hns: Misc. HNS Bug Fixes & Code Improvements

2017-03-30 Thread David Miller
From: Salil Mehta Date: Thu, 30 Mar 2017 17:19:44 + > >> -Original Message- >> From: David Miller [mailto:da...@davemloft.net] >> Sent: Thursday, March 30, 2017 6:09 PM >> To: Salil Mehta >> Cc: Zhuangyuzeng (Yisen); mehta.salil@gmail.com; >>

[PATCH net-next v2 4/6] net: mpls: Limit memory allocation for mpls_route

2017-03-30 Thread David Ahern
Limit memory allocation size for mpls_route to 4096. Signed-off-by: David Ahern --- v2 - new patch in v2 of set net/mpls/af_mpls.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/net/mpls/af_mpls.c

[PATCH net-next v2 1/6] net: mpls: rt_nhn_alive and nh_flags should be accessed using READ_ONCE

2017-03-30 Thread David Ahern
The number of alive nexthops for a route (rt->rt_nhn_alive) and the flags for a next hop (nh->nh_flags) are modified by netdev event handlers. The event handlers run with rtnl_lock held so updates are always done with the lock held. The packet path accesses the fields under the rcu lock. Since

[PATCH net-next v2 6/6] net: mpls: Increase max number of labels for lwt encap

2017-03-30 Thread David Ahern
Alow users to push down more labels per MPLS encap. Similar to LSR case, move label array to the end of mpls_iptunnel_encap and allocate based on the number of labels for the route. For consistency with the LSR case, re-use the same maximum number of labels. Signed-off-by: David Ahern

[PATCH net-next v2 2/6] net: mpls: Convert number of nexthops to u8

2017-03-30 Thread David Ahern
Number of nexthops and number of alive nexthops are tracked using an unsigned int. A route should never have more than 255 nexthops so convert both to u8. Update all references and intermediate variables to consistently use u8 as well. Shrinks the size of mpls_route from 32 bytes to 24 bytes with

[PATCH net-next v2 3/6] net: mpls: change mpls_route layout

2017-03-30 Thread David Ahern
Move labels to the end of mpls_nh as a 0-sized array and within mpls_route move the via for a nexthop after the mpls_nh. The new layout becomes: +--+ | mpls_route | +--+ | mpls_nh 0| +--+ |

  1   2   3   >