Re: [PATCH net] net: sched: sch_ingress: do not report ingress filter info in egress path

2019-05-22 Thread Lorenzo Bianconi
> On Tue, 2019-05-21 at 14:59 +0200, Lorenzo Bianconi wrote: > > Currently if we add a filter to the ingress qdisc (e.g matchall) the > > filter data are reported even in the egress path. The issue can be > > triggered with the following reproducer: > > [...]

Re: [PATCH net] net: sched: sch_ingress: do not report ingress filter info in egress path

2019-05-22 Thread Lorenzo Bianconi
> On 05/22/2019 12:20 PM, Lorenzo Bianconi wrote: > >> On Tue, 2019-05-21 at 14:59 +0200, Lorenzo Bianconi wrote: > >>> Currently if we add a filter to the ingress qdisc (e.g matchall) the > >>> filter data are reported even in the egress path. The issue can b

[PATCH net] net: neigh: fix multiple neigh timer scheduling

2019-07-12 Thread Lorenzo Bianconi
] entry_SYSCALL_64_after_hwframe+0x49/0xbe Fix the issue unscheduling neigh_timer if selected entry is in 'IN_TIMER' receiving a netlink request with NTF_USE flag set Reported-by: Marek Majkowski Fixes: 0c5c2d308906 ("neigh: Allow for user space users of the neighbour table") Signed-off-by: Lorenzo Bi

Re: [PATCH net] net: neigh: fix multiple neigh timer scheduling

2019-07-13 Thread Lorenzo Bianconi
> > From: David Miller > Date: Fri, 12 Jul 2019 15:40:47 -0700 (PDT) > > > From: Lorenzo Bianconi > > Date: Fri, 12 Jul 2019 19:22:51 +0200 > > > >> Neigh timer can be scheduled multiple times from userspace adding > >> multiple neigh entrie

[PATCH net v2] net: neigh: fix multiple neigh timer scheduling

2019-07-14 Thread Lorenzo Bianconi
] entry_SYSCALL_64_after_hwframe+0x49/0xbe Fix the issue unscheduling neigh_timer if selected entry is in 'IN_TIMER' receiving a netlink request with NTF_USE flag set Reported-by: Marek Majkowski Fixes: 0c5c2d308906 ("neigh: Allow for user space users of the neighbour table") Signed-off-by: Lorenzo B

Re: [PATCH net v2] net: neigh: fix multiple neigh timer scheduling

2019-07-14 Thread Lorenzo Bianconi
> On 7/14/19 2:45 AM, Lorenzo Bianconi wrote: > > @@ -1124,7 +1125,9 @@ int __neigh_event_send(struct neighbour *neigh, > > struct sk_buff *skb) > > > > atomic_set(&neigh->probes, > >

[PATCH net v3] net: neigh: fix multiple neigh timer scheduling

2019-07-14 Thread Lorenzo Bianconi
] entry_SYSCALL_64_after_hwframe+0x49/0xbe Fix the issue unscheduling neigh_timer if selected entry is in 'IN_TIMER' receiving a netlink request with NTF_USE flag set Reported-by: Marek Majkowski Fixes: 0c5c2d308906 ("neigh: Allow for user space users of the neighbour table") Signed-off-by: Lorenzo B

Re: [PATCH net v3] net: neigh: fix multiple neigh timer scheduling

2019-07-30 Thread Lorenzo Bianconi
> > Hello, Hi Julian, sorry for the late reply, I was AFK > > On Sun, 14 Jul 2019, Lorenzo Bianconi wrote: > > > Neigh timer can be scheduled multiple times from userspace adding > > If the garbage comes from ndm_state, why we should create > a patc

[PATCH v6 bpf-next 2/8] xdp: add xdp_shared_info data structure

2021-01-19 Thread Lorenzo Bianconi
Introduce xdp_shared_info data structure to contain info about "non-linear" xdp frame. xdp_shared_info will alias skb_shared_info allowing to keep most of the frags in the same cache-line. Introduce some xdp_shared_info helpers aligned to skb_frag* ones Signed-off-by: Lorenz

[PATCH v6 bpf-next 8/8] bpf: add multi-buff support to the bpf_xdp_adjust_tail() API

2021-01-19 Thread Lorenzo Bianconi
From: Eelco Chaudron This change adds support for tail growing and shrinking for XDP multi-buff. Signed-off-by: Eelco Chaudron Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 5 net/core/filter.c | 63 +++ 2 files changed, 68

[PATCH v6 bpf-next 5/8] net: mvneta: add multi buffer support to XDP_TX

2021-01-19 Thread Lorenzo Bianconi
Introduce the capability to map non-linear xdp buffer running mvneta_xdp_submit_frame() for XDP_TX and XDP_REDIRECT Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 94 --- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/drivers

[PATCH v6 bpf-next 4/8] xdp: add multi-buff support to xdp_return_{buff/frame}

2021-01-19 Thread Lorenzo Bianconi
Take into account if the received xdp_buff/xdp_frame is non-linear recycling/returning the frame memory to the allocator or into xdp_frame_bulk. Introduce xdp_return_num_frags_from_buff to return a given number of fragments from a xdp multi-buff starting from the tail. Signed-off-by: Lorenzo

[PATCH v6 bpf-next 6/8] net: mvneta: enable jumbo frames for XDP

2021-01-19 Thread Lorenzo Bianconi
Enable the capability to receive jumbo frames even if the interface is running in XDP mode Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet

[PATCH v6 bpf-next 3/8] net: mvneta: update mb bit before passing the xdp buffer to eBPF layer

2021-01-19 Thread Lorenzo Bianconi
Update multi-buffer bit (mb) in xdp_buff to notify XDP/eBPF layer and XDP remote drivers if this is a "non-linear" XDP buffer. Access xdp_shared_info only if xdp_buff mb is set. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 26

[PATCH v6 bpf-next 7/8] net: xdp: add multi-buff support to xdp_build_skb_from_fram

2021-01-19 Thread Lorenzo Bianconi
Introduce xdp multi-buff support to __xdp_build_skb_from_frame/xdp_build_skb_from_fram utility routines. Signed-off-by: Lorenzo Bianconi --- net/core/xdp.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/net/core/xdp.c b/net/core/xdp.c index af9b9c1194fc

[PATCH v6 bpf-next 1/8] xdp: introduce mb in xdp_buff/xdp_frame

2021-01-19 Thread Lorenzo Bianconi
. Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/net/xdp.h b/include/net/xdp.h index c4bfdc9a8b79..945767813fdd 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -73,7 +73,8 @@ struct xdp_buff

[PATCH v6 bpf-next 0/8] mvneta: introduce XDP multi-buffer support

2021-01-19 Thread Lorenzo Bianconi
section) Eelco Chaudron (1): bpf: add multi-buff support to the bpf_xdp_adjust_tail() API Lorenzo Bianconi (7): xdp: introduce mb in xdp_buff/xdp_frame xdp: add xdp_shared_info data structure net: mvneta: update mb bit before passing the xdp buffer to eBPF layer xdp: add multi-buff support

[PATCH bpf-next] net: xdp: introduce xdp_init_buff utility routine

2020-12-10 Thread Lorenzo Bianconi
Introduce xdp_init_buff utility routine to initialize xdp_buff data structure. Rely on xdp_init_buff in all XDP capable drivers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c| 3 +-- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 3 +-- drivers

Re: [PATCH bpf-next] net: xdp: introduce xdp_init_buff utility routine

2020-12-10 Thread Lorenzo Bianconi
> On Thu, Dec 10, 2020 at 04:50:42PM +0100, Lorenzo Bianconi wrote: > > Introduce xdp_init_buff utility routine to initialize xdp_buff data > > structure. Rely on xdp_init_buff in all XDP capable drivers. > > Hm, Jesper was suggesting two helpers, one that you implemented

Re: [PATCH bpf-next] net: xdp: introduce xdp_init_buff utility routine

2020-12-10 Thread Lorenzo Bianconi
On Dec 10, Maciej Fijalkowski wrote: > On Thu, Dec 10, 2020 at 05:32:41PM +0100, Lorenzo Bianconi wrote: > > > On Thu, Dec 10, 2020 at 04:50:42PM +0100, Lorenzo Bianconi wrote: > > > > Introduce xdp_init_buff utility routine to initialize xdp_buff data > > > >

Re: [PATCH bpf-next] net: xdp: introduce xdp_init_buff utility routine

2020-12-10 Thread Lorenzo Bianconi
> On Thu, 2020-12-10 at 18:59 +0100, Lorenzo Bianconi wrote: > > On Dec 10, Maciej Fijalkowski wrote: > > > On Thu, Dec 10, 2020 at 05:32:41PM +0100, Lorenzo Bianconi wrote: > > > > > On Thu, Dec 10, 2020 at 04:50:42PM +0100, Lorenzo Bianconi > > > >

Re: [PATCH bpf-next] net: xdp: introduce xdp_init_buff utility routine

2020-12-10 Thread Lorenzo Bianconi
> On Thu, 2020-12-10 at 20:28 +0100, Lorenzo Bianconi wrote: > > > On Thu, 2020-12-10 at 18:59 +0100, Lorenzo Bianconi wrote: > > > > On Dec 10, Maciej Fijalkowski wrote: > > > > > On Thu, Dec 10, 2020 at 05:32:41PM +0100, Lorenzo Bianconi > > > >

[PATCH v2 bpf-next 1/2] net: xdp: introduce xdp_init_buff utility routine

2020-12-11 Thread Lorenzo Bianconi
Introduce xdp_init_buff utility routine to initialize xdp_buff fields const over NAPI iterations (e.g. frame_sz or rxq pointer). Rely on xdp_init_buff in all XDP capable drivers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c| 3 +-- drivers/net

[PATCH v2 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-11 Thread Lorenzo Bianconi
Introduce xdp_prepare_buff utility routine to initialize per-descriptor xdp_buff fields (e.g. xdp_buff pointers). Rely on xdp_prepare_buff() in all XDP capable drivers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++--- drivers/net/ethernet

[PATCH v2 bpf-next 0/2] introduce xdp_init_buff/xdp_prepare_buff

2020-12-11 Thread Lorenzo Bianconi
Introduce xdp_init_buff and xdp_prepare_buff utility routines to initialize xdp_buff data structure and remove duplicated code in all XDP capable drivers. Changes since v1: - introduce xdp_prepare_buff utility routine Lorenzo Bianconi (2): net: xdp: introduce xdp_init_buff utility routine

Re: [PATCH v2 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-12 Thread Lorenzo Bianconi
On Dec 11, Saeed Mahameed wrote: > On Fri, 2020-12-11 at 20:28 +0100, Lorenzo Bianconi wrote: > > Introduce xdp_prepare_buff utility routine to initialize per- > > descriptor > > xdp_buff fields (e.g. xdp_buff pointers). Rely on xdp_prepare_buff() > > in

[PATCH v3 bpf-next 0/2] introduce xdp_init_buff/xdp_prepare_buff

2020-12-12 Thread Lorenzo Bianconi
nd xdp->data_meta in xdp_prepare_buff() Changes since v1: - introduce xdp_prepare_buff utility routine Lorenzo Bianconi (2): net: xdp: introduce xdp_init_buff utility routine net: xdp: introduce xdp_prepare_buff utility routine drivers/net/ethernet/amazon/ena/ena_netdev.c | 8 +++- dr

[PATCH v3 bpf-next 1/2] net: xdp: introduce xdp_init_buff utility routine

2020-12-12 Thread Lorenzo Bianconi
Introduce xdp_init_buff utility routine to initialize xdp_buff fields const over NAPI iterations (e.g. frame_sz or rxq pointer). Rely on xdp_init_buff in all XDP capable drivers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c| 3 +-- drivers/net

[PATCH v3 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-12 Thread Lorenzo Bianconi
Introduce xdp_prepare_buff utility routine to initialize per-descriptor xdp_buff fields (e.g. xdp_buff pointers). Rely on xdp_prepare_buff() in all XDP capable drivers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++--- drivers/net/ethernet

Re: [PATCH v3 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-15 Thread Lorenzo Bianconi
[...] > > xdp_act = bpf_prog_run_xdp(xdp_prog, &xdp); > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c > > b/drivers/net/ethernet/intel/i40e/i40e_txrx.c > > index 4dbbbd49c389..fcd1ca3343fb 100644 > > --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c > > +++ b/drivers/net/ethernet/

Re: [PATCH v3 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-15 Thread Lorenzo Bianconi
> On 12/15/20 2:47 PM, Lorenzo Bianconi wrote: > [...] > > > > diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c > > > > index 329397c60d84..61d3f5f8b7f3 100644 > > > > --- a/drivers/net/xen-netfront.c > > > > +++ b/drivers/

Re: [PATCH v3 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-15 Thread Lorenzo Bianconi
> On Tue, Dec 15, 2020 at 04:06:20PM +0100, Lorenzo Bianconi wrote: > > > On 12/15/20 2:47 PM, Lorenzo Bianconi wrote: > > > [...] > > > > > > diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c > > > > > > index 329397c60d

Re: [PATCH v3 bpf-next 1/2] net: xdp: introduce xdp_init_buff utility routine

2020-12-16 Thread Lorenzo Bianconi
> On Sat, 12 Dec 2020 18:41:48 +0100 > Lorenzo Bianconi wrote: > > > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c > > b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c > > index fcc262064766..b7942c3440c0 100644 > > --- a/drivers/net/ethernet/b

Re: [PATCH v3 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-16 Thread Lorenzo Bianconi
> On Tue, 15 Dec 2020 14:47:10 +0100 > Lorenzo Bianconi wrote: > > > [...] > > > > xdp_act = bpf_prog_run_xdp(xdp_prog, &xdp); > > > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c > > > > b/drivers/net/ethernet/intel/i4

[PATCH bpf-next 0/2] add xdp_build_skb_from_frame utility routine

2020-12-16 Thread Lorenzo Bianconi
Introduce __xdp_build_skb_from_frame and xdp_build_skb_from_frame routines to build the skb from a xdp_frame. Respect to __xdp_build_skb_from_frame, xdp_build_skb_from_frame will allocate the skb object. Rely on __xdp_build_skb_from_frame/xdp_build_skb_from_frame in cpumap and veth code. Lorenzo

[PATCH bpf-next 2/2] net: xdp: introduce xdp_build_skb_from_frame utility routine

2020-12-16 Thread Lorenzo Bianconi
Introduce xdp_build_skb_from_frame utility routine to build the skb from xdp_frame. Respect to __xdp_build_skb_from_frame, xdp_build_skb_from_frame will allocate the skb object. Rely on xdp_build_skb_from_frame in veth driver. Signed-off-by: Lorenzo Bianconi --- drivers/net/veth.c | 18

[PATCH bpf-next 1/2] net: xdp: introduce __xdp_build_skb_from_frame utility routine

2020-12-16 Thread Lorenzo Bianconi
Introduce __xdp_build_skb_from_frame utility routine to build the skb from xdp_frame. Rely on __xdp_build_skb_from_frame in cpumap code. Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 3 +++ kernel/bpf/cpumap.c | 45 + net/core/xdp.c

[PATCH v4 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-19 Thread Lorenzo Bianconi
Introduce xdp_prepare_buff utility routine to initialize per-descriptor xdp_buff fields (e.g. xdp_buff pointers). Rely on xdp_prepare_buff() in all XDP capable drivers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 7 +++ drivers/net/ethernet

[PATCH v4 bpf-next 0/2] introduce xdp_init_buff/xdp_prepare_buff

2020-12-19 Thread Lorenzo Bianconi
xdp_prepare_buff() Changes since v1: - introduce xdp_prepare_buff utility routine Lorenzo Bianconi (2): net: xdp: introduce xdp_init_buff utility routine net: xdp: introduce xdp_prepare_buff utility routine Acked-by: Martin Habets Acked-by: Camelia Groza drivers/net/ethernet/amazon/ena

[PATCH v4 bpf-next 1/2] net: xdp: introduce xdp_init_buff utility routine

2020-12-19 Thread Lorenzo Bianconi
Introduce xdp_init_buff utility routine to initialize xdp_buff fields const over NAPI iterations (e.g. frame_sz or rxq pointer). Rely on xdp_init_buff in all XDP capable drivers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c| 3 +-- drivers/net

Re: [PATCH v4 bpf-next 0/2] introduce xdp_init_buff/xdp_prepare_buff

2020-12-20 Thread Lorenzo Bianconi
> > > Lorenzo Bianconi writes: > > > Introduce xdp_init_buff and xdp_prepare_buff utility routines to > > initialize > > xdp_buff data structure and remove duplicated code in all XDP > > capable > > drivers. > > > > Changes sin

Re: [PATCH v5 bpf-next 03/14] xdp: add xdp_shared_info data structure

2020-12-20 Thread Lorenzo Bianconi
> > > Lorenzo Bianconi writes: > > >> On Mon, 2020-12-07 at 17:32 +0100, Lorenzo Bianconi wrote: > >> > Introduce xdp_shared_info data structure to contain info > >> > about > >> > "non-linear" xdp frame. xdp_shared_info will ali

Re: [PATCH v5 bpf-next 11/14] bpf: cpumap: introduce xdp multi-buff support

2020-12-20 Thread Lorenzo Bianconi
> > > Lorenzo Bianconi writes: > > > Introduce __xdp_build_skb_from_frame and > > xdp_build_skb_from_frame > > utility routines to build the skb from xdp_frame. > > Add xdp multi-buff support to cpumap > > > > Signed-off-by: Lorenzo Bianconi > &

Re: [PATCH v5 bpf-next 06/14] net: mvneta: add multi buffer support to XDP_TX

2020-12-20 Thread Lorenzo Bianconi
On Sat, Dec 19, 2020 at 4:56 PM Shay Agroskin wrote: > > > Lorenzo Bianconi writes: > > > Introduce the capability to map non-linear xdp buffer running > > mvneta_xdp_submit_frame() for XDP_TX and XDP_REDIRECT > > > > Signed-off-by: Lorenzo Bianconi >

Re: [PATCH v4 bpf-next 1/2] net: xdp: introduce xdp_init_buff utility routine

2020-12-21 Thread Lorenzo Bianconi
On Mon, Dec 21, 2020 at 9:37 AM Jesper Dangaard Brouer wrote: > > On Sat, 19 Dec 2020 18:55:00 +0100 > Lorenzo Bianconi wrote: > > > diff --git a/include/net/xdp.h b/include/net/xdp.h > > index 11ec93f827c0..323340caef88 100644 > > --- a/include/net/xdp.h > >

[PATCH v5 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-22 Thread Lorenzo Bianconi
Introduce xdp_prepare_buff utility routine to initialize per-descriptor xdp_buff fields (e.g. xdp_buff pointers). Rely on xdp_prepare_buff() in all XDP capable drivers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 7 +++ drivers/net/ethernet/broadcom

[PATCH v5 bpf-next 0/2] introduce xdp_init_buff/xdp_prepare_buff

2020-12-22 Thread Lorenzo Bianconi
p->data as hard_start + headroom and save it in a local variable to reuse it for xdp->data_end and xdp->data_meta in xdp_prepare_buff() Changes since v1: - introduce xdp_prepare_buff utility routine Lorenzo Bianconi (2): net: xdp: introduce xdp_init_buff utility routine net: xdp: introdu

[PATCH v5 bpf-next 1/2] net: xdp: introduce xdp_init_buff utility routine

2020-12-22 Thread Lorenzo Bianconi
Introduce xdp_init_buff utility routine to initialize xdp_buff fields const over NAPI iterations (e.g. frame_sz or rxq pointer). Rely on xdp_init_buff in all XDP capable drivers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c| 3 +-- drivers/net

[PATCH v5 bpf-next 00/14] mvneta: introduce XDP multi-buffer support

2020-12-07 Thread Lorenzo Bianconi
XDP ctx bpf: update xdp_adjust_tail selftest to include multi-buffer Lorenzo Bianconi (11): xdp: introduce mb in xdp_buff/xdp_frame xdp: initialize xdp_buff mb bit to 0 in all XDP drivers xdp: add xdp_shared_info data structure net: mvneta: update mb bit before passing the xdp buffer to eBPF

[PATCH v5 bpf-next 01/14] xdp: introduce mb in xdp_buff/xdp_frame

2020-12-07 Thread Lorenzo Bianconi
. Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 8 ++-- net/core/xdp.c| 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/net/xdp.h b/include/net/xdp.h index 700ad5db7f5d..70559720ff44 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -73,7 +73,8

[PATCH v5 bpf-next 02/14] xdp: initialize xdp_buff mb bit to 0 in all XDP drivers

2020-12-07 Thread Lorenzo Bianconi
Initialize multi-buffer bit (mb) to 0 in all XDP-capable drivers. This is a preliminary patch to enable xdp multi-buffer support. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/amazon/ena/ena_netdev.c| 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 1 + drivers/net

[PATCH v5 bpf-next 03/14] xdp: add xdp_shared_info data structure

2020-12-07 Thread Lorenzo Bianconi
Introduce xdp_shared_info data structure to contain info about "non-linear" xdp frame. xdp_shared_info will alias skb_shared_info allowing to keep most of the frags in the same cache-line. Introduce some xdp_shared_info helpers aligned to skb_frag* ones Signed-off-by: Lorenz

[PATCH v5 bpf-next 04/14] net: mvneta: update mb bit before passing the xdp buffer to eBPF layer

2020-12-07 Thread Lorenzo Bianconi
Update multi-buffer bit (mb) in xdp_buff to notify XDP/eBPF layer and XDP remote drivers if this is a "non-linear" XDP buffer. Access xdp_shared_info only if xdp_buff mb is set. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 24 ++

[PATCH v5 bpf-next 05/14] xdp: add multi-buff support to xdp_return_{buff/frame}

2020-12-07 Thread Lorenzo Bianconi
Take into account if the received xdp_buff/xdp_frame is non-linear recycling/returning the frame memory to the allocator or into xdp_frame_bulk. Introduce xdp_return_num_frags_from_buff to return a given number of fragments from a xdp multi-buff starting from the tail. Signed-off-by: Lorenzo

[PATCH v5 bpf-next 08/14] bpf: introduce multibuff support to bpf_prog_test_run_xdp()

2020-12-07 Thread Lorenzo Bianconi
Introduce the capability to allocate a xdp multi-buff in bpf_prog_test_run_xdp routine. This is a preliminary patch to introduce the selftests for new xdp multi-buff ebpf helpers Signed-off-by: Lorenzo Bianconi --- net/bpf/test_run.c | 52 +++--- 1 file

[PATCH v5 bpf-next 06/14] net: mvneta: add multi buffer support to XDP_TX

2020-12-07 Thread Lorenzo Bianconi
Introduce the capability to map non-linear xdp buffer running mvneta_xdp_submit_frame() for XDP_TX and XDP_REDIRECT Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 94 --- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/drivers

[PATCH v5 bpf-next 10/14] net: mvneta: enable jumbo frames for XDP

2020-12-07 Thread Lorenzo Bianconi
Enable the capability to receive jumbo frames even if the interface is running in XDP mode Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet

[PATCH v5 bpf-next 09/14] bpf: test_run: add xdp_shared_info pointer in bpf_test_finish signature

2020-12-07 Thread Lorenzo Bianconi
introduce xdp_shared_info pointer in bpf_test_finish signature in order to copy back paged data from a xdp multi-buff frame to userspace buffer Signed-off-by: Lorenzo Bianconi --- net/bpf/test_run.c | 46 +++--- 1 file changed, 39 insertions(+), 7

[PATCH v5 bpf-next 07/14] bpf: move user_size out of bpf_test_init

2020-12-07 Thread Lorenzo Bianconi
Rely on data_size_in in bpf_test_init routine signature. This is a preliminary patch to introduce xdp multi-buff selftest Signed-off-by: Lorenzo Bianconi --- net/bpf/test_run.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/net/bpf/test_run.c b/net/bpf

[PATCH v5 bpf-next 12/14] bpf: add multi-buff support to the bpf_xdp_adjust_tail() API

2020-12-07 Thread Lorenzo Bianconi
From: Eelco Chaudron This change adds support for tail growing and shrinking for XDP multi-buff. Signed-off-by: Eelco Chaudron Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 5 net/core/filter.c | 63 +++ 2 files changed, 68

[PATCH v5 bpf-next 11/14] bpf: cpumap: introduce xdp multi-buff support

2020-12-07 Thread Lorenzo Bianconi
Introduce __xdp_build_skb_from_frame and xdp_build_skb_from_frame utility routines to build the skb from xdp_frame. Add xdp multi-buff support to cpumap Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 5 kernel/bpf/cpumap.c | 45 +--- net/core/xdp.c

[PATCH v5 bpf-next 14/14] bpf: update xdp_adjust_tail selftest to include multi-buffer

2020-12-07 Thread Lorenzo Bianconi
From: Eelco Chaudron This change adds test cases for the multi-buffer scenarios when shrinking and growing. Signed-off-by: Eelco Chaudron Signed-off-by: Lorenzo Bianconi --- .../bpf/prog_tests/xdp_adjust_tail.c | 105 ++ .../bpf/progs/test_xdp_adjust_tail_grow.c

[PATCH v5 bpf-next 13/14] bpf: add new frame_length field to the XDP ctx

2020-12-07 Thread Lorenzo Bianconi
< ctx->frame_length) { /* Fragements exists. /* } Signed-off-by: Eelco Chaudron Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 22 + include/uapi/linux/bpf.h | 1 + kernel/bpf/verifier.c | 2 +- net/core/filter.c

Re: [PATCH v5 bpf-next 02/14] xdp: initialize xdp_buff mb bit to 0 in all XDP drivers

2020-12-08 Thread Lorenzo Bianconi
> On Mon, 2020-12-07 at 22:37 +0100, Maciej Fijalkowski wrote: > > On Mon, Dec 07, 2020 at 01:15:00PM -0800, Alexander Duyck wrote: > > > On Mon, Dec 7, 2020 at 8:36 AM Lorenzo Bianconi > > > wrote: > > > > Initialize multi-buffer bit (mb) to 0 in all

Re: [PATCH v5 bpf-next 03/14] xdp: add xdp_shared_info data structure

2020-12-08 Thread Lorenzo Bianconi
> On Mon, 2020-12-07 at 17:32 +0100, Lorenzo Bianconi wrote: > > Introduce xdp_shared_info data structure to contain info about > > "non-linear" xdp frame. xdp_shared_info will alias skb_shared_info > > allowing to keep most of the frags in the same cache-line. >

[PATCH net-next 0/3] mvneta: access skb_shared_info only on last frag

2020-11-20 Thread Lorenzo Bianconi
Build skb_shared_info on mvneta_rx_swbm stack and sync it to xdp_buff skb_shared_info area only on the last fragment. Avoid avoid unnecessary xdp_buff initialization in mvneta_rx_swbm routine. This a preliminary series to complete xdp multi-buff in mvneta driver. Lorenzo Bianconi (3): net

[PATCH net-next 1/3] net: mvneta: avoid unnecessary xdp_buff initialization

2020-11-20 Thread Lorenzo Bianconi
Explicitly initialize mandatory fields defining xdp_buff struct in mvneta_rx_swbm routine Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net

[PATCH net-next 2/3] net: mvneta: move skb_shared_info in mvneta_xdp_put_buff caller

2020-11-20 Thread Lorenzo Bianconi
Pass skb_shared_info pointer from mvneta_xdp_put_buff caller. This is a preliminary patch to reduce accesses to skb_shared_info area and reduce cache misses. Remove napi parameter in mvneta_xdp_put_buff signature since it is always run in NAPI context Signed-off-by: Lorenzo Bianconi --- drivers

[PATCH net-next 3/3] net: mvneta: alloc skb_shared_info on the mvneta_rx_swbm stack

2020-11-20 Thread Lorenzo Bianconi
Build skb_shared_info on mvneta_rx_swbm stack and sync it to xdp_buff skb_shared_info area only on the last fragment. Leftover cache miss in mvneta_swbm_rx_frame will be addressed introducing mb bit in xdp_buff/xdp_frame struct Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell

[PATCH net-next] net: page_pool: Add page_pool_put_page_bulk() to page_pool.rst

2020-11-20 Thread Lorenzo Bianconi
Introduce page_pool_put_page_bulk() entry into the API section of page_pool.rst Signed-off-by: Lorenzo Bianconi --- Documentation/networking/page_pool.rst | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/networking/page_pool.rst b/Documentation/networking/page_pool.rst

Re: [PATCH net-next] net: page_pool: Add page_pool_put_page_bulk() to page_pool.rst

2020-11-23 Thread Lorenzo Bianconi
> On Fri, Nov 20, 2020 at 11:19:34PM +0100, Lorenzo Bianconi wrote: > > Introduce page_pool_put_page_bulk() entry into the API section of > > page_pool.rst > > > > Signed-off-by: Lorenzo Bianconi > > --- > > Documentation/networking/page_pool.rst | 8 +++

[PATCH v2 net-next] net: page_pool: Add page_pool_put_page_bulk() to page_pool.rst

2020-11-23 Thread Lorenzo Bianconi
Introduce page_pool_put_page_bulk() entry into the API section of page_pool.rst Acked-by: Ilias Apalodimas Signed-off-by: Lorenzo Bianconi --- Changes since v1: - addressed Ilias's comments --- Documentation/networking/page_pool.rst | 8 1 file changed, 8 insertions(+) diff --

Re: [PATCH net-next 0/3] mvneta: access skb_shared_info only on last frag

2020-11-24 Thread Lorenzo Bianconi
> On Fri, 20 Nov 2020 18:05:41 +0100 Lorenzo Bianconi wrote: > > Build skb_shared_info on mvneta_rx_swbm stack and sync it to xdp_buff > > skb_shared_info area only on the last fragment. > > Avoid avoid unnecessary xdp_buff initialization in mvneta_rx_swbm routine. > > T

[PATCH v5 net-nex 0/5] xdp: introduce bulking for page_pool tx return path

2020-11-10 Thread Lorenzo Bianconi
in page_pool_put_page_bulk for loop Lorenzo Bianconi (5): net: xdp: introduce bulking for xdp tx return path net: page_pool: add bulk support for ptr_ring net: mvneta: add xdp tx return bulking support net: mvpp2: add xdp tx return bulking support net: mlx5: add xdp tx return bulking

[PATCH v5 net-nex 1/5] net: xdp: introduce bulking for xdp tx return path

2020-11-10 Thread Lorenzo Bianconi
Brouer Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 17 +- net/core/xdp.c| 59 +++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a

[PATCH v5 net-nex 2/5] net: page_pool: add bulk support for ptr_ring

2020-11-10 Thread Lorenzo Bianconi
Introduce the capability to batch page_pool ptr_ring refill since it is usually run inside the driver NAPI tx completion loop. Suggested-by: Jesper Dangaard Brouer Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- include/net

[PATCH v5 net-nex 5/5] net: mlx5: add xdp tx return bulking support

2020-11-10 Thread Lorenzo Bianconi
Convert mlx5 driver to xdp_return_frame_bulk APIs. XDP_REDIRECT (upstream codepath): 8.9Mpps XDP_REDIRECT (upstream codepath + bulking APIs): 10.2Mpps Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- .../net/ethernet/mellanox

[PATCH v5 net-nex 3/5] net: mvneta: add xdp tx return bulking support

2020-11-10 Thread Lorenzo Bianconi
Convert mvneta driver to xdp_return_frame_bulk APIs. XDP_REDIRECT (upstream codepath): 275Kpps XDP_REDIRECT (upstream codepath + bulking APIs): 284Kpps Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet

[PATCH v5 net-nex 4/5] net: mvpp2: add xdp tx return bulking support

2020-11-10 Thread Lorenzo Bianconi
Convert mvpp2 driver to xdp_return_frame_bulk APIs. XDP_REDIRECT (upstream codepath): 1.79Mpps XDP_REDIRECT (upstream codepath + bulking APIs): 1.93Mpps Tested-by: Matteo Croce Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi

Re: [PATCH v5 net-nex 0/5] xdp: introduce bulking for page_pool tx return path

2020-11-10 Thread Lorenzo Bianconi
> On Tue, 10 Nov 2020 16:37:55 +0100 > Lorenzo Bianconi wrote: > > > XDP bulk APIs introduce a defer/flush mechanism to return > > pages belonging to the same xdp_mem_allocator object > > (identified via the mem.id field) in bulk to optimize > > I-cache and

Re: [PATCH v5 net-nex 2/5] net: page_pool: add bulk support for ptr_ring

2020-11-11 Thread Lorenzo Bianconi
> Lorenzo Bianconi wrote: > > Introduce the capability to batch page_pool ptr_ring refill since it is > > usually run inside the driver NAPI tx completion loop. > > > > Suggested-by: Jesper Dangaard Brouer > > Co-developed-by: Jesper Dangaard Brouer > >

[PATCH v6 net-nex 0/5] xdp: introduce bulking for page_pool tx return path

2020-11-13 Thread Lorenzo Bianconi
page_pool_put_page_bulk for loop Acked-by: Jesper Dangaard Brouer Lorenzo Bianconi (5): net: xdp: introduce bulking for xdp tx return path net: page_pool: add bulk support for ptr_ring net: mvneta: add xdp tx return bulking support net: mvpp2: add xdp tx return bulking support net: mlx5: add xdp tx

[PATCH v6 net-nex 2/5] net: page_pool: add bulk support for ptr_ring

2020-11-13 Thread Lorenzo Bianconi
Introduce the capability to batch page_pool ptr_ring refill since it is usually run inside the driver NAPI tx completion loop. Suggested-by: Jesper Dangaard Brouer Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- include/net

[PATCH v6 net-nex 3/5] net: mvneta: add xdp tx return bulking support

2020-11-13 Thread Lorenzo Bianconi
Convert mvneta driver to xdp_return_frame_bulk APIs. XDP_REDIRECT (upstream codepath): 275Kpps XDP_REDIRECT (upstream codepath + bulking APIs): 284Kpps Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet

[PATCH v6 net-nex 1/5] net: xdp: introduce bulking for xdp tx return path

2020-11-13 Thread Lorenzo Bianconi
Brouer Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 17 +- net/core/xdp.c| 59 +++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a

[PATCH v6 net-nex 5/5] net: mlx5: add xdp tx return bulking support

2020-11-13 Thread Lorenzo Bianconi
Convert mlx5 driver to xdp_return_frame_bulk APIs. XDP_REDIRECT (upstream codepath): 8.9Mpps XDP_REDIRECT (upstream codepath + bulking APIs): 10.2Mpps Tested-by: Jesper Dangaard Brouer Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo

[PATCH v6 net-nex 4/5] net: mvpp2: add xdp tx return bulking support

2020-11-13 Thread Lorenzo Bianconi
Convert mvpp2 driver to xdp_return_frame_bulk APIs. XDP_REDIRECT (upstream codepath): 1.79Mpps XDP_REDIRECT (upstream codepath + bulking APIs): 1.93Mpps Tested-by: Matteo Croce Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi

[PATCH net] net: mvneta: fix possible memory leak in mvneta_swbm_add_rx_fragment

2020-11-13 Thread Lorenzo Bianconi
Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 54b0bf574c05..4a9041ee1b39 100644 --- a/drivers/net/ethern

[PATCH net-next] net: netsec: add xdp tx return bulking support

2020-11-17 Thread Lorenzo Bianconi
Convert netsec driver to xdp_return_frame_bulk APIs. Rely on xdp_return_frame_rx_napi for XDP_TX in order to try to recycle the page in the "in-irq" page_pool cache. Co-developed-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- Thi

Re: [PATCH v5 bpf-next 2/2] net: xdp: introduce xdp_prepare_buff utility routine

2020-12-29 Thread Lorenzo Bianconi
> > + hard_start = page_address(rx_buffer->page) + > > + rx_buffer->page_offset - offset; > > + xdp_prepare_buff(&xdp, hard_start, offset, size, > > true); > > #if (PAGE_SIZE > 4096) > > /* At larger P

Re: [PATCH] mt76: Fix queue ID variable types after mcu queue split

2020-12-31 Thread Lorenzo Bianconi
send_message to be > more neutral like mt7615_mcu_send_message. > > Fixes: e637763b606b ("mt76: move mcu queues to mt76_dev q_mcu array") > Link: https://github.com/ClangBuiltLinux/linux/issues/1229 > Signed-off-by: Nathan Chancellor Acked-by: Lorenzo Bianconi > --- >

Re: [PATCH bpf-next 0/2] add xdp_build_skb_from_frame utility routine

2021-01-12 Thread Lorenzo Bianconi
veth > code. Hi Daniel/Alexei, since this series is marked as "archived" in patchwork, do I need to resubmit it? Regards, Lorenzo > > Lorenzo Bianconi (2): > net: xdp: introduce __xdp_build_skb_from_frame utility routine > net: xdp: introduce xdp_build_skb_from_fr

Re: [PATCH bpf-next 0/2] add xdp_build_skb_from_frame utility routine

2021-01-12 Thread Lorenzo Bianconi
> On 1/12/21 5:08 PM, Lorenzo Bianconi wrote: > > > Introduce __xdp_build_skb_from_frame and xdp_build_skb_from_frame > > > routines to > > > build the skb from a xdp_frame. Respect to __xdp_build_skb_from_frame, > > > xdp_build_skb_from_frame will

[PATCH v2 bpf-next 0/2] add xdp_build_skb_from_frame utility routine

2021-01-12 Thread Lorenzo Bianconi
since v1: - fix a checkpatch warning - improve commit log in patch 2/2 Lorenzo Bianconi (2): net: xdp: introduce __xdp_build_skb_from_frame utility routine net: xdp: introduce xdp_build_skb_from_frame utility routine drivers/net/veth.c | 18 +++--- include/net/xdp.h | 5

[PATCH v2 bpf-next 1/2] net: xdp: introduce __xdp_build_skb_from_frame utility routine

2021-01-12 Thread Lorenzo Bianconi
Introduce __xdp_build_skb_from_frame utility routine to build the skb from xdp_frame. Rely on __xdp_build_skb_from_frame in cpumap code. Acked-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 3 +++ kernel/bpf/cpumap.c | 46

[PATCH v2 bpf-next 2/2] net: xdp: introduce xdp_build_skb_from_frame utility routine

2021-01-12 Thread Lorenzo Bianconi
missing metadata support in veth_xdp_rcv_one(). Reviewed-by: Toshiaki Makita Acked-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- drivers/net/veth.c | 18 +++--- include/net/xdp.h | 2 ++ net/core/xdp.c | 15 +++ 3 files changed, 20 insertions

[RFC 2/2] net: page_pool: add bulk support for ptr_ring

2020-10-20 Thread Lorenzo Bianconi
Introduce the capability to batch page_pool ptr_ring refill since it is usually run inside the driver NAPI tx completion loop. Suggested-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- include/net/page_pool.h | 21 + net/core/page_pool.c| 37

[RFC 0/2] xdp: introduce bulking for page_pool tx return path

2020-10-20 Thread Lorenzo Bianconi
code: XDP_TX: ~296Kpps XDP_REDIRECT: ~273Kpps mvneta + xdp_return_frame_bulk APIs: XDP_TX: ~303Kpps XDP_REDIRECT: ~287Kpps Lorenzo Bianconi (2): net: xdp: introduce bulking for xdp tx return path net: page_pool: add bulk support for ptr_ring drivers/net/ethernet/marvell

[RFC 1/2] net: xdp: introduce bulking for xdp tx return path

2020-10-20 Thread Lorenzo Bianconi
xdp_return_frame_bulk APIs. Suggested-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 8 ++--- include/net/xdp.h | 11 ++ net/core/xdp.c| 50 +++ 3 files changed, 65

Re: [RFC 1/2] net: xdp: introduce bulking for xdp tx return path

2020-10-20 Thread Lorenzo Bianconi
> On Tue, 20 Oct 2020 11:33:37 +0200 > Lorenzo Bianconi wrote: > > > diff --git a/drivers/net/ethernet/marvell/mvneta.c > > b/drivers/net/ethernet/marvell/mvneta.c > > index 54b0bf574c05..af33cc62ed4c 100644 > > --- a/drivers/net/ethernet/marvell/mvneta.c >

  1   2   3   4   5   6   7   >