[PATCH net-next v2 1/7] selftests/bpf: add a test for verifier logs

2017-10-09 Thread Jakub Kicinski
Add a test for verifier log handling. Check bad attr combinations but focus on cases when log is truncated. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> Acked-by: Alexei Starovoitov <a...@kernel.org> Acked-b

[PATCH net 2/2] nfp: handle page allocation failures

2017-10-10 Thread Jakub Kicinski
page_address() does not handle NULL argument gracefully, make sure we NULL-check the page pointer before passing it to page_address(). Fixes: ecd63a0217d5 ("nfp: add XDP support in the driver") Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon H

[PATCH net 1/2] nfp: fix ethtool stats gather retry

2017-10-10 Thread Jakub Kicinski
The while loop fetching 64 bit ethtool statistics may have to retry multiple times, it shouldn't modify the outside state. Fixes: 4c3523623dc0 ("net: add driver for Netronome NFP4000/NFP6000 NIC VFs") Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-

[PATCH net 0/2] nfp: fix ethtool stats and page allocation

2017-10-10 Thread Jakub Kicinski
in the driver "for ever" and fix won't backport cleanly beyond commit 325945ede6d4 ("nfp: split software and hardware vNIC statistics") which is in net. Jakub Kicinski (2): nfp: fix ethtool stats gather retry nfp: handle page allocation failures drivers/net/ethernet/netronome/

[PATCH net-next] net: dst: move cpu inside ifdef to avoid compilation warning

2017-10-10 Thread Jakub Kicinski
If CONFIG_DST_CACHE is not selected cpu variable will be unused and we will see a compilation warning. Move it under the ifdef. Reported-by: kbuild test robot <fengguang...@intel.com> Fixes: d66f2b91f95b ("bpf: don't rely on the verifier lock for metadata_dst allocation") Sign

[PATCH net-next 2/5] bpf: move instruction printing into a separate file

2017-10-05 Thread Jakub Kicinski
Separate the instruction printing into a standalone source file. This way sneaky code from tools/ can compile it in directly. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- kernel/bpf/Makefile | 1 + kernel/

[PATCH net-next 5/5] bpf: write back the verifier log buffer as it gets filled

2017-10-05 Thread Jakub Kicinski
of allocating a smaller buffer (a page) and writing it out into the user buffer whenever it fills up. To simplify the code assume that prints will never be longer than 1024 bytes. This is in preparation of the global verifier lock removal. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.

[PATCH net-next 3/5] tools: bpftool: use the kernel's instruction printer

2017-10-05 Thread Jakub Kicinski
Compile the instruction printer from kernel/bpf and use it for disassembling "translated" eBPF code. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- tools/bpf/bpftool/Documentation/bpftool-prog.rst

[PATCH net-next 0/5] bpf: get rid of global verifier state and reuse instruction printer

2017-10-05 Thread Jakub Kicinski
of actually removing the verifier lock is left to someone more competent and self-confident :) Jakub Kicinski (5): bpf: remove global verifier log bpf: move instruction printing into a separate file tools: bpftool: use the kernel's instruction printer bpf: don't rely on the verifier lock

[PATCH net-next 1/5] bpf: remove global verifier log

2017-10-05 Thread Jakub Kicinski
The biggest piece of global state protected by the verifier lock is the verifier log. Move that log to struct bpf_verifier_env. struct bpf_verifier_env has to be passed now to all invocations of verbose(). Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon

[PATCH net-next 4/5] bpf: don't rely on the verifier lock for metadata_dst allocation

2017-10-05 Thread Jakub Kicinski
bpf_skb_set_tunnel_*() functions require allocation of per-cpu metadata_dst. The allocation happens upon verfication of the first program using those helpers. In preparation for removing the verifier lock, use cmpxchg() to make sure we only allocate the metadata_dsts once. Signed-off-by: Jakub

Re: [PATCH net-next v4 0/3] tools: add bpftool

2017-10-05 Thread Jakub Kicinski
On Wed, 04 Oct 2017 21:46:47 -0700 (PDT), David Miller wrote: > From: Jakub Kicinski <jakub.kicin...@netronome.com> > Date: Wed, 4 Oct 2017 20:10:02 -0700 > > > Hi! > > > > This set adds bpftool to the tools/ directory. The first > > patch renames tool

Re: [PATCH net-next v2 0/3] ethtool: support for forward error correction mode setting on a link

2017-10-05 Thread Jakub Kicinski
On Fri, 28 Jul 2017 23:28:26 -0700, Roopa Prabhu wrote: > On Fri, Jul 28, 2017 at 9:46 AM, Jakub Kicinski <kubak...@wp.pl> wrote: > > On Fri, 28 Jul 2017 07:53:01 -0700, Roopa Prabhu wrote: > >> On Thu, Jul 27, 2017 at 7:33 PM, Jakub Kicinski <kubak...@wp.pl> wrote

[PATCH net] bpf: disallow arithmetic operations on context pointer

2017-10-16 Thread Jakub Kicinski
ntext pointers and add to selftests the test case described here. Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- Dave, a merge note - in net-next this will need env to be passed to verbose(). kernel/

Re: [PATCH net] bpf: disallow arithmetic operations on context pointer

2017-10-16 Thread Jakub Kicinski
On Mon, 16 Oct 2017 17:16:24 +0100, Edward Cree wrote: > On 16/10/17 16:45, Jakub Kicinski wrote: > > Commit f1174f77b50c ("bpf/verifier: rework value tracking") > > removed the crafty selection of which pointer types are > > allowed to be modified. This is OK f

[PATCH net-next] tools: bpftool: use more common tag format

2017-10-16 Thread Jakub Kicinski
g. This was pointed out in review but I misunderstood the comment. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- tools/bpf/bpftool/Documentation/bpftool-prog.rst | 2 +- tools/bpf/bpftool/main.h

[PATCH net v2] bpf: disallow arithmetic operations on context pointer

2017-10-16 Thread Jakub Kicinski
ntext pointers and add to selftests the test case described here. Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- Dave, a merge note - in net-next this will need env to be passed to verbos

Re: [PATCH net] bpf: disallow arithmetic operations on context pointer

2017-10-16 Thread Jakub Kicinski
On Mon, 16 Oct 2017 17:47:45 +0100, Edward Cree wrote: > On 16/10/17 17:30, Jakub Kicinski wrote: > > On Mon, 16 Oct 2017 17:16:24 +0100, Edward Cree wrote: > >> On 16/10/17 16:45, Jakub Kicinski wrote: > >>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verif

Re: [patch net-next 27/34] nfp: bpf: Convert ndo_setup_tc offloads to block callbacks

2017-10-17 Thread Jakub Kicinski
On Tue, 17 Oct 2017 14:48:12 +0200, Jiri Pirko wrote: > Fri, Oct 13, 2017 at 03:08:24AM CEST, jakub.kicin...@netronome.com wrote: > >On Thu, 12 Oct 2017 19:18:16 +0200, Jiri Pirko wrote: > >> diff --git a/drivers/net/ethernet/netronome/nfp/bpf/offload.c > >>

Re: [PATCH] nfp: Explicitly include linux/bug.h

2017-10-12 Thread Jakub Kicinski
-by: Mark Brown <broo...@kernel.org> Acked-by: Jakub Kicinski <jakub.kicin...@netronome.com> Thank you!

[PATCH net-next 2/4] bpf: remove the verifier ops from program structure

2017-10-16 Thread Jakub Kicinski
Since the verifier ops don't have to be associated with the program for its entire lifetime we can move it to verifier's struct bpf_verifier_env. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- include/linux/bpf.h | 1 - include/linux/bpf_verifier.h | 1 + kern

[PATCH net-next 1/4] bpf: split verifier and program ops

2017-10-16 Thread Jakub Kicinski
struct bpf_verifier_ops contains both verifier ops and operations used later during program's lifetime (test_run). Split the runtime ops into a different structure. BPF_PROG_TYPE() will now append ## _prog_ops or ## _verifier_ops to the names. Signed-off-by: Jakub Kicinski <jakub.ki

[PATCH net-next 4/4] bpf: allow access to skb->len from offloads

2017-10-16 Thread Jakub Kicinski
Since we are now doing strict checking of what offloads may access, make sure skb->len is on that list. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- net/core/filter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/filter.c b/net/core/filte

[PATCH net-next 3/4] bpf: move knowledge about post-translation offsets out of verifier

2017-10-16 Thread Jakub Kicinski
/bpf_types.h). Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- include/linux/bpf.h | 3 +++ kernel/bpf/verifier.c | 55 +++ net/core/filter.c | 40 + 3 files changed, 59 insertions(

[PATCH net-next 0/4] bpf: move context info out of the verifier

2017-10-16 Thread Jakub Kicinski
analysis. To do that, I have to first move the test_run callback to a separate structure. Then verifier ops can be declared in the verifier directly and different sets can be picked for verification vs analysis. Jakub Kicinski (4): bpf: split verifier and program ops bpf: remove the verifier

Re: [PATCH net] nfp: double free on error in probe

2017-08-29 Thread Jakub Kicinski
have removed the call from nfp_net_pf_app_start(). > > Fixes: 02082701b974 ("nfp: create control vNICs and wire up rx/tx") > Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> Acked-by: Jakub Kicinski <jakub.kicin...@netronome.com>

[PATCH net v2] net: sched: don't use GFP_KERNEL under spin lock

2017-09-05 Thread Jakub Kicinski
ed: Change act_api and act_xxx modules to use IDR") Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- net/sched/act_api.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/sched/ac

Re: nfp bpf offload add/replace

2017-09-07 Thread Jakub Kicinski
On Thu, 7 Sep 2017 11:10:33 +0200, Jiri Pirko wrote: > Hi Kuba. > > I'm looking into cls_bpf code and nfp_net_bpf_offload function in your > driver. Why do you need TC_CLSBPF_ADD? Seems like TC_CLSBPF_REPLACE > should be enough. It would make the cls_bpf code easier. > > Note that other cls just

Re: nfp bpf offload add/replace

2017-09-07 Thread Jakub Kicinski
On Thu, 7 Sep 2017 16:05:03 +0200, Jiri Pirko wrote: > Thu, Sep 07, 2017 at 03:44:12PM CEST, kubak...@wp.pl wrote: > >On Thu, 7 Sep 2017 11:10:33 +0200, Jiri Pirko wrote: > >> Hi Kuba. > >> > >> I'm looking into cls_bpf code and nfp_net_bpf_offload function in your > >> driver. Why do you need

Re: [patch net] net: sched: fix memleak for chain zero

2017-09-06 Thread Jakub Kicinski
chain_create function directly. The > chain is created with refcnt == 1, which is not correct in this case and > causes the memleak. So move the refcnt increment into tcf_chain_get > function even for the case when chain needs to be created. > > Reported-by: Jakub Kicinski <kuba

Re: [PATCH net-next 2/2] tools: bpf: add bpftool

2017-09-26 Thread Jakub Kicinski
On Tue, 26 Sep 2017 15:24:06 -0700, Alexei Starovoitov wrote: > On Tue, Sep 26, 2017 at 08:35:22AM -0700, Jakub Kicinski wrote: > > Add a simple tool for querying and updating BPF objects on the system. > > > > Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com

Re: [PATCH net-next 0/2] tools: add bpftool

2017-09-26 Thread Jakub Kicinski
On Tue, 26 Sep 2017 17:32:31 -0600, David Ahern wrote: > On 9/26/17 9:35 AM, Jakub Kicinski wrote: > > I'm looking for a home for bpftool, Daniel suggested that > > tools/net could be a good place, since there are only BPF > > utilities there already. > > >

Re: [PATCH net-next 0/7] nfp: flower vxlan tunnel offload

2017-09-25 Thread Jakub Kicinski
separate data sets > to be supplied. ... Acked-by: Jakub Kicinski <jakub.kicin...@netronome.com>

[PATCH net-next 2/2] tools: bpf: add bpftool

2017-09-26 Thread Jakub Kicinski
Add a simple tool for querying and updating BPF objects on the system. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- tools/bpf/Makefile | 18 +- tools/bpf/bpftool/Makefile | 80 + tools

[PATCH net-next 0/2] tools: add bpftool

2017-09-26 Thread Jakub Kicinski
directly using LLVM library and JSON output are high on the priority list. The first patch renames tools/net to tools/bpf, while the second one adds the new code. Jakub Kicinski (2): tools: rename tools/net directory to tools/bpf tools: bpf: add bpftool MAINTAINERS | 3

[PATCH net-next 1/2] tools: rename tools/net directory to tools/bpf

2017-09-26 Thread Jakub Kicinski
We currently only have BPF tools in the tools/net directory. We are about to add more BPF tools there, not necessarily networking related, rename the directory and related Makefile targets to bpf. Suggested-by: Daniel Borkmann <dan...@iogearbox.net> Signed-off-by: Jakub Kicinski <ja

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

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

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

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

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

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

Re: [PATCH net-next 2/2] tools: bpf: add bpftool

2017-09-28 Thread Jakub Kicinski
On Tue, 26 Sep 2017 08:35:22 -0700, Jakub Kicinski wrote: > Add a simple tool for querying and updating BPF objects on the system. > > Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> > Reviewed-by: Simon Horman <simon.hor...@netronome.com> Dave, I got s

Re: [PATCH net-next 5/6] bpf, nfp: add meta data support

2017-09-25 Thread Jakub Kicinski
> > Signed-off-by: Daniel Borkmann <dan...@iogearbox.net> > Acked-by: Alexei Starovoitov <a...@kernel.org> > Acked-by: John Fastabend <john.fastab...@gmail.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> Thanks!

[PATCH net] nfp: TX time stamp packets before HW doorbell is rung

2017-08-23 Thread Jakub Kicinski
TX completion may happen any time after HW queue was kicked. We can't access the skb afterwards. Move the time stamping before ringing the doorbell. Fixes: 4c3523623dc0 ("net: add driver for Netronome NFP4000/NFP6000 NIC VFs") Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.

Re: [PATCH] mt7601u: check memory allocation failure

2017-08-21 Thread Jakub Kicinski
On Mon, 21 Aug 2017 14:34:30 -0700, Jakub Kicinski wrote: > On Mon, 21 Aug 2017 22:59:56 +0200, Christophe JAILLET wrote: > > Check memory allocation failure and return -ENOMEM in such a case, as > > already done a few lines below > > > > Signed-off-by: Christop

Re: [PATCH v2] mt7601u: check memory allocation failure

2017-08-21 Thread Jakub Kicinski
y. > > Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> Acked-by: Jakub Kicinski <kubak...@wp.pl>

Re: [PATCH] mt7601u: check memory allocation failure

2017-08-21 Thread Jakub Kicinski
On Mon, 21 Aug 2017 22:59:56 +0200, Christophe JAILLET wrote: > Check memory allocation failure and return -ENOMEM in such a case, as > already done a few lines below > > Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> Acked-by: Jakub Kicinski <kubak...@wp.pl> Thanks!

[PATCH net-next] selftests/bpf: check the instruction dumps are populated

2017-08-25 Thread Jakub Kicinski
retrieving the image dumps. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- tools/testing/selftests/bpf/test_progs.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/te

Re: [PATCH net-next 1/4] net: Add SRIOV VGT+ support

2017-08-27 Thread Jakub Kicinski
On Sun, 27 Aug 2017 14:06:15 +0300, Saeed Mahameed wrote: > From: Mohamad Haj Yahia > > VGT+ is a security feature that gives the administrator the ability of > controlling the allowed vlan-ids list that can be transmitted/received > from/to the VF. > The allowed vlan-ids

Re: [PATCH net-next 3/4] net/core: Add violation counters to VF statisctics

2017-08-27 Thread Jakub Kicinski
On Sun, 27 Aug 2017 14:06:17 +0300, Saeed Mahameed wrote: > From: Eugenia Emantayev > > Add receive and transmit violation counters to be > displayed in iproute2 VF statistics. > > Signed-off-by: Eugenia Emantayev > Signed-off-by: Saeed Mahameed

[PATCH net-next 1/2] nfp: add basic SR-IOV ndo functions

2017-08-24 Thread Jakub Kicinski
m> Signed-off-by: Jimmy Kizito <jimmy.kiz...@netronome.com> Signed-off-by: Rami Tomer <rami.to...@netronome.com> Signed-off-by: Simon Horman <simon.hor...@netronome.com> Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- drivers/net/ethernet/netronome/nfp/

[PATCH net-next 0/2] nfp: SR-IOV ndos support

2017-08-24 Thread Jakub Kicinski
Hi! This set adds basic SR-IOV including setting/getting VF MAC addresses, VLANs, link state and spoofcheck settings. It is wired up for both vNICs and representors (note: ip link will not report VF settings on VF/PF representors because they are not linked to the PF PCI device). Pablo and team

[PATCH net-next 2/2] nfp: add basic SR-IOV ndo functions to representors

2017-08-24 Thread Jakub Kicinski
From: Simon Horman <simon.hor...@netronome.com> Add basic ndo_set/get_vf to support SR-IOV on all types of port representors. Signed-off-by: Simon Horman <simon.hor...@netronome.com> Signed-off-by: Dirk van der Merwe <dirk.vanderme...@netronome.com> Reviewed-by: Jakub Kic

Re: [RFC PATCH] net: limit maximum number of packets to mark with xmit_more

2017-08-25 Thread Jakub Kicinski
On Fri, 25 Aug 2017 08:24:49 -0700, Jacob Keller wrote: > Under some circumstances, such as with many stacked devices, it is > possible that dev_hard_start_xmit will bundle many packets together, and > mark them all with xmit_more. Excuse my ignorance but what are those stacked devices? Could

[PATCH net-next 0/6] nfp: refactor app init, and minor flower fixes

2017-09-02 Thread Jakub Kicinski
the default Kconfig selection of flower offload. Patch 6 fixes locking around representor updates which got lost in net-next. Jakub Kicinski (6): nfp: separate app vNIC init/clean from alloc/free nfp: flower: base lifetime of representors on existence of lower vNIC nfp: move the start/stop

[PATCH net-next 2/6] nfp: flower: base lifetime of representors on existence of lower vNIC

2017-09-02 Thread Jakub Kicinski
Create representors after lower vNIC is registered and destroy them before it is destroyed. Move the code out of start/stop callbacks directly into vnic_init/clean callbacks. Make sure SR-IOV callbacks don't try to create representors when lower device does not exist. Signed-off-by: Jakub

[PATCH net-next 4/6] nfp: be drop monitor friendly

2017-09-02 Thread Jakub Kicinski
Use dev_consume_skb_any() in place of dev_kfree_skb_any() when control frame has been successfully processed in flower and on the driver's main TX completion path. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> ---

[PATCH net-next 6/6] nfp: flower: restore RTNL locking around representor updates

2017-09-02 Thread Jakub Kicinski
the netdev pointer. RTNL is needed for the dev_set_mtu() call. Fixes: 2dff19622421 ("nfp: process MTU updates from firmware flower app") Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/etherne

[PATCH net-next 5/6] nfp: build the flower offload by default

2017-09-02 Thread Jakub Kicinski
It's reasonable to assume that if user selects to build the NFP driver all offload capabilities will be enabled by default. Change the CONFIG_NFP_APP_FLOWER to default to enabled. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netr

[PATCH net-next 1/6] nfp: separate app vNIC init/clean from alloc/free

2017-09-02 Thread Jakub Kicinski
and add proper init/clean. Apps using representors will be able to use new callbacks to manage lifetime of upper devices. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/mai

[PATCH net-next 3/6] nfp: move the start/stop app callbacks back

2017-09-02 Thread Jakub Kicinski
Since representors are now created with a separate callback start/stop app callbacks can be moved again to their original location. They are intended to app-specific init/clean up over the control channel. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon

Re: [PATCH net] net: sched: don't use GFP_KERNEL under spin lock

2017-09-05 Thread Jakub Kicinski
Jiri, FWIW I also just noticed these, but they seem related to the earlier TC chain work? unreferenced object 0x8807466f70c8 (size 64): comm "tc", pid 1812, jiffies 4294932641 (age 1537.192s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 a0 83 e1 31 07 88 ff ff ...1

[PATCH net] net: sched: don't use GFP_KERNEL under spin lock

2017-09-05 Thread Jakub Kicinski
xxx modules to use IDR") Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- net/sched/act_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c inde

Re: [oss-drivers] Re: [PATCH net] net: sched: don't use GFP_KERNEL under spin lock

2017-09-05 Thread Jakub Kicinski
On Tue, 5 Sep 2017 14:52:21 +0200, Jiri Pirko wrote: > Tue, Sep 05, 2017 at 12:59:48PM CEST, kubak...@wp.pl wrote: > >Jiri, FWIW I also just noticed these, but they seem related to the > >earlier TC chain work? > > What do you do to trigger this? Sorry, I wasted a bit of time there because

Re: BUG: using smp_processor_id() in preemptible [00000000]

2017-10-08 Thread Jakub Kicinski
On Sun, 8 Oct 2017 20:47:10 -0700, Eric Dumazet wrote: > This was discussed/reported earlier today by Ido. > > https://patchwork.ozlabs.org/patch/823011/ > > We will submit an official fix shortly. Ah, sorry, I missed that!

Re: [PATCH] net: make ->ndo_get_phys_port_name accept 32-bit len

2017-10-08 Thread Jakub Kicinski
On Sun, 8 Oct 2017 01:19:17 +0300, Alexey Dobriyan wrote: > Buffer length passed into this hook is always IFNAMSIZ which is 16. > > Code savings on x86_64: > > add/remove: 0/0 grow/shrink: 1/9 up/down: 2/-45 (-43) > function old new delta >

BUG: using smp_processor_id() in preemptible [00000000]

2017-10-08 Thread Jakub Kicinski
Hi! This appeared in net-next over the weekend - looks likely related to this set... [ 164.456668] BUG: using smp_processor_id() in preemptible [] code: sshd/1255 [ 164.472259] caller is ip6_pol_route+0xe88/0x4a80 [ 164.477571] CPU: 10 PID: 1255 Comm: sshd Not tainted

[PATCH net-next 00/15] nfp: bpf ABIv2 and multi port

2017-10-08 Thread Jakub Kicinski
(PoC had ECC protection on instruction store disabled). There is also a minor ld_field fix and all 64 bit shifts can now be encoded. Jakub Kicinski (15): nfp: output control messages to trace_devlink_hwmsg() nfp: bpf: lift the single-port limitation nfp: bpf: use the power of sparse

[PATCH net-next 06/15] nfp: bpf: remove register rename

2017-10-08 Thread Jakub Kicinski
the BPF closer with FW app datapath anyway, and the target datapath itself runs in 4 context mode. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 46 ++-

[PATCH net-next 10/15] nfp: bpf: encode extended LM pointer operands

2017-10-08 Thread Jakub Kicinski
Most instructions have special fields which allow switching between base and extended Local Memory pointers. Introduce those to register encoding, we will use the extra LM pointers to access high addresses of the stack. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Re

[PATCH net-next 11/15] nfp: bpf: move to datapath ABI version 2

2017-10-08 Thread Jakub Kicinski
so we have to extract it into one of the scratch registers, OTOH since LMEM can be used in restricted operands we don't have to extract packet pointer. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethe

[PATCH net-next 08/15] nfp: add more white space to the instruction defines

2017-10-08 Thread Jakub Kicinski
We need to add longer OP_* defines, move the values away. Purely whitespace commit. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/nfp_asm.h | 156 +--

[PATCH net-next 03/15] nfp: bpf: use the power of sparse to check we encode registers right

2017-10-08 Thread Jakub Kicinski
Define a new __bitwise type for software representation of registers. This will allow us to catch incorrect parameter types using sparse. Accessors we define also allow us to return correct enum type and therefore ensure all switches handle all register types. Signed-off-by: Jakub Kicinski

[PATCH net-next 07/15] nfp: bpf: remove packet marking support

2017-10-08 Thread Jakub Kicinski
Temporarily drop support for skb->mark. We are primarily focusing on XDP offload, and implementing skb->mark on the new datapath has lower priority. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- dr

[PATCH net-next 15/15] nfp: bpf: pass dst register to ld_field instruction

2017-10-08 Thread Jakub Kicinski
ld_field instruction is a bit special because the encoding uses two source registers and one of them becomes the output. We do need to pass the dst register to our encoding helpers though, otherwise the "write both banks" flag will not be observed. Signed-off-by: Jakub Kicinski &l

[PATCH net-next 09/15] nfp: bpf: encode LMEM accesses

2017-10-08 Thread Jakub Kicinski
NFP LMEM is a large, indirectly accessed register file. There are two basic indirect access registers. Each access operation may either use offset (up to 8 or 16 words) or perform post decrement/increment. Add encodings of LMEM indexes as instruction operands. Signed-off-by: Jakub Kicinski

[PATCH net-next 02/15] nfp: bpf: lift the single-port limitation

2017-10-08 Thread Jakub Kicinski
Limiting the eBPF offload to a single port was a workaround required for the PoC application FW which has not been released externally. It's not necessary any more. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com>

[PATCH net-next 05/15] nfp: bpf: encode all 64bit shifts

2017-10-08 Thread Jakub Kicinski
Add encodings of all 64bit shift operations. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 48 +--- 1 file changed, 36 insertions(+),

[PATCH net-next 04/15] nfp: bpf: move software reg helpers and cmd table out of translator

2017-10-08 Thread Jakub Kicinski
Move the software reg helpers and some static data to nfp_asm.c. They are related to the previous patch, but move is done in a separate commit for ease of review. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> ---

[PATCH net-next 13/15] nfp: bpf: pad code with valid nops

2017-10-08 Thread Jakub Kicinski
We need to append up to 8 nops after last instruction to make sure the CPU will not fetch garbage instructions with invalid ECC if the code store was not initialized. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com>

[PATCH net-next 12/15] nfp: bpf: calculate code store ECC

2017-10-08 Thread Jakub Kicinski
In the initial PoC firmware I simply disabled ECC on the instruction store. Do the ECC calculation for generated instructions in the driver. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/n

[PATCH net-next 01/15] nfp: output control messages to trace_devlink_hwmsg()

2017-10-08 Thread Jakub Kicinski
Use standard devlink trace point to allow tracing of control messages. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/nfp_app.h | 8 1 file changed, 8 insertions(+)

[PATCH net-next 14/15] nfp: bpf: byte swap the instructions

2017-10-08 Thread Jakub Kicinski
Device expects the instructions in little endian. Make sure we byte swap on big endian hosts. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 6 -- 1 fil

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 10:42:42 -0700, Manoj Gupta wrote: > Hi Jakub, > > I had discussed about supporting this code with some clang developers. > However, the consensus was this code relies on a specific GCC optimizer > behavior and Clang does not share the same behavior by design. Hm. I find

Re: [RFC] bpf: remove global verifier state

2017-10-04 Thread Jakub Kicinski
On Wed, 04 Oct 2017 21:13:47 +0200, Daniel Borkmann wrote: > On 10/04/2017 05:43 AM, Alexei Starovoitov wrote: > > On Tue, Oct 03, 2017 at 08:24:06PM -0700, Eric Dumazet wrote: > >> On Tue, 2017-10-03 at 19:52 -0700, Alexei Starovoitov wrote: > >> > >>> yep. looks great. > >>> Please test it

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 11:49:57 -0700, Matthias Kaehlcke wrote: > Hi Joe, > > El Wed, Oct 04, 2017 at 11:07:19AM -0700 Joe Perches ha dit: > > > On Tue, 2017-10-03 at 13:05 -0700, Matthias Kaehlcke wrote: > > > nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to > > > identify

Re: [PATCH net-next 5/5] bpf: write back the verifier log buffer as it gets filled

2017-10-05 Thread Jakub Kicinski
On Thu, 05 Oct 2017 23:10:03 +0200, Daniel Borkmann wrote: > > include/linux/bpf_verifier.h | 7 +++-- > > kernel/bpf/verifier.c| 64 > > +++- > > 2 files changed, 50 insertions(+), 21 deletions(-) > > > > diff --git

Re: [PATCH net-next v3 3/3] tools: bpftool: add documentation

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 20:36:42 +0200, Jesper Dangaard Brouer wrote: > On Wed, 4 Oct 2017 08:40:32 -0700 > Jakub Kicinski <jakub.kicin...@netronome.com> wrote: > > > Add documentation for bpftool. Separate files for each subcommand. > > Use rst format. Documentation

Re: [PATCH net-next v2 0/3] tools: add bpftool

2017-10-03 Thread Jakub Kicinski
On Tue, 3 Oct 2017 17:19:42 -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, Oct 02, 2017 at 04:11:27PM -0700, Jakub Kicinski escreveu: > > Hi! > > > > This set adds bpftool to the tools/ directory. The first > > patch renames tools/net to tools/bpf, the second one ad

[RFC] bpf: remove global verifier state

2017-10-03 Thread Jakub Kicinski
The only global state protected by the verifier lock is the verifier log. Move that log to struct bpf_verifier_env and allow verification of multiple programs in parallel. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- Like this? :) Compile-tested, I'm rebasing

Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

2017-10-04 Thread Jakub Kicinski
On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: > > > Thanks for the suggestion. This seems a viable alternative if David > > > and the NFP owners can live without the extra checking provided by > > > __BF_FIELD_CHECK. > > > > The reason the __BF_FIELD_CHECK refuses to compile

Re: [PATCH net-next 2/2] tools: bpf: add bpftool

2017-09-27 Thread Jakub Kicinski
On Wed, 27 Sep 2017 12:45:11 +0200, Jesper Dangaard Brouer wrote: > On Wed, 27 Sep 2017 00:02:08 +0100 > Jakub Kicinski <jakub.kicin...@netronome.com> wrote: > > > On Tue, 26 Sep 2017 15:24:06 -0700, Alexei Starovoitov wrote: > > > On Tue, Sep 26, 2017 at 08:35:22

[PATCH net-next 03/12] nfp: bpf: add missing return in jne_imm optimization

2017-10-12 Thread Jakub Kicinski
We optimize comparisons to immediate 0 as if (reg.lo | reg.hi). The early return statement was missing, however, which means we would generate two comparisons - optimized one followed by a normal 2x 32 bit compare. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by:

[PATCH net-next 02/12] nfp: bpf: reorder arguments to emit_ld_field_any()

2017-10-12 Thread Jakub Kicinski
ld_field instruction has the following format in NFP assembler: ld_field[dst, 1000, src, <<24] reoder parameters to emit_ld_field_any() to make it closer to the familiar assembler order. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horma

[PATCH net-next 12/12] nfp: bpf: support direct packet access in TC

2017-10-12 Thread Jakub Kicinski
Add support for direct packet access in TC, note that because writing the packet will cause the verifier to generate a csum fixup prologue we won't be able to offload packet writes from TC, just yet, only the reads will work. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Re

[PATCH net-next 11/12] nfp: bpf: direct packet access - write

2017-10-12 Thread Jakub Kicinski
This patch adds ability to write packet contents using pre-validated packet pointers (direct packet access). Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf

[PATCH net-next 07/12] nfp: bpf: support BPF offload only on little endian

2017-10-12 Thread Jakub Kicinski
to little endian hosts only. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/b

[PATCH net-next 08/12] nfp: bpf: fix context accesses

2017-10-12 Thread Jakub Kicinski
Sizes of fields in struct xdp_md/xdp_buff and some in sk_buff depend on target architecture. Take that into account and use struct xdp_buff, not struct xdp_md. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> ---

[PATCH net-next 06/12] nfp: bpf: implement byte swap instruction

2017-10-12 Thread Jakub Kicinski
Implement byte swaps with rotations, shifts and byte loads. Remember to clear upper parts of the 64 bit registers. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bp

[PATCH net-next 10/12] nfp: bpf: add support for direct packet access - read

2017-10-12 Thread Jakub Kicinski
or STACK, so we can add the check already. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 85 +-- drivers/net/ethernet/netronome/nfp/bpf/mai

[PATCH net-next 00/12] nfp: bpf: support direct packet access

2017-10-12 Thread Jakub Kicinski
with unreleased PoC FW (ABI version 1) and therefore nobody outside of Netronome can exercise it anyway. Jakub Kicinski (12): bpf: verifier: set reg_type on context accesses in second pass nfp: bpf: reorder arguments to emit_ld_field_any() nfp: bpf: add missing return in jne_imm optimization

[PATCH net-next 04/12] nfp: bpf: fix compare instructions

2017-10-12 Thread Jakub Kicinski
Now that we have BPF assemebler support in LLVM 6 we can easily test all compare instructions (LLVM 4 didn't generate most of them from C). Fix the compare to immediates and refactor the order of compare to regs to make sure they both follow the same pattern. Signed-off-by: Jakub Kicinski

<    5   6   7   8   9   10   11   12   13   14   >