Re: [BUG] xfrm: unable to handle kernel NULL pointer dereference

2018-11-21 Thread Steffen Klassert
On Fri, Nov 16, 2018 at 08:12:46PM +0100, Steffen Klassert wrote: > On Fri, Nov 16, 2018 at 08:48:00PM +0200, Lennert Buytenhek wrote: > > On Sat, Nov 10, 2018 at 08:34:34PM +0100, Jean-Philippe Menil wrote: > > > > > we're seeing unexpected crashes from kernel 4.15 to 4.18.17, using > > > IPsec

Re: [PATCH net-next,v3 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-21 Thread Jiri Pirko
Thu, Nov 22, 2018 at 05:59:27AM CET, f.faine...@gmail.com wrote: > > >On 11/20/2018 6:51 PM, Pablo Neira Ayuso wrote: >> This patch adds a function to translate the ethtool_rx_flow_spec >> structure to the flow_rule representation. >> >> This allows us to reuse code from the driver side given

Re: [PATCH net-next,v3 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-21 Thread Jiri Pirko
Thu, Nov 22, 2018 at 05:57:31AM CET, f.faine...@gmail.com wrote: > > >On 11/20/2018 6:51 PM, Pablo Neira Ayuso wrote: >> This patch adds a function to translate the ethtool_rx_flow_spec >> structure to the flow_rule representation. >> >> This allows us to reuse code from the driver side given

[RFC PATCH bpf-next] libbpf: make bpf_object__open default to UNSPEC

2018-11-21 Thread Nikita V. Shirokov
currently by default libbpf's bpf_object__open requires bpf's program to specify version in a code because of two things: 1) default prog type is set to KPROBE 2) KPROBE requires (in kernel/bpf/syscall.c) version to be specified in this RFC i'm proposing change default to UNSPEC and also

[PATCH bpf-next v2 1/1] bpf, lpm: make longest_prefix_match() faster

2018-11-21 Thread Eric Dumazet
At LPC 2018 in Vancouver, Vlad Dumitrescu mentioned that longest_prefix_match() has a high cost [1]. One reason for that cost is a loop handling one byte at a time. We can handle more bytes at a time, if enough attention is paid to endianness. I was able to remove ~55 % of

[PATCH bpf-next 1/1] bpf, lpm: make longest_prefix_match() faster

2018-11-21 Thread Eric Dumazet
At LPC 2018 in Vancouver, Vlad Dumitrescu mentioned that longest_prefix_match() has a high cost [1]. One reason for that cost is a loop handling one byte at a time. We can handle more bytes at a time, if enough attention is paid to endianness. I was able to remove ~55 % of

Re: [PATCH net-next,v3 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-21 Thread Florian Fainelli
On 11/20/2018 6:51 PM, Pablo Neira Ayuso wrote: > This patch adds a function to translate the ethtool_rx_flow_spec > structure to the flow_rule representation. > > This allows us to reuse code from the driver side given that both flower > and ethtool_rx_flow interfaces use the same

Re: [PATCH net-next,v3 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-21 Thread Florian Fainelli
On 11/20/2018 6:51 PM, Pablo Neira Ayuso wrote: > This patch adds a function to translate the ethtool_rx_flow_spec > structure to the flow_rule representation. > > This allows us to reuse code from the driver side given that both flower > and ethtool_rx_flow interfaces use the same

Re: [PATCH net-next,v3 10/12] dsa: bcm_sf2: use flow_rule infrastructure

2018-11-21 Thread Florian Fainelli
On 11/20/2018 6:51 PM, Pablo Neira Ayuso wrote: > Update this driver to use the flow_rule infrastructure, hence we can use > the same code to populate hardware IR from ethtool_rx_flow and the > cls_flower interfaces. > > Signed-off-by: Pablo Neira Ayuso > --- [snip] > @@ -398,9 +411,10 @@

Re: [PATCH net-next,v3 03/12] flow_dissector: add flow action infrastructure

2018-11-21 Thread Florian Fainelli
On 11/20/2018 6:51 PM, Pablo Neira Ayuso wrote: > This new infrastructure defines the nic actions that you can perform > from existing network drivers. This infrastructure allows us to avoid a > direct dependency with the native software TC action representation. > > Signed-off-by: Pablo Neira

Re: [RFC v3 3/3] vxlan: handle underlay VRF changes

2018-11-21 Thread David Ahern
On 11/21/18 5:54 PM, Alexis Bauvin wrote: >>> There is one issue I can see with SO_REUSEPORT (if my understanding of it is >>> correct). From what I understood, enabling this option will balance incoming >>> connections (for TCP) / dgrams (for UDP) based on a 4-tuple hash (sip, dip, >>> sport,

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-21 Thread Paweł Staszewski
W dniu 16.11.2018 o 21:06, Cong Wang pisze: On Thu, Nov 15, 2018 at 8:50 PM Herbert Xu wrote: On Thu, Nov 15, 2018 at 06:23:38PM -0800, Cong Wang wrote: Normally if the hardware's partial checksum is valid then we just trust it and send the packet along. However, if the partial checksum is

[RFC v4 4/5] netdev: add netdev_is_upper_master

2018-11-21 Thread Alexis Bauvin
In preparation of next patch, this function allows to check if a device is a master, be it direct or indirect, of another one. It walks up the master chain until it finds the device, or there is no more master. This allows to check e.g. if br-blue is a master of eth0: +--+ |

[RFC v4 3/5] vxlan: add support for underlay in non-default VRF

2018-11-21 Thread Alexis Bauvin
Creating a VXLAN device with is underlay in the non-default VRF makes egress route lookup fail or incorrect since it will resolve in the default VRF, and ingress fail because the socket listens in the default VRF. This patch binds the underlying UDP tunnel socket to the l3mdev of the lower device

[RFC v4 1/5] udp_tunnel: add config option to bind to a device

2018-11-21 Thread Alexis Bauvin
UDP tunnel sockets are always opened unbound to a specific device. This patch allow the socket to be bound on a custom device, which incidentally makes UDP tunnels VRF-aware if binding to an l3mdev. Signed-off-by: Alexis Bauvin Reviewed-by: Amine Kherbouche Tested-by: Amine Kherbouche ---

[RFC v4 2/5] l3mdev: add function to retreive upper master

2018-11-21 Thread Alexis Bauvin
Existing functions to retreive the l3mdev of a device did not walk the master chain to find the upper master. This patch adds a function to find the l3mdev, even indirect through e.g. a bridge: +--+ | | | vrf-blue | | | ++-+ | | ++-+ |

[RFC v4 0/5] Add VRF support for VXLAN underlay

2018-11-21 Thread Alexis Bauvin
v3 -> v4: - rename vxlan_is_in_l3mdev_chain to netdev_is_upper master - move it to net/core/dev.c - make it return bool instead of int - check if remote_ifindex is zero before resolving the l3mdev - add testing script v2 -> v3: - fix build when CONFIG_NET_IPV6 is off - fix build "unused

[RFC v4 5/5] vxlan: handle underlay VRF changes

2018-11-21 Thread Alexis Bauvin
When underlay VRF changes, either because the lower device itself changed, or its VRF changed, this patch releases the current socket of the VXLAN device and recreates another one in the right VRF. This allows for on-the-fly change of the underlay VRF of a VXLAN device. Signed-off-by: Alexis

Re: [PATCH net-next 3/3] tcp: implement head drops in backlog queue

2018-11-21 Thread Eric Dumazet
On Wed, Nov 21, 2018 at 4:55 PM Yuchung Cheng wrote: > > To clarify I do think this patch set is overall useful so I only > wanted to discuss the specifics of the head drop. > > It occurs to me we check the limit differently (one w/ 64KB more), so > we may overcommit and trim more often than

Re: consistency for statistics with XDP mode

2018-11-21 Thread Toshiaki Makita
On 2018/11/22 6:06, David Ahern wrote: > Paweł ran some more XDP tests yesterday and from it found a couple of > issues. One is a panic in the mlx5 driver unloading the bpf program > (mlx5e_xdp_xmit); he will send a send a separate email for that problem. > > The problem I wanted to discuss here

Re: [PATCH net-next 3/3] tcp: implement head drops in backlog queue

2018-11-21 Thread Yuchung Cheng
On Wed, Nov 21, 2018 at 4:18 PM, Eric Dumazet wrote: > On Wed, Nov 21, 2018 at 3:52 PM Eric Dumazet wrote: >> This is basically what the patch does, the while loop breaks when we have >> freed >> just enough skbs. > > Also this is the patch we tested with Jean-Louis on his host, bring > very

Re: [RFC v3 3/3] vxlan: handle underlay VRF changes

2018-11-21 Thread Alexis Bauvin
Le 21 nov. 2018 à 20:28, David Ahern a écrit : > On 11/21/18 7:05 AM, Alexis Bauvin wrote: >> Le 20 nov. 2018 à 18:09, David Ahern a écrit : >>> On 11/20/18 9:58 AM, Alexis Bauvin wrote: A socket bound to vrf-blue listens on *:4789, thus owning the port. If moving an underlay to

Re: [RFC v3 0/3] Add VRF support for VXLAN underlay

2018-11-21 Thread Alexis Bauvin
Le 21 nov. 2018 à 20:26, David Ahern a écrit : > > On 11/21/18 6:30 AM, Alexis Bauvin wrote: >> Le 20 nov. 2018 à 22:45, David Ahern a écrit : >>> >>> On 11/20/18 7:23 AM, Alexis Bauvin wrote: We are trying to isolate the VXLAN traffic from different VMs with VRF as shown in

Re: consistency for statistics with XDP mode

2018-11-21 Thread Saeed Mahameed
On Wed, 2018-11-21 at 22:29 +0100, Paweł Staszewski wrote: > W dniu 21.11.2018 o 22:14, Toke Høiland-Jørgensen pisze: > > David Ahern writes: > > > > > Paweł ran some more XDP tests yesterday and from it found a > > > couple of > > > issues. One is a panic in the mlx5 driver unloading the bpf >

Re: [PATCH net-next 3/3] tcp: implement head drops in backlog queue

2018-11-21 Thread Eric Dumazet
On Wed, Nov 21, 2018 at 3:52 PM Eric Dumazet wrote: > This is basically what the patch does, the while loop breaks when we have > freed > just enough skbs. Also this is the patch we tested with Jean-Louis on his host, bring very nice results, even from an old stack sender (the one that had

Re: net: thunderx: nicvf_xdp_setup error code path

2018-11-21 Thread David Miller
From: Lorenzo Bianconi Date: Tue, 20 Nov 2018 18:56:36 +0100 > Hi all, > > looking at thunderx XDP support I noticed that nic->xdp_prog pointer in > nicvf_xdp_setup is not actually set to NULL if bpf_prog_add fails but it > is initialized with bpf_prog_add error code. xdp_prog pointer value is

Re: [PATCH v2 net-next] net: lpc_eth: fix trivial comment typo

2018-11-21 Thread David Miller
From: Andrea Claudi Date: Tue, 20 Nov 2018 18:30:30 +0100 > Fix comment typo rxfliterctrl -> rxfilterctrl > > Signed-off-by: Andrea Claudi Applied.

Re: [PATCH net V4 0/5] net/smc: fixes 2018-11-12

2018-11-21 Thread David Miller
From: Ursula Braun Date: Tue, 20 Nov 2018 16:46:38 +0100 > here is V4 of some net/smc fixes in different areas for the net tree. > > v1->v2: >do not define 8-byte alignment for union smcd_cdc_cursor in >patch 4/5 "net/smc: atomic SMCD cursor handling" > v2->v3: >stay with 8-byte

Re: [PATCH net-next 3/3] tcp: implement head drops in backlog queue

2018-11-21 Thread Eric Dumazet
On Wed, Nov 21, 2018 at 3:47 PM Yuchung Cheng wrote: > > On Wed, Nov 21, 2018 at 2:47 PM, Eric Dumazet wrote: > > > > > > On 11/21/2018 02:40 PM, Yuchung Cheng wrote: > >> On Wed, Nov 21, 2018 at 9:52 AM, Eric Dumazet wrote: > >>> Under high stress, and if GRO or coalescing does not help, > >>>

Re: [PATCH net] tcp: defer SACK compression after DupThresh

2018-11-21 Thread David Miller
From: Eric Dumazet Date: Tue, 20 Nov 2018 05:53:59 -0800 > Jean-Louis reported a TCP regression and bisected to recent SACK > compression. > > After a loss episode (receiver not able to keep up and dropping > packets because its backlog is full), linux TCP stack is sending > a single SACK

[PATCH v3 5/5] Bluetooth: btusb: Use the hw_reset method to allow resetting the BT chip

2018-11-21 Thread Rajat Jain
If the platform provides it, use the reset gpio to reset the BT chip (requested by the HCI core if needed). This has been found helpful on some of Intel bluetooth controllers where the firmware gets stuck and the only way out is a hard reset pin provided by the platform. Signed-off-by: Rajat Jain

Re: [PATCH net-next,v3 04/12] cls_api: add translator to flow_action representation

2018-11-21 Thread Pablo Neira Ayuso
On Wed, Nov 21, 2018 at 07:15:41PM -0200, Marcelo Ricardo Leitner wrote: > On Wed, Nov 21, 2018 at 03:51:24AM +0100, Pablo Neira Ayuso wrote: [...] > > diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c > > index d2971fbfc3d9..8898943b8ee6 100644 > > --- a/net/sched/cls_flower.c > > +++

Re: [PATCH net-next 3/3] tcp: implement head drops in backlog queue

2018-11-21 Thread Yuchung Cheng
On Wed, Nov 21, 2018 at 2:47 PM, Eric Dumazet wrote: > > > On 11/21/2018 02:40 PM, Yuchung Cheng wrote: >> On Wed, Nov 21, 2018 at 9:52 AM, Eric Dumazet wrote: >>> Under high stress, and if GRO or coalescing does not help, >>> we better make room in backlog queue to be able to keep latest >>>

Re: [PATCH bpf] tools: bpftool: fix potential NULL pointer dereference in do_load

2018-11-21 Thread Daniel Borkmann
On 11/21/2018 10:53 PM, Jakub Kicinski wrote: > This patch fixes a possible null pointer dereference in > do_load, detected by the semantic patch deref_null.cocci, > with the following warning: > > ./tools/bpf/bpftool/prog.c:1021:23-25: ERROR: map_replace is NULL but > dereferenced. > > The

Re: [PATCH net-next 0/4] VLAN tag handling cleanup

2018-11-21 Thread David Miller
From: Michał Mirosław Date: Tue, 20 Nov 2018 13:20:30 +0100 > This is a cleanup set after VLAN_TAG_PRESENT removal. The CFI bit > handling is made similar to how other tag fields are used. Series applied, thanks.

Re: [PATCH net] net: skb_scrub_packet(): Scrub offload_fwd_mark

2018-11-21 Thread David Miller
From: Petr Machata Date: Tue, 20 Nov 2018 11:39:56 + > When a packet is trapped and the corresponding SKB marked as > already-forwarded, it retains this marking even after it is forwarded > across veth links into another bridge. There, since it ingresses the > bridge over veth, which doesn't

Re: [PATCH bpf-next] bpf: add read/write access to skb->tstamp from tc clsact progs

2018-11-21 Thread Daniel Borkmann
On 11/21/2018 07:48 PM, Vlad Dumitrescu wrote: > On Wed, Nov 21, 2018 at 5:08 AM Eric Dumazet wrote: >> On 11/20/2018 06:40 PM, Alexei Starovoitov wrote: >>> >>> looks good to me. >>> >>> Any particular reason you decided to disable it for cg_skb ? >>> It seems to me the same EDT approach will

Re: [PATCH net-next 3/3] tcp: implement head drops in backlog queue

2018-11-21 Thread Eric Dumazet
On 11/21/2018 02:40 PM, Yuchung Cheng wrote: > On Wed, Nov 21, 2018 at 9:52 AM, Eric Dumazet wrote: >> Under high stress, and if GRO or coalescing does not help, >> we better make room in backlog queue to be able to keep latest >> packet coming. >> >> This generally helps fast recovery, given

Re: [PATCH bpf-next] bpf: add read/write access to skb->tstamp from tc clsact progs

2018-11-21 Thread Alexei Starovoitov
On Wed, Nov 21, 2018 at 10:48:21AM -0800, Vlad Dumitrescu wrote: > On Wed, Nov 21, 2018 at 5:08 AM Eric Dumazet wrote: > > > > > > > > On 11/20/2018 06:40 PM, Alexei Starovoitov wrote: > > > > > > > > looks good to me. > > > > > > Any particular reason you decided to disable it for cg_skb ? > > >

Re: [PATCH net-next 1/3] tcp: remove hdrlen argument from tcp_queue_rcv()

2018-11-21 Thread Yuchung Cheng
On Wed, Nov 21, 2018 at 9:52 AM, Eric Dumazet wrote: > Only one caller needs to pull TCP headers, so lets > move __skb_pull() to the caller side. > > Signed-off-by: Eric Dumazet > --- Acked-by: Yuchung Cheng > net/ipv4/tcp_input.c | 13 ++--- > 1 file changed, 6 insertions(+), 7

Re: [PATCH net-next 3/3] tcp: implement head drops in backlog queue

2018-11-21 Thread Yuchung Cheng
On Wed, Nov 21, 2018 at 9:52 AM, Eric Dumazet wrote: > Under high stress, and if GRO or coalescing does not help, > we better make room in backlog queue to be able to keep latest > packet coming. > > This generally helps fast recovery, given that we often receive > packets in order. I like the

Re: [PATCH net-next 2/3] tcp: implement coalescing on backlog queue

2018-11-21 Thread Eric Dumazet
On 11/21/2018 02:31 PM, Yuchung Cheng wrote: > On Wed, Nov 21, 2018 at 9:52 AM, Eric Dumazet wrote: >> + > Really nice! would it make sense to re-use (some of) the similar > tcp_try_coalesce()? > Maybe, but it is a bit complex, since skbs in receive queues (regular or out of order) are

Re: [PATCH v5 bpf-next 0/2] bpf: adding support for mapinmap in libbpf

2018-11-21 Thread Daniel Borkmann
On 11/21/2018 05:55 AM, Nikita V. Shirokov wrote: > in this patch series i'm adding a helper for libbpf which would allow > it to load map-in-map(BPF_MAP_TYPE_ARRAY_OF_MAPS and > BPF_MAP_TYPE_HASH_OF_MAPS). > first patch contains new helper + explains proposed workflow > second patch contains

Re: [PATCH net-next 2/3] tcp: implement coalescing on backlog queue

2018-11-21 Thread Yuchung Cheng
On Wed, Nov 21, 2018 at 9:52 AM, Eric Dumazet wrote: > > In case GRO is not as efficient as it should be or disabled, > we might have a user thread trapped in __release_sock() while > softirq handler flood packets up to the point we have to drop. > > This patch balances work done from user thread

Re: [PATCH bpf-next v3 1/3] bpf, libbpf: introduce bpf_object__probe_caps to test BPF capabilities

2018-11-21 Thread Daniel Borkmann
On 11/21/2018 02:11 AM, Stanislav Fomichev wrote: > It currently only checks whether kernel supports map/prog names. > This capability check will be used in the next two commits to skip setting > prog/map names. > > Suggested-by: Daniel Borkmann > Signed-off-by: Stanislav Fomichev Looks great,

Re: [PATCH bpf-next 1/2] libbpf: Add version script for DSO

2018-11-21 Thread Alexei Starovoitov
On 11/21/18 12:18 PM, Yonghong Song wrote: > > > On 11/21/18 9:40 AM, Andrey Ignatov wrote: >> More and more projects use libbpf and one day it'll likely be packaged >> and distributed as DSO and that requires ABI versioning so that both >> compatible and incompatible changes to ABI can be

Re: [PATCH bpf-next v3] libbpf: make sure bpf headers are c++ include-able

2018-11-21 Thread Daniel Borkmann
On 11/21/2018 06:29 PM, Stanislav Fomichev wrote: > Wrap headers in extern "C", to turn off C++ mangling. > This simplifies including libbpf in c++ and linking against it. > > v2 changes: > * do the same for btf.h > > v3 changes: > * test_libbpf.cpp to test for possible future c++ breakages > >

[PATCH bpf] tools: bpftool: fix potential NULL pointer dereference in do_load

2018-11-21 Thread Jakub Kicinski
This patch fixes a possible null pointer dereference in do_load, detected by the semantic patch deref_null.cocci, with the following warning: ./tools/bpf/bpftool/prog.c:1021:23-25: ERROR: map_replace is NULL but dereferenced. The following code has potential null pointer references: 881

Re: [PATCH net] net/sched: act_police: add missing spinlock initialization

2018-11-21 Thread Jiri Pirko
Wed, Nov 21, 2018 at 06:23:53PM CET, dcara...@redhat.com wrote: >commit f2cbd4852820 ("net/sched: act_police: fix race condition on state >variables") introduces a new spinlock, but forgets its initialization. >Ensure that tcf_police_init() initializes 'tcfp_lock' every time a 'police' >action is

Re: [iproute2-next PATCH v4] tc: flower: Classify packets based port ranges

2018-11-21 Thread David Ahern
On 11/20/18 11:17 PM, Amritha Nambiar wrote: > diff --git a/tc/f_flower.c b/tc/f_flower.c > index 65fca04..722647d 100644 > --- a/tc/f_flower.c > +++ b/tc/f_flower.c > @@ -494,6 +494,68 @@ static int flower_parse_port(char *str, __u8 ip_proto, > return 0; > } > > +static int

Re: [PATCH V2 mlx5-next 00/12] mlx5 core generic EQ API for RDMA ODP

2018-11-21 Thread Jason Gunthorpe
On Tue, Nov 20, 2018 at 11:11:16AM -0700, Leon Romanovsky wrote: > On Mon, Nov 19, 2018 at 10:52:30AM -0800, Saeed Mahameed wrote: > > Hi, > > > > This patchset is for mlx5-next shared branch, and will be applied there > > once the review is done. > > > > This patchset introduces mostly

Re: consistency for statistics with XDP mode

2018-11-21 Thread Paweł Staszewski
W dniu 21.11.2018 o 22:14, Toke Høiland-Jørgensen pisze: David Ahern writes: Paweł ran some more XDP tests yesterday and from it found a couple of issues. One is a panic in the mlx5 driver unloading the bpf program (mlx5e_xdp_xmit); he will send a send a separate email for that problem.

Re: [PATCH bpf-next] bpf: fix a libbpf loader issue

2018-11-21 Thread Daniel Borkmann
On 11/21/2018 08:22 PM, Yonghong Song wrote: > Commit 2993e0515bb4 ("tools/bpf: add support to read .BTF.ext sections") > added support to read .BTF.ext sections from an object file, create > and pass prog_btf_fd and func_info to the kernel. > > The program btf_fd (prog->btf_fd) is initialized to

Re: [PATCH net-next,v3 04/12] cls_api: add translator to flow_action representation

2018-11-21 Thread Marcelo Ricardo Leitner
On Wed, Nov 21, 2018 at 03:51:24AM +0100, Pablo Neira Ayuso wrote: > This patch implements a new function to translate from native TC action > to the new flow_action representation. Moreover, this patch also updates > cls_flower to use this new function. > > Signed-off-by: Pablo Neira Ayuso >

Re: consistency for statistics with XDP mode

2018-11-21 Thread Toke Høiland-Jørgensen
David Ahern writes: > Paweł ran some more XDP tests yesterday and from it found a couple of > issues. One is a panic in the mlx5 driver unloading the bpf program > (mlx5e_xdp_xmit); he will send a send a separate email for that > problem. Same as this one, I guess?

Re: [PATCH net-next 4/4] netns: enable to dump full nsid translation table

2018-11-21 Thread David Ahern
On 11/21/18 2:01 PM, Nicolas Dichtel wrote: > Le 21/11/2018 à 19:09, David Ahern a écrit : >> On 11/21/18 4:01 AM, Nicolas Dichtel wrote: >>> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c >>> index 92730905886c..fc568cd0b560 100644 >>> --- a/net/core/net_namespace.c >>> +++

Re: [PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-21 Thread David Ahern
On 11/21/18 1:58 PM, Nicolas Dichtel wrote: > The target-nsid is not stored in net_cb (not needed). ref_net is set only if > tgt_net comes from TARGET_NSID. I can add a comment. ref_net is added by this patch and it is only used (unless I missed something) to know if the put_net is needed. ie/,

consistency for statistics with XDP mode

2018-11-21 Thread David Ahern
Paweł ran some more XDP tests yesterday and from it found a couple of issues. One is a panic in the mlx5 driver unloading the bpf program (mlx5e_xdp_xmit); he will send a send a separate email for that problem. The problem I wanted to discuss here is statistics for XDP context. The short of it is

Re: [PATCH net-next 4/4] netns: enable to dump full nsid translation table

2018-11-21 Thread Nicolas Dichtel
Le 21/11/2018 à 19:09, David Ahern a écrit : > On 11/21/18 4:01 AM, Nicolas Dichtel wrote: >> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c >> index 92730905886c..fc568cd0b560 100644 >> --- a/net/core/net_namespace.c >> +++ b/net/core/net_namespace.c >> @@ -740,7 +740,7 @@

Re: [PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-21 Thread Nicolas Dichtel
Le 21/11/2018 à 19:05, David Ahern a écrit : > On 11/21/18 4:01 AM, Nicolas Dichtel wrote: >> static int rtnl_net_dumpid(struct sk_buff *skb, struct netlink_callback *cb) >> { >> -struct net *net = sock_net(skb->sk); >> struct rtnl_net_dump_cb net_cb = { >> -.net = net, >> +

Re: [PATCH bpf-next 1/2] libbpf: Add version script for DSO

2018-11-21 Thread Yonghong Song
On 11/21/18 9:40 AM, Andrey Ignatov wrote: > More and more projects use libbpf and one day it'll likely be packaged > and distributed as DSO and that requires ABI versioning so that both > compatible and incompatible changes to ABI can be introduced in a safe > way in the future without breaking

Re: [PATCH bpf-next] bpf: fix a libbpf loader issue

2018-11-21 Thread Martin Lau
On Wed, Nov 21, 2018 at 11:22:42AM -0800, Yonghong Song wrote: > Commit 2993e0515bb4 ("tools/bpf: add support to read .BTF.ext sections") > added support to read .BTF.ext sections from an object file, create > and pass prog_btf_fd and func_info to the kernel. > > The program btf_fd (prog->btf_fd)

[net-next 3/6] docs-networking: fix typo in define

2018-11-21 Thread Jeff Kirsher
From: Jesse Brandeburg The #define for NETIF_F_GSO_UDP_L4 was incorrect in the documentation, fix it by making it match the actual code. Signed-off-by: Jesse Brandeburg Tested-by: Andrew Bowers Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher ---

[net-next 4/6] ethernet/intel: consolidate NAPI and NAPI exit

2018-11-21 Thread Jeff Kirsher
From: Jesse Brandeburg While reviewing code, I noticed that Eric Dumazet recommends that drivers check the return code of napi_complete_done, and use that to decide to enable interrupts or not when exiting poll. One of the Intel drivers was already fixed (ixgbe). Upon looking at the Intel

[net-next 0/6][pull request] Intel Wired LAN Driver Updates 2018-11-21

2018-11-21 Thread Jeff Kirsher
This series contains updates to all of the Intel LAN drivers and documentation. Shannon Nelson updates the ixgbe kernel documentation to include IPsec hardware offload. Joe Perches cleans up whitespace issues in the igb driver. Jesse update the netdev kernel documentation for NETIF_F_GSO_UDP_L4

[net-next 1/6] ixgbe: add ipsec hw offload note to ixgbe Documentation

2018-11-21 Thread Jeff Kirsher
From: Shannon Nelson Add a short note about using IPsec Hardware Offload with the ixgbe driver. Signed-off-by: Shannon Nelson Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- Documentation/networking/ixgbe.rst | 13 + 1 file changed, 13 insertions(+) diff --git

[net-next 6/6] igc: Remove obsolete IGC_ERR define

2018-11-21 Thread Jeff Kirsher
From: Sasha Neftin Address community comment. Remove obsolete IGC_ERR define and use dev_err method. Suggested by Joe Perches. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/igc/igc.h | 2 --

[net-next 2/6] igb: Fix format with line continuation whitespace

2018-11-21 Thread Jeff Kirsher
From: Joe Perches The line continuation unintentionally adds whitespace so instead use a coalesced format to remove the whitespace. Miscellanea: o Use a more typical style for ternaries and arguments for this logging message Signed-off-by: Joe Perches Tested-by: Aaron Brown Acked-by:

[net-next 5/6] ixgbe: Replace synchronize_sched() with synchronize_rcu()

2018-11-21 Thread Jeff Kirsher
From: "Paul E. McKenney" Now that synchronize_rcu() waits for preempt-disable regions of code as well as RCU read-side critical sections, synchronize_sched() can be replaced by synchronize_rcu(). This commit therefore makes this change. Signed-off-by: "Paul E. McKenney" Tested-by: Andrew

[PATCH net-next] net-gro: use ffs() to speedup napi_gro_flush()

2018-11-21 Thread Eric Dumazet
We very often have few flows/chains to look at, and we might increase GRO_HASH_BUCKETS to 32 or 64 in the future. Signed-off-by: Eric Dumazet --- net/core/dev.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index

Re: [Patch net-next 2/2] net: dump whole skb data in netdev_rx_csum_fault()

2018-11-21 Thread Saeed Mahameed
On Wed, 2018-11-21 at 10:26 -0800, Eric Dumazet wrote: > On Wed, Nov 21, 2018 at 10:17 AM Cong Wang > wrote: > > On Wed, Nov 21, 2018 at 5:05 AM Eric Dumazet < > > eric.duma...@gmail.com> wrote: > > > > > > > > > On 11/20/2018 06:13 PM, Cong Wang wrote: > > > > Currently, we only dump a few

[PATCH v1 net] lan743x: Enable driver to work with LAN7431

2018-11-21 Thread Bryan Whitehead
This driver was designed to work with both LAN7430 and LAN7431. The only difference between the two is the LAN7431 has support for external phy. This change adds LAN7431 to the list of recognized devices supported by this driver. fixes: driver won't load for LAN7431 Signed-off-by: Bryan

Re: [RFC v3 3/3] vxlan: handle underlay VRF changes

2018-11-21 Thread David Ahern
On 11/21/18 7:05 AM, Alexis Bauvin wrote: > Le 20 nov. 2018 à 18:09, David Ahern a écrit : >> On 11/20/18 9:58 AM, Alexis Bauvin wrote: >>> A socket bound to vrf-blue listens on *:4789, thus owning the port. If >>> moving an >>> underlay to the default vrf (ip link set dummy-b nomaster), a new

Re: [RFC v3 0/3] Add VRF support for VXLAN underlay

2018-11-21 Thread David Ahern
On 11/21/18 6:30 AM, Alexis Bauvin wrote: > Le 20 nov. 2018 à 22:45, David Ahern a écrit : >> >> On 11/20/18 7:23 AM, Alexis Bauvin wrote: >>> We are trying to isolate the VXLAN traffic from different VMs with VRF as >>> shown >>> in the schemas below: >>> >>> +-+

[PATCH bpf-next] bpf: fix a libbpf loader issue

2018-11-21 Thread Yonghong Song
Commit 2993e0515bb4 ("tools/bpf: add support to read .BTF.ext sections") added support to read .BTF.ext sections from an object file, create and pass prog_btf_fd and func_info to the kernel. The program btf_fd (prog->btf_fd) is initialized to be -1 to please zclose so we do not need special

Re: [PATCH net] sctp: hold transport before accessing its asoc in sctp_hash_transport

2018-11-21 Thread Marcelo Ricardo Leitner
On Wed, Nov 21, 2018 at 08:27:21AM -0500, Neil Horman wrote: > On Tue, Nov 20, 2018 at 10:46:26PM -0200, Marcelo Ricardo Leitner wrote: > > On Tue, Nov 20, 2018 at 07:52:48AM -0500, Neil Horman wrote: > > > On Tue, Nov 20, 2018 at 07:09:16PM +0800, Xin Long wrote: > > > > In sctp_hash_transport,

Re: [PATCH bpf-next] bpf: add read/write access to skb->tstamp from tc clsact progs

2018-11-21 Thread Vlad Dumitrescu
On Wed, Nov 21, 2018 at 5:08 AM Eric Dumazet wrote: > > > > On 11/20/2018 06:40 PM, Alexei Starovoitov wrote: > > > > > looks good to me. > > > > Any particular reason you decided to disable it for cg_skb ? > > It seems to me the same EDT approach will work from > > cgroup-bpf skb hooks just as

[PATCH v2 net] lan743x: fix return value for lan743x_tx_napi_poll

2018-11-21 Thread Bryan Whitehead
The lan743x driver, when under heavy traffic load, has been noticed to sometimes hang, or cause a kernel panic. Debugging reveals that the TX napi poll routine was returning the wrong value, 'weight'. Most other drivers return 0. And call napi_complete, instead of napi_complete_done.

Re: [Patch net-next 2/2] net: dump whole skb data in netdev_rx_csum_fault()

2018-11-21 Thread Eric Dumazet
On Wed, Nov 21, 2018 at 10:17 AM Cong Wang wrote: > > On Wed, Nov 21, 2018 at 5:05 AM Eric Dumazet wrote: > > > > > > > > On 11/20/2018 06:13 PM, Cong Wang wrote: > > > Currently, we only dump a few selected skb fields in > > > netdev_rx_csum_fault(). It is not suffient for debugging checksum >

Re: [Patch net-next 2/2] net: dump whole skb data in netdev_rx_csum_fault()

2018-11-21 Thread Cong Wang
On Wed, Nov 21, 2018 at 5:05 AM Eric Dumazet wrote: > > > > On 11/20/2018 06:13 PM, Cong Wang wrote: > > Currently, we only dump a few selected skb fields in > > netdev_rx_csum_fault(). It is not suffient for debugging checksum > > fault. This patch introduces skb_dump() which dumps skb mac

Re: Application of f8b39039cbf2a15f ("net: fs_enet: do not call phy_stop() in interrupts") to 4.9 and 4.14 stable

2018-11-21 Thread Greg KH
On Wed, Oct 17, 2018 at 02:08:41PM +0200, Christophe LEROY wrote: > Hi, > > Could you please apply f8b39039cbf2a15f2b8c9f081e1cbd5dee00aaf5 to 4.9 and > 4.14 ? > > It fixes an Oops when Ethernet transmission times out. > > As you can observe in the commit log, the Oops what initially observed

Re: [PATCH net-next 4/4] netns: enable to dump full nsid translation table

2018-11-21 Thread David Ahern
On 11/21/18 4:01 AM, Nicolas Dichtel wrote: > diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c > index 92730905886c..fc568cd0b560 100644 > --- a/net/core/net_namespace.c > +++ b/net/core/net_namespace.c > @@ -740,7 +740,7 @@ static int rtnl_net_get_size(void) > } > > static int

Re: [PATCH net v2] net/sched: act_police: fix race condition on state variables

2018-11-21 Thread Cong Wang
On Tue, Nov 20, 2018 at 1:19 PM Davide Caratti wrote: > @@ -257,25 +261,28 @@ static int tcf_police_act(struct sk_buff *skb, const > struct tc_action *a, > } > > now = ktime_get_ns(); > - toks = min_t(s64, now - p->tcfp_t_c, p->tcfp_burst); > +

Re: [PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-21 Thread David Ahern
On 11/21/18 4:01 AM, Nicolas Dichtel wrote: > static int rtnl_net_dumpid(struct sk_buff *skb, struct netlink_callback *cb) > { > - struct net *net = sock_net(skb->sk); > struct rtnl_net_dump_cb net_cb = { > - .net = net, > + .tgt_net = sock_net(skb->sk), >

Re: [PATCH net] net/sched: act_police: add missing spinlock initialization

2018-11-21 Thread Cong Wang
On Wed, Nov 21, 2018 at 9:24 AM Davide Caratti wrote: > > commit f2cbd4852820 ("net/sched: act_police: fix race condition on state > variables") introduces a new spinlock, but forgets its initialization. > Ensure that tcf_police_init() initializes 'tcfp_lock' every time a 'police' > action is

Re: selftests/bpf :get_cgroup_id_user: File not found: /sys/kernel/debug/tracing/events/syscalls/sys_enter_nanosleep/id

2018-11-21 Thread Y Song
On Wed, Nov 21, 2018 at 3:44 AM Naresh Kamboju wrote: > > Kselftest bpf get_cgroup_id_user is failed on all devices. > > selftests: bpf: get_cgroup_id_user > main:PASS:setup_cgroup_environment > main:PASS:create_and_get_cgroup > main:PASS:join_cgroup > main:PASS:bpf_prog_load >

Re: [PATCH net] sctp: hold transport before accessing its asoc in sctp_hash_transport

2018-11-21 Thread Marcelo Ricardo Leitner
On Wed, Nov 21, 2018 at 03:47:33PM +0900, Xin Long wrote: > On Wed, Nov 21, 2018 at 9:46 AM Marcelo Ricardo Leitner > wrote: > > > > On Tue, Nov 20, 2018 at 07:52:48AM -0500, Neil Horman wrote: > > > On Tue, Nov 20, 2018 at 07:09:16PM +0800, Xin Long wrote: > > > > In sctp_hash_transport, it

[PATCH net-next 2/3] tcp: implement coalescing on backlog queue

2018-11-21 Thread Eric Dumazet
In case GRO is not as efficient as it should be or disabled, we might have a user thread trapped in __release_sock() while softirq handler flood packets up to the point we have to drop. This patch balances work done from user thread and softirq, to give more chances to __release_sock() to

[PATCH net-next 3/3] tcp: implement head drops in backlog queue

2018-11-21 Thread Eric Dumazet
Under high stress, and if GRO or coalescing does not help, we better make room in backlog queue to be able to keep latest packet coming. This generally helps fast recovery, given that we often receive packets in order. Signed-off-by: Eric Dumazet Tested-by: Jean-Louis Dupond Cc: Neal Cardwell

[PATCH net-next 0/3] tcp: take a bit more care of backlog stress

2018-11-21 Thread Eric Dumazet
While working on the SACK compression issue Jean-Louis Dupond reported, we found that his linux box was suffering very hard from tail drops on the socket backlog queue, because the opposite TCP stack was ont implementing latest RFC recommendations. First patch is a cleanup Second patch is

[PATCH net-next 1/3] tcp: remove hdrlen argument from tcp_queue_rcv()

2018-11-21 Thread Eric Dumazet
Only one caller needs to pull TCP headers, so lets move __skb_pull() to the caller side. Signed-off-by: Eric Dumazet --- net/ipv4/tcp_input.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index

Re: [PATCH net v2] net: don't keep lonely packets forever in the gro hash

2018-11-21 Thread Eric Dumazet
On 11/21/2018 09:21 AM, Paolo Abeni wrote: > Eric noted that with UDP GRO and NAPI timeout, we could keep a single > UDP packet inside the GRO hash forever, if the related NAPI instance > calls napi_gro_complete() at an higher frequency than the NAPI timeout. Acked-by: Eric Dumazet

[PATCH bpf-next 2/2] libbpf: Verify versioned symbols

2018-11-21 Thread Andrey Ignatov
Since ABI versioning info is kept separately from the code it's easy to forget to update it while adding a new API. Add simple verification that all global symbols exported with LIBBPF_API are versioned in libbpf.map version script. The idea is to check that number of global symbols in

[PATCH bpf-next 0/2] libbpf: ABI versioning

2018-11-21 Thread Andrey Ignatov
This patch set adds ABI versioning to libbpf. Patch 1 adds version script and has more details on why it's needed. Patch 2 adds simple check that all global symbols are versioned. Andrey Ignatov (2): libbpf: Add version script for DSO libbpf: Verify versioned symbols

[PATCH bpf-next 1/2] libbpf: Add version script for DSO

2018-11-21 Thread Andrey Ignatov
More and more projects use libbpf and one day it'll likely be packaged and distributed as DSO and that requires ABI versioning so that both compatible and incompatible changes to ABI can be introduced in a safe way in the future without breaking executables dynamically linked with a previous

Re: [PATCH iproute2] ipnetns: parse nsid as a signed integer

2018-11-21 Thread Stephen Hemminger
On Wed, 21 Nov 2018 10:44:27 +0100 Nicolas Dichtel wrote: > Don't confuse the user, nsid is a signed integer, this kind of command > should return an error: 'ip netns set foo 0x'. > > Also, a valid value is a positive value. To let the kernel chooses a value, > the keyword 'auto' must

Re: [PATCH iproute2] bpf: initialise map symbol before retrieving and comparing its type

2018-11-21 Thread Stephen Hemminger
On Tue, 20 Nov 2018 01:26:27 + Quentin Monnet wrote: > In order to compare BPF map symbol type correctly in regard to the > latest LLVM, commit 7a04dd84a7f9 ("bpf: check map symbol type properly > with newer llvm compiler") compares map symbol type to both NOTYPE and > OBJECT. To do so, it

Re: [PATCH net v2] net: don't keep lonely packets forever in the gro hash

2018-11-21 Thread Willem de Bruijn
On Wed, Nov 21, 2018 at 12:21 PM Paolo Abeni wrote: > > Eric noted that with UDP GRO and NAPI timeout, we could keep a single > UDP packet inside the GRO hash forever, if the related NAPI instance > calls napi_gro_complete() at an higher frequency than the NAPI timeout. > Willem noted that even

[PATCH bpf-next v3] libbpf: make sure bpf headers are c++ include-able

2018-11-21 Thread Stanislav Fomichev
Wrap headers in extern "C", to turn off C++ mangling. This simplifies including libbpf in c++ and linking against it. v2 changes: * do the same for btf.h v3 changes: * test_libbpf.cpp to test for possible future c++ breakages Signed-off-by: Stanislav Fomichev --- tools/lib/bpf/Makefile

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-21 Thread Stanislav Fomichev
On 11/21, Quentin Monnet wrote: > 2018-11-20 15:26 UTC-0800 ~ Stanislav Fomichev > > On 11/20, Alexei Starovoitov wrote: > >> On Wed, Nov 21, 2018 at 12:18:57AM +0100, Daniel Borkmann wrote: > >>> On 11/21/2018 12:04 AM, Alexei Starovoitov wrote: > On Tue, Nov 20, 2018 at 01:19:05PM -0800,

  1   2   >