[PATCH net 00/10] bpf: offload: check netdev pointer in the drivers and namespace trouble

2017-11-19 Thread Jakub Kicinski
space API is not reporting any namespace identification we have to remove the ifindex until a correct way of reporting is agreed upon. Jakub Kicinski (10): bpf: offload: add comment warning developers about double destroy bpf: offload: limit offload to cls_bpf and xdp programs only bpf

[PATCH net 2/5] nfp: fix vlan receive MAC statistics typo

2017-11-16 Thread Jakub Kicinski
82c00e ("nfp: map mac_stats and vf_cfg BARs") Fixes: 098ce840c9ef ("nfp: report MAC statistics in ethtool") Reported-by: Brendan Galloway <brendan.gallo...@netronome.com> Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuu...@netronome.com> Reviewed-by: Jakub

[PATCH net 0/5] nfp: flower fixes and typo in ethtool stats name

2017-11-16 Thread Jakub Kicinski
Hi! This set comes from the flower offload team. From Pieter we have a fix to the semantics of the flag telling FW whether to allocate or free a mask and correction of a typo in name of one of the MAC statistics (reveive -> received, we use past participle to match HW docs). Dirk fixes

[PATCH net 4/5] nfp: register flower reprs for egress dev offload

2017-11-16 Thread Jakub Kicinski
From: John Hurley <john.hur...@netronome.com> Register a callback for offloading flows that have a repr as their egress device. The new egdev_register function is added to net-next for the 4.15 release. Signed-off-by: John Hurley <john.hur...@netronome.com> Reviewed-by: Ja

[PATCH net 3/5] nfp: inherit the max_mtu from the PF netdev

2017-11-16 Thread Jakub Kicinski
e <dirk.vanderme...@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_n

[PATCH net 1/5] nfp: fix flower offload metadata flag usage

2017-11-16 Thread Jakub Kicinski
low offload") Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuu...@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- drivers/net/ethernet/netronome/nfp/flower/main.h | 3 +-- drivers/net/ethernet/netronome/nfp/flower/metadata.c | 7 +-- 2

[PATCH net 5/5] nfp: remove false positive offloads in flower vxlan

2017-11-16 Thread Jakub Kicinski
s port and offload a match accordingly. Fixes: 611aec101ab7 ("nfp: compile flower vxlan tunnel metadata match fields") Signed-off-by: John Hurley <john.hur...@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- .../net/ethernet/netronome/

Re: [PATCH V3 net-next 1/2] liquidio: switchdev support for LiquidIO NIC

2017-11-01 Thread Jakub Kicinski
On Wed, 1 Nov 2017 12:29:48 -0700, Felix Manlunas wrote: > > > +lio_vf_rep_phys_port_name(struct net_device *dev, > > > + char *buf, size_t len) > > > +{ > > > + struct lio_vf_rep_desc *vf_rep = netdev_priv(dev); > > > + struct octeon_device *oct = vf_rep->oct; > > > + int ret; >

[PATCH net-next] security: bpf: replace include of linux/bpf.h with forward declarations

2017-11-01 Thread Jakub Kicinski
Touching linux/bpf.h makes us rebuild a surprisingly large portion of the kernel. Remove the unnecessary dependency from security.h, it only needs forward declarations. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netr

Re: [net-next 0/7] nfp: ethtool and related improvements

2017-11-04 Thread Jakub Kicinski
5: Since representors can now handle media overrides, we can > allocate the get/set link ndo's to them. > > Patch 6 & 7: Add support for FEC mode modification. I forgot to put: Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> on Dirk's patches, thanks for posting Simon!

Re: [PATCH 2/2] [net-next] bpf: fix out-of-bounds access warning in bpf_check

2017-11-02 Thread Jakub Kicinski
On Thu, 2 Nov 2017 17:14:00 +0100, Arnd Bergmann wrote: > On Thu, Nov 2, 2017 at 4:59 PM, Alexei Starovoitov wrote: > > On Thu, Nov 02, 2017 at 12:05:52PM +0100, Arnd Bergmann wrote: > >> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > >> index 750aff880ecb..debb60ad08ee 100644 > >>

Re: [PATCH 1/2] [net-next] bpf: fix link error without CONFIG_NET

2017-11-02 Thread Jakub Kicinski
On Thu, 2 Nov 2017 12:05:51 +0100, Arnd Bergmann wrote: > I ran into this link error with the latest net-next plus linux-next > trees when networking is disabled: > > kernel/bpf/verifier.o:(.rodata+0x2958): undefined reference to > `tc_cls_act_analyzer_ops' >

[PATCH net-next 2/8] nfp: flower: vxlan - ensure no sleep in atomic context

2017-11-02 Thread Jakub Kicinski
From: John Hurley Functions called by the netevent notifier must be in atomic context. Change the mutex to spinlock and ensure mem allocations are done with the atomic flag. Also, remove unnecessary locking after notifiers are unregistered. Signed-off-by: John Hurley

[PATCH net-next 3/8] nfp: bpf: reject TC offload if XDP loaded

2017-11-02 Thread Jakub Kicinski
Recent TC changes dropped the check protecting us from trying to offload a TC program if XDP programs are already loaded. Fixes: 90d97315b3e7 ("nfp: bpf: Convert ndo_setup_tc offloads to block callbacks") Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-

[PATCH net-next 1/8] nfp: flower: app should use struct nfp_repr

2017-11-02 Thread Jakub Kicinski
ome.com> Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- drivers/net/ethernet/netronome/nfp/flower/offload.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronom

[PATCH net-next 4/8] nfp: reorganize the app table

2017-11-02 Thread Jakub Kicinski
The app table is an unordered array right now. We have to search apps by ID. It also makes it harder to fall back to core NIC if advanced functions are not compiled into the kernel (e.g. eBPF). Make the table keyed by app id. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Re

[PATCH net-next 5/8] nfp: bpf: fall back to core NIC app if BPF not selected

2017-11-02 Thread Jakub Kicinski
If kernel config does not include BPF just replace the BPF app handler with the handler for basic NIC. The BPF app will now be built only if BPF infrastructure is selected in kernel config. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <

[PATCH net-next 7/8] nfp: use a counter instead of log message for allocation failures

2017-11-02 Thread Jakub Kicinski
Add a counter incremented when allocation of replacement RX page fails. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/nfp_net.h | 3 +++ drivers/net/ethernet/n

[PATCH net-next 8/8] nfp: improve defines for constants in ethtool

2017-11-02 Thread Jakub Kicinski
We split rvector stats into two categories - per queue and stats which are added up into one total counter. Improve the defines denoting their number. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/

[PATCH net-next 6/8] nfp: switch to dev_alloc_page()

2017-11-02 Thread Jakub Kicinski
Use the dev_alloc_page() networking helper to allocate pages for RX packets. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 +- 1 file changed, 1 ins

[PATCH net-next 0/8] nfp: TC block fixes, app fallback and dev_alloc()

2017-11-02 Thread Jakub Kicinski
after the fixes which went into -net some time ago I refactor the page allocation, add a ethtool counter for failed allocations and clean the ethtool stat code while at it. Jakub Kicinski (6): nfp: bpf: reject TC offload if XDP loaded nfp: reorganize the app table nfp: bpf: fall back to core

Re: [PATCH net-next V3 2/3] tools: bpftool: show filenames of pinned objects

2017-11-07 Thread Jakub Kicinski
On Wed, 8 Nov 2017 11:34:44 +0900, Prashant Bhole wrote: > > > + FILE *mntfile = NULL; > > > + FTSENT *ftse = NULL; > > > + FTS *fts = NULL; > > > + int fd, err; > > > + > > > + mntfile = setmntent("/proc/mounts", "r"); > > > + if (!mntfile) > > > + return -1; > > > + > > > + while

Re: [PATCH net-next V3 2/3] tools: bpftool: show filenames of pinned objects

2017-11-07 Thread Jakub Kicinski
On Mon, 6 Nov 2017 15:06:31 +0900, Prashant Bhole wrote: > Added support to show filenames of pinned objects. > ... > Signed-off-by: Prashant Bhole Thanks for the changes, a couple more nit picks, sorry for not spotting them earlier. > v2: > - Dynamically

Re: [PATCH net-next v2 02/15] bpf: offload: add infrastructure for loading programs for a specific netdev

2017-11-09 Thread Jakub Kicinski
Hi! Sorry for the delay! On Mon, 06 Nov 2017 18:32:45 +0100, Daniel Borkmann wrote: > On 11/03/2017 09:56 PM, Jakub Kicinski wrote: > > @@ -1549,6 +1555,8 @@ static void bpf_prog_free_deferred(struct work_struct > > *work) > > struct bpf_prog_aux *aux; > > >

Re: [PATCH net-next V4 0/3] tools: bpftool: show filenames of pinned objects

2017-11-08 Thread Jakub Kicinski
canning bpf-fs can be costly. Acked-by: Jakub Kicinski <jakub.kicin...@netronome.com> Thank you!

Re: [RFC 01/12] net: bpf: rename ndo_xdp to ndo_bpf

2017-11-01 Thread Jakub Kicinski
On Wed, 1 Nov 2017 08:41:42 +0100, Jesper Dangaard Brouer wrote: > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > > index fc059f193e7d..edf984406ba0 100644 > > --- a/drivers/net/virtio_net.c > > +++ b/drivers/net/virtio_net.c > > @@ -2115,7 +2115,7 @@ static const struct

[PATCH net-next 2/2] nfp: bpf: support [BPF_ALU | BPF_ALU64] | BPF_NEG

2017-11-01 Thread Jakub Kicinski
onome.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/bpf/jit.c b/drivers/net/ethernet/netronome/nfp/bpf/jit.c

[PATCH net-next 1/2] nfp: bpf: rename ALU_OP_NEG to ALU_OP_NOT

2017-11-01 Thread Jakub Kicinski
ng Wang <jiong.w...@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 2 +- drivers/net/ethernet/netronome/nfp/nfp_asm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/etherne

[PATCH net-next 0/2] nfp: bpf: rename ALU_OP_NEG and support BPF_NEG

2017-11-01 Thread Jakub Kicinski
Jiong says: Compilers are starting to use BPF_NEG, for example LLVM. However, NFP does not support JITing it. This patch set adds this. Unit test is added as well. Meanwhile, the current NFP_ALU_NEG is actually doing bitwise NOT (one's complement) operation, so the name is misleading. This

[PATCH net-next 10/15] nfp: bpf: refactor offload logic

2017-11-03 Thread Jakub Kicinski
. Temporarily set @code to NULL in nfp_net_bpf_offload(), compilers seem to have trouble recognizing it's always initialized. Next patches will eliminate that variable. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com>

[PATCH net-next 15/15] bpf: remove old offload/analyzer

2017-11-03 Thread Jakub Kicinski
Thanks to the ability to load a program for a specific device, running verifier twice is no longer needed. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- include/linux/bpf_verifier.h | 5 --- kernel/bp

[PATCH net-next 09/15] nfp: bpf: remove unnecessary include of nfp_net.h

2017-11-03 Thread Jakub Kicinski
BPF offload's main header does not need to include nfp_net.h. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/main.h | 1 - 1 file changed, 1 deletion(-) diff --git a

[PATCH net-next 14/15] nfp: bpf: move to new BPF program offload infrastructure

2017-11-03 Thread Jakub Kicinski
will now use user space context offsets. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 35 - drivers/net/ethernet/netronome/nfp/bpf/main.c | 4 +

[PATCH net-next 05/15] xdp: allow attaching programs loaded for specific device

2017-11-03 Thread Jakub Kicinski
Pass the netdev pointer to bpf_prog_get_type(). This way BPF code can decide whether the device matches what the code was loaded/translated for. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> Reviewed-by: Qu

[PATCH net-next 01/15] net: bpf: rename ndo_xdp to ndo_bpf

2017-11-03 Thread Jakub Kicinski
ndo_xdp is a control path callback for setting up XDP in the driver. We can reuse it for other forms of communication between the eBPF stack and the drivers. Rename the callback and associated structures and definitions. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Re

[PATCH net-next 13/15] nfp: bpf: move translation prepare to offload.c

2017-11-03 Thread Jakub Kicinski
area and only DMA map it for the time of loading (instead of allocating DMA coherent memory upfront). Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 43 ++---

[PATCH net-next 08/15] nfp: bpf: remove the register renumbering leftovers

2017-11-03 Thread Jakub Kicinski
The register renumbering was removed and will not be coming back in its old, naive form, given that it would be fundamentally incompatible with calling functions. Remove the leftovers. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <qu

[PATCH net-next 06/15] cls_bpf: allow attaching programs loaded for specific device

2017-11-03 Thread Jakub Kicinski
If TC program is loaded with skip_sw flag, we should allow the device-specific programs to be accepted. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com&g

[PATCH net-next 12/15] nfp: bpf: move program prepare and free into offload.c

2017-11-03 Thread Jakub Kicinski
Most of offload/translation prepare logic will be moved to offload.c. To help git generate more reasonable diffs move nfp_prog_prepare() and nfp_prog_free() functions there as a first step. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <qu

[PATCH net-next 00/15] bpf: add offload as a first class citizen

2017-11-03 Thread Jakub Kicinski
into the original verifier log. v1: - rename the ifindex member on load; - improve commit messages; - split nfp patches more. Jakub Kicinski (15): net: bpf: rename ndo_xdp to ndo_bpf bpf: offload: add infrastructure for loading programs for a specific netdev bpf: report offload info to user

[PATCH net-next 03/15] bpf: report offload info to user space

2017-11-03 Thread Jakub Kicinski
Extend struct bpf_prog_info to contain information about program being bound to a device. Since the netdev may get destroyed while program still exists we need a flag to indicate the program is loaded for a device, even if the device is gone. Signed-off-by: Jakub Kicinski <jakub.ki

[PATCH net-next 04/15] bpftool: print program device bound info

2017-11-03 Thread Jakub Kicinski
If program is bound to a device, print the name of the relevant interface or unknown if the netdev has since been removed. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon..

[PATCH net-next 02/15] bpf: offload: add infrastructure for loading programs for a specific netdev

2017-11-03 Thread Jakub Kicinski
to attach_type to make it clearer that it's only set on attachment. All calls to ndo_bpf are protected by rtnl, only verifier callbacks are not. We need a wait queue to make sure netdev doesn't get destroyed while verifier is still running and calling its driver. Signed-off-by: Jakub Kicinski <jakub.ki

[PATCH net-next 07/15] nfp: bpf: drop support for cls_bpf with legacy actions

2017-11-03 Thread Jakub Kicinski
for legacy vs DA mode. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 87 ++--- drivers/net/ethernet/netronome/nfp/bpf/main.c | 33 ++-

[PATCH net-next 11/15] nfp: bpf: require seamless reload for program replace

2017-11-03 Thread Jakub Kicinski
needs a load, start has already been done on add. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/main.c| 11 ++--- drivers/net/ethernet/netronome/nfp/bpf/main.h| 2

[PATCH net-next] tools: bpftool: move p_err() and p_info() from main.h to common.c

2017-11-03 Thread Jakub Kicinski
commit. Make them non-inlined functions and move them to common.c file instead. Suggested-by: Joe Perches <j...@perches.com> Signed-off-by: Quentin Monnet <quentin.mon...@netronome.com> Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- tools/b

[PATCH net-next v2 08/15] nfp: bpf: remove the register renumbering leftovers

2017-11-03 Thread Jakub Kicinski
The register renumbering was removed and will not be coming back in its old, naive form, given that it would be fundamentally incompatible with calling functions. Remove the leftovers. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <qu

[PATCH net-next v2 09/15] nfp: bpf: remove unnecessary include of nfp_net.h

2017-11-03 Thread Jakub Kicinski
BPF offload's main header does not need to include nfp_net.h. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/main.h | 1 - 1 file changed, 1 deletion(-) diff --git a

[PATCH net-next v2 10/15] nfp: bpf: refactor offload logic

2017-11-03 Thread Jakub Kicinski
. Temporarily set @code to NULL in nfp_net_bpf_offload(), compilers seem to have trouble recognizing it's always initialized. Next patches will eliminate that variable. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com>

[PATCH net-next v2 15/15] bpf: remove old offload/analyzer

2017-11-03 Thread Jakub Kicinski
Thanks to the ability to load a program for a specific device, running verifier twice is no longer needed. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- include/linux/bpf_verifier.h | 5 --- kernel/bp

[PATCH net-next v2 13/15] nfp: bpf: move translation prepare to offload.c

2017-11-03 Thread Jakub Kicinski
area and only DMA map it for the time of loading (instead of allocating DMA coherent memory upfront). Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 43 ++---

[PATCH net-next v2 01/15] net: bpf: rename ndo_xdp to ndo_bpf

2017-11-03 Thread Jakub Kicinski
ndo_xdp is a control path callback for setting up XDP in the driver. We can reuse it for other forms of communication between the eBPF stack and the drivers. Rename the callback and associated structures and definitions. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Re

[PATCH net-next v2 03/15] bpf: report offload info to user space

2017-11-03 Thread Jakub Kicinski
Extend struct bpf_prog_info to contain information about program being bound to a device. Since the netdev may get destroyed while program still exists we need a flag to indicate the program is loaded for a device, even if the device is gone. Signed-off-by: Jakub Kicinski <jakub.ki

[PATCH net-next v2 05/15] xdp: allow attaching programs loaded for specific device

2017-11-03 Thread Jakub Kicinski
Pass the netdev pointer to bpf_prog_get_type(). This way BPF code can decide whether the device matches what the code was loaded/translated for. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> Reviewed-by: Qu

[PATCH net-next v2 12/15] nfp: bpf: move program prepare and free into offload.c

2017-11-03 Thread Jakub Kicinski
Most of offload/translation prepare logic will be moved to offload.c. To help git generate more reasonable diffs move nfp_prog_prepare() and nfp_prog_free() functions there as a first step. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <qu

[PATCH net-next v2 07/15] nfp: bpf: drop support for cls_bpf with legacy actions

2017-11-03 Thread Jakub Kicinski
for legacy vs DA mode. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 87 ++--- drivers/net/ethernet/netronome/nfp/bpf/main.c | 33 ++-

[PATCH net-next v2 11/15] nfp: bpf: require seamless reload for program replace

2017-11-03 Thread Jakub Kicinski
needs a load, start has already been done on add. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/main.c| 11 ++--- drivers/net/ethernet/netronome/nfp/bpf/main.h| 2

[PATCH net-next v2 14/15] nfp: bpf: move to new BPF program offload infrastructure

2017-11-03 Thread Jakub Kicinski
will now use user space context offsets. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 35 - drivers/net/ethernet/netronome/nfp/bpf/main.c | 4 +

[PATCH net-next v2 06/15] cls_bpf: allow attaching programs loaded for specific device

2017-11-03 Thread Jakub Kicinski
If TC program is loaded with skip_sw flag, we should allow the device-specific programs to be accepted. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com&g

[PATCH net-next v2 02/15] bpf: offload: add infrastructure for loading programs for a specific netdev

2017-11-03 Thread Jakub Kicinski
to attach_type to make it clearer that it's only set on attachment. All calls to ndo_bpf are protected by rtnl, only verifier callbacks are not. We need a wait queue to make sure netdev doesn't get destroyed while verifier is still running and calling its driver. Signed-off-by: Jakub Kicinski <jakub.ki

[PATCH net-next v2 04/15] bpftool: print program device bound info

2017-11-03 Thread Jakub Kicinski
If program is bound to a device, print the name of the relevant interface or unknown if the netdev has since been removed. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon..

[PATCH net-next v2 00/15] bpf: add offload as a first class citizen

2017-11-03 Thread Jakub Kicinski
the ifindex member on load; - improve commit messages; - split nfp patches more. Jakub Kicinski (15): net: bpf: rename ndo_xdp to ndo_bpf bpf: offload: add infrastructure for loading programs for a specific netdev bpf: report offload info to user space bpftool: print program device bound

Re: [PATCH net-next v2 03/15] bpf: report offload info to user space

2017-11-04 Thread Jakub Kicinski
On Sat, 4 Nov 2017 18:45:31 +0900, Alexei Starovoitov wrote: > On Fri, Nov 03, 2017 at 01:56:18PM -0700, Jakub Kicinski wrote: > > Extend struct bpf_prog_info to contain information about program > > being bound to a device. Since the netdev may get destroyed while > > pr

Re: [PATCH v2 net-next 3/4] bpftool: implement prog load command

2017-12-07 Thread Jakub Kicinski
og load SOURCE_FILE FILE > > FILE is a non-existing file on bpffs. > > Signed-off-by: Roman Gushchin <g...@fb.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> The only reservation I have is that SRC may confuse people, would it make sense to call the compiled c

[PATCH net-next 2/2] tools: bpftool: create "uninstall", "doc-uninstall" make targets

2017-12-07 Thread Jakub Kicinski
From: Quentin Monnet Create two targets to remove executable and documentation that would have been previously installed with `make install` and `make doc-install`. Also create a "QUIET_UNINST" helper in tools/scripts/Makefile.include. Do not attempt to remove

Re: [PATCH net-next v3 0/2] net: thunderx: add support for PTP clock

2017-12-07 Thread Jakub Kicinski
On Wed, 6 Dec 2017 16:30:56 +0300, Aleksey Makarov wrote: > This series adds support for IEEE 1588 Precision Time Protocol > to Cavium ethernet driver. > > The first patch adds support for the Precision Time Protocol Clocks and > Timestamping coprocessor (PTP) found on Cavium processors. > It

Re: [PATCH v2 net-next 4/4] bpftool: implement cgroup bpf operations

2017-12-07 Thread Jakub Kicinski
On Thu, 7 Dec 2017 18:39:09 +, Roman Gushchin wrote: > This patch adds basic cgroup bpf operations to bpftool: > cgroup list, attach and detach commands. > > Usage is described in the corresponding man pages, > and examples are provided. > > Syntax: > $ bpftool cgroup list CGROUP > $ bpftool

[PATCH net-next 1/2] tools: bpftool: harmonise Makefile and Documentation/Makefile

2017-12-07 Thread Jakub Kicinski
From: Quentin Monnet Several minor fixes and harmonisation items for Makefiles: * Use the same mechanism for verbose/non-verbose output in two files ("$(Q)"), for all commands. * Use calls to "QUIET_INSTALL" and equivalent in Makefile. In particular, use

[PATCH net-next 0/2] tools: bpftool: clean up and extend Makefiles

2017-12-07 Thread Jakub Kicinski
Hi! This is a follow up to a series of Makefile fixes for bpftool from two weeks ago. I think there will have to be a merge back of net-next into bpf-next (or rebase), AFAICT the previous series arrived in net-next already, but not in bpf-next. I hope that makes sense. FWIW this should not

Re: [PATCH net-next] netdevsim: correctly check return value of debugfs_create_dir

2017-12-07 Thread Jakub Kicinski
On Fri, 8 Dec 2017 09:52:50 +0900, Prashant Bhole wrote: > Return value is now checked with IS_ERROR_OR_NULL because > debugfs_create_dir doesn't return error value. It either returns > NULL or a valid pointer. > > Signed-off-by: Prashant Bhole > --- >

Re: [RFC] virtio-net: help live migrate SR-IOV devices

2017-12-05 Thread Jakub Kicinski
On Tue, 5 Dec 2017 11:59:17 +0200, achiad shochat wrote: > I second Jacob - having a netdev of one device driver enslave a netdev > of another device driver is an awkward a-symmetric model. > Regardless of whether they share the same backend device. > Only I am not sure the

Re: BUG: KASAN: use-after-free in tcf_block_put_ext+0x5cf/0x5e0

2017-12-07 Thread Jakub Kicinski
On Thu, 7 Dec 2017 20:51:27 -0800, Jakub Kicinski wrote: > Running the netdevsim test after a week and a bit of not trying it: > > $ make -C tools/testing/selftests/bpf/ CLANG=clang LLC=llc > # ./tools/testing/selftests/bpf/test_offload.py Ah, I didn't clarify - this is net-next at

Re: [PATCH net-next v2] netdevsim: remove return value check of debugfs_create_dir

2017-12-07 Thread Jakub Kicinski
It returns NULL or a valid pointer when DebugFS is enabled. > > Finally it was decided to remove error handling altogether to > make it consistent and removal of this check isn't fatal to the driver. > > Signed-off-by: Prashant Bhole <bhole_prashant...@lab.ntt.co.jp> Revi

Re: [PATCH net-next] netdevsim: remove check on return value of debugfs_create_dir

2017-12-07 Thread Jakub Kicinski
ff-by: Prashant Bhole <bhole_prashant...@lab.ntt.co.jp> Acked-by: Jakub Kicinski <jakub.kicin...@netronome.com> but as I mentioned there is another, similar check in netdevsim/bpf.c: "... drop this error handling here and in nsim_bpf_create_prog()." > diff --git

BUG: KASAN: use-after-free in tcf_block_put_ext+0x5cf/0x5e0

2017-12-07 Thread Jakub Kicinski
Running the netdevsim test after a week and a bit of not trying it: $ make -C tools/testing/selftests/bpf/ CLANG=clang LLC=llc # ./tools/testing/selftests/bpf/test_offload.py [ 284.174418] == [ 284.182655] BUG: KASAN:

Re: [PATCH net-next] netdevsim: check return value of debugfs_create_dir

2017-12-07 Thread Jakub Kicinski
On Thu, 7 Dec 2017 17:56:37 +0900, Prashant Bhole wrote: > > From: Jakub Kicinski [mailto:jakub.kicin...@netronome.com] > > > > On Thu, 7 Dec 2017 13:10:39 +0900, Prashant Bhole wrote: > > > > From: Jakub Kicinski [mailto:jakub.kicin...@netronome.com] > > &

[bisected] x86 boot still broken on -rc2

2017-12-03 Thread Jakub Kicinski
;Kirill A. Shutemov" <kirill.shute...@linux.intel.com> Link: https://lkml.kernel.org/r/20171114124257.22013-4-pra...@redhat.com On Fri, 1 Dec 2017 16:39:54 -0800, Jakub Kicinski wrote: > Hi! > > I'm hitting these after DaveM pulled rc1 into net-next on my Xeon > E5-263

Re: [PATCH net-next] netdevsim: check return value of debugfs_create_dir

2017-12-06 Thread Jakub Kicinski
On Thu, 7 Dec 2017 13:10:39 +0900, Prashant Bhole wrote: > > From: Jakub Kicinski [mailto:jakub.kicin...@netronome.com] > > > > On Thu, 7 Dec 2017 10:02:13 +0900, Prashant Bhole wrote: > > > - Handled debugfs_create_dir failure in nsim_init() > > > - Fi

Re: [PATCH net-next] netdevsim: check return value of debugfs_create_dir

2017-12-06 Thread Jakub Kicinski
On Thu, 7 Dec 2017 10:02:13 +0900, Prashant Bhole wrote: > - Handled debugfs_create_dir failure in nsim_init() > - Fixed return value of nsim_module_init() when debugfs_create_dir fails > > Signed-off-by: Prashant Bhole Why? Failing to expose the state via

Re: [PATCH v2 net-next 4/4] bpftool: implement cgroup bpf operations

2017-12-08 Thread Jakub Kicinski
On Fri, 8 Dec 2017 09:52:16 -0700, David Ahern wrote: > On 12/8/17 8:39 AM, Quentin Monnet wrote: > > I don't believe compatibility is an issue here, since the program and > > its documentation come together (so they should stay in sync) and are > > part of the kernel tree (so the tool should be

[PATCH net-next 2/4] nfp: flower: remove dead code paths

2017-12-08 Thread Jakub Kicinski
emoved. 'Additional metadata' if statement can never be true so remove it as well. Signed-off-by: John Hurley <john.hur...@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vanderme...@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- drivers/net/ethernet/net

[PATCH net-next 0/4] nfp: dead code, clean ups and slight improvements

2017-12-08 Thread Jakub Kicinski
Hi! This series contains small clean ups from John and Carl, and brings no functional changes. John's improvements target the flower code. First he makes sure we don't allocate space in FW request messages for MAC matches if the TC rule does not contain any. The remaining two patches remove

[PATCH net-next 4/4] nfp: debug dump - decrease endian conversions

2017-12-08 Thread Jakub Kicinski
total number of conversions used. Signed-off-by: Carl Heymann <carl.heym...@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff -

[PATCH net-next 3/4] nfp: flower: remove unused defines

2017-12-08 Thread Jakub Kicinski
From: John Hurley <john.hur...@netronome.com> Delete match field defines that are not supported at this time. Signed-off-by: John Hurley <john.hur...@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vanderme...@netronome.com> Reviewed-by: Jakub Kicinski <jakub.k

[PATCH net-next 1/4] nfp: flower: do not assume mac/mpls matches

2017-12-08 Thread Jakub Kicinski
nality but removes unnessary memory assignment in the match cmsg. Signed-off-by: John Hurley <john.hur...@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vanderme...@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com> --- drivers/net/ethernet/netronome/n

Re: [PATCH v3 net-next 4/4] bpftool: implement cgroup bpf operations

2017-12-08 Thread Jakub Kicinski
On Fri, 8 Dec 2017 14:52:36 +, Roman Gushchin wrote: > +static int list_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type) > +{ > + __u32 prog_ids[1024] = {0}; > + char *attach_flags_str; > + __u32 prog_cnt, iter; > + __u32 attach_flags; > + char buf[16]; > +

Re: [PATCH net-next] netdevsim: correctly check return value of debugfs_create_dir

2017-12-11 Thread Jakub Kicinski
On Mon, 11 Dec 2017 13:46:48 +0900, Prashant Bhole wrote: > > From: David Miller [mailto:da...@davemloft.net] > > > > From: Prashant Bhole > > Date: Fri, 8 Dec 2017 09:52:50 +0900 > > > > > Return value is now checked with IS_ERROR_OR_NULL because > > >

Re: [RFC][PATCH] new byteorder primitives - ..._{replace,get}_bits()

2017-12-11 Thread Jakub Kicinski
On Mon, 11 Dec 2017 15:54:22 +, Al Viro wrote: > Essentially, it gives helpers for work with bitfields in fixed-endian. > Suppose we have e.g. a little-endian 32bit value with fixed layout; > expressing that as a bitfield would go like > struct foo { > unsigned foo:4;

Re: [PATCH net-next v2 7/8] netdevsim: add SR-IOV functionality

2017-12-01 Thread Jakub Kicinski
On Fri, 1 Dec 2017 22:36:52 +0100, Phil Sutter wrote: > On Fri, Dec 01, 2017 at 12:14:07PM -0800, Jakub Kicinski wrote: > > On Fri, 1 Dec 2017 14:43:06 +0100, Phil Sutter wrote: > > > On Thu, Nov 30, 2017 at 05:35:39PM -0800, Jakub Kicinski wrote: > > >

Re: [PATCH net-next v2 7/8] netdevsim: add SR-IOV functionality

2017-12-01 Thread Jakub Kicinski
On Fri, 1 Dec 2017 22:58:29 +0100, Phil Sutter wrote: > > > > > > + ret = count; > > > > > > +exit_unlock: > > > > > > + rtnl_unlock(); > > > > > > + > > > > > > + return ret; > > > > > > +} > > > > > > > > > > [...] > > > > > > > > > > > +static void nsim_free(struct net_device

Re: [PATCH net-next 1/5] libbpf: add ability to guess program type based on section name

2017-12-01 Thread Jakub Kicinski
lity will be used to implement > > loading of different programs without asking a user to specify > > the program type. In first order it will be used by bpftool. > > > > Signed-off-by: Roman Gushchin <g...@fb.com> > > Cc: Alexei Starovoitov <a...@kernel.org&g

[PATCH net-next v3 4/8] netdevsim: add software driver for testing offloads

2017-12-01 Thread Jakub Kicinski
further features to it. Add a new driver for purposes of software modelling only. eBPF and SR-IOV will be added here shortly, others are invited to further extend the driver with their offload models. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <

[PATCH net-next v3 1/8] net: xdp: avoid output parameters when querying XDP prog

2017-12-01 Thread Jakub Kicinski
The output parameters will get unwieldy if we want to add more information about the program. Simply pass the entire struct netdev_bpf in. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> Reviewed-by: Quentin Monnet

[PATCH net-next v3 6/8] selftests/bpf: add offload test based on netdevsim

2017-12-01 Thread Jakub Kicinski
Add a test of BPF offload control path interfaces based on just-added netdevsim driver. Perform various checks of both the stack and the expected driver behaviour. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com&

[PATCH net-next v3 7/8] netdevsim: add SR-IOV functionality

2017-12-01 Thread Jakub Kicinski
attribute for each netdev. The zero MAC address is accepted as some HW use it to mean any address is allowed. Link state is also now validated. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> --- CC: Phil Sutter <

[PATCH net-next v3 5/8] netdevsim: add bpf offload support

2017-12-01 Thread Jakub Kicinski
Add support for loading programs for netdevsim devices and expose the related information via DebugFS. Both offload of XDP and cls_bpf programs is supported. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> Reviewed

[PATCH net-next v3 3/8] net: xdp: make the stack take care of the tear down

2017-12-01 Thread Jakub Kicinski
is moved from free_netdev() as well. Because the remove will now be called before notifiers are invoked, BPF offload state of the program will not get destroyed before uninstall. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com&

[PATCH net-next v3 2/8] net: xdp: report flags program was installed with on query

2017-12-01 Thread Jakub Kicinski
Some drivers enforce that flags on program replacement and removal must match the flags passed on install. This leaves the possibility open to enable simultaneous loading of XDP programs both to HW and DRV. Allow such drivers to report the flags back to the stack. Signed-off-by: Jakub Kicinski

[PATCH net-next v3 0/8] xdp: make stack perform remove and add selftests

2017-12-01 Thread Jakub Kicinski
-IOV API implementation of dummy; - make the dev_xdp_uninstall() also handle the XDP generic (Daniel). Jakub Kicinski (8): net: xdp: avoid output parameters when querying XDP prog net: xdp: report flags program was installed with on query net: xdp: make the stack take care of the tear down

[PATCH net-next v3 8/8] net: dummy: remove fake SR-IOV functionality

2017-12-01 Thread Jakub Kicinski
netdevsim driver seems like a better place for fake SR-IOV functionality. Remove the code previously added to dummy. Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com> Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com> Acked-by: Phil Sutter <p...@nwl.cc> ---

<    8   9   10   11   12   13   14   15   16   17   >