[PATCH 3/4] netfilter: ctnetlink: Fix regression in conntrack entry deletion

2019-06-28 Thread Pablo Neira Ayuso
From: Felix Kaechele Commit f8e608982022 ("netfilter: ctnetlink: Resolve conntrack L3-protocol flush regression") introduced a regression in which deletion of conntrack entries would fail because the L3 protocol information is replaced by AF_UNSPEC. As a result the search for the entry to be dele

[PATCH 0/4] Netfilter/IPVS fixes for net

2019-06-28 Thread Pablo Neira Ayuso
Hi, The following patchset contains Netfilter fixes for net: 1) Fix memleak reported by syzkaller when registering IPVS hooks, patch from Julian Anastasov. 2) Fix memory leak in start_sync_thread, also from Julian. 3) Fix conntrack deletion via ctnetlink, from Felix Kaechele. 4) Fix reject

Re: [net-next 4/4] gve: Add ethtool support

2019-06-28 Thread Catherine Sullivan
On Wed, Jun 26, 2019 at 12:48 PM Andrew Lunn wrote: > > > +static int gve_get_sset_count(struct net_device *netdev, int sset) > > +{ > > + struct gve_priv *priv = netdev_priv(netdev); > > + > > + if (!netif_carrier_ok(netdev)) > > + return 0; > > That is pretty unusual. What go

Re: [PATCH v3 bpf-next 2/9] libbpf: introduce concept of bpf_link

2019-06-28 Thread Stanislav Fomichev
On 06/28, Andrii Nakryiko wrote: > On Fri, Jun 28, 2019 at 9:02 AM Stanislav Fomichev wrote: > > > > On 06/27, Andrii Nakryiko wrote: > > > bpf_link is and abstraction of an association of a BPF program and one > > > of many possible BPF attachment points (hooks). This allows to have > > > uniform

Re: [net-next 2/4] gve: Add transmit and receive support

2019-06-28 Thread Catherine Sullivan
On Wed, Jun 26, 2019 at 12:49 PM David Miller wrote: > > From: Catherine Sullivan > Date: Wed, 26 Jun 2019 11:52:49 -0700 > > > +#ifdef __LITTLE_ENDIAN > > +#define GVE_SEQNO(x) __force u16)x) >> 8) & 0x7) > > +#else > > +#define GVE_SEQNO(x) ((__force u16)(x) & 0x7) > > +#endif > > This

Re: [PATCH v3 bpf-next 2/9] libbpf: introduce concept of bpf_link

2019-06-28 Thread Alexei Starovoitov
On 6/28/19 10:45 AM, Stanislav Fomichev wrote: +struct bpf_link { >>> Maybe call it bpf_attachment? You call the bpf_program__attach_to_blah >>> and you get an attachment? >> >> I wanted to keep it as short as possible, bpf_attachment is way too >> long (it's also why as an alternative I'

Re: [net-next 2/4] gve: Add transmit and receive support

2019-06-28 Thread Catherine Sullivan
On Wed, Jun 26, 2019 at 12:42 PM Andrew Lunn wrote: > > > +static int gve_change_mtu(struct net_device *dev, int new_mtu) > > +{ > > + dev->mtu = new_mtu; > > + return 0; > > +} > > The default implementation does this. > > Also, i think your mtu has a limit of PAGE size. So you should se

Re: [net-next 1/4] gve: Add basic driver framework for Compute Engine Virtual NIC

2019-06-28 Thread Catherine Sullivan
On Wed, Jun 26, 2019 at 4:08 PM Jakub Kicinski wrote: > > On Wed, 26 Jun 2019 11:52:48 -0700, Catherine Sullivan wrote: > > Add a driver framework for the Compute Engine Virtual NIC that will be > > available in the future. > > > > At this point the only functionality is loading the driver. > > >

Re: [PATCH v3 bpf-next 3/9] libbpf: add ability to attach/detach BPF program to perf event

2019-06-28 Thread Stanislav Fomichev
On 06/28, Andrii Nakryiko wrote: > On Fri, Jun 28, 2019 at 9:04 AM Stanislav Fomichev wrote: > > > > On 06/27, Andrii Nakryiko wrote: > > > bpf_program__attach_perf_event allows to attach BPF program to existing > > > perf event hook, providing most generic and most low-level way to attach > > >

Re: [net-next 1/4] gve: Add basic driver framework for Compute Engine Virtual NIC

2019-06-28 Thread Catherine Sullivan
On Wed, Jun 26, 2019 at 12:35 PM Andrew Lunn wrote: > > On Wed, Jun 26, 2019 at 11:52:48AM -0700, Catherine Sullivan wrote: > > Add a driver framework for the Compute Engine Virtual NIC that will be > > available in the future. > > > > +static int __init gvnic_init_module(void) > > +{ > > + re

Re: [PATCH v3 bpf-next 2/9] libbpf: introduce concept of bpf_link

2019-06-28 Thread Stanislav Fomichev
On 06/28, Alexei Starovoitov wrote: > On 6/28/19 10:45 AM, Stanislav Fomichev wrote: > > +struct bpf_link { > >>> Maybe call it bpf_attachment? You call the bpf_program__attach_to_blah > >>> and you get an attachment? > >> > >> I wanted to keep it as short as possible, bpf_attachment is w

[PATCH net-next v2 0/4] Add gve driver

2019-06-28 Thread Catherine Sullivan
This patch series adds the gve driver which will support the Compute Engine Virtual NIC that will be available in the future. v2: - Patch 1: - Remove gve_size_assert.h and use static_assert instead. - Loop forever instead of bugging if the device won't reset - Use module_pci_driver - Patch 2

[PATCH net-next v2 4/4] gve: Add ethtool support

2019-06-28 Thread Catherine Sullivan
Add support for the following ethtool commands: ethtool -s|--change devname [msglvl N] [msglevel type on|off] ethtool -S|--statistics devname ethtool -i|--driver devname ethtool -l|--show-channels devname ethtool -L|--set-channels devname ethtool -g|--show-ring devname ethtool --reset devname Sig

[PATCH net-next v2 3/4] gve: Add workqueue and reset support

2019-06-28 Thread Catherine Sullivan
Add support for the workqueue to handle management interrupts and support for resets. Signed-off-by: Catherine Sullivan Signed-off-by: Sagi Shahar Signed-off-by: Jon Olson Acked-by: Willem de Bruijn Reviewed-by: Luigi Rizzo --- .../networking/device_drivers/google/gve.rst | 11 + drivers/n

[PATCH net-next v2 1/4] gve: Add basic driver framework for Compute Engine Virtual NIC

2019-06-28 Thread Catherine Sullivan
Add a driver framework for the Compute Engine Virtual NIC that will be available in the future. At this point the only functionality is loading the driver. Signed-off-by: Catherine Sullivan Signed-off-by: Sagi Shahar Signed-off-by: Jon Olson Acked-by: Willem de Bruijn Reviewed-by: Luigi Rizzo

[PATCH net-next v2 2/4] gve: Add transmit and receive support

2019-06-28 Thread Catherine Sullivan
Add support for passing traffic. Signed-off-by: Catherine Sullivan Signed-off-by: Sagi Shahar Signed-off-by: Jon Olson Acked-by: Willem de Bruijn Reviewed-by: Luigi Rizzo --- .../networking/device_drivers/google/gve.rst | 30 + drivers/net/ethernet/google/gve/Makefile | 2 +- driver

Re: [PATCH 3/3, net-next] net: netsec: add XDP support

2019-06-28 Thread Ilias Apalodimas
Hi Maciej, > > On Fri, Jun 28, 2019 at 03:35:52PM +0200, Jesper Dangaard Brouer wrote: > > > On Fri, 28 Jun 2019 13:39:15 +0300 > > > Ilias Apalodimas wrote: > > > > > > > +static int netsec_xdp_setup(struct netsec_priv *priv, struct bpf_prog > > > > *prog, > > > > +

Re: [PATCH v3 bpf-next 3/9] libbpf: add ability to attach/detach BPF program to perf event

2019-06-28 Thread Andrii Nakryiko
On Fri, Jun 28, 2019 at 10:54 AM Stanislav Fomichev wrote: > > On 06/28, Andrii Nakryiko wrote: > > On Fri, Jun 28, 2019 at 9:04 AM Stanislav Fomichev wrote: > > > > > > On 06/27, Andrii Nakryiko wrote: > > > > bpf_program__attach_perf_event allows to attach BPF program to existing > > > > perf e

Re: [PATCH v3 bpf-next 3/9] libbpf: add ability to attach/detach BPF program to perf event

2019-06-28 Thread Stanislav Fomichev
On 06/27, Andrii Nakryiko wrote: > bpf_program__attach_perf_event allows to attach BPF program to existing > perf event hook, providing most generic and most low-level way to attach BPF > programs. It returns struct bpf_link, which should be passed to > bpf_link__destroy to detach and free resource

[Patch net 2/3] idr: introduce idr_for_each_entry_continue_ul()

2019-06-28 Thread Cong Wang
Similarly, other callers of idr_get_next_ul() suffer the same overflow bug as they don't handle it properly either. Introduce idr_for_each_entry_continue_ul() to help these callers iterate from a given ID. cls_flower needs more care here because it still has overflow when does arg->cookie++, we h

[Patch net 0/3] idr: fix overflow cases on 32-bit CPU

2019-06-28 Thread Cong Wang
idr_get_next_ul() is problematic by design, it can't handle the following overflow case well on 32-bit CPU: u32 id = UINT_MAX; idr_alloc_u32(&id); while (idr_get_next_ul(&id) != NULL) id++; when 'id' overflows and becomes 0 after UINT_MAX, the loop goes infinite. Fix this by eliminating externa

[Patch net 3/3] selftests: add a test case for cls_lower handle overflow

2019-06-28 Thread Cong Wang
From: Davide Caratti Reported-by: Li Shuang Signed-off-by: Davide Caratti Signed-off-by: Cong Wang --- .../tc-testing/tc-tests/filters/tests.json| 19 +++ 1 file changed, 19 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json b/tools

[Patch net 1/3] idr: fix overflow case for idr_for_each_entry_ul()

2019-06-28 Thread Cong Wang
idr_for_each_entry_ul() is buggy as it can't handle overflow case correctly. When we have an ID == UINT_MAX, it becomes an infinite loop. This happens when running on 32-bit CPU where unsigned long has the same size with unsigned int. There is no better way to fix this than casting it to a larger

Re: [PATCH v3 bpf-next 3/9] libbpf: add ability to attach/detach BPF program to perf event

2019-06-28 Thread Andrii Nakryiko
On Fri, Jun 28, 2019 at 11:00 AM Stanislav Fomichev wrote: > > On 06/27, Andrii Nakryiko wrote: > > bpf_program__attach_perf_event allows to attach BPF program to existing > > perf event hook, providing most generic and most low-level way to attach BPF > > programs. It returns struct bpf_link, whi

Re: [PATCH v3 bpf-next 3/9] libbpf: add ability to attach/detach BPF program to perf event

2019-06-28 Thread Stanislav Fomichev
On 06/27, Andrii Nakryiko wrote: > bpf_program__attach_perf_event allows to attach BPF program to existing > perf event hook, providing most generic and most low-level way to attach BPF > programs. It returns struct bpf_link, which should be passed to > bpf_link__destroy to detach and free resource

Re: [PATCH net-next v2 4/4] gve: Add ethtool support

2019-06-28 Thread Stephen Hemminger
On Fri, 28 Jun 2019 10:56:33 -0700 Catherine Sullivan wrote: > +static void > +gve_get_ethtool_stats(struct net_device *netdev, > + struct ethtool_stats *stats, u64 *data) > +{ > + struct gve_priv *priv = netdev_priv(netdev); > + u64 rx_pkts, rx_bytes, tx_pkts, tx_bytes;

Re: [PATCH v3 bpf-next 3/9] libbpf: add ability to attach/detach BPF program to perf event

2019-06-28 Thread Stanislav Fomichev
On 06/28, Andrii Nakryiko wrote: > On Fri, Jun 28, 2019 at 11:00 AM Stanislav Fomichev wrote: > > > > On 06/27, Andrii Nakryiko wrote: > > > bpf_program__attach_perf_event allows to attach BPF program to existing > > > perf event hook, providing most generic and most low-level way to attach > > >

Re: [PATCH v3 bpf-next 3/9] libbpf: add ability to attach/detach BPF program to perf event

2019-06-28 Thread Andrii Nakryiko
On Fri, Jun 28, 2019 at 11:14 AM Stanislav Fomichev wrote: > > On 06/28, Andrii Nakryiko wrote: > > On Fri, Jun 28, 2019 at 11:00 AM Stanislav Fomichev > > wrote: > > > > > > On 06/27, Andrii Nakryiko wrote: > > > > bpf_program__attach_perf_event allows to attach BPF program to existing > > > >

Re: [PATCH v4 03/13] dt-bindings: net: Add a YAML schemas for the generic MDIO options

2019-06-28 Thread Rob Herring
On Fri, Jun 28, 2019 at 7:46 AM Maxime Ripard wrote: > > On Thu, Jun 27, 2019 at 10:06:57AM -0600, Rob Herring wrote: > > On Thu, Jun 27, 2019 at 9:57 AM Maxime Ripard > > wrote: > > > > > + > > > > > +reset-gpios = <&gpio2 5 1>; > > > > > +reset-delay-us = <2>; > > > > > + > > >

Re: [PATCH v2 bpf-next 2/4] selftests/bpf: add __int and __type macro for BTF-defined maps

2019-06-28 Thread Song Liu
> On Jun 28, 2019, at 8:25 AM, Andrii Nakryiko wrote: > > Add simple __int and __type macro that hide details of how type and > integer values are captured in BTF-defined maps. > > Signed-off-by: Andrii Nakryiko Acked-by: Song Liu > --- > tools/testing/selftests/bpf/bpf_helpers.h | 3 +++

Re: [PATCH v2 bpf-next 1/4] libbpf: capture value in BTF type info for BTF-defined map defs

2019-06-28 Thread Song Liu
> On Jun 28, 2019, at 8:25 AM, Andrii Nakryiko wrote: > > Change BTF-defined map definitions to capture compile-time integer > values as part of BTF type definition, to avoid split of key/value type > information and actual type/size/flags initialization for maps. > > Signed-off-by: Andrii Na

Re: [PATCHv2 next 0/3] blackhole device to invalidate dst

2019-06-28 Thread Michael Chan
On Thu, Jun 27, 2019 at 12:42 PM Mahesh Bandewar wrote: > However, Michael Chan had a setup > where these fixes helped him mitigate the issue and not cause > the crash. > Our lab has finished testing these patches. The patches work in the sense that no oversize packets are now passed to the dr

Re: [PATCH v2 bpf-next 3/4] selftests/bpf: convert selftests using BTF-defined maps to new syntax

2019-06-28 Thread Song Liu
> On Jun 28, 2019, at 8:25 AM, Andrii Nakryiko wrote: > > Convert all the existing selftests that are already using BTF-defined > maps to use new syntax (with no static data initialization). > > Signed-off-by: Andrii Nakryiko Acked-by: Song Liu This looks cleaner! > --- > tools/testing/s

Re: [PATCH v2 bpf-next 4/4] selftests/bpf: convert legacy BPF maps to BTF-defined ones

2019-06-28 Thread Song Liu
> On Jun 28, 2019, at 8:25 AM, Andrii Nakryiko wrote: > > Convert selftests that were originally left out and new ones added > recently to consistently use BTF-defined maps. > > Signed-off-by: Andrii Nakryiko Acked-by: Song Liu > --- > .../selftests/bpf/progs/get_cgroup_id_kern.c | 26 +

[PATCH net-next 0/2] Fix batched event generation for mirred action

2019-06-28 Thread Roman Mashak
When adding or deleting a batch of entries, the kernel sends upto TCA_ACT_MAX_PRIO entries in an event to user space. However it does not consider that the action sizes may vary and require different skb sizes. For example : % cat tc-batch.sh TC="sudo /mnt/iproute2.git/tc/tc" $TC actions flush a

[PATCH net-next 1/2] net sched: update mirred action for batched events operations

2019-06-28 Thread Roman Mashak
Add get_fill_size() routine used to calculate the action size when building a batch of events. Signed-off-by: Roman Mashak --- net/sched/act_mirred.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 58e7573dded4..2857c8dd4c04 100644

[PATCH net-next 2/2] tc-testing: updated mirred action tests with batch create/delete

2019-06-28 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/mirred.json| 94 ++ 1 file changed, 94 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json b/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json index 6

Re: [PATCH 1/2] tls: remove close callback sock unlock/lock and flush_sync

2019-06-28 Thread Jakub Kicinski
On Fri, 28 Jun 2019 07:12:07 -0700, John Fastabend wrote: > Yeah seems possible although never seen in my testing. So I'll > move the test_bit() inside the lock and do a ctx check to ensure > still have the reference. > > CPU 0 (free) CPU 1 (wq) > > lock(sk) >

Re: [net-next 1/4] gve: Add basic driver framework for Compute Engine Virtual NIC

2019-06-28 Thread Jakub Kicinski
On Fri, 28 Jun 2019 10:52:27 -0700, Catherine Sullivan wrote: > > > +if NET_VENDOR_GOOGLE > > > + > > > +config GVE > > > + tristate "Google Virtual NIC (gVNIC) support" > > > + depends on (PCI_MSI && X86) > > > > We usually prefer for drivers not to depend on the platform unless > > real

Re: [PATCH v2 bpf-next 1/4] bpf: unprivileged BPF access via /dev/bpf

2019-06-28 Thread Song Liu
Hi Andy, > On Jun 27, 2019, at 4:40 PM, Andy Lutomirski wrote: > > On 6/27/19 1:19 PM, Song Liu wrote: >> This patch introduce unprivileged BPF access. The access control is >> achieved via device /dev/bpf. Users with write access to /dev/bpf are able >> to call sys_bpf(). >> Two ioctl command

Re: [PATCH v2 bpf-next 1/4] bpf: unprivileged BPF access via /dev/bpf

2019-06-28 Thread Song Liu
> On Jun 28, 2019, at 2:01 AM, Lorenz Bauer wrote: > > On Thu, 27 Jun 2019 at 21:19, Song Liu wrote: >> >> This patch introduce unprivileged BPF access. The access control is >> achieved via device /dev/bpf. Users with write access to /dev/bpf are able >> to call sys_bpf(). >> >> Two ioctl

Re: [PATCH 1/1] net: dsa: b53: Disable all ports on setup

2019-06-28 Thread Vivien Didelot
On Fri, 28 Jun 2019 10:23:06 -0700, Florian Fainelli wrote: > On 6/28/19 9:58 AM, Benedikt Spranger wrote: > > A b53 device may configured through an external EEPROM like the switch > > device on the Lamobo R1 router board. The configuration of a port may > > therefore differ from the reset confi

Re: [PATCH bpf-next] bpf: fix precision tracking

2019-06-28 Thread Andrii Nakryiko
On Fri, Jun 28, 2019 at 9:25 AM Alexei Starovoitov wrote: > > When equivalent state is found the current state needs to propagate precision > marks. > Otherwise the verifier will prune the search incorrectly. > > There is a price for correctness: > before beforebrok

Re: [PATCH v3 bpf-next 1/9] libbpf: make libbpf_strerror_r agnostic to sign of error

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > It's often inconvenient to switch sign of error when passing it into > libbpf_strerror_r. It's better for it to handle that automatically. > > Signed-off-by: Andrii Nakryiko > Reviewed-by: Stanislav Fomichev Acked-by: Song Liu > ---

Re: [PATCH bpf-next] bpf: fix precision tracking

2019-06-28 Thread Lawrence Brakmo
On 6/28/19, 12:33 PM, "netdev-ow...@vger.kernel.org on behalf of Andrii Nakryiko" wrote: On Fri, Jun 28, 2019 at 9:25 AM Alexei Starovoitov wrote: > > When equivalent state is found the current state needs to propagate precision marks. > Otherwise the verifier will prune the

Re: [PATCH v3 bpf-next 2/9] libbpf: introduce concept of bpf_link

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > bpf_link is and abstraction of an association of a BPF program and one > of many possible BPF attachment points (hooks). This allows to have > uniform interface for detaching BPF programs regardless of the nature of > link and how it was

Re: [PATCH 1/2] tls: remove close callback sock unlock/lock and flush_sync

2019-06-28 Thread John Fastabend
Jakub Kicinski wrote: > On Fri, 28 Jun 2019 07:12:07 -0700, John Fastabend wrote: > > Yeah seems possible although never seen in my testing. So I'll > > move the test_bit() inside the lock and do a ctx check to ensure > > still have the reference. > > > > CPU 0 (free) CPU 1 (wq) > > >

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

2019-06-28 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 an EDT of more than 500us in the future unless the packet belongs to a flow with less than 2 packets in fligh

Re: [PATCH v3 bpf-next 4/9] libbpf: add kprobe/uprobe attach API

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > Add ability to attach to kernel and user probes and retprobes. > Implementation depends on perf event support for kprobes/uprobes. > > Signed-off-by: Andrii Nakryiko > --- > tools/lib/bpf/libbpf.c | 213 +++

Re: [PATCH v3 bpf-next 5/9] libbpf: add tracepoint attach API

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > Allow attaching BPF programs to kernel tracepoint BPF hooks specified by > category and name. > > Signed-off-by: Andrii Nakryiko > --- > tools/lib/bpf/libbpf.c | 78 > tools/lib/bpf/libbpf.h

Re: [PATCH v3 bpf-next 6/9] libbpf: add raw tracepoint attach API

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > Add a wrapper utilizing bpf_link "infrastructure" to allow attaching BPF > programs to raw tracepoints. > > Signed-off-by: Andrii Nakryiko Acked-by: Song Liu

Re: [PATCH net-next] af_packet: convert pending frame counter to atomic_t

2019-06-28 Thread Neil Horman
On Fri, Jun 28, 2019 at 11:15:09AM -0400, Willem de Bruijn wrote: > On Fri, Jun 28, 2019 at 10:53 AM Neil Horman wrote: > > > > The AF_PACKET protocol, when running as a memory mapped socket uses a > > pending frame counter to track the number of skbs in flight during > > transmission. It is incr

Re: [PATCH v3 bpf-next 4/9] libbpf: add kprobe/uprobe attach API

2019-06-28 Thread Andrii Nakryiko
On Fri, Jun 28, 2019 at 12:46 PM Song Liu wrote: > > On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > > > Add ability to attach to kernel and user probes and retprobes. > > Implementation depends on perf event support for kprobes/uprobes. > > > > Signed-off-by: Andrii Nakryiko > > ---

Re: [net-next 1/4] gve: Add basic driver framework for Compute Engine Virtual NIC

2019-06-28 Thread Andrew Lunn
On Fri, Jun 28, 2019 at 11:46:15AM -0700, Jakub Kicinski wrote: > On Fri, 28 Jun 2019 10:52:27 -0700, Catherine Sullivan wrote: > > > > +if NET_VENDOR_GOOGLE > > > > + > > > > +config GVE > > > > + tristate "Google Virtual NIC (gVNIC) support" > > > > + depends on (PCI_MSI && X86) > > > >

Re: [PATCH 00/11] XDP unaligned chunk placement support

2019-06-28 Thread Jakub Kicinski
On Fri, 28 Jun 2019 18:51:37 +0200, Björn Töpel wrote: > In your example Jakub, how would this look in XDP? Wouldn't the > timestamp be part of the metadata (xdp_md.data_meta)? Isn't > data-data_meta (if valid) <= XDP_PACKET_HEADROOM? That was my assumption. The driver parses the metadata and copi

Re: [PATCH v3 bpf-next 7/9] selftests/bpf: switch test to new attach_perf_event API

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > Use new bpf_program__attach_perf_event() in test previously relying on > direct ioctl manipulations. > > Signed-off-by: Andrii Nakryiko > Reviewed-by: Stanislav Fomichev Acked-by: Song Liu > --- > .../bpf/prog_tests/stacktrace_build

Re: [PATCH v3 bpf-next 4/9] libbpf: add kprobe/uprobe attach API

2019-06-28 Thread Song Liu
On Fri, Jun 28, 2019 at 12:59 PM Andrii Nakryiko wrote: > > On Fri, Jun 28, 2019 at 12:46 PM Song Liu wrote: > > > > On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > > > > > Add ability to attach to kernel and user probes and retprobes. > > > Implementation depends on perf event suppo

Re: [PATCH v3 bpf-next 8/9] selftests/bpf: add kprobe/uprobe selftests

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 10:54 PM Andrii Nakryiko wrote: > > Add tests verifying kprobe/kretprobe/uprobe/uretprobe APIs work as > expected. > > Signed-off-by: Andrii Nakryiko > Reviewed-by: Stanislav Fomichev Acked-by: Song Liu > --- > .../selftests/bpf/prog_tests/attach_probe.c | 155 +

Re: [PATCH v3 bpf-next 5/9] libbpf: add tracepoint attach API

2019-06-28 Thread Song Liu
On Fri, Jun 28, 2019 at 12:50 PM Song Liu wrote: > > On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > > > Allow attaching BPF programs to kernel tracepoint BPF hooks specified by > > category and name. > > > > Signed-off-by: Andrii Nakryiko Acked-by: Song Liu > > --- > > tools/lib

Re: [PATCH v3 bpf-next 9/9] selftests/bpf: convert existing tracepoint tests to new APIs

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > Convert some existing tests that attach to tracepoints to use > bpf_program__attach_tracepoint API instead. > > Signed-off-by: Andrii Nakryiko > Reviewed-by: Stanislav Fomichev Acked-by: Song Liu > --- > .../bpf/prog_tests/stacktrac

Re: [PATCH v3] bpf: fix uapi bpf_prog_info fields alignment

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 9:11 PM Baruch Siach wrote: > > Merge commit 1c8c5a9d38f60 ("Merge > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next") undid the > fix from commit 36f9814a494 ("bpf: fix uapi hole for 32 bit compat > applications") by taking the gpl_compatible 1-bit field defin

Re: [PATCH 00/11] XDP unaligned chunk placement support

2019-06-28 Thread Jakub Kicinski
On Fri, 28 Jun 2019 17:19:09 +0100, Laatz, Kevin wrote: > On 27/06/2019 22:25, Jakub Kicinski wrote: > > On Thu, 27 Jun 2019 12:14:50 +0100, Laatz, Kevin wrote: > >> On the application side (xdpsock), we don't have to worry about the user > >> defined headroom, since it is 0, so we only need to a

Re: [PATCH bpf-next] selftests/bpf: fix -Wstrict-aliasing in test_sockopt_sk.c

2019-06-28 Thread Song Liu
On Thu, Jun 27, 2019 at 6:14 PM Stanislav Fomichev wrote: > > Let's use union with u8[4] and u32 members for sockopt buffer, > that should fix any possible aliasing issues. > > test_sockopt_sk.c: In function ‘getsetsockopt’: > test_sockopt_sk.c:115:2: warning: dereferencing type-punned pointer wil

Re: [PATCH 00/11] XDP unaligned chunk placement support

2019-06-28 Thread Jonathan Lemon
On 28 Jun 2019, at 9:19, Laatz, Kevin wrote: On 27/06/2019 22:25, Jakub Kicinski wrote: On Thu, 27 Jun 2019 12:14:50 +0100, Laatz, Kevin wrote: On the application side (xdpsock), we don't have to worry about the user defined headroom, since it is 0, so we only need to account for the XDP_P

Re: [PATCH 1/1] net: dsa: b53: Disable all ports on setup

2019-06-28 Thread David Miller
From: Florian Fainelli Date: Fri, 28 Jun 2019 10:23:06 -0700 > On 6/28/19 9:58 AM, Benedikt Spranger wrote: >> A b53 device may configured through an external EEPROM like the switch >> device on the Lamobo R1 router board. The configuration of a port may >> therefore differ from the reset configu

Re: [PATCH v3 bpf-next 4/9] libbpf: add kprobe/uprobe attach API

2019-06-28 Thread Andrii Nakryiko
On Fri, Jun 28, 2019 at 1:09 PM Song Liu wrote: > > On Fri, Jun 28, 2019 at 12:59 PM Andrii Nakryiko > wrote: > > > > On Fri, Jun 28, 2019 at 12:46 PM Song Liu wrote: > > > > > > On Thu, Jun 27, 2019 at 10:53 PM Andrii Nakryiko wrote: > > > > > > > > Add ability to attach to kernel and user pro

Re: [PATCH 0/4] Netfilter/IPVS fixes for net

2019-06-28 Thread David Miller
From: Pablo Neira Ayuso Date: Fri, 28 Jun 2019 19:41:21 +0200 > The following patchset contains Netfilter fixes for net: > > 1) Fix memleak reported by syzkaller when registering IPVS hooks, >patch from Julian Anastasov. > > 2) Fix memory leak in start_sync_thread, also from Julian. > > 3)

Re: [PATCH 2/6 bpf-next] Clean up xsk reuseq API

2019-06-28 Thread Jakub Kicinski
On Thu, 27 Jun 2019 19:31:26 -0700, Jonathan Lemon wrote: > On 27 Jun 2019, at 15:38, Jakub Kicinski wrote: > > > On Thu, 27 Jun 2019 15:08:32 -0700, Jonathan Lemon wrote: > >> The reuseq is actually a recycle stack, only accessed from the kernel > >> side. > >> Also, the implementation details

Re: [PATCH net-next] af_packet: convert pending frame counter to atomic_t

2019-06-28 Thread kbuild test robot
Hi Neil, I love your patch! Perhaps something to improve: [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Neil-Horman/af_packet-convert-pending-frame-counter-to-atomic_t/20190629-032437 config: x86_64-randconfig-x007-201925 (attached as .config) com

Re: [PATCH 4/6 bfp-next] Simplify AF_XDP umem allocation path for Intel drivers.

2019-06-28 Thread Jakub Kicinski
On Thu, 27 Jun 2019 19:36:42 -0700, Jonathan Lemon wrote: > On 27 Jun 2019, at 15:42, Jakub Kicinski wrote: > > Could you be more explicit on the motivation? I'd call this patch set > > "make all drivers use reuse queue" rather than "clean up". > > The motivation is to have packets which were r

Re: [PATCH 4/6 bfp-next] Simplify AF_XDP umem allocation path for Intel drivers.

2019-06-28 Thread Jonathan Lemon
On 28 Jun 2019, at 13:48, Jakub Kicinski wrote: > On Thu, 27 Jun 2019 19:36:42 -0700, Jonathan Lemon wrote: >> On 27 Jun 2019, at 15:42, Jakub Kicinski wrote: >>> Could you be more explicit on the motivation? I'd call this patch set >>> "make all drivers use reuse queue" rather than "clean up". >

Re: [PATCH 2/6 bpf-next] Clean up xsk reuseq API

2019-06-28 Thread Jonathan Lemon
On 28 Jun 2019, at 13:41, Jakub Kicinski wrote: > On Thu, 27 Jun 2019 19:31:26 -0700, Jonathan Lemon wrote: >> On 27 Jun 2019, at 15:38, Jakub Kicinski wrote: >> >>> On Thu, 27 Jun 2019 15:08:32 -0700, Jonathan Lemon wrote: The reuseq is actually a recycle stack, only accessed from the ker

Re: [Patch net 2/3] idr: introduce idr_for_each_entry_continue_ul()

2019-06-28 Thread Davide Caratti
On Fri, 2019-06-28 at 11:03 -0700, Cong Wang wrote: > Similarly, other callers of idr_get_next_ul() suffer the same > overflow bug as they don't handle it properly either. > > Introduce idr_for_each_entry_continue_ul() to help these callers > iterate from a given ID. > > cls_flower needs more car

[PATCH net-next 1/1] tc-testing: added tdc tests for prio qdisc

2019-06-28 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../selftests/tc-testing/tc-tests/qdiscs/prio.json | 276 + 1 file changed, 276 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/prio.json diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/prio.

Re: [PATCH] net: ethernet: ti: cpsw: Assign OF node to slave devices

2019-06-28 Thread David Miller
From: Marek Vasut Date: Sun, 23 Jun 2019 14:11:43 +0200 > Assign OF node to CPSW slave devices, otherwise it is not possible to > bind e.g. DSA switch to them. Without this patch, the DSA code tries > to find the ethernet device by OF match, but fails to do so because > the slave device has NULL

Re: [PATCH net-next 0/2] Track recursive calls in TC act_mirred

2019-06-28 Thread David Miller
From: John Hurley Date: Mon, 24 Jun 2019 23:13:34 +0100 > These patches aim to prevent act_mirred causing stack overflow events from > recursively calling packet xmit or receive functions. Such events can > occur with poor TC configuration that causes packets to travel in loops > within the syste

[PATCH v2 net-next 09/19] ionic: Add the basic NDO callbacks for netdev support

2019-06-28 Thread Shannon Nelson
Set up the initial NDO structure and callbacks for netdev to use, and register the netdev. This will allow us to do a few basic operations on the device, but no traffic yet. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic.h | 1 + .../ethernet/pensando/ionic/ioni

[PATCH v2 net-next 04/19] ionic: Add basic lif support

2019-06-28 Thread Shannon Nelson
The LIF is the Logical Interface, which represents the external connections. The NIC can multiplex many LIFs to a single port, but in most setups, LIF0 is the primary control for the port. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/Makefile | 3 +- drivers/net/ethe

[PATCH v2 net-next 05/19] ionic: Add interrupts and doorbells

2019-06-28 Thread Shannon Nelson
The ionic interrupt model is based on interrupt control blocks accessed through the PCI BAR. Doorbell registers are used by the driver to signal to the NIC that requests are waiting on the message queues. Interrupts are used by the NIC to signal to the driver that answers are waiting on the compl

[PATCH v2 net-next 12/19] ionic: Add async link status check and basic stats

2019-06-28 Thread Shannon Nelson
Add code to handle the link status event, and wire up the basic netdev hardware stats. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 116 ++ .../net/ethernet/pensando/ionic/ionic_lif.h | 1 + 2 files changed, 117 insertions(+) diff --git a

[PATCH v2 net-next 08/19] ionic: Add notifyq support

2019-06-28 Thread Shannon Nelson
The AdminQ is fine for sending messages and requests to the NIC, but we also need to have events published from the NIC to the driver. The NotifyQ handles this for us, using the same interrupt as AdminQ. Signed-off-by: Shannon Nelson --- .../ethernet/pensando/ionic/ionic_debugfs.c | 16 ++ .

[PATCH v2 net-next 18/19] ionic: Add coalesce and other features

2019-06-28 Thread Shannon Nelson
Interrupt coalescing, tunable copybreak value, and tx timeout. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic.h | 2 +- .../ethernet/pensando/ionic/ionic_ethtool.c | 105 ++ .../net/ethernet/pensando/ionic/ionic_lif.c | 13 ++- .../net/ethern

[PATCH v2 net-next 17/19] ionic: Add RSS support

2019-06-28 Thread Shannon Nelson
Add code to manipulate through ethtool the RSS configuration used by the NIC. Signed-off-by: Shannon Nelson --- .../ethernet/pensando/ionic/ionic_ethtool.c | 73 +++ .../net/ethernet/pensando/ionic/ionic_lif.c | 89 +++ .../net/ethernet/pensando/ionic/ionic_lif.h

[PATCH v2 net-next 10/19] ionic: Add management of rx filters

2019-06-28 Thread Shannon Nelson
Set up the infrastructure for managing Rx filters. We can't ask the hardware for what filters it has, so we keep a local list of filters that we've pushed into the HW. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/Makefile | 4 +- .../net/ethernet/pensando/ionic/ionic

[PATCH v2 net-next 00/19] Add ionic driver

2019-06-28 Thread Shannon Nelson
This is the second version of a patch series that adds the ionic driver, supporting the Pensando ethernet device. In this initial patchset we implement basic transmit and receive. Later patchsets will add more advanced features. Our thanks to Andrew Lunn, Michal Kubecek, Jacub Kicinski, and the

[PATCH v2 net-next 03/19] ionic: Add port management commands

2019-06-28 Thread Shannon Nelson
The port management commands apply to the physical port associated with the PCI device, which might be shared among several logical interfaces. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic.h | 4 + .../ethernet/pensando/ionic/ionic_bus_pci.c | 16 +++ .../ne

[PATCH v2 net-next 19/19] ionic: Add basic devlink interface

2019-06-28 Thread Shannon Nelson
Add a devlink interface for access to information that isn't normally available through ethtool or the iplink interface. Example: $ ./devlink -j -p dev info pci/:b6:00.0 { "info": { "pci/:b6:00.0": { "driver": "ionic",

[PATCH v2 net-next 06/19] ionic: Add basic adminq support

2019-06-28 Thread Shannon Nelson
Most of the NIC configuration happens through the AdminQ message queue. NAPI is used for basic interrupt handling and message queue management. These routines are set up to be shared among different types of queues when used in slow-path handling. Signed-off-by: Shannon Nelson --- drivers/net/

[PATCH v2 net-next 01/19] ionic: Add basic framework for IONIC Network device driver

2019-06-28 Thread Shannon Nelson
This patch adds a basic driver framework for the Pensando IONIC network device. There is no functionality right now other than the ability to load and unload. Signed-off-by: Shannon Nelson --- .../networking/device_drivers/index.rst | 1 + .../device_drivers/pensando/ionic.rst |

[PATCH v2 net-next 15/19] ionic: Add netdev-event handling

2019-06-28 Thread Shannon Nelson
When the netdev gets a new name from userland, pass that name down to the NIC for internal tracking. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic.h | 2 + .../net/ethernet/pensando/ionic/ionic_lif.c | 65 +++ 2 files changed, 67 insertions(+)

[PATCH v2 net-next 02/19] ionic: Add hardware init and device commands

2019-06-28 Thread Shannon Nelson
The ionic device has a small set of PCI registers, including a device control and data space, and a large set of message commands. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/Makefile |2 +- drivers/net/ethernet/pensando/ionic/ionic.h | 20 + .../net/ethernet/p

[PATCH v2 net-next 16/19] ionic: Add driver stats

2019-06-28 Thread Shannon Nelson
Add in the detailed statistics for ethtool -S that the driver keeps as it processes packets. Display of the additional debug statistics can be enabled through the ethtool priv-flags feature. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/Makefile | 3 +- .../ethernet/p

[PATCH v2 net-next 11/19] ionic: Add Rx filter and rx_mode ndo support

2019-06-28 Thread Shannon Nelson
Add the Rx filtering and rx_mode NDO callbacks. Also add the deferred work thread handling needed to manage the filter requests otuside of the netif_addr_lock spinlock. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 389 +- .../net/ethernet/pen

[PATCH v2 net-next 13/19] ionic: Add initial ethtool support

2019-06-28 Thread Shannon Nelson
Add in the basic ethtool callbacks for device information and control. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/Makefile | 2 +- .../net/ethernet/pensando/ionic/ionic_dev.h | 3 + .../ethernet/pensando/ionic/ionic_ethtool.c | 509 ++ .../ethe

[PATCH v2 net-next 07/19] ionic: Add adminq action

2019-06-28 Thread Shannon Nelson
Add AdminQ specific message requests and completion handling. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic.h | 7 ++ .../net/ethernet/pensando/ionic/ionic_main.c | 106 ++ 2 files changed, 113 insertions(+) diff --git a/drivers/net/ethernet/pe

[PATCH v2 net-next 14/19] ionic: Add Tx and Rx handling

2019-06-28 Thread Shannon Nelson
Add both the Tx and Rx queue setup and handling. The related stats display comes later. Instead of using the generic napi routines used by the slow-path commands, the Tx and Rx paths are simplified and inlined in one file in order to get better compiler optimizations. Signed-off-by: Shannon Nels

Re: [PATCH] net: phylink: further documentation clarifications

2019-06-28 Thread David Miller
From: Russell King Date: Tue, 25 Jun 2019 10:44:33 +0100 > Clarify the validate() behaviour in a few cases which weren't mentioned > in the documentation, but which are necessary for users to get the > correct behaviour. > > Signed-off-by: Russell King Applied.

Re: [PATCH net-next v6 0/8] net/sched: Add txtime-assist support for taprio.

2019-06-28 Thread David Miller
From: Vedang Patel Date: Tue, 25 Jun 2019 15:07:11 -0700 > Currently, we are seeing packets being transmitted outside their > timeslices. We can confirm that the packets are being dequeued at the right > time. So, the delay is induced after the packet is dequeued, because > taprio, without any of

[PATCH 1/3 bpf-next] net: add convert_to_xdp_frame_keep_zc function

2019-06-28 Thread Jonathan Lemon
Add a function which converts a ZC xdp_buff to a an xdp_frame, while keeping the zc backing storage. This will be used to support TX of received AF_XDP frames. Signed-off-by: Jonathan Lemon --- include/net/xdp.h | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff -

[PATCH 3/3 bpf-next] ixgbe: Support zero-copy XDP_TX on the RX path for AF_XDP sockets.

2019-06-28 Thread Jonathan Lemon
When the XDP program attached to a zero-copy AF_XDP socket returns XDP_TX, queue the umem frame on the XDP TX ring. Space on the recycle stack is pre-allocated when the xsk is created. (taken from tx_ring, since the xdp ring is not initialized yet) Signed-off-by: Jonathan Lemon --- drivers/ne

<    1   2   3   4   >