[PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'

2017-09-29 Thread Christophe JAILLET
If this sanity check fails, we must free 'rss_indir'. Otherwise there is a memory leak. 'goto err' as done in the other error handling paths to fix it. Fixes: 46a3df9f9718 ("net: hns3: Fix for setting rss_size incorrectly") Signed-off-by: Christophe JAILLET ---

Re: [PATCH] mkiss: remove redundant check on len being zero

2017-09-29 Thread David Miller
From: Colin King Date: Wed, 27 Sep 2017 22:45:13 +0100 > From: Colin Ian King > > The check on len is redundant as it is always greater than 1, > so just remove it and make the printk less complex. > > Detected by CoverityScan, CID#1226729

Re: [PATCH] net-ipv6: add support for sockopt(SOL_IPV6, IPV6_FREEBIND)

2017-09-29 Thread David Miller
From: Maciej Żenczykowski Date: Tue, 26 Sep 2017 21:32:42 -0700 > From: Maciej Żenczykowski > > So far we've been relying on sockopt(SOL_IP, IP_FREEBIND) being usable > even on IPv6 sockets. > > However, it turns out it is perfectly reasonable to want

Re: [PATCH net-next] liquidio: fix format truncation warning reported by gcc 7.1.1

2017-09-29 Thread David Miller
From: Felix Manlunas Date: Tue, 26 Sep 2017 11:48:27 -0700 > From: Satanand Burla > > gcc 7.1.1 with -Wformat-truncation reports these warnings: > > drivers/net/ethernet/cavium/liquidio/lio_core.c: In function > `octeon_setup_interrupt':

Re: [PATCH net-next] net: ipv6: send NS for DAD when link operationally up

2017-09-29 Thread David Miller
From: Mike Manning Date: Mon, 25 Sep 2017 22:01:36 +0100 > The NS for DAD are sent on admin up as long as a valid qdisc is found. > A race condition exists by which these packets will not egress the > interface if the operational state of the lower device is not yet up. >

Re: [net-next V2 PATCH 5/5] samples/bpf: add cpumap sample program xdp_redirect_cpu

2017-09-29 Thread Alexei Starovoitov
On Fri, Sep 29, 2017 at 06:34:32PM +0200, Jesper Dangaard Brouer wrote: > + > +static __always_inline > +u16 get_dest_port_ipv4_udp(struct xdp_md *ctx, u64 nh_off) > +{ > + void *data_end = (void *)(long)ctx->data_end; > + void *data = (void *)(long)ctx->data; > +struct iphdr

Re: [PATCH net-next 2/5] bpf: Add map_name to bpf_map_info

2017-09-29 Thread Jakub Kicinski
On Fri, 29 Sep 2017 19:35:18 -0700, Martin KaFai Lau wrote: > On Sat, Sep 30, 2017 at 02:07:46AM +, Jakub Kicinski wrote: > > Hi Martin! > > > > On Wed, 27 Sep 2017 14:37:53 -0700, Martin KaFai Lau wrote: > > > diff --git a/include/linux/bpf.h b/include/linux/bpf.h > > > index

Re: [PATCH net-next 2/5] bpf: Add map_name to bpf_map_info

2017-09-29 Thread Martin KaFai Lau
On Sat, Sep 30, 2017 at 02:07:46AM +, Jakub Kicinski wrote: > Hi Martin! > > On Wed, 27 Sep 2017 14:37:53 -0700, Martin KaFai Lau wrote: > > diff --git a/include/linux/bpf.h b/include/linux/bpf.h > > index 33ccc474fb04..252f4bc9eb25 100644 > > --- a/include/linux/bpf.h > > +++

Re: [PATCH net-next 2/5] bpf: Add map_name to bpf_map_info

2017-09-29 Thread Jakub Kicinski
Hi Martin! On Wed, 27 Sep 2017 14:37:53 -0700, Martin KaFai Lau wrote: > diff --git a/include/linux/bpf.h b/include/linux/bpf.h > index 33ccc474fb04..252f4bc9eb25 100644 > --- a/include/linux/bpf.h > +++ b/include/linux/bpf.h > @@ -56,6 +56,7 @@ struct bpf_map { > struct work_struct work; >

Re: [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables

2017-09-29 Thread Santosh Shilimkar
On 9/29/2017 6:13 PM, Avinash Repaka wrote: This patch fixes the scope of has_fr and has_fmr variables as they are needed only in rds_ib_add_one(). Signed-off-by: Avinash Repaka --- Indeed the final merge version actually didn't need those across files. Change looks

Re: [PATCH net-next] vhost_net: do not stall on zerocopy depletion

2017-09-29 Thread Willem de Bruijn
On Fri, Sep 29, 2017 at 3:38 PM, Michael S. Tsirkin wrote: > On Wed, Sep 27, 2017 at 08:25:56PM -0400, Willem de Bruijn wrote: >> From: Willem de Bruijn >> >> Vhost-net has a hard limit on the number of zerocopy skbs in flight. >> When reached, transmission

Re: [PATCH net-next v2 1/7] net: dsa: add master helper to look up slaves

2017-09-29 Thread Florian Fainelli
On 09/29/2017 02:19 PM, Vivien Didelot wrote: > The DSA tagging code does not need to know about the DSA architecture, > it only needs to return the slave device corresponding to the source > port index (and eventually the source device index for cascade-capable > switches) parsed from the frame

[PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables

2017-09-29 Thread Avinash Repaka
This patch fixes the scope of has_fr and has_fmr variables as they are needed only in rds_ib_add_one(). Signed-off-by: Avinash Repaka --- net/rds/ib.c | 11 ++- net/rds/ib.h | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/net/rds/ib.c

[net-next 08/15] i40e: use separate state bit for miscellaneous IRQ setup

2017-09-29 Thread Jeff Kirsher
From: Jacob Keller We currently (mis)use the __I40E_RECOVERY_PENDING bit to determine when we should actually request a new IRQ in i40e_setup_misc_vector(). This led to a design mistake where we open-coded the re-setup of the miscellaneous vector in i40e_resume()

[net-next 06/15] i40e: fix for flow director counters not wrapping as expected

2017-09-29 Thread Jeff Kirsher
From: Mariusz Stachura An errata with GLQF_PCNT causes it to not wrap as expected. This can cause an error in flow director statistics. This patch resets affected counters just after reading. Signed-off-by: Mariusz Stachura Tested-by:

[net-next 07/15] i40evf: lower message level

2017-09-29 Thread Jeff Kirsher
From: Mitch Williams We see this message regularly on VF reset or unload (which invokes a reset). It's essentially meaningless unless it's happening constantly. To prevent consternation, lower the log level to debug so it's not seen under normal circumstance.

[net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2017-09-29

2017-09-29 Thread Jeff Kirsher
This series contains updates to i40e and i40evf only. Jake provides several of the changes starting with the renaming of a variable to clarify what the value is actually calculating. Found we were misusing the __I40E_RECOVERY_PENDING bit to determine when we should actually request a new IRQ in

[net-next 03/15] i40e: Fix link down message when interface is brought up

2017-09-29 Thread Jeff Kirsher
From: Sudheer Mogilappagari i40e_print_link_message() is intended to compare new link state with current link state and print log message only if the new state is different from current state. However in current driver the new state does not get updated when

[net-next 01/15] i40e/i40evf: rename bytes_per_int to bytes_per_usec

2017-09-29 Thread Jeff Kirsher
From: Jacob Keller This value is not calculating bytes_per_int, which would actually just be bytes/ITR_COUNTDOWN_START, but rather it's calculating bytes/usecs. Rename the variable for clarity so that future developers understand what the value is actually calculating.

[net-next 09/15] i40e: use newer generic PM support instead of legacy PM callbacks

2017-09-29 Thread Jeff Kirsher
From: Jacob Keller Stop using the old legacy PM support, since we now have stable support for the newer generic PM callbacks. This has several advantages. First, we no longer have to manage our own pci_save_state() and power changes, as it's preferred to have the PCI

[net-next 04/15] i40e: simplify member variable accesses

2017-09-29 Thread Jeff Kirsher
From: Sudheer Mogilappagari This commit replaces usage of vsi->back in i40e_print_link_message() (which is actually a PF pointer) with temp variable. Signed-off-by: Sudheer Mogilappagari Tested-by: Andrew Bowers

[net-next 14/15] i40e: Enable VF to negotiate number of allocated queues

2017-09-29 Thread Jeff Kirsher
From: Alan Brady Currently the PF allocates a default number of queues for each VF and cannot be changed. This patch enables the VF to request a different number of queues allocated to it. This patch also adds a new virtchnl op and capability flag to facilitate this

[net-next 02/15] i40e: Fix unqualified module message while bringing link up

2017-09-29 Thread Jeff Kirsher
From: Sudheer Mogilappagari In current driver, when ifconfig ethx up is done, the link state doesn't transition to UP inside i40e_open(). It changes after AQ command response is handled in i40e_handle_link_event(). When pf->hw.phy.link_info.link_info is DOWN

[net-next 15/15] i40e: refactor FW version checking

2017-09-29 Thread Jeff Kirsher
From: Mitch Williams The i40e driver now supports two different devices with two different firmware versions. So be smart about how we handle these. Move the FW version macros to the appropriate header file, and add a convenience macro that checks the version based on

[net-next 12/15] i40e: shutdown all IRQs and disable MSI-X when suspended

2017-09-29 Thread Jeff Kirsher
From: Jacob Keller On some platforms with a large number of CPUs, we will allocate many IRQ vectors. When hibernating, the system will attempt to migrate all of the vectors back to CPU0 when shutting down all the other CPUs. It is possible that we have so many vectors

[net-next 13/15] i40evf: fix ring to vector mapping

2017-09-29 Thread Jeff Kirsher
From: Alan Brady The current implementation for mapping queues to vectors is broken because it attempts to map each Tx and Rx ring to its own vector, however we use combined queues so we should actually be mapping the Tx/Rx rings together on one vector. Also in the current

[net-next 05/15] i40e: relax warning message in case of version mismatch

2017-09-29 Thread Jeff Kirsher
From: Mariusz Stachura Fortville and Fort Park devices are often on different firmware release schedules. This change relaxes the minor version warning message, so it is only displayed for older FW warning version for old firmware Fortville 3 or earlier.

[net-next 11/15] i40e: prevent service task from running while we're suspended

2017-09-29 Thread Jeff Kirsher
From: Jacob Keller Although the service task does check the suspended status before running, it might already be part way through running when we go to suspend. Lets ensure that the service task is stopped and will not be restarted again until we finish resuming. This

[net-next 10/15] i40e: don't clear suspended state until we finish resuming

2017-09-29 Thread Jeff Kirsher
From: Jacob Keller When handling suspend and resume callbacks we want to make sure that (a) we don't suspend again if we're already suspended and (b) we don't resume again if we're already resuming. Lets make sure we test_and_set the __I40E_SUSPENDED bit in i40e_suspend

Re: [PATCH] net: hns3: fix null pointer dereference before null check

2017-09-29 Thread Yunsheng Lin
Hi, Colin On 2017/9/30 3:51, Colin King wrote: > From: Colin Ian King > > pointer ndev is being dereferenced with the call to netif_running > before it is being null checked. Re-order the code to only dereference > ndev after it has been null checked. Thanks for

[next-queue PATCH v2 1/5] mqprio: Implement select_queue class_ops

2017-09-29 Thread Vinicius Costa Gomes
From: Jesus Sanchez-Palencia When replacing a child qdisc from mqprio, tc_modify_qdisc() must fetch the netdev_queue pointer that the current child qdisc is associated with before creating the new qdisc. Currently, when using mqprio as root qdisc, the kernel

[next-queue PATCH v2 2/5] net/sched: Fix accessing invalid dev_queue

2017-09-29 Thread Vinicius Costa Gomes
From: Jesus Sanchez-Palencia In qdisc_alloc() the dev_queue pointer was used without any checks being performed. If qdisc_create() gets a null dev_queue pointer, it just passes it along to qdisc_alloc(), leading to a crash. That happens if a root qdisc

[next-queue PATCH v2 3/5] net/sched: Introduce the user API for the CBS shaper

2017-09-29 Thread Vinicius Costa Gomes
Export the API necessary for configuring the CBS shaper (implemented in the next patch) via the tc tool. Signed-off-by: Vinicius Costa Gomes --- include/uapi/linux/pkt_sched.h | 17 + 1 file changed, 17 insertions(+) diff --git

[next-queue PATCH v2 5/5] igb: Add support for CBS offload

2017-09-29 Thread Vinicius Costa Gomes
From: Andre Guedes This patch adds support for Credit-Based Shaper (CBS) qdisc offload from Traffic Control system. This support enable us to leverage the Forwarding and Queuing for Time-Sensitive Streams (FQTSS) features from Intel i210 Ethernet Controller. FQTSS is the

[next-queue PATCH v2 4/5] net/sched: Introduce Credit Based Shaper (CBS) qdisc

2017-09-29 Thread Vinicius Costa Gomes
This queueing discipline implements the shaper algorithm defined by the 802.1Q-2014 Section 8.6.8.2 and detailed in Annex L. It's primary usage is to apply some bandwidth reservation to user defined traffic classes, which are mapped to different queues via the mqprio qdisc. Initially, it only

[next-queue PATCH v2 0/5] TSN: Add qdisc based config interface for CBS

2017-09-29 Thread Vinicius Costa Gomes
Hi, Changes since v1: - Solved the mqprio dependency; - Fixed a mqprio bug, that caused the inner qdisc to have a wrong dev_queue associated with it; Changes from the RFC: - Fixed comments from Henrik Austad; - Simplified the Qdisc, using the generic implementation of callbacks where

[PATCH 1/2] capability: introduce sysctl for controlled user-ns capability whitelist

2017-09-29 Thread Mahesh Bandewar
From: Mahesh Bandewar Add a sysctl variable kernel.controlled_userns_caps_whitelist. This takes input as capability mask expressed as two comma separated hex u32 words. The mask, however, is stored in kernel as kernel_cap_t type. Any capabilities that are not part of this

[PATCH 0/2] capability controlled user-namespaces

2017-09-29 Thread Mahesh Bandewar
From: Mahesh Bandewar [Same as the previous RFC series sent on 9/21] TL;DR version - Creating a sandbox environment with namespaces is challenging considering what these sandboxed processes can engage into. e.g. CVE-2017-6074, CVE-2017-7184, CVE-2017-7308 etc.

[PATCH 2/2] userns: control capabilities of some user namespaces

2017-09-29 Thread Mahesh Bandewar
From: Mahesh Bandewar With this new notion of "controlled" user-namespaces, the controlled user-namespaces are marked at the time of their creation while the capabilities of processes that belong to them are controlled using the global mask. Init-user-ns is always

Re: [PATCH net-next] net: bridge: add per-port group_fwd_mask with less restrictions

2017-09-29 Thread Roopa Prabhu
On Fri, Sep 29, 2017 at 3:11 PM, Nikolay Aleksandrov wrote: > On 30/09/17 00:51, Stephen Hemminger wrote: >> On Sat, 30 Sep 2017 00:01:24 +0300 >> Nikolay Aleksandrov wrote: >> >>> On 29/09/17 18:14, Stephen Hemminger wrote: On Wed,

Re: [PATCH net-next] net: bridge: add per-port group_fwd_mask with less restrictions

2017-09-29 Thread Nikolay Aleksandrov
On 30/09/17 00:51, Stephen Hemminger wrote: > On Sat, 30 Sep 2017 00:01:24 +0300 > Nikolay Aleksandrov wrote: > >> On 29/09/17 18:14, Stephen Hemminger wrote: >>> On Wed, 27 Sep 2017 16:12:44 +0300 >>> Nikolay Aleksandrov wrote: >>>

Re: [PATCH next] bonding: speed/duplex update at NETDEV_UP event

2017-09-29 Thread महेश बंडेवार
On Fri, Sep 29, 2017 at 1:08 PM, Stephen Hemminger wrote: > On Wed, 27 Sep 2017 18:03:49 -0700 > Mahesh Bandewar wrote: > >> From: Mahesh Bandewar >> >> Some NIC drivers don't have correct speed/duplex settings at the >> time

Re: [PATCH net-next] net: bridge: add per-port group_fwd_mask with less restrictions

2017-09-29 Thread Stephen Hemminger
On Sat, 30 Sep 2017 00:01:24 +0300 Nikolay Aleksandrov wrote: > On 29/09/17 18:14, Stephen Hemminger wrote: > > On Wed, 27 Sep 2017 16:12:44 +0300 > > Nikolay Aleksandrov wrote: > > > >> We need to be able to transparently forward

[PATCH net-next v2 1/7] net: dsa: add master helper to look up slaves

2017-09-29 Thread Vivien Didelot
The DSA tagging code does not need to know about the DSA architecture, it only needs to return the slave device corresponding to the source port index (and eventually the source device index for cascade-capable switches) parsed from the frame received on the master device. For this purpose,

[PATCH net-next v2 6/7] net: dsa: change dsa_ptr for a dsa_port

2017-09-29 Thread Vivien Didelot
With DSA, a master net device (CPU facing interface) has a dsa_ptr pointer to which hangs a dsa_switch_tree. This is not correct because a master interface is wired to a dedicated switch port, and because we can theoretically have several master interfaces pointing to several CPU ports of the same

[PATCH net-next v2 0/7] net: dsa: change dsa_ptr for a dsa_port

2017-09-29 Thread Vivien Didelot
With DSA, a master net_device is physically wired to a dedicated CPU switch port. For interaction with the DSA layer, the struct net_device contains a dsa_ptr, which currently points to a dsa_switch_tree object. This is only valid for a switch fabric with a single CPU port. In order to support

[PATCH net-next v2 5/7] net: dsa: prepare master receive hot path

2017-09-29 Thread Vivien Didelot
In preparation to make DSA master devices point to their corresponding CPU port instead of the whole tree, add copies of dst and rcv in the dsa_port structure so that we keep fast access in the receive hot path. Also keep the copies at the beginning of the dsa_port structure in order to ensure

[PATCH net-next v2 7/7] net: dsa: remove tag ops from the switch tree

2017-09-29 Thread Vivien Didelot
Now that the dsa_ptr is a dsa_port instance, there is no need to keep the tag operations in the dsa_switch_tree structure. Remove it. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- include/net/dsa.h | 11 ---

[PATCH net-next v2 4/7] net: dsa: add tagging ops to port

2017-09-29 Thread Vivien Didelot
The DSA tagging protocol operations are specific to each CPU port, thus the dsa_device_ops pointer belongs to the dsa_port structure. >From now on assign a slave's xmit copy from its CPU port tagging operations. This will ease the future support for multiple CPU ports. Also keep the tag_ops at

[PATCH net-next v2 3/7] net: dsa: use temporary dsa_device_ops variable

2017-09-29 Thread Vivien Didelot
When resolving the DSA tagging protocol used by a CPU switch, use a temporary "tag_ops" variable to store the dsa_device_ops instead of using directly dst->tag_ops. This will make the future patches moving this pointer around easier to read. There is no functional changes. Signed-off-by: Vivien

[PATCH net-next v2 2/7] net: dsa: use cpu_dp in master code

2017-09-29 Thread Vivien Didelot
Make it clear that the master device is linked to a CPU port by using "cpu_dp" for the dsa_port variable in master.c instead of "port", then use a "port" variable to describe the port index, as usually seen in other places of DSA core. This will make the future patch touching dsa_ptr more

Re: [RFC net-next 0/5] TSN: Add qdisc-based config interfaces for traffic shapers

2017-09-29 Thread Rodney Cummings
Hi, I am posting my reply to this thread after subscribing, so I apologize if the archive happens to attach it to the wrong thread. First, I'd like to say that I strongly support this RFC. We need Linux interfaces for IEEE 802.1 TSN features. Although I haven't looked in detail, the proposal

Re: [PATCH net-next] net: bridge: add per-port group_fwd_mask with less restrictions

2017-09-29 Thread Nikolay Aleksandrov
On 29/09/17 18:14, Stephen Hemminger wrote: > On Wed, 27 Sep 2017 16:12:44 +0300 > Nikolay Aleksandrov wrote: > >> We need to be able to transparently forward most link-local frames via >> tunnels (e.g. vxlan, qinq). Currently the bridge's group_fwd_mask has a >>

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Andrew Lunn
On Fri, Sep 29, 2017 at 07:19:17PM +, tristram...@microchip.com wrote: > > > My concern is if a task is already running with SPI access to a lot > > > of registers like reading the 32 MIB counters in every port of the > > > switch, another register access has to wait until they are finished. >

Re: [PATCH next] bonding: speed/duplex update at NETDEV_UP event

2017-09-29 Thread Stephen Hemminger
On Wed, 27 Sep 2017 18:03:49 -0700 Mahesh Bandewar wrote: > From: Mahesh Bandewar > > Some NIC drivers don't have correct speed/duplex settings at the > time they send NETDEV_UP notification and that messes up the > bonding state. Especially 802.3ad

Re: [net-next V2 PATCH 1/5] bpf: introduce new bpf cpu map type BPF_MAP_TYPE_CPUMAP

2017-09-29 Thread Jesper Dangaard Brouer
On Fri, 29 Sep 2017 11:41:54 -0700 Jakub Kicinski wrote: > On Fri, 29 Sep 2017 18:34:12 +0200, Jesper Dangaard Brouer wrote: > > The 'cpumap' is primary used as a backend map for XDP BPF helper > > call bpf_redirect_map() and XDP_REDIRECT action, like 'devmap'. > > > > This

[PATCH] net: hns3: fix null pointer dereference before null check

2017-09-29 Thread Colin King
From: Colin Ian King pointer ndev is being dereferenced with the call to netif_running before it is being null checked. Re-order the code to only dereference ndev after it has been null checked. Detected by CoverityScan, CID#1457206 ("Dereference before null check")

Re: [PATCH net-next 0/8] net: dsa: change dsa_ptr for a dsa_port

2017-09-29 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: > On 09/29/2017 11:36 AM, Vivien Didelot wrote: >> With DSA, a master net_device is physically wired to a dedicated CPU >> switch port. For interaction with the DSA layer, the struct net_device >> contains a dsa_ptr, which currently

Re: [PATCH net-next] vhost_net: do not stall on zerocopy depletion

2017-09-29 Thread Michael S. Tsirkin
On Wed, Sep 27, 2017 at 08:25:56PM -0400, Willem de Bruijn wrote: > From: Willem de Bruijn > > Vhost-net has a hard limit on the number of zerocopy skbs in flight. > When reached, transmission stalls. Stalls cause latency, as well as > head-of-line blocking of other flows

Re: [PATCH net-next 0/8] net: dsa: change dsa_ptr for a dsa_port

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > With DSA, a master net_device is physically wired to a dedicated CPU > switch port. For interaction with the DSA layer, the struct net_device > contains a dsa_ptr, which currently points to a dsa_switch_tree object. > > This is only valid for a

Re: [PATCH net-next 5/8] net: dsa: add tagging ops to port

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > The DSA tagging protocol operations are specific to each CPU port, > thus the dsa_device_ops pointer belongs to the dsa_port structure. > > From now on assign a slave's xmit copy from its CPU port tagging > operations. This will ease the future

Re: [PATCH net-next 7/8] net: dsa: change dsa_ptr for a dsa_port

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > With DSA, a master net device (CPU facing interface) has a dsa_ptr > pointer to which hangs a dsa_switch_tree. This is not correct because a > master interface is wired to a dedicated switch port, and because we can > theoretically have several

Re: [PATCH net-next 1/8] net: dsa: directly fetch switch in mtk_tag_rcv

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > In a single-chip switch fabric, there is no need to fetch the dsa_switch > structure from the tree, directly use the CPU port's "ds" member. > > Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli

Re: [PATCH net-next 8/8] net: dsa: remove tag ops from the switch tree

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > Now that the dsa_ptr is a dsa_port instance, there is no need to keep > the tag operations in the dsa_switch_tree structure. Remove it. > > Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> > My concern is if a task is already running with SPI access to a lot > > of registers like reading the 32 MIB counters in every port of the > > switch, another register access has to wait until they are finished. > > Why does it have to wait? Looking at the code in > ksz_get_ethtool_stats(),

Re: [PATCH net-next 6/8] net: dsa: prepare master receive hot path

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > In preparation to make DSA master devices point to their corresponding > CPU port instead of the whole tree, add copies of dst and rcv in the > dsa_port structure so that we keep fast access in the receive hot path. > > Signed-off-by: Vivien Didelot

[PATCH RFC] flow_dissector: Add FLOW_DISSECTOR_F_FLOWER

2017-09-29 Thread Tom Herbert
This patch is RFC and would be applied after "flow_dissector: Protocol specific flow dissector offload" In order to maitain uAPI in flower, the FLOW_DISSECTOR_F_FLOWER flag is added to indicate to flow_dissector that the caller is flower. As new funtionality is addes to flow_dissector that would

Re: [PATCH net-next 5/8] net: dsa: add tagging ops to port

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > The DSA tagging protocol operations are specific to each CPU port, > thus the dsa_device_ops pointer belongs to the dsa_port structure. > > From now on assign a slave's xmit copy from its CPU port tagging > operations. This will ease the future

Re: [PATCH net-next 4/8] net: dsa: use temporary dsa_device_ops variable

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > When resolving the DSA tagging protocol used by a CPU switch, use a > temporary "tag_ops" variable to store the dsa_device_ops instead of > using directly dst->tag_ops. This will make the future patches moving > this pointer around easier to read. >

Re: [PATCH net-next 3/8] net: dsa: use cpu_dp in master code

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > Make it clear that the master device is linked to a CPU port by using > "cpu_dp" for the dsa_port variable in master.c instead of "port", then > use a "port" variable to describe the port index, as usually seen in > other places of DSA core. > >

Re: [PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv

2017-09-29 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: >> @@ -72,11 +72,10 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, >> struct net_device *dev, >> { >> u16 *lan9303_tag; >> struct dsa_switch_tree *dst = dev->dsa_ptr; >> -struct dsa_switch *ds; >> +struct

Re: [iproute PATCH] ip-route: Fix for listing routes with RTAX_LOCK attribute

2017-09-29 Thread Stephen Hemminger
On Thu, 28 Sep 2017 19:33:56 +0200 Phil Sutter wrote: > This fixes a corner-case for routes with a certain metric locked to > zero: > > | ip route add 192.168.7.0/24 dev eth0 window 0 > | ip route add 192.168.7.0/24 dev eth0 window lock 0 > > Since the kernel doesn't dump the

Re: [PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv

2017-09-29 Thread Florian Fainelli
On 09/29/2017 11:36 AM, Vivien Didelot wrote: > In a single-chip switch fabric, there is no need to fetch the dsa_switch > structure from the tree, directly use the CPU port's "ds" member. > > Signed-off-by: Vivien Didelot > --- > net/dsa/tag_lan9303.c | 5

Re: [PATCH v2] lib: fix multiple strlcpy definition

2017-09-29 Thread Stephen Hemminger
On Thu, 28 Sep 2017 21:02:11 +0300 Baruch Siach wrote: > Some C libraries, like uClibc and musl, provide BSD compatible > strlcpy(). Add check_strlcpy() to configure, and avoid defining strlcpy > and strlcat when the C library provides them. > > This fixes the following

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> On Mon 2017-09-18 20:27:13, tristram...@microchip.com wrote: > > > > +/** > > > > + * Some counters do not need to be read too often because they are > less > > > likely > > > > + * to increase much. > > > > + */ > > > > > > What does comment mean? Are you caching statistics, and updating > > >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Andrew Lunn
> My concern is if a task is already running with SPI access to a lot > of registers like reading the 32 MIB counters in every port of the > switch, another register access has to wait until they are finished. Why does it have to wait? Looking at the code in ksz_get_ethtool_stats(), you don't

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> > > > > Similar code will be needed by other drivers, right? > > > > > > > > Although KSZ8795 and KSZ8895 may use the same code, the other > > > > chips will have different code. > > > > > > Ok, please make sure code is shared between these two. > > > > The exact function probably cannot be

[PATCH net-next 5/8] net: dsa: add tagging ops to port

2017-09-29 Thread Vivien Didelot
The DSA tagging protocol operations are specific to each CPU port, thus the dsa_device_ops pointer belongs to the dsa_port structure. >From now on assign a slave's xmit copy from its CPU port tagging operations. This will ease the future support for multiple CPU ports. Signed-off-by: Vivien

[PATCH net-next 8/8] net: dsa: remove tag ops from the switch tree

2017-09-29 Thread Vivien Didelot
Now that the dsa_ptr is a dsa_port instance, there is no need to keep the tag operations in the dsa_switch_tree structure. Remove it. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 11 --- net/dsa/dsa2.c| 2 -- net/dsa/legacy.c | 2 --

Re: [net-next V2 PATCH 1/5] bpf: introduce new bpf cpu map type BPF_MAP_TYPE_CPUMAP

2017-09-29 Thread Jakub Kicinski
On Fri, 29 Sep 2017 18:34:12 +0200, Jesper Dangaard Brouer wrote: > The 'cpumap' is primary used as a backend map for XDP BPF helper > call bpf_redirect_map() and XDP_REDIRECT action, like 'devmap'. > > This patch implement the main part of the map. It is not connected to > the XDP redirect

[PATCH net-next 2/8] net: dsa: directly fetch switch in lan9303_rcv

2017-09-29 Thread Vivien Didelot
In a single-chip switch fabric, there is no need to fetch the dsa_switch structure from the tree, directly use the CPU port's "ds" member. Signed-off-by: Vivien Didelot --- net/dsa/tag_lan9303.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

[PATCH net-next 1/8] net: dsa: directly fetch switch in mtk_tag_rcv

2017-09-29 Thread Vivien Didelot
In a single-chip switch fabric, there is no need to fetch the dsa_switch structure from the tree, directly use the CPU port's "ds" member. Signed-off-by: Vivien Didelot --- net/dsa/tag_mtk.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-)

[PATCH net-next 0/8] net: dsa: change dsa_ptr for a dsa_port

2017-09-29 Thread Vivien Didelot
With DSA, a master net_device is physically wired to a dedicated CPU switch port. For interaction with the DSA layer, the struct net_device contains a dsa_ptr, which currently points to a dsa_switch_tree object. This is only valid for a switch fabric with a single CPU port. In order to support

[PATCH net-next 7/8] net: dsa: change dsa_ptr for a dsa_port

2017-09-29 Thread Vivien Didelot
With DSA, a master net device (CPU facing interface) has a dsa_ptr pointer to which hangs a dsa_switch_tree. This is not correct because a master interface is wired to a dedicated switch port, and because we can theoretically have several master interfaces pointing to several CPU ports of the same

[PATCH net-next 3/8] net: dsa: use cpu_dp in master code

2017-09-29 Thread Vivien Didelot
Make it clear that the master device is linked to a CPU port by using "cpu_dp" for the dsa_port variable in master.c instead of "port", then use a "port" variable to describe the port index, as usually seen in other places of DSA core. This will make the future patch touching dsa_ptr more

[PATCH net-next 6/8] net: dsa: prepare master receive hot path

2017-09-29 Thread Vivien Didelot
In preparation to make DSA master devices point to their corresponding CPU port instead of the whole tree, add copies of dst and rcv in the dsa_port structure so that we keep fast access in the receive hot path. Signed-off-by: Vivien Didelot ---

[PATCH net-next 4/8] net: dsa: use temporary dsa_device_ops variable

2017-09-29 Thread Vivien Didelot
When resolving the DSA tagging protocol used by a CPU switch, use a temporary "tag_ops" variable to store the dsa_device_ops instead of using directly dst->tag_ops. This will make the future patches moving this pointer around easier to read. There is no functional changes. Signed-off-by: Vivien

[PATCH net-next] hv_netvsc: report stop_queue and wake_queue

2017-09-29 Thread Simon Xiao
Report the numbers of events for stop_queue and wake_queue in ethtool stats. Example: ethtool -S eth0 NIC statistics: ... stop_queue: 7 wake_queue: 7 ... Signed-off-by: Simon Xiao Reviewed-by: Haiyang Zhang ---

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
The actual SPI access performance will depend on the SPI host controller. The SPI access speed, ranging from 12 MHz to 50 MHz depending on the chip, is a factor but the performance of the SPI host controller is more important. Generally the SPI host controller scales down the clock by a factor of

Re: [PATCHv4 iproute2 1/2] lib/libnetlink: re malloc buff if size is not enough

2017-09-29 Thread Michal Kubecek
On Fri, Sep 29, 2017 at 10:54:40AM -0700, Stephen Hemminger wrote: > On Thu, 28 Sep 2017 21:33:45 +0800 > Hangbin Liu wrote: > > > > > +static int __rtnl_recvmsg(int fd, struct msghdr *msg, int flags) > > +{ > > + int len; > > + > > + do { > > + len =

Re: [PATCH v4 net-next 0/8] flow_dissector: Protocol specific flow dissector offload

2017-09-29 Thread Tom Herbert
On Fri, Sep 29, 2017 at 10:59 AM, Tom Herbert wrote: > On Fri, Sep 29, 2017 at 10:42 AM, David Miller wrote: >> From: Tom Herbert >> Date: Fri, 29 Sep 2017 08:48:55 -0700 >> >>> The flow_dissector interface is not a uAPI. >> >>

Re: [PATCH v4 net-next 0/8] flow_dissector: Protocol specific flow dissector offload

2017-09-29 Thread Tom Herbert
On Fri, Sep 29, 2017 at 10:42 AM, David Miller wrote: > From: Tom Herbert > Date: Fri, 29 Sep 2017 08:48:55 -0700 > >> The flow_dissector interface is not a uAPI. > > That's not true, insofar as cls_flower.c uses the flow_dissector > therefore if you

Re: [PATCHv4 iproute2 1/2] lib/libnetlink: re malloc buff if size is not enough

2017-09-29 Thread Stephen Hemminger
On Thu, 28 Sep 2017 21:33:45 +0800 Hangbin Liu wrote: > > +static int __rtnl_recvmsg(int fd, struct msghdr *msg, int flags) > +{ > + int len; > + > + do { > + len = recvmsg(fd, msg, flags); > + } while (len < 0 && (errno == EINTR || errno == EAGAIN));

[PATCH net-next] bpf: Fix compiler warning on info.map_ids for 32bit platform

2017-09-29 Thread Martin KaFai Lau
This patch uses u64_to_user_ptr() to cast info.map_ids to a userspace ptr. It also tags the user_map_ids with '__user' for sparse check. Fixes: cb4d2b3f03d8 ("bpf: Add name, load_time, uid and map_ids to bpf_prog_info") Signed-off-by: Martin KaFai Lau --- kernel/bpf/syscall.c | 2

Re: netlink backwards compatibility in userspace tools

2017-09-29 Thread Rustad, Mark D
> On Sep 29, 2017, at 3:22 AM, Jason A. Donenfeld wrote: > > Hi guys, > > One handy aspect of Netlink is that it's backwards compatible. This > means that you can run old userspace utilities on new kernels, even if > the new kernel supports new features and netlink attributes.

Re: [PATCH v4 net-next 0/8] flow_dissector: Protocol specific flow dissector offload

2017-09-29 Thread David Miller
From: Tom Herbert Date: Fri, 29 Sep 2017 08:48:55 -0700 > The flow_dissector interface is not a uAPI. That's not true, insofar as cls_flower.c uses the flow_dissector therefore if you change the flow_dissector in certain ways then cls_flower.c might have it's behavior

Re: [PATCH][net-next] net_sched: remove redundant assignment to ret

2017-09-29 Thread Cong Wang
On Fri, Sep 29, 2017 at 7:01 AM, Colin King wrote: > From: Colin Ian King > > The assignment of -EINVAL to variable ret is redundant as it > is being overwritten on the following error exit paths or > to the return value from the following call

Re: [iproute PATCH v2 0/3] Check user supplied interface name lengths

2017-09-29 Thread Stephen Hemminger
On Wed, 27 Sep 2017 18:05:28 +0200 Phil Sutter wrote: > On Wed, Sep 27, 2017 at 08:42:49AM +0100, Stephen Hemminger wrote: > > On Tue, 26 Sep 2017 18:35:45 +0200 > > Phil Sutter wrote: > > > > > This series adds explicit checks for user-supplied interface names to >

Re: RFC iproute2 doc files

2017-09-29 Thread Stephen Hemminger
On Thu, 28 Sep 2017 09:18:04 +0200 Simon Horman wrote: > On Wed, Sep 20, 2017 at 08:11:59AM -0700, Stephen Hemminger wrote: > > I noticed that the iproute man pages are up to date but the LaTex > > documentation > > is very out of date. Rarely updated since the Linux

Re: [PATCH net-next 07/10] sctp: add sockopt to get/set stream scheduler

2017-09-29 Thread Marcelo Ricardo Leitner
On Fri, Sep 29, 2017 at 12:47:32PM -0400, Neil Horman wrote: > On Thu, Sep 28, 2017 at 05:25:20PM -0300, Marcelo Ricardo Leitner wrote: > > As defined per RFC Draft ndata Section 4.3.2, named as > > SCTP_STREAM_SCHEDULER. > > > > See-also:

  1   2   >