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

2019-06-12 Thread Jakub Kicinski
On Wed, 12 Jun 2019 16:14:18 +, Maxim Mikityanskiy wrote: > 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

Re: [PATCH net] net: dsa: microchip: Don't try to read stats for unused ports

2019-06-12 Thread Andrew Lunn
On Wed, Jun 12, 2019 at 02:33:32PM -0600, Robert Hancock wrote: > If some of the switch ports were not listed in the device tree, due to > being unused, the ksz_mib_read_work function ended up accessing a NULL > dp->slave pointer and causing an oops. Skip checking statistics for any > unused ports.

[PATCH net-next 0/2] Microchip KSZ driver enhancements

2019-06-12 Thread Robert Hancock
A couple of enhancements to the Microchip KSZ switch driver: one to add PHY register settings for errata workarounds for more stable operation, and another to add a device tree option to change the output clock rate as required by some board designs. Robert Hancock (2): net: dsa: microchip: Add

[PATCH net-next 2/2] net: dsa: microchip: Support optional 125MHz SYNCLKO output

2019-06-12 Thread Robert Hancock
The KSZ9477 series chips have a SYNCLKO pin which by default outputs a 25MHz clock, but some board setups require a 125MHz clock instead. Added a microchip,synclko-125 device tree property to allow indicating a 125MHz clock output is required. Signed-off-by: Robert Hancock --- Documentation/devi

[PATCH net-next 1/2] net: dsa: microchip: Add PHY errata workarounds

2019-06-12 Thread Robert Hancock
The Silicon Errata and Data Sheet Clarification documents for the KSZ9477 series of chips describe a number of otherwise undocumented PHY register settings which are required to work around various chip errata. Apply these settings when initializing the PHY ports on these chips. Signed-off-by: Rob

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

2019-06-12 Thread Jakub Kicinski
On Wed, 12 Jun 2019 15:56:33 +, Maxim Mikityanskiy wrote: > UAPI is not changed, XSK RX queues are exposed to the kernel. The lower > half of the available amount of RX queues are regular queues, and the > upper half are XSK RX queues. If I have 32 queues enabled on the NIC and I install AF_X

Re: [PATCH v4 net] sctp: Free cookie before we memdup a new one

2019-06-12 Thread David Miller
From: Neil Horman Date: Wed, 12 Jun 2019 16:32:30 -0400 > On Wed, Jun 12, 2019 at 03:07:15PM -0300, Marcelo Ricardo Leitner wrote: >> On Tue, Jun 11, 2019 at 08:38:14PM -0400, Neil Horman wrote: >> > Based on comments from Xin, even after fixes for our recent syzbot >> > report of cookie memory l

Re: [PATCH net] net: dsa: microchip: Don't try to read stats for unused ports

2019-06-12 Thread Vivien Didelot
On Wed, 12 Jun 2019 14:33:32 -0600, Robert Hancock wrote: > If some of the switch ports were not listed in the device tree, due to > being unused, the ksz_mib_read_work function ended up accessing a NULL > dp->slave pointer and causing an oops. Skip checking statistics for any > unused ports. >

[PATCH net] net: dsa: microchip: Don't try to read stats for unused ports

2019-06-12 Thread Robert Hancock
If some of the switch ports were not listed in the device tree, due to being unused, the ksz_mib_read_work function ended up accessing a NULL dp->slave pointer and causing an oops. Skip checking statistics for any unused ports. Fixes: 7c6ff470aa867f53 ("net: dsa: microchip: add MIB counter reading

Re: [PATCH v4 net] sctp: Free cookie before we memdup a new one

2019-06-12 Thread Neil Horman
On Wed, Jun 12, 2019 at 03:07:15PM -0300, Marcelo Ricardo Leitner wrote: > On Tue, Jun 11, 2019 at 08:38:14PM -0400, Neil Horman wrote: > > Based on comments from Xin, even after fixes for our recent syzbot > > report of cookie memory leaks, its possible to get a resend of an INIT > > chunk which w

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

2019-06-12 Thread Jakub Kicinski
On Wed, 12 Jun 2019 15:56:48 +, Maxim Mikityanskiy wrote: > 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() ch

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

2019-06-12 Thread Jakub Kicinski
On Wed, 12 Jun 2019 15:56:43 +, Maxim Mikityanskiy wrote: > 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. This is slightly sur

Re: [PATCH v2 net-next] tcp: add optional per socket transmit delay

2019-06-12 Thread David Miller
From: Eric Dumazet Date: Wed, 12 Jun 2019 11:57:25 -0700 > This patchs adds TCP_TX_DELAY socket option, to set a delay in > usec units. ... Ok, build testing again :-)

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

2019-06-12 Thread Maciej Fijalkowski
On Tue, 11 Jun 2019 20:17:02 +0200 Toke Høiland-Jørgensen wrote: > Jesper Dangaard Brouer writes: > > > On Tue, 11 Jun 2019 17:44:00 +0200 > > Toke Høiland-Jørgensen wrote: > > > >> From: Toke Høiland-Jørgensen > >> > >> The bpf_redirect_map() helper used by XDP programs doesn't return any

Re: [PATCH bpf-next 2/2] bpf: Add test for SO_REUSEPORT_DETACH_BPF

2019-06-12 Thread Stanislav Fomichev
On 06/12, Martin KaFai Lau wrote: > This patch adds a test for the new sockopt SO_REUSEPORT_DETACH_BPF. > > '-I../../../../usr/include/' is added to the Makefile to get > the newly added SO_REUSEPORT_DETACH_BPF. > > Signed-off-by: Martin KaFai Lau > --- > tools/testing/selftests/bpf/Makefile

Re: [PATCH net-next 1/3] net/sched: Introduce action ct

2019-06-12 Thread Florian Westphal
Paul Blakey wrote: > + /* The conntrack module expects to be working at L3. */ It also expects that IP stack has validated ip(v6) headers and has pulled the ip header into linear area. What are your plans wrt. IP fragments? AFAICS right now they will not match which means they won't be NATed

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

2019-06-12 Thread Jakub Kicinski
On Wed, 12 Jun 2019 11:49:17 +0200, Toke Høiland-Jørgensen wrote: > 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

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

2019-06-12 Thread Florian Fainelli
On 6/12/19 1:57 AM, Raju Lakkaraju wrote: > 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 gen

Re: [PATCH net-next v6] net: sched: Introduce act_ctinfo action

2019-06-12 Thread Michal Kubecek
On Wed, Jun 12, 2019 at 08:56:10PM +0200, Johannes Berg wrote: > (switching to my personal email) > > > > I can't add these actions with current net-next and iproute-next: > > > # ~/iproute2/tc/tc action add action ctinfo dscp 0xfc00 0x0100 > > > Error: NLA_F_NESTED is missing. > > > We ha

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

2019-06-12 Thread Jonathan Lemon
On 12 Jun 2019, at 8:56, Maxim Mikityanskiy wrote: > 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 drive

[PATCH bpf-next 1/2] bpf: net: Add SO_DETACH_REUSEPORT_BPF

2019-06-12 Thread Martin KaFai Lau
There is SO_ATTACH_REUSEPORT_[CE]BPF but there is no DETACH. This patch adds SO_DETACH_REUSEPORT_BPF sockopt. The same sockopt can be used to undo both SO_ATTACH_REUSEPORT_[CE]BPF. reseport_detach_prog() is added and it is mostly a mirror of the existing reuseport_attach_prog(). The differences

[PATCH bpf-next 2/2] bpf: Add test for SO_REUSEPORT_DETACH_BPF

2019-06-12 Thread Martin KaFai Lau
This patch adds a test for the new sockopt SO_REUSEPORT_DETACH_BPF. '-I../../../../usr/include/' is added to the Makefile to get the newly added SO_REUSEPORT_DETACH_BPF. Signed-off-by: Martin KaFai Lau --- tools/testing/selftests/bpf/Makefile | 1 + .../selftests/bpf/test_select_reuse

[PATCH bpf-next 0/2] bpf: net: Detach BPF prog from reuseport sk

2019-06-12 Thread Martin KaFai Lau
This patch adds SO_DETACH_REUSEPORT_BPF to detach BPF prog from reuseport sk. Martin KaFai Lau (2): bpf: net: Add SO_DETACH_REUSEPORT_BPF bpf: Add test for SO_REUSEPORT_DETACH_BPF arch/alpha/include/uapi/asm/socket.h | 2 + arch/mips/include/uapi/asm/socket.h | 2 + arch

[PATCH v2 net-next] tcp: add optional per socket transmit delay

2019-06-12 Thread Eric Dumazet
Adding delays to TCP flows is crucial for studying behavior of TCP stacks, including congestion control modules. Linux offers netem module, but it has unpractical constraints : - Need root access to change qdisc - Hard to setup on egress if combined with non trivial qdisc like FQ - Single delay fo

Re: [PATCH net-next v6] net: sched: Introduce act_ctinfo action

2019-06-12 Thread Johannes Berg
(switching to my personal email) > > I can't add these actions with current net-next and iproute-next: > > # ~/iproute2/tc/tc action add action ctinfo dscp 0xfc00 0x0100 > > Error: NLA_F_NESTED is missing. > > We have an error talking to the kernel > > > > This also happens with the curre

[PATCH net] net: netem: fix use after free and double free with packet corruption

2019-06-12 Thread Jakub Kicinski
Brendan reports that the use of netem's packet corruption capability leads to strange crashes. This seems to be caused by commit d66280b12bd7 ("net: netem: use a list in addition to rbtree") which uses skb->next pointer to construct a fast-path queue of in-order skbs. Packet corruption code has t

Re: [PATCH net-next] tcp: add optional per socket transmit delay

2019-06-12 Thread Eric Dumazet
On Wed, Jun 12, 2019 at 11:21 AM David Miller wrote: > > From: David Miller > Date: Wed, 12 Jun 2019 11:03:44 -0700 (PDT) > > > Applied to net-next and build testing. > > Missing symbol export it seems... > > ERROR: "tcp_tx_delay_enabled" [net/ipv6/ipv6.ko] undefined! > make[1]: *** [scripts/Make

Re: [PATCH net-next v6] net: sched: Introduce act_ctinfo action

2019-06-12 Thread Marcelo Ricardo Leitner
On Wed, Jun 12, 2019 at 11:46:27AM -0700, Jakub Kicinski wrote: > On Wed, 12 Jun 2019 15:02:39 -0300, Marcelo Ricardo Leitner wrote: > > On Tue, May 28, 2019 at 05:03:50PM +, Kevin 'ldir' Darbyshire-Bryant > > wrote: > > ... > > > +static int tcf_ctinfo_init(struct net *net, struct nlattr *nla

Re: [PATCH net-next v6] net: sched: Introduce act_ctinfo action

2019-06-12 Thread Jakub Kicinski
On Wed, 12 Jun 2019 15:02:39 -0300, Marcelo Ricardo Leitner wrote: > On Tue, May 28, 2019 at 05:03:50PM +, Kevin 'ldir' Darbyshire-Bryant > wrote: > ... > > +static int tcf_ctinfo_init(struct net *net, struct nlattr *nla, > > + struct nlattr *est, struct tc_action **a, > >

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

2019-06-12 Thread Björn Töpel
On 2019-06-12 18:14, Maxim Mikityanskiy wrote: 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 se

[PATCH v1 22/31] docs: leds: convert to ReST

2019-06-12 Thread Mauro Carvalho Chehab
Rename the leds documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro

[PATCH iproute2-next] Makefile: use make -C to change directory

2019-06-12 Thread Andrea Claudi
make provides a handy -C option to change directory before reading the makefiles or doing anything else. Use that instead of the "cd dir && make && cd .." pattern, thus simplifying sintax for some makefiles. Signed-off-by: Andrea Claudi --- Makefile| 3 ++- testsuite/Makefil

Re: [PATCH V3 net 0/7] Support for dynamic queue size changes

2019-06-12 Thread David Miller
From: Date: Tue, 11 Jun 2019 14:58:04 +0300 > From: Sameeh Jubran > > This patchset introduces the following: > * add new admin command for supporting different queue size for Tx/Rx > * add support for Tx/Rx queues size modification through ethtool > * allow queues allocation backoff when low o

Re: [PATCH net-next] tcp: add optional per socket transmit delay

2019-06-12 Thread David Miller
From: David Miller Date: Wed, 12 Jun 2019 11:03:44 -0700 (PDT) > Applied to net-next and build testing. Missing symbol export it seems... ERROR: "tcp_tx_delay_enabled" [net/ipv6/ipv6.ko] undefined! make[1]: *** [scripts/Makefile.modpost:91: __modpost] Error 1

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

2019-06-12 Thread Stephen Hemminger
On Wed, 12 Jun 2019 19:32:29 +0200 Matteo Croce wrote: > On Wed, Jun 12, 2019 at 6:04 PM Matteo Croce wrote: > > > > 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 t

Re: [PATCH net-next v3 0/3] dpaa2-eth: Add support for MQPRIO offloading

2019-06-12 Thread David Miller
From: Ioana Radulescu Date: Tue, 11 Jun 2019 14:50:00 +0300 > Add support for adding multiple TX traffic classes with mqprio. We can have > up to one netdev queue and hardware frame queue per TC per core. Series applied, thanks.

Re: [PATCH net 0/7] mlxsw: Various fixes

2019-06-12 Thread David Miller
From: Ido Schimmel Date: Tue, 11 Jun 2019 10:19:39 +0300 > From: Ido Schimmel > > This patchset contains various fixes for mlxsw. > > Patch #1 fixes an hash polarization problem when a nexthop device is a > LAG device. This is caused by the fact that the same seed is used for > the LAG and ECM

Re: [PATCH v4 net] sctp: Free cookie before we memdup a new one

2019-06-12 Thread Marcelo Ricardo Leitner
On Tue, Jun 11, 2019 at 08:38:14PM -0400, Neil Horman wrote: > Based on comments from Xin, even after fixes for our recent syzbot > report of cookie memory leaks, its possible to get a resend of an INIT > chunk which would lead to us leaking cookie memory. > > To ensure that we don't leak cookie m

Re: [net PATCH v2] net: tls, correctly account for copied bytes with multiple sk_msgs

2019-06-12 Thread David Miller
From: John Fastabend Date: Wed, 12 Jun 2019 17:23:57 + > tls_sw_do_sendpage needs to return the total number of bytes sent > regardless of how many sk_msgs are allocated. Unfortunately, copied > (the value we return up the stack) is zero'd before each new sk_msg > is allocated so we only retu

Re: [PATCH net-next 1/3] net/sched: Introduce action ct

2019-06-12 Thread Marcelo Ricardo Leitner
On Tue, Jun 11, 2019 at 04:28:31PM +0300, Paul Blakey wrote: > Allow sending a packet to conntrack and set conntrack zone, mark, > labels and nat parameters. > > Signed-off-by: Paul Blakey > Signed-off-by: Marcelo Ricardo Leitner > Signed-off-by: Yossi Kuperman > Acked-by: Jiri Pirko > --- >

Re: [PATCH net-next] tcp: add optional per socket transmit delay

2019-06-12 Thread David Miller
From: Eric Dumazet Date: Mon, 10 Jun 2019 20:03:34 -0700 > Adding delays to TCP flows is crucial for studying behavior > of TCP stacks, including congestion control modules. > > Linux offers netem module, but it has unpractical constraints : > - Need root access to change qdisc > - Hard to setup

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

2019-06-12 Thread Marcelo Ricardo Leitner
On Wed, Jun 12, 2019 at 01:51:44PM +0100, John Hurley wrote: > 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

Re: [PATCH net-next v6] net: sched: Introduce act_ctinfo action

2019-06-12 Thread Marcelo Ricardo Leitner
On Tue, May 28, 2019 at 05:03:50PM +, Kevin 'ldir' Darbyshire-Bryant wrote: ... > +static int tcf_ctinfo_init(struct net *net, struct nlattr *nla, > +struct nlattr *est, struct tc_action **a, > +int ovr, int bind, bool rtnl_held, > +

Re: [PATCH net v2] vrf: Increment Icmp6InMsgs on the original netdev

2019-06-12 Thread David Miller
From: Stephen Suryaputra Date: Mon, 10 Jun 2019 10:32:50 -0400 > Get the ingress interface and increment ICMP counters based on that > instead of skb->dev when the the dev is a VRF device. > > This is a follow up on the following message: > https://www.spinics.net/lists/netdev/msg560268.html >

Re: [PATCH v4 net] sctp: Free cookie before we memdup a new one

2019-06-12 Thread Xin Long
On Wed, Jun 12, 2019 at 8:38 AM Neil Horman wrote: > > Based on comments from Xin, even after fixes for our recent syzbot > report of cookie memory leaks, its possible to get a resend of an INIT > chunk which would lead to us leaking cookie memory. > > To ensure that we don't leak cookie memory, f

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

2019-06-12 Thread David Miller
From: Vivien Didelot Date: Wed, 12 Jun 2019 12:42:47 -0400 > 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

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

2019-06-12 Thread Matteo Croce
On Wed, Jun 12, 2019 at 6:04 PM Matteo Croce wrote: > > 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

[PATCH bpf-next 1/4] bpf: export bpf_sock for BPF_PROG_TYPE_CGROUP_SOCK_ADDR prog type

2019-06-12 Thread Stanislav Fomichev
And let it use bpf_sk_storage_{get,delete} helpers to access socket storage. Kernel context (struct bpf_sock_addr_kern) already has sk member, so I just expose it to the BPF hooks. Using PTR_TO_SOCKET instead of PTR_TO_SOCK_COMMON should be safe because the hook is called on bind/connect. Cc: Mart

[PATCH bpf-next 4/4] selftests/bpf: convert socket_cookie test to sk storage

2019-06-12 Thread Stanislav Fomichev
This lets us test that both BPF_PROG_TYPE_CGROUP_SOCK_ADDR and BPF_PROG_TYPE_SOCK_OPS can access underlying bpf_sock. Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- .../selftests/bpf/progs/socket_cookie_prog.c | 46 --- .../selftests/bpf/test_socket_cookie.c| 24 +

[PATCH bpf-next 3/4] bpf/tools: sync bpf.h

2019-06-12 Thread Stanislav Fomichev
Add sk to struct bpf_sock_addr and struct bpf_sock_ops. Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- tools/include/uapi/linux/bpf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index ae0907d8c03a..d0a23476f887 1006

[PATCH bpf-next 2/4] bpf: export bpf_sock for BPF_PROG_TYPE_SOCK_OPS prog type

2019-06-12 Thread Stanislav Fomichev
And let it use bpf_sk_storage_{get,delete} helpers to access socket storage. Kernel context (struct bpf_sock_ops_kern) already has sk member, so I just expose it to the BPF hooks. I use PTR_TO_SOCKET_OR_NULL and return NULL in !is_fullsock case. I also export bpf_tcp_sock to make it possible to ac

[net PATCH v2] net: tls, correctly account for copied bytes with multiple sk_msgs

2019-06-12 Thread John Fastabend
tls_sw_do_sendpage needs to return the total number of bytes sent regardless of how many sk_msgs are allocated. Unfortunately, copied (the value we return up the stack) is zero'd before each new sk_msg is allocated so we only return the copied size of the last sk_msg used. The caller (splice, etc.

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

2019-06-12 Thread Willem de Bruijn
On Wed, Jun 12, 2019 at 12:52 PM Eric Dumazet wrote: > > 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 eve

[PATCH 4/4] qmi_wwan: extend permitted QMAP mux_id value range

2019-06-12 Thread Reinhard Speyerer
Permit mux_id values up to 254 to be used in qmimux_register_device() for compatibility with ip(8) and the rmnet driver. Fixes: c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support") Cc: Daniele Palmas Signed-off-by: Reinhard Speyerer --- Documentation/ABI/testing/sysfs-class-net-qm

[PATCH 3/4] qmi_wwan: avoid RCU stalls on device disconnect when in QMAP mode

2019-06-12 Thread Reinhard Speyerer
Switch qmimux_unregister_device() and qmi_wwan_disconnect() to use unregister_netdevice_queue() and unregister_netdevice_many() instead of unregister_netdevice(). This avoids RCU stalls which have been observed on device disconnect in certain setups otherwise. Fixes: c6adf77953bc ("net: usb: qmi_w

[PATCH 2/4] qmi_wwan: add network device usage statistics for qmimux devices

2019-06-12 Thread Reinhard Speyerer
Add proper network device usage statistics for qmimux devices instead of reporting all-zero values for them. Fixes: c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support") Cc: Daniele Palmas Signed-off-by: Reinhard Speyerer --- drivers/net/usb/qmi_wwan.c | 76

[PATCH 0/4] qmi_wwan: fix QMAP handling

2019-06-12 Thread Reinhard Speyerer
This series addresses the following issues observed when using the QMAP support of the qmi_wwan driver: 1. The QMAP code in the qmi_wwan driver is based on the CodeAurora GobiNet driver ([1], [2]) which does not process QMAP padding in the RX path correctly. This causes qmimux_rx_fixup() to

[PATCH 1/4] qmi_wwan: add support for QMAP padding in the RX path

2019-06-12 Thread Reinhard Speyerer
The QMAP code in the qmi_wwan driver is based on the CodeAurora GobiNet driver which does not process QMAP padding in the RX path correctly. Add support for QMAP padding to qmimux_rx_fixup() according to the description of the rmnet driver. Fixes: c6adf77953bc ("net: usb: qmi_wwan: add qmap mux pr

Re: [PATCH v2 2/2] dt-bindings: net: wiznet: add w5x00 support

2019-06-12 Thread David Miller
From: Nicolas Saenz Julienne Date: Wed, 12 Jun 2019 14:25:27 +0200 > Add bindings for Wiznet's w5x00 series of SPI interfaced Ethernet chips. > > Based on the bindings for microchip,enc28j60. > > Signed-off-by: Nicolas Saenz Julienne Applied to net-next.

[PATCH net-next 6/8] net/packet: implement shortcut in tpacket_rcv()

2019-06-12 Thread Eric Dumazet
tpacket_rcv() can be hit under DDOS quite hard, since it will always grab a socket spinlock, to eventually find there is no room for an additional packet. Using tcpdump [1] on a busy host can lead to catastrophic consequences, because of all cpus spinning on a contended spinlock. This replicates

[PATCH net-next 7/8] net/packet: remove locking from packet_rcv_has_room()

2019-06-12 Thread Eric Dumazet
__packet_rcv_has_room() can now be run without lock being held. po->pressure is only a non persistent hint, we can mark all read/write accesses with READ_ONCE()/WRITE_ONCE() to document the fact that the field could be written without any synchronization. Signed-off-by: Eric Dumazet --- net/pac

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

[PATCH net-next 8/8] net/packet: introduce packet_rcv_try_clear_pressure() helper

2019-06-12 Thread Eric Dumazet
There are two places where we want to clear the pressure if possible, add a helper to make it more obvious. Signed-off-by: Eric Dumazet Suggested-by: Willem de Bruijn --- net/packet/af_packet.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/net/packet/af_packe

[PATCH net-next 4/8] net/packet: constify __packet_rcv_has_room()

2019-06-12 Thread Eric Dumazet
Goal is use the helper without lock being held. Signed-off-by: Eric Dumazet --- net/packet/af_packet.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 5ef63d0c3ad0a184a03429fdd52cad26349647d1..a0564855ed9dca

[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

[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 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.

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] 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

[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

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

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

[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

[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 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 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 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 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 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 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 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 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 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 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 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

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 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(+),

[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 <<

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-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

[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 ---

  1   2   >