[PATCH net-next] net: sched: ingress: set 'unlocked' flag for Qdisc ops

2019-06-12 Thread Vlad Buslov
To remove rtnl lock dependency in tc filter update API when using ingress Qdisc, set QDISC_CLASS_OPS_DOIT_UNLOCKED flag in ingress Qdisc_class_ops. Ingress Qdisc ops don't require any modifications to be used without rtnl lock on tc filter update path. Ingress implementation never changes its q->b

[PATCH ipsec-next] xfrm: fix bogus WARN_ON with ipv6

2019-06-12 Thread Florian Westphal
net/xfrm/xfrm_input.c:378:17: warning: this statement may fall through [-Wimplicit-fallthrough=] skb->protocol = htons(ETH_P_IPV6); ... the fallthrough then causes a bogus WARN_ON(). Reported-by: Stephen Rothwell Fixes: 4c203b0454b ("xfrm: remove eth_proto value from xfrm_state_afinfo") Signed-

Re: DSA with MV88E6321 and imx28

2019-06-12 Thread Benjamin Beckmeyer
>> I captured a ping from my device to my computer to look if outgoing is >> working >> (captured on both devices). Here is the output from my device where i >> started the: >> >> 00:24:24.752057 ARP, Request who-has 192.168.10.2 tell 192.168.10.1, length >> 28 >> 0x: 0001 0800 0604

[RFC, net-next v0 2/2] net: phy: mscc: Add PHY driver for Cable Diagnostics command

2019-06-12 Thread Raju Lakkaraju
From: Raju Lakkaraju Add the Cable diagnostics command to VSC85xx PHYs. Signed-off-by: Raju Lakkaraju --- drivers/net/phy/mscc.c | 128 + 1 file changed, 128 insertions(+) diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c index 28676a

[RFC, net-next v0 0/2] Microsemi PHY cable

2019-06-12 Thread Raju Lakkaraju
This series of patches add the Microsemi PHY cable diagnostics command with PHY Netlink Interface. 1. phy_netlink.c and phy_netlink.h files add for PHY diagnostics features implementation through PHY Netlink interface. 2. phy.c contain the generic functions of "PHY diagnostics". This layer indepe

[RFC, net-next v0 1/2] net: phy: mscc: Add PHY Netlink Interface along with Cable Diagnostics command

2019-06-12 Thread Raju Lakkaraju
From: Raju Lakkaraju Add the PHY Netlink interface driver to implement the cable diagnostics of Microsemi Ethernet PHYs. Signed-off-by: Raju Lakkaraju --- drivers/net/phy/Kconfig | 6 ++ drivers/net/phy/Makefile | 1 + drivers/net/phy/phy.c | 17 drivers/net/phy/ph

[iproute2 net-next PATCH] ip: add a new parameter -Numeric

2019-06-12 Thread Hangbin Liu
Add a new parameter '-Numeric' to show the number of protocol, scope, dsfield, etc directly instead of converting it to human readable name. Do the same on tc and ss. This patch is based on David Ahern's previous patch. Suggested-by: Phil Sutter Signed-off-by: Hangbin Liu --- include/utils.h

Re: [iproute2 net-next PATCH] ip: add a new parameter -Numeric

2019-06-12 Thread Hangbin Liu
On Wed, 12 Jun 2019 at 17:21, Hangbin Liu wrote: > > Add a new parameter '-Numeric' to show the number of protocol, scope, > dsfield, etc directly instead of converting it to human readable name. > Do the same on tc and ss. > > This patch is based on David Ahern's previous patch. > > Suggested-by:

Re: [PATCH bpf-next v3 2/3] bpf_xdp_redirect_map: Perform map lookup in eBPF helper

2019-06-12 Thread Toke Høiland-Jørgensen
Jakub Kicinski writes: > On Tue, 11 Jun 2019 17:44:00 +0200, Toke Høiland-Jørgensen wrote: >> +#define XDP_REDIRECT_INVALID_MASK (XDP_ABORTED | XDP_DROP | XDP_PASS | >> XDP_TX) > > It feels a little strange to OR in values which are not bits, even if > it happens to work today (since those are v

[PATCH net-next v3 0/2] net/mlx5: use indirect call wrappers

2019-06-12 Thread Paolo Abeni
The mlx5_core driver uses several indirect calls in fast-path, some of them are invoked on each ingress packet, even for the XDP-only traffic. This series leverage the indirect call wrappers infrastructure the avoid the expansive RETPOLINE overhead for 2 indirect calls in fast-path. Each call is

[PATCH net-next v3 2/2] net/mlx5e: use indirect calls wrapper for the rx packet handler

2019-06-12 Thread Paolo Abeni
We can avoid another indirect call per packet wrapping the rx handler call with the proper helper. To ensure that even the last listed direct call experience measurable gain, despite the additional conditionals we must traverse before reaching it, I tested reversing the order of the listed options

[PATCH net-next v3 1/2] net/mlx5e: use indirect calls wrapper for skb allocation

2019-06-12 Thread Paolo Abeni
We can avoid an indirect call per packet wrapping the skb creation with the appropriate helper. Signed-off-by: Paolo Abeni --- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 22 ++- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5

[PATCH] bpf: optimize constant blinding

2019-06-12 Thread Naveen N. Rao
Currently, for constant blinding, we re-allocate the bpf program to account for its new size and adjust all branches to accommodate the same, for each BPF instruction that needs constant blinding. This is inefficient and can lead to soft lockup with sufficiently large programs, such as the new veri

[PATCH net-next 2/2] ipoib: show VF broadcast address

2019-06-12 Thread Denis Kirjanov
in IPoIB case we can't see a VF broadcast address for but can see for PF Before: 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/infiniband 80:00:00:66:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a4:3e:7c brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:f

[PATCH 1/2] ipoib: correcly show a VF hardware address

2019-06-12 Thread Denis Kirjanov
in the case of IPoIB with SRIOV enabled hardware ip link show command incorrecly prints 0 instead of a VF hardware address. To correcly print the address add a new field to specify an address length. Before: 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/

[PATCH net-next 1/2] ipoib: correcly show a VF hardware address

2019-06-12 Thread Denis Kirjanov
in the case of IPoIB with SRIOV enabled hardware ip link show command incorrecly prints 0 instead of a VF hardware address. To correcly print the address add a new field to specify an address length. Before: 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/

[PATCH 2/2] ipoib: show VF broadcast address

2019-06-12 Thread Denis Kirjanov
in IPoIB case we can't see a VF broadcast address for but can see for PF Before: 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/infiniband 80:00:00:66:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a4:3e:7c brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:f

Re: [PATCH net-next 2/2] ipoib: show VF broadcast address

2019-06-12 Thread Denis Kirjanov
On 6/12/19, Michal Kubecek wrote: > On Wed, Jun 12, 2019 at 01:33:48PM +0200, Denis Kirjanov wrote: >> in IPoIB case we can't see a VF broadcast address for but >> can see for PF >> >> Before: >> 11: ib1: mtu 2044 qdisc pfifo_fast >> state UP mode DEFAULT group default qlen 256 >> link/infini

tc tp creation performance degratation since kernel 5.1

2019-06-12 Thread Jiri Pirko
Hi. I came across serious performance degradation when adding many tps. I'm using following script: #!/bin/bash dev=testdummy ip link add name $dev type dummy ip link set dev $dev up tc qdisc add dev $dev ingress tmp_file_

Re: [PATCH net-next 2/2] ipoib: show VF broadcast address

2019-06-12 Thread Michal Kubecek
On Wed, Jun 12, 2019 at 01:33:48PM +0200, Denis Kirjanov wrote: > in IPoIB case we can't see a VF broadcast address for but > can see for PF > > Before: > 11: ib1: mtu 2044 qdisc pfifo_fast > state UP mode DEFAULT group default qlen 256 > link/infiniband > 80:00:00:66:fe:80:00:00:00:00:00:00:

Re: [PATCH net-next 1/2] ipoib: correcly show a VF hardware address

2019-06-12 Thread Michal Kubecek
On Wed, Jun 12, 2019 at 01:33:47PM +0200, Denis Kirjanov wrote: > in the case of IPoIB with SRIOV enabled hardware > ip link show command incorrecly prints > 0 instead of a VF hardware address. To correcly print the address > add a new field to specify an address length. > > Before: > 11: ib1: mt

[PATCH rdma-next v1 3/4] RDMA/mlx5: Consider eswitch encap mode

2019-06-12 Thread Leon Romanovsky
From: Maor Gottlieb When flow steering is created, then the encap support should consider the eswitch encap mode. If the eswitch flow table (FDB) supports encap then it shouldn't be supported on NIC RX flow tables. Fixes: 4adda1122c490 ('RDMA/mlx5: Enable decap and packet reformat on flow table

[PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode

2019-06-12 Thread Leon Romanovsky
From: Leon Romanovsky Devlink has UAPI declaration for encap mode, so there is no need to be loose on the data get/set by drivers. Update call sites to use enum devlink_eswitch_encap_mode instead of plain u8. Suggested-by: Parav Pandit Signed-off-by: Leon Romanovsky --- drivers/net/ethernet/

[PATCH rdma-next v1 4/4] RDMA/mlx5: Enable decap and packet reformat on FDB

2019-06-12 Thread Leon Romanovsky
From: Maor Gottlieb If FDB flow tables support decap operation, enable it on creation, This allows to perform decapsulation of tunnelled packets by steering rules. If FDB flow tables support reformat operation, enable it on creation as well. Signed-off-by: Maor Gottlieb Reviewed-by: Petr Vorel

[PATCH mlx5-next v1 2/4] net/mlx5: Expose eswitch encap mode

2019-06-12 Thread Leon Romanovsky
From: Maor Gottlieb Add API to get the current Eswitch encap mode. It will be used in downstream patches to check if flow table can be created with encap support or not. Signed-off-by: Maor Gottlieb Reviewed-by: Petr Vorel Signed-off-by: Leon Romanovsky --- drivers/net/ethernet/mellanox/mlx5

[PATCH rdma-next v1 0/4] Expose ENCAP mode to mlx5_ib

2019-06-12 Thread Leon Romanovsky
From: Leon Romanovsky Changelog v0->v1: * Added patch to devlink to use declared enum for encap mode instead of u8 * Constify input argumetn to encap mode function * fix encap variable type to be boolean - Hi, This is short

Re: [PATCH net-next 1/2] ipoib: correcly show a VF hardware address

2019-06-12 Thread Denis Kirjanov
On 6/12/19, Michal Kubecek wrote: > On Wed, Jun 12, 2019 at 01:33:47PM +0200, Denis Kirjanov wrote: >> in the case of IPoIB with SRIOV enabled hardware >> ip link show command incorrecly prints >> 0 instead of a VF hardware address. To correcly print the address >> add a new field to specify an ad

Re: tc tp creation performance degratation since kernel 5.1

2019-06-12 Thread Paolo Abeni
Hi, On Wed, 2019-06-12 at 14:03 +0200, Jiri Pirko wrote: > I did simple prifiling using perf. Output on 5.1 kernel: > 77.85% tc [kernel.kallsyms] [k] tcf_chain_tp_find > 3.30% tc [kernel.kallsyms] [k] > _raw_spin_unlock_irqrestore > 1.33% tc_pref_sca

Re: tc tp creation performance degratation since kernel 5.1

2019-06-12 Thread Vlad Buslov
On Wed 12 Jun 2019 at 15:03, Jiri Pirko wrote: > Hi. > > I came across serious performance degradation when adding many tps. I'm > using following script: > > > #!/bin/bash > > dev=testdummy > ip link add name $dev type dumm

Re: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode

2019-06-12 Thread Petr Vorel
Hi Leon, > From: Leon Romanovsky > Devlink has UAPI declaration for encap mode, so there is no > need to be loose on the data get/set by drivers. > Update call sites to use enum devlink_eswitch_encap_mode > instead of plain u8. > Suggested-by: Parav Pandit > Signed-off-by: Leon Romanovsky >

[PATCH net-next 0/3] Add MPLS actions to TC

2019-06-12 Thread John Hurley
This patchset introduces a new TC action module that allows the manipulation of the MPLS headers of packets. The code impliments functionality including push, pop, and modify. Also included is a update to the IR action preparation code to allow the new MPLS actions to be offloaded to HW. John Hur

[PATCH net-next 1/3] net: sched: add mpls manipulation actions to TC

2019-06-12 Thread John Hurley
Currently, TC offers the ability to match on the MPLS fields of a packet through the use of the flow_dissector_key_mpls struct. However, as yet, TC actions do not allow the modification or manipulation of such fields. Add a new module that registers TC action ops to allow manipulation of MPLS. Thi

[PATCH net-next 2/3] net: sched: include mpls actions in hardware intermediate representation

2019-06-12 Thread John Hurley
A recent addition to TC actions is the ability to manipulate the MPLS headers on packets. In preparation to offload such actions to hardware, update the IR code to accept and prepare the new actions. Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski --- include/net/flow_offload.h | 10 +

[PATCH net-next 3/3] selftests: tc-tests: actions: add MPLS tests

2019-06-12 Thread John Hurley
Add a new series of selftests to verify the functionality of act_mpls in TC. Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski --- .../tc-testing/tc-tests/actions/mpls.json | 744 + 1 file changed, 744 insertions(+) create mode 100644 tools/testing/selftests/

[PATCH bpf] bpf: Simplify definition of BPF_FIB_LOOKUP related flags

2019-06-12 Thread Martynas Pumputis
Previously, the BPF_FIB_LOOKUP_{DIRECT,OUTPUT} flags were defined with the help of BIT macro. This had the following issues: - In order to user any of the flags, a user was required to depend on . - No other flag in bpf.h uses the macro, so it seems that an unwritten convention is to use (1 <<

Fw: [Bug 203867] New: invalid parameter to NL_SET_ERR_MSG_ATTR() in vxlan.c and geneve.c

2019-06-12 Thread Stephen Hemminger
Begin forwarded message: Date: Wed, 12 Jun 2019 07:49:06 + From: bugzilla-dae...@bugzilla.kernel.org To: step...@networkplumber.org Subject: [Bug 203867] New: invalid parameter to NL_SET_ERR_MSG_ATTR() in vxlan.c and geneve.c https://bugzilla.kernel.org/show_bug.cgi?id=203867

Re: [PATCH net-next] net: axienet: move use of resource after validity check

2019-06-12 Thread Andrew Lunn
On Tue, Jun 11, 2019 at 10:56:02AM -0600, Robert Hancock wrote: > We were accessing the pointer returned from platform_get_resource before > checking if it was valid, causing an oops if it was not. Move this access > after the call to devm_ioremap_resource which does the validity check. > > Signed

Re: net-next: KSZ switch driver oops in ksz_mib_read_work

2019-06-12 Thread Andrew Lunn
On Tue, Jun 11, 2019 at 04:27:47PM -0700, Florian Fainelli wrote: > On 6/11/19 10:57 AM, Robert Hancock wrote: > > We are using an embedded platform with a KSZ9897 switch. I am getting > > the oops below in ksz_mib_read_work when testing with net-next branch. > > After adding in some debug output,

Re: [PATCH bpf-next v3 0/5] net: xdp: refactor XDP program queries

2019-06-12 Thread Jonathan Lemon
On 11 Jun 2019, at 0:24, Björn Töpel wrote: > On 2019-06-11 00:24, Jakub Kicinski wrote: >> On Mon, 10 Jun 2019 18:02:29 +0200, Björn Töpel wrote: >>> Jakub, what's your thoughts on the special handling of XDP offloading? >>> Maybe it's just overkill? Just allocate space for the offloaded >>> p

Re: [PATCH] bpf: optimize constant blinding

2019-06-12 Thread Alexei Starovoitov
On Wed, Jun 12, 2019 at 4:32 AM Naveen N. Rao wrote: > > Currently, for constant blinding, we re-allocate the bpf program to > account for its new size and adjust all branches to accommodate the > same, for each BPF instruction that needs constant blinding. This is > inefficient and can lead to so

Re: [PATCH bpf] bpf: net: Set sk_bpf_storage back to NULL for cloned sk

2019-06-12 Thread Daniel Borkmann
On 06/11/2019 11:45 PM, Martin KaFai Lau wrote: > The cloned sk should not carry its parent-listener's sk_bpf_storage. > This patch fixes it by setting it back to NULL. > > Fixes: 6ac99e8f23d4 ("bpf: Introduce bpf sk local storage") > Signed-off-by: Martin KaFai Lau Applied, thanks!

Re: [PATCH bpf] bpf: Simplify definition of BPF_FIB_LOOKUP related flags

2019-06-12 Thread Alexei Starovoitov
On Wed, Jun 12, 2019 at 6:25 AM Martynas Pumputis wrote: > > Previously, the BPF_FIB_LOOKUP_{DIRECT,OUTPUT} flags were defined > with the help of BIT macro. This had the following issues: > > - In order to user any of the flags, a user was required to depend > on . > - No other flag in bpf.h use

[PATCH] sunrpc: no need to check return value of debugfs_create functions

2019-06-12 Thread Greg Kroah-Hartman
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Trond Myklebust Cc: Anna Schumaker Cc: linux-...@vger.kernel.org Cc: n

Re: [PATCH] bpf: optimize constant blinding

2019-06-12 Thread Jiong Wang
Alexei Starovoitov writes: > On Wed, Jun 12, 2019 at 4:32 AM Naveen N. Rao > wrote: >> >> Currently, for constant blinding, we re-allocate the bpf program to >> account for its new size and adjust all branches to accommodate the >> same, for each BPF instruction that needs constant blinding. Th

Transmit VLAN with AF_PACKET

2019-06-12 Thread Stephen Hemminger
Sending VLAN packets through AF_PACKET over Hyper-V netvsc driver doesn't work now. The question is what is best option for fixing it? AF_PACKET handles VLAN stripping on receive, but there currently is no mechanism for VLAN offload on transmit. Instead an application may form a raw packet with a

Re: [PATCH] bpf: optimize constant blinding

2019-06-12 Thread Jiong Wang
Jiong Wang writes: > Alexei Starovoitov writes: > >> On Wed, Jun 12, 2019 at 4:32 AM Naveen N. Rao >> wrote: >>> >>> Currently, for constant blinding, we re-allocate the bpf program to >>> account for its new size and adjust all branches to accommodate the >>> same, for each BPF instruction tha

Re: [PATCH] bpf: optimize constant blinding

2019-06-12 Thread Alexei Starovoitov
On Wed, Jun 12, 2019 at 8:25 AM Jiong Wang wrote: > > > Jiong Wang writes: > > > Alexei Starovoitov writes: > > > >> On Wed, Jun 12, 2019 at 4:32 AM Naveen N. Rao > >> wrote: > >>> > >>> Currently, for constant blinding, we re-allocate the bpf program to > >>> account for its new size and adjust

[PATCH RFC 3/3] net: ethtool: self_test: Mark interface in testing operative status

2019-06-12 Thread Andrew Lunn
When an interface is executing a self test, put the interface into operative status testing. Signed-off-by: Andrew Lunn --- net/core/ethtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/ethtool.c b/net/core/ethtool.c index d08b1e19ce9c..f86070effd61 100644 --- a/net/core/etht

[PATCH RFC 1/3] net: Add IF_OPER_TESTING

2019-06-12 Thread Andrew Lunn
RFC 2863 defines the operational state testing. Add support for this state, both as a IF_LINK_MODE_ and __LINK_STATE_. Signed-off-by: Andrew Lunn --- include/linux/netdevice.h | 41 +++ include/uapi/linux/if.h | 1 + net/core/dev.c| 5 + ne

[PATCH RFC 0/3] RFC 2863 Testing Oper status

2019-06-12 Thread Andrew Lunn
This patchset add support for RFC 2863 Oper status testing. An interface is placed into this state when a self test is performed using ethtool. Andrew Lunn (3): net: Add IF_OPER_TESTING net: Add testing sysfs attribute net: ethtool: self_test: Mark interface in testing operative status Do

[PATCH RFC 2/3] net: Add testing sysfs attribute

2019-06-12 Thread Andrew Lunn
Similar to speed, duplex and dorment, report the testing status in sysfs. Signed-off-by: Andrew Lunn --- Documentation/ABI/testing/sysfs-class-net | 13 + net/core/net-sysfs.c | 15 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Do

Re: [PATCH iproute2] testsuite: don't clobber /tmp

2019-06-12 Thread Stephen Hemminger
On Tue, 11 Jun 2019 20:03:26 +0200 Matteo Croce wrote: > Even if not running the testsuite, every build will leave > a stale tc_testkenv.* file in the system temp directory. > Conditionally create the temp file only if we're running the testsuite. > > Signed-off-by: Matteo Croce > --- > testsu

[PATCH bpf-next v4 03/17] xsk: Add getsockopt XDP_OPTIONS

2019-06-12 Thread Maxim Mikityanskiy
Make it possible for the application to determine whether the AF_XDP socket is running in zero-copy mode. To achieve this, add a new getsockopt option XDP_OPTIONS that returns flags. The only flag supported for now is the zero-copy mode indicator. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Ta

[PATCH bpf-next v4 02/17] xsk: Add API to check for available entries in FQ

2019-06-12 Thread Maxim Mikityanskiy
Add a function that checks whether the Fill Ring has the specified amount of descriptors available. It will be useful for mlx5e that wants to check in advance, whether it can allocate a bulk of RX descriptors, to get the best performance. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Touka

[PATCH bpf-next v4 01/17] net/mlx5e: Attach/detach XDP program safely

2019-06-12 Thread Maxim Mikityanskiy
When an XDP program is set, a full reopen of all channels happens in two cases: 1. When there was no program set, and a new one is being set. 2. When there was a program set, but it's being unset. The full reopen is necessary, because the channel parameters may change if XDP is enabled or disabl

[PATCH bpf-next v4 04/17] libbpf: Support getsockopt XDP_OPTIONS

2019-06-12 Thread Maxim Mikityanskiy
Query XDP_OPTIONS in libbpf to determine if the zero-copy mode is active or not. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- tools/lib/bpf/xsk.c | 12 1 file changed, 12 insertions(+) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xs

[PATCH bpf-next v4 08/17] net/mlx5e: Replace deprecated PCI_DMA_TODEVICE

2019-06-12 Thread Maxim Mikityanskiy
The PCI API for DMA is deprecated, and PCI_DMA_TODEVICE is just defined to DMA_TO_DEVICE for backward compatibility. Just use DMA_TO_DEVICE. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 +- 1 file

[PATCH bpf-next v4 05/17] xsk: Change the default frame size to 4096 and allow controlling it

2019-06-12 Thread Maxim Mikityanskiy
The typical XDP memory scheme is one packet per page. Change the AF_XDP frame size in libbpf to 4096, which is the page size on x86, to allow libbpf to be used with the drivers with the packet-per-page scheme. Add a command line option -f to xdpsock to allow to specify a custom frame size. Signed

[PATCH bpf-next v4 12/17] net/mlx5e: Share the XDP SQ for XDP_TX between RQs

2019-06-12 Thread Maxim Mikityanskiy
Put the XDP SQ that is used for XDP_TX into the channel. It used to be a part of the RQ, but with introduction of AF_XDP there will be one more RQ that could share the same XDP SQ. This patch is a preparation for that change. Separate XDP_TX statistics per RQ were implemented in one of the previou

[PATCH bpf-next v4 10/17] net/mlx5e: Allow ICO SQ to be used by multiple RQs

2019-06-12 Thread Maxim Mikityanskiy
Prepare to creation of the XSK RQ, which will require posting UMRs, too. The same ICO SQ will be used for both RQs and also to trigger interrupts by posting NOPs. UMR WQEs can't be reused any more. Optimization introduced in commit ab966d7e4ff98 ("net/mlx5e: RX, Recycle buffer of UMR WQEs") is reve

[PATCH bpf-next v4 07/17] libbpf: Support drivers with non-combined channels

2019-06-12 Thread Maxim Mikityanskiy
Currently, libbpf uses the number of combined channels as the maximum queue number. However, the kernel has a different limitation: - xdp_reg_umem_at_qid() allows up to max(RX queues, TX queues). - ethtool_set_channels() checks for UMEMs in queues up to combined_count + max(rx_count, tx_count).

[PATCH bpf-next v4 13/17] net/mlx5e: XDP_TX from UMEM support

2019-06-12 Thread Maxim Mikityanskiy
When an XDP program returns XDP_TX, and the RQ is XSK-enabled, it requires careful handling, because convert_to_xdp_frame creates a new page and copies the data there, while our driver expects the xdp_frame to point to the same memory as the xdp_buff. Handle this case separately: map the page, and

[PATCH bpf-next v4 11/17] net/mlx5e: Refactor struct mlx5e_xdp_info

2019-06-12 Thread Maxim Mikityanskiy
Currently, struct mlx5e_xdp_info has some issues that have to be cleaned up before the upcoming AF_XDP support makes things too complicated and messy. This structure is used both when sending the packet and on completion. Moreover, the cleanup procedure on completion depends on the origin of the pa

[PATCH bpf-next v4 15/17] net/mlx5e: Encapsulate open/close queues into a function

2019-06-12 Thread Maxim Mikityanskiy
Create new functions mlx5e_{open,close}_queues to encapsulate opening and closing RQs and SQs, and call the new functions from mlx5e_{open,close}_channel. It simplifies the existing functions a bit and prepares them for the upcoming AF_XDP changes. Signed-off-by: Maxim Mikityanskiy Reviewed-by: T

[PATCH bpf-next v4 14/17] net/mlx5e: Consider XSK in XDP MTU limit calculation

2019-06-12 Thread Maxim Mikityanskiy
Use the existing mlx5e_get_linear_rq_headroom function to calculate the headroom for mlx5e_xdp_max_mtu. This function takes the XSK headroom into consideration, which will be used in the following patches. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed ---

[PATCH bpf-next v4 09/17] net/mlx5e: Calculate linear RX frag size considering XSK

2019-06-12 Thread Maxim Mikityanskiy
Additional conditions introduced: - XSK implies XDP. - Headroom includes the XSK headroom if it exists. - No space is reserved for struct shared_skb_info in XSK mode. - Fragment size smaller than the XSK chunk size is not allowed. A new auxiliary function mlx5e_get_linear_rq_headroom with the sup

[PATCH bpf-next v4 06/17] xsk: Return the whole xdp_desc from xsk_umem_consume_tx

2019-06-12 Thread Maxim Mikityanskiy
Some drivers want to access the data transmitted in order to implement acceleration features of the NICs. It is also useful in AF_XDP TX flow. Change the xsk_umem_consume_tx API to return the whole xdp_desc, that contains the data pointer, length and DMA address, instead of only the latter two. Ad

[PATCH bpf-next v4 16/17] net/mlx5e: Move queue param structs to en/params.h

2019-06-12 Thread Maxim Mikityanskiy
structs mlx5e_{rq,sq,cq,channel}_param are going to be used in the upcoming XSK RX and TX patches. Move them to a header file to make them accessible from other C files. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/en/

[PATCH bpf-next v4 00/17] AF_XDP infrastructure improvements and mlx5e support

2019-06-12 Thread Maxim Mikityanskiy
This series contains improvements to the AF_XDP kernel infrastructure and AF_XDP support in mlx5e. The infrastructure improvements are required for mlx5e, but also some of them benefit to all drivers, and some can be useful for other drivers that want to implement AF_XDP. The performance testing w

Re: [iproute2 net-next PATCH] ip: add a new parameter -Numeric

2019-06-12 Thread Roman Mashak
Hangbin Liu writes: > Add a new parameter '-Numeric' to show the number of protocol, scope, > dsfield, etc directly instead of converting it to human readable name. > Do the same on tc and ss. > > This patch is based on David Ahern's previous patch. > [...] It would be good idea to specify the

[PATCH bpf v2 1/2] bpf: simplify definition of BPF_FIB_LOOKUP related flags

2019-06-12 Thread Martynas Pumputis
Previously, the BPF_FIB_LOOKUP_{DIRECT,OUTPUT} flags were defined with the help of BIT macro. This had the following issues: - In order to user any of the flags, a user was required to depend on . - No other flag in bpf.h uses the macro, so it seems that an unwritten convention is to use (1 <<

[PATCH bpf v2 2/2] bpf: sync BPF_FIB_LOOKUP flag changes with BPF uapi

2019-06-12 Thread Martynas Pumputis
Sync the changes to the flags made in "bpf: simplify definition of BPF_FIB_LOOKUP related flags" with the BPF uapi headers. Doing in a separate commit to ease syncing of github/libbpf. Signed-off-by: Martynas Pumputis --- tools/include/uapi/linux/bpf.h | 4 ++-- 1 file changed, 2 insertions(+),

Re: [PATCH iproute2] testsuite: don't clobber /tmp

2019-06-12 Thread Matteo Croce
On Wed, Jun 12, 2019 at 5:55 PM Stephen Hemminger wrote: > > On Tue, 11 Jun 2019 20:03:26 +0200 > Matteo Croce wrote: > > > Even if not running the testsuite, every build will leave > > a stale tc_testkenv.* file in the system temp directory. > > Conditionally create the temp file only if we're r

[PATCH RFC 08/13] net: phy: Add helpers for reporting test results

2019-06-12 Thread Andrew Lunn
The PHY drivers can use these helpers for reporting the results. The results get translated into netlink attributes which are added to the pre-allocated skbuf. Signed-off-by: Andrew Lunn --- drivers/net/phy/phy.c | 47 +++ include/linux/phy.h | 4

[PATCH RFC 01/13] net: phy: Add cable test support to state machine

2019-06-12 Thread Andrew Lunn
Running a cable test is desruptive to normal operation of the PHY and can take a 5 to 10 seconds to complete. The RTNL lock cannot be held for this amount of time, and add a new state to the state machine for running a cable test. The driver is expected to implement two functions. The first is use

[PATCH RFC 07/13] net: phy: cable test: Use request seq in broadcast reply

2019-06-12 Thread Andrew Lunn
An ethtool netlink action is used to start the cable test. Use the sequence number from this action in the multicast later used to send the results of the cable test, so that the results can be match back to the request. Signed-off-by: Andrew Lunn --- drivers/net/phy/phy.c | 5 +++-- i

[PATCH RFC 06/13] net: phy: Add infrastructure for reporting cable test results

2019-06-12 Thread Andrew Lunn
Provide infrastrucutre for PHY drivers to report the cable test results. A netlink skb is associated to the phydev. Helpers will be added which can add results to this skb. Once the test has finished the results are sent to user space. Signed-off-by: Andrew Lunn --- drivers/net/phy/phy.c | 44 +

[PATCH RFC 04/13] net: ethtool: Add Properties for cable test reports.

2019-06-12 Thread Andrew Lunn
Add the attributes needed to report cable test results to userspace. The reports are expected to be per twisted pair. A nested property per pair can report the result of the cable test, and length of the cable to any fault. More attributes can be added later for other types of fault or measurement.

[PATCH RFC 03/13] net: ethtool: netlink: Add support for triggering a cable test

2019-06-12 Thread Andrew Lunn
Add new ethtool netlink calls to trigger the starting of a PHY cable test. Signed-off-by: Andrew Lunn --- drivers/net/phy/Kconfig | 1 + include/uapi/linux/ethtool_netlink.h | 12 + net/ethtool/actions.c| 77 net/ethtool/netlink.c

[PATCH RFC 00/13] Ethernet PHY cable test support

2019-06-12 Thread Andrew Lunn
This patchset adds support for executing Ethernet PHY cable tests and reporting the results back to user space. The Marvell PHY driver has been extended so some of its cable test features can be used. It builds upon the work of Michal Kubecek adding a netlink version of ethtool. As such, that work

[PATCH RFC 09/13] net: phy: marvell: Add cable test support

2019-06-12 Thread Andrew Lunn
The Marvell PHYs have a couple of different register sets for performing cable tests. Page 7 provides the simplest to use. However, it does not provide cable length, only length to a fault, when there is a fault. Signed-off-by: Andrew Lunn --- drivers/net/phy/marvell.c | 198

[PATCH RFC 11/13] net: phy: Add helpers and attributes for amplitude graph

2019-06-12 Thread Andrew Lunn
The amplitude graph needs to return the measured amplitude of the reflected signal for each pair. Add a helper to store such a measurement into the results skbuf. The size of the transmitted pulse affects the size of the measured pulse. So add a helper to report the pulse size. For a 100m cable, a

[PATCH RFC 02/13] net: phy: Add support for polling cable test

2019-06-12 Thread Andrew Lunn
Some PHYs are not capable of generating interrupts when a cable test finished. They do however support interrupts for normal operations, like link up/down. As such, the PHY state machine would normally not poll the PHY. Add support for indicating the PHY state machine must poll the PHY when perfor

[PATCH RFC 05/13] net: ethtool: Make helpers public

2019-06-12 Thread Andrew Lunn
Move Some helpers for building ethtool netlink messages into public locations so drivers can make use of them. Signed-off-by: Andrew Lunn --- include/linux/ethtool_netlink.h | 11 +++ net/ethtool/netlink.h | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git

[PATCH RFC 12/13] net: phy: marvell: Add support for amplitude graph

2019-06-12 Thread Andrew Lunn
The Marvell PHYs can measure the amplitude of the returned signal for a given distance. Implement this option of the cable test infrastructure. Signed-off-by: Andrew Lunn --- drivers/net/phy/marvell.c | 178 +- 1 file changed, 175 insertions(+), 3 deletions(-)

[PATCH RFC 13/13] net: phy: Put interface into oper testing during cable test

2019-06-12 Thread Andrew Lunn
Since running a cable test is disruptive, put the interface into operative state testing while the test is running. Signed-off-by: Andrew Lunn --- drivers/net/phy/phy.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c

[PATCH RFC 10/13] net: phy: Allow options to be passed to the cable test

2019-06-12 Thread Andrew Lunn
Some PHYs can do more than just measure the distance to a fault. But these additional actions are expensive. So allow options to be passed to enable these additional actions. Signed-off-by: Andrew Lunn --- drivers/net/phy/marvell.c| 6 +- drivers/net/phy/phy.c|

[PATCH bpf-next] net: Don't uninstall an XDP program when none is installed

2019-06-12 Thread Maxim Mikityanskiy
dev_change_xdp_fd doesn't perform any checks in case it uninstalls an XDP program. It means that the driver's ndo_bpf can be called with XDP_SETUP_PROG asking to set it to NULL even if it's already NULL. This case happens if the user runs `ip link set eth0 xdp off` when there is no XDP program atta

Re: [PATCH net-next] net: sched: ingress: set 'unlocked' flag for Qdisc ops

2019-06-12 Thread David Miller
From: Vlad Buslov Date: Wed, 12 Jun 2019 10:14:35 +0300 > To remove rtnl lock dependency in tc filter update API when using ingress > Qdisc, set QDISC_CLASS_OPS_DOIT_UNLOCKED flag in ingress Qdisc_class_ops. > > Ingress Qdisc ops don't require any modifications to be used without rtnl > lock on

Re: [PATCH net-next] net: sched: ingress: set 'unlocked' flag for Qdisc ops

2019-06-12 Thread Daniel Borkmann
On 06/12/2019 09:14 AM, Vlad Buslov wrote: > To remove rtnl lock dependency in tc filter update API when using ingress > Qdisc, set QDISC_CLASS_OPS_DOIT_UNLOCKED flag in ingress Qdisc_class_ops. > > Ingress Qdisc ops don't require any modifications to be used without rtnl > lock on tc filter updat

[PATCH bpf-next] bpf: Add support for fq's EDT to HBM

2019-06-12 Thread brakmo
Adds support for fq's Earliest Departure Time to HBM (Host Bandwidth Manager). Includes a new BPF program supporting EDT, and also updates corresponding programs. It will drop packets with and EDT of more than 500us in the future unless the packet belongs to a flow with less than 2 packets in flig

[PATCH net-next] net: dsa: mv88e6xxx: lock mutex in port_fdb_dump

2019-06-12 Thread Vivien Didelot
During a port FDB dump operation, the mutex protecting the concurrent access to the switch registers is currently held by the internal mv88e6xxx_port_db_dump and mv88e6xxx_port_db_dump_fid helpers. It must be held at the higher level in mv88e6xxx_port_fdb_dump which is called directly by DSA throu

Re: [PATCH net] mpls: fix af_mpls dependencies for real

2019-06-12 Thread David Miller
From: Matteo Croce Date: Wed, 12 Jun 2019 11:50:37 +0200 > Randy reported that selecting MPLS_ROUTING without PROC_FS breaks > the build, because since commit c1a9d65954c6 ("mpls: fix af_mpls > dependencies"), MPLS_ROUTING selects PROC_SYSCTL, but Kconfig's select > doesn't recursively handle dep

[PATCH net-next 0/8] net/packet: better behavior under DDOS

2019-06-12 Thread Eric Dumazet
Using tcpdump (or other af_packet user) on a busy host can lead to catastrophic consequences, because suddenly, potentially all cpus are spinning on a contended spinlock. Both packet_rcv() and tpacket_rcv() grab the spinlock to eventually find there is no room for an additional packet. This patch

[PATCH net-next 1/8] net/packet: constify __packet_get_status() argument

2019-06-12 Thread Eric Dumazet
struct packet_sock is only read. Signed-off-by: Eric Dumazet --- net/packet/af_packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 7fa847dcea30e481b2f291cc6980a7b887629cd7..66fcfd5b51f82a861795e002e91d3cbc69ab545a

[PATCH net-next 2/8] net/packet: constify packet_lookup_frame() and __tpacket_has_room()

2019-06-12 Thread Eric Dumazet
Goal is to be able to use __tpacket_has_room() without holding a lock. Signed-off-by: Eric Dumazet --- net/packet/af_packet.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 66fcfd5b51f82a861795e002e91d3cbc

Re: [PATCH v2 1/2] net: ethernet: wiznet: w5X00 add device tree support

2019-06-12 Thread David Miller
From: Nicolas Saenz Julienne Date: Wed, 12 Jun 2019 14:25:25 +0200 > The w5X00 chip provides an SPI to Ethernet inteface. This patch allows > platform devices to be defined through the device tree. > > Signed-off-by: Nicolas Saenz Julienne Applied to net-next.

[PATCH net-next 3/8] net/packet: constify prb_lookup_block() and __tpacket_v3_has_room()

2019-06-12 Thread Eric Dumazet
Goal is to be able to use __tpacket_v3_has_room() without holding a lock. Signed-off-by: Eric Dumazet --- net/packet/af_packet.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 273bffd2130d36cceb9947540a851

[PATCH net-next 5/8] net/packet: make tp_drops atomic

2019-06-12 Thread Eric Dumazet
Under DDOS, we want to be able to increment tp_drops without touching the spinlock. This will help readers to drain the receive queue slightly faster :/ Signed-off-by: Eric Dumazet --- net/packet/af_packet.c | 20 +++- net/packet/internal.h | 1 + 2 files changed, 12 insertions

Re: [PATCH v2 1/2] net: ethernet: wiznet: w5X00 add device tree support

2019-06-12 Thread Nicolas Saenz Julienne
On Wed, 2019-06-12 at 09:52 -0700, David Miller wrote: > From: Nicolas Saenz Julienne > Date: Wed, 12 Jun 2019 14:25:25 +0200 > > > The w5X00 chip provides an SPI to Ethernet inteface. This patch allows > > platform devices to be defined through the device tree. > > > > Signed-off-by: Nicolas Sa

  1   2   >