[RFC PATCH bpf-next 3/4] libbpf: move xdp program removal to libbpf

2019-06-03 Thread Maciej Fijalkowski
it, remove the socket/umem in xdpsock's error path. Signed-off-by: Maciej Fijalkowski --- samples/bpf/xdpsock_user.c | 33 ++--- tools/lib/bpf/xsk.c| 32 tools/lib/bpf/xsk.h| 1 + 3 files changed, 43 insertions(+

[RFC PATCH bpf-next 0/4] libbpf: xsk improvements

2019-06-03 Thread Maciej Fijalkowski
ue per CPU core. For xsk counter we could have for example additional entry in qidconf_map, but that map is removed in Jonathan's patches, so that's not an option. The resolution I gave a shot is to have a pinned map with a single entry. Further reasoning is included in commit messag

[RFC PATCH bpf-next 1/4] libbpf: fill the AF_XDP fill queue before bind() call

2019-06-03 Thread Maciej Fijalkowski
for having this preparation done after bind(). Signed-off-by: Maciej Fijalkowski Signed-off-by: Krzysztof Kazimierczak --- samples/bpf/xdpsock_user.c | 15 --- tools/lib/bpf/xsk.c| 19 ++- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/s

[RFC PATCH bpf-next 4/4] libbpf: don't remove eBPF resources when other xsks are present

2019-06-03 Thread Maciej Fijalkowski
ap in nr_map_ids field of struct bpf_prog_info. The described behaviour brings the need to have this map pinned, so in case when socket is being created and the libbpf detects the presence of bpf resources, it will be able to access that map. Signed-off-by: Maciej Fijalkowski --- tools/lib/bpf/xsk.c

[RFC PATCH bpf-next 2/4] libbpf: check for channels.max_{t,r}x in xsk_get_max_queues

2019-06-03 Thread Maciej Fijalkowski
or channels.max_{t,r}x as well in xsk_get_max_queues. Signed-off-by: Maciej Fijalkowski --- tools/lib/bpf/xsk.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index 57dda1389870..514ab3fb06f4 100644 --- a/tools/l

Re: [RFC PATCH bpf-next 1/4] libbpf: fill the AF_XDP fill queue before bind() call

2019-06-04 Thread Maciej Fijalkowski
On Tue, 4 Jun 2019 10:06:36 +0200 Björn Töpel wrote: > On 2019-06-03 15:19, Maciej Fijalkowski wrote: > > Let's get into the driver via ndo_bpf with command set to XDP_SETUP_UMEM > > with fill queue that already contains some available entries that can be > > used

Re: [RFC PATCH bpf-next 2/4] libbpf: check for channels.max_{t,r}x in xsk_get_max_queues

2019-06-04 Thread Maciej Fijalkowski
On Tue, 4 Jun 2019 10:06:57 +0200 Björn Töpel wrote: > On 2019-06-03 15:19, Maciej Fijalkowski wrote: > > When it comes down to ethtool's get channels API, various drivers are > > reporting the queue count in two ways - they are setting max_combined or > > max_tx/max_rx

Re: [RFC PATCH bpf-next 3/4] libbpf: move xdp program removal to libbpf

2019-06-04 Thread Maciej Fijalkowski
On Tue, 4 Jun 2019 10:07:25 +0200 Björn Töpel wrote: > > On 2019-06-03 15:19, Maciej Fijalkowski wrote: > > Since xsk support in libbpf loads the xdp program interface, make it > > also responsible for its removal. Store the prog id in xsk_socket_config > > so when rem

Re: [RFC PATCH bpf-next 4/4] libbpf: don't remove eBPF resources when other xsks are present

2019-06-04 Thread Maciej Fijalkowski
On Tue, 4 Jun 2019 10:08:03 +0200 Björn Töpel wrote: > On 2019-06-03 15:19, Maciej Fijalkowski wrote: > > In case where multiple xsk sockets are attached to a single interface > > and one of them gets detached, the eBPF maps and program are removed. > > This should not

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Maciej Fijalkowski
On Wed, 7 Aug 2019 10:02:04 -0700 Y Song wrote: > On Tue, Aug 6, 2019 at 7:25 PM Daniel T. Lee wrote: > > > > By this commit, using `bpftool net detach`, the attached XDP prog can > > be detached. Detaching the BPF prog will be done through libbpf > > 'bpf_set_link_xdp_fd' with the progfd set to

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Maciej Fijalkowski
On Wed, 7 Aug 2019 13:12:17 -0700 Y Song wrote: > On Wed, Aug 7, 2019 at 11:30 AM Maciej Fijalkowski > wrote: > > > > On Wed, 7 Aug 2019 10:02:04 -0700 > > Y Song wrote: > > > > > On Tue, Aug 6, 2019 at 7:25 PM Daniel T. Lee > > > wrote: &g

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

2021-01-18 Thread Maciej Fijalkowski
On Thu, Dec 31, 2020 at 12:16:41AM +0100, Daniel Borkmann wrote: > On 12/29/20 7:09 PM, Lorenzo Bianconi wrote: > > > > + hard_start = page_address(rx_buffer->page) + > > > > + rx_buffer->page_offset - offset; > > > > + xdp_pr

[PATCH v3 net-next 00/11] intel driver cleanups

2021-01-18 Thread Maciej Fijalkowski
allocation loop Maciej Fijalkowski (10): i40e: drop redundant check when setting xdp prog i40e: drop misleading function comments i40e: adjust i40e_is_non_eop ice: simplify ice_run_xdp ice: move skb pointer from rx_buf to rx_ring ice: remove redundant checks in ice_change_mtu ice: skip NULL

[PATCH v3 net-next 01/11] i40e: drop redundant check when setting xdp prog

2021-01-18 Thread Maciej Fijalkowski
Net core handles the case where netdev has no xdp prog attached and current prog is NULL. Therefore, remove such check within i40e_xdp_setup. Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 --- 1 file changed, 3 deletions(-) diff

[PATCH v3 net-next 04/11] ice: simplify ice_run_xdp

2021-01-18 Thread Maciej Fijalkowski
There's no need for 'result' variable, we can directly return the internal status based on action returned by xdp prog. Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/ice_txrx.c | 15 +-- 1 file changed, 5 insertions(+

[PATCH v3 net-next 03/11] i40e: adjust i40e_is_non_eop

2021-01-18 Thread Maciej Fijalkowski
n is limited to what the name actually states. Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 23 ++--- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drive

[PATCH v3 net-next 08/11] i40e, xsk: Simplify the do-while allocation loop

2021-01-18 Thread Maciej Fijalkowski
From: Björn Töpel Fold the count decrement into the while-statement. Reviewed-by: Maciej Fijalkowski Signed-off-by: Björn Töpel --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b

[PATCH v3 net-next 10/11] ice: store the result of ice_rx_offset() onto ice_ring

2021-01-18 Thread Maciej Fijalkowski
;rx_offset' field to ice_ring that is meant to hold the ice_rx_offset() result and use it within ice_clean_rx_irq(). Furthermore, use it within ice_alloc_mapped_page(). Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/

[PATCH v3 net-next 09/11] i40e: store the result of i40e_rx_offset() onto i40e_ring

2021-01-18 Thread Maciej Fijalkowski
ives in .c file. Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 35 +++-- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 1 + 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e

[PATCH v3 net-next 11/11] ixgbe: store the result of ixgbe_rx_offset() onto ixgbe_ring

2021-01-18 Thread Maciej Fijalkowski
ut the inlining. Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 15 --- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/i

[PATCH v3 net-next 06/11] ice: remove redundant checks in ice_change_mtu

2021-01-18 Thread Maciej Fijalkowski
dev_validate_mtu checks that mtu value specified by user is not less than min mtu and not greater than max allowed mtu. It is being done before calling the ndo_change_mtu exposed by driver, so remove these redundant checks in ice_change_mtu. Reviewed-by: Björn Töpel Signed-off-by: Maciej

[PATCH v3 net-next 07/11] ice: skip NULL check against XDP prog in ZC path

2021-01-18 Thread Maciej Fijalkowski
Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/ice_xsk.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index 1782146db644..b926ca9c4f4f 100644 --- a/drivers/net

[PATCH v3 net-next 02/11] i40e: drop misleading function comments

2021-01-18 Thread Maciej Fijalkowski
i40e_cleanup_headers has a statement about check against skb being linear or not which is not relevant anymore, so let's remove it. Same case for i40e_can_reuse_rx_page, it references things that are not present there anymore. Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalk

[PATCH v3 net-next 05/11] ice: move skb pointer from rx_buf to rx_ring

2021-01-18 Thread Maciej Fijalkowski
Similar thing has been done in i40e, as there is no real need for having the sk_buff pointer in each rx_buf. Non-eop frames can be simply handled on that pointer moved upwards to rx_ring. Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/ice_txrx.c

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

2021-01-18 Thread Maciej Fijalkowski
On Fri, Jan 15, 2021 at 05:36:23PM +0100, Eelco Chaudron wrote: > > > On 16 Dec 2020, at 15:08, Eelco Chaudron wrote: > > > On 15 Dec 2020, at 19:06, Maciej Fijalkowski wrote: > > > > > On Tue, Dec 15, 2020 at 02:28:39PM +0100, Eelco Chaudron wrote: > >

Re: [PATCH bpf-next v2 0/8] Introduce bpf_redirect_xsk() helper

2021-01-20 Thread Maciej Fijalkowski
On Wed, Jan 20, 2021 at 04:57:08PM +0100, Jesper Dangaard Brouer wrote: > On Wed, 20 Jan 2021 15:15:22 +0200 > Maxim Mikityanskiy wrote: > > > On 2021-01-19 17:50, Björn Töpel wrote: > > > This series extends bind() for XDP sockets, so that the bound socket > > > is added to the netdev_rx_queue _

Re: [PATCHv15 bpf-next 1/6] bpf: run devmap xdp_prog on flush instead of bulk enqueue

2021-01-20 Thread Maciej Fijalkowski
On Wed, Jan 20, 2021 at 10:25:09AM +0800, Hangbin Liu wrote: > From: Jesper Dangaard Brouer > > This changes the devmap XDP program support to run the program when the > bulk queue is flushed instead of before the frame is enqueued. This has > a couple of benefits: > > - It "sorts" the packets b

Re: [PATCHv15 bpf-next 1/6] bpf: run devmap xdp_prog on flush instead of bulk enqueue

2021-01-21 Thread Maciej Fijalkowski
On Thu, Jan 21, 2021 at 11:54:24AM +0800, Hangbin Liu wrote: > Hi Maciej, > On Wed, Jan 20, 2021 at 11:42:38PM +0100, Maciej Fijalkowski wrote: > > > +static int dev_map_bpf_prog_run(struct bpf_prog *xdp_prog, > > > + struct x

Re: [PATCH net-next] sfc: reduce the number of requested xdp ev queues

2021-01-21 Thread Maciej Fijalkowski
On Thu, Jan 21, 2021 at 06:11:30PM +0100, Jesper Dangaard Brouer wrote: > On Wed, 20 Jan 2021 13:27:59 -0800 > Ivan Babrou wrote: > > > Without this change the driver tries to allocate too many queues, > > breaching the number of available msi-x interrupts on machines > > with many logical cpus a

Re: [PATCH bpf-next v2 0/8] Introduce bpf_redirect_xsk() helper

2021-01-22 Thread Maciej Fijalkowski
On Fri, Jan 22, 2021 at 09:59:53AM +0100, Magnus Karlsson wrote: > On Thu, Jan 21, 2021 at 6:07 PM Jesper Dangaard Brouer > wrote: > > > > On Wed, 20 Jan 2021 17:19:31 +0100 > > Maciej Fijalkowski wrote: > > > > > On Wed, Jan 20, 2021 at 04:57:08PM +0100, J

Re: [PATCHv16 bpf-next 1/6] bpf: run devmap xdp_prog on flush instead of bulk enqueue

2021-01-22 Thread Maciej Fijalkowski
+ } > + return nframes; /* sent frames count */ > +} > + > static void bq_xmit_all(struct xdp_dev_bulk_queue *bq, u32 flags) > { > struct net_device *dev = bq->dev; > - int sent = 0, drops = 0, err = 0; > + unsigned int cnt = bq->count; > +

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

2020-12-10 Thread Maciej Fijalkowski
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 for things that are set once per NA

Re: [PATCH net-next] ice, xsk: Move Rx alloction out of while-loop

2020-12-10 Thread Maciej Fijalkowski
leaned frames (16). You also have a typo in subject (alloction). Is spinning a v2 worth it? > > This change boosts the xdpsock rxdrop scenario with 15% more > packets-per-second. > > Reviewed-by: Maciej Fijalkowski > Signed-off-by: Björn Töpel > --- > dri

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

2020-12-10 Thread Maciej Fijalkowski
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 > > > structure. Rely on xdp_init_buff in all XDP capable drivers. > > > > Hm, Jesper wa

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

2020-12-10 Thread Maciej Fijalkowski
On Thu, Dec 10, 2020 at 06:59:45PM +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 wrote: > > > > > Int

[PATCH net-next 0/8] i40e/ice cleanups

2020-12-11 Thread Maciej Fijalkowski
Hi, This series is mostly about the cleanups on Rx (ZC/normal) paths both in ice and i40e drivers. Things that stand out are the simplifactions of ice_change_mtu and i40e_xdp_setup. Thanks! Björn Töpel (1): i40e, xsk: Simplify the do-while allocation loop Maciej Fijalkowski (7): i40e: drop

[PATCH net-next 1/8] i40e: drop redundant check when setting xdp prog

2020-12-11 Thread Maciej Fijalkowski
Net core handles the case where netdev has no xdp prog attached and current prog is NULL. Therefore, remove such check within i40e_xdp_setup. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net

[PATCH net-next 2/8] i40e: drop misleading function comments

2020-12-11 Thread Maciej Fijalkowski
i40e_cleanup_headers has a statement about check against skb being linear or not which is not relevant anymore, so let's remove it. Same case for i40e_can_reuse_rx_page, it references things that are not present there anymore. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/

[PATCH net-next 7/8] ice: skip NULL check against XDP prog in ZC path

2020-12-11 Thread Maciej Fijalkowski
Whole zero-copy variant of clean Rx irq is executed when xsk_pool is attached to rx_ring and it can happen only when XDP program is present on interface. Therefore it is safe to assume that program is always !NULL and there is no need for checking it in ice_run_xdp_zc. Signed-off-by: Maciej

[PATCH net-next 3/8] i40e: adjust i40e_is_non_eop

2020-12-11 Thread Maciej Fijalkowski
n is limited to what the name actually states. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 23 ++--- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i

[PATCH net-next 5/8] ice: move skb pointer from rx_buf to rx_ring

2020-12-11 Thread Maciej Fijalkowski
Similar thing had been done in i40e, as there is no real need for having the sk_buff pointer in each rx_buf. Non-eop frames can be simply handled on that pointer moved upwards to rx_ring. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/ice_txrx.c | 28

[PATCH net-next 8/8] i40e, xsk: Simplify the do-while allocation loop

2020-12-11 Thread Maciej Fijalkowski
From: Björn Töpel Fold the count decrement into the while-statement. Signed-off-by: Björn Töpel --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i4

[PATCH net-next 6/8] ice: remove redundant checks in ice_change_mtu

2020-12-11 Thread Maciej Fijalkowski
dev_validate_mtu checks that mtu value specified by user is not less than min mtu and not greater than max allowed mtu. It is being done before calling the ndo_change_mtu exposed by driver, so remove these redundant checks in ice_change_mtu. Signed-off-by: Maciej Fijalkowski --- drivers/net

[PATCH net-next 4/8] ice: simplify ice_run_xdp

2020-12-11 Thread Maciej Fijalkowski
There's no need for 'result' variable, we can directly return the internal status based on action returned by xdp prog. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/ice_txrx.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff

Re: [PATCH bpf] xsk: fix memory leak for failed bind

2020-12-14 Thread Maciej Fijalkowski
On Mon, Dec 14, 2020 at 09:51:27AM +0100, Magnus Karlsson wrote: > From: Magnus Karlsson > > Fix a possible memory leak when a bind of an AF_XDP socket fails. When > the fill and completion rings are created, they are tied to the > socket. But when the buffer pool is later created at bind time, t

Re: [PATCH net-next 5/8] ice: move skb pointer from rx_buf to rx_ring

2020-12-14 Thread Maciej Fijalkowski
On Fri, Dec 11, 2020 at 08:23:15PM -0800, Jakub Kicinski wrote: > On Fri, 11 Dec 2020 17:49:53 +0100 Maciej Fijalkowski wrote: > > @@ -864,14 +865,12 @@ ice_reuse_rx_page(struct ice_ring *rx_ring, struct > > ice_rx_buf *old_buf) > > * for use by the CPU. > > */ &g

[PATCH v2 net-next 0/8] i40e/ice cleanups

2020-12-14 Thread Maciej Fijalkowski
Maciej Fijalkowski (7): i40e: drop redundant check when setting xdp prog i40e: drop misleading function comments i40e: adjust i40e_is_non_eop ice: simplify ice_run_xdp ice: move skb pointer from rx_buf to rx_ring ice: remove redundant checks in ice_change_mtu ice: skip NULL check against

[PATCH v2 net-next 1/8] i40e: drop redundant check when setting xdp prog

2020-12-14 Thread Maciej Fijalkowski
Net core handles the case where netdev has no xdp prog attached and current prog is NULL. Therefore, remove such check within i40e_xdp_setup. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net

[PATCH v2 net-next 2/8] i40e: drop misleading function comments

2020-12-14 Thread Maciej Fijalkowski
i40e_cleanup_headers has a statement about check against skb being linear or not which is not relevant anymore, so let's remove it. Same case for i40e_can_reuse_rx_page, it references things that are not present there anymore. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/

[PATCH v2 net-next 3/8] i40e: adjust i40e_is_non_eop

2020-12-14 Thread Maciej Fijalkowski
n is limited to what the name actually states. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 23 ++--- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i

[PATCH v2 net-next 5/8] ice: move skb pointer from rx_buf to rx_ring

2020-12-14 Thread Maciej Fijalkowski
Similar thing has been done in i40e, as there is no real need for having the sk_buff pointer in each rx_buf. Non-eop frames can be simply handled on that pointer moved upwards to rx_ring. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/ice_txrx.c | 29

[PATCH v2 net-next 4/8] ice: simplify ice_run_xdp

2020-12-14 Thread Maciej Fijalkowski
There's no need for 'result' variable, we can directly return the internal status based on action returned by xdp prog. Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ice/ice_txrx.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff

[PATCH v2 net-next 7/8] ice: skip NULL check against XDP prog in ZC path

2020-12-14 Thread Maciej Fijalkowski
Whole zero-copy variant of clean Rx irq is executed when xsk_pool is attached to rx_ring and it can happen only when XDP program is present on interface. Therefore it is safe to assume that program is always !NULL and there is no need for checking it in ice_run_xdp_zc. Signed-off-by: Maciej

[PATCH v2 net-next 8/8] i40e, xsk: Simplify the do-while allocation loop

2020-12-14 Thread Maciej Fijalkowski
From: Björn Töpel Fold the count decrement into the while-statement. Signed-off-by: Björn Töpel --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i4

[PATCH v2 net-next 6/8] ice: remove redundant checks in ice_change_mtu

2020-12-14 Thread Maciej Fijalkowski
dev_validate_mtu checks that mtu value specified by user is not less than min mtu and not greater than max allowed mtu. It is being done before calling the ndo_change_mtu exposed by driver, so remove these redundant checks in ice_change_mtu. Signed-off-by: Maciej Fijalkowski --- drivers/net

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

2020-12-15 Thread Maciej Fijalkowski
On Sat, Dec 12, 2020 at 06:41:49PM +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 > all XDP capable drivers. > > Signed-off-by: Lorenzo Bianconi > --- > drivers/net

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

2020-12-15 Thread Maciej Fijalkowski
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 329397c60d84..61d3f5f8b7f3 100644 > > > > > --- a/drivers/net/xen-netfront.c >

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

2020-12-15 Thread Maciej Fijalkowski
On Tue, Dec 15, 2020 at 02:28:39PM +0100, Eelco Chaudron wrote: > > > On 9 Dec 2020, at 13:07, Eelco Chaudron wrote: > > > On 9 Dec 2020, at 12:10, Maciej Fijalkowski wrote: > > > > > > > > > + > > > > > > + ctx_re

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

2020-12-17 Thread Maciej Fijalkowski
On Thu, Dec 17, 2020 at 10:16:06AM -0800, Saeed Mahameed wrote: > On Wed, 2020-12-16 at 16:01 +0100, Lorenzo Bianconi wrote: > > > On Tue, 15 Dec 2020 14:47:10 +0100 > > > Lorenzo Bianconi wrote: > > > > > > > [...] > > > > > > xdp_act = bpf_prog_run_xdp(xdp_prog, &xdp); > > > > > > diff --gi

Re: [PATCH net-next 0/3] i40e, ice, ixgbe: optimize for XDP_REDIRECT in xsk path

2020-12-02 Thread Maciej Fijalkowski
space. This provides around 100k extra packets in throughput on my > server when running l2fwd in xdpsock. > > Thanks: Magnus For series: Acked-by: Maciej Fijalkowski You only ate 'e' from i40e subject line. > > Magnus Karlsson (3): > i40: optimize for XDP_REDI

Re: [PATCH v2 bpf 1/5] net: ethtool: add xdp properties flag set

2020-12-04 Thread Maciej Fijalkowski
On Fri, Dec 04, 2020 at 01:18:31PM +0100, Toke Høiland-Jørgensen wrote: > alar...@gmail.com writes: > > > From: Marek Majtyka > > > > Implement support for checking what kind of xdp functionality a netdev > > supports. Previously, there was no way to do this other than to try > > to create an AF_

Re: [PATCH v2 bpf 1/5] net: ethtool: add xdp properties flag set

2020-12-04 Thread Maciej Fijalkowski
On Fri, Dec 04, 2020 at 11:28:57AM +0100, alar...@gmail.com wrote: > From: Marek Majtyka > > Implement support for checking what kind of xdp functionality a netdev > supports. Previously, there was no way to do this other than to try > to create an AF_XDP socket on the interface or load an XDP pr

Re: [PATCH V4 net-next 6/9] net: ena: use xdp_frame in XDP TX flow

2020-12-06 Thread Maciej Fijalkowski
On Fri, Dec 04, 2020 at 02:11:12PM +0200, akiy...@amazon.com wrote: > From: Arthur Kiyanovski > > Rename the ena_xdp_xmit_buff() function to ena_xdp_xmit_frame() and pass > it an xdp_frame struct instead of xdp_buff. > This change lays the ground for XDP redirect implementation which uses > xdp_f

Re: [PATCH V4 net-next 9/9] net: ena: introduce ndo_xdp_xmit() function for XDP_REDIRECT

2020-12-06 Thread Maciej Fijalkowski
On Fri, Dec 04, 2020 at 02:11:15PM +0200, akiy...@amazon.com wrote: > From: Arthur Kiyanovski > > This patch implements the ndo_xdp_xmit() net_device function which is > called when a packet is redirected to this driver using an > XDP_REDIRECT directive. > > The function receives an array of xdp

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

2020-12-07 Thread Maciej Fijalkowski
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 XDP-capable drivers. > > This is a preliminary patch to enable xdp multi-buffer support. > > > > Signed-off-by: Lorenzo Bia

Re: [PATCH v2 bpf 1/5] net: ethtool: add xdp properties flag set

2020-12-07 Thread Maciej Fijalkowski
On Mon, Dec 07, 2020 at 12:52:22PM -0800, John Fastabend wrote: > Jesper Dangaard Brouer wrote: > > On Fri, 4 Dec 2020 16:21:08 +0100 > > Daniel Borkmann wrote: > > > > > On 12/4/20 1:46 PM, Maciej Fijalkowski wrote: > > > > On Fri, Dec 04, 2020 at 01:1

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

2020-12-08 Thread Maciej Fijalkowski
On Mon, Dec 07, 2020 at 05:32:42PM +0100, Lorenzo Bianconi wrote: > From: Eelco Chaudron > > This patch adds a new field to the XDP context called frame_length, > which will hold the full length of the packet, including fragments > if existing. The approach you took for ctx access conversion is

Re: [PATCH v2 bpf 1/5] net: ethtool: add xdp properties flag set

2020-12-09 Thread Maciej Fijalkowski
On Tue, Dec 08, 2020 at 10:03:51PM -0800, John Fastabend wrote: > > On Mon, Dec 07, 2020 at 12:52:22PM -0800, John Fastabend wrote: > > > Jesper Dangaard Brouer wrote: > > > > On Fri, 4 Dec 2020 16:21:08 +0100 > > > > Daniel Borkmann wrote: > > [...] pruning the thread to answer Jesper. I think

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

2020-12-09 Thread Maciej Fijalkowski
On Wed, Dec 09, 2020 at 11:35:13AM +0100, Eelco Chaudron wrote: > > > On 8 Dec 2020, at 23:17, Maciej Fijalkowski wrote: > > > On Mon, Dec 07, 2020 at 05:32:42PM +0100, Lorenzo Bianconi wrote: > > > From: Eelco Chaudron > > > > > > This pat

Re: [PATCH v3] aquantia: Remove the build_skb path

2020-11-19 Thread Maciej Fijalkowski
On Thu, Nov 19, 2020 at 10:34:48PM +, Ramsay, Lincoln wrote: > When performing IPv6 forwarding, there is an expectation that SKBs > will have some headroom. When forwarding a packet from the aquantia > driver, this does not always happen, triggering a kernel warning. > > The build_skb path fai

Re: [PATCH net-next v3 4/7] dpaa_eth: add XDP_TX support

2020-11-19 Thread Maciej Fijalkowski
On Thu, Nov 19, 2020 at 06:29:33PM +0200, Camelia Groza wrote: > Use an xdp_frame structure for managing the frame. Store a backpointer to > the structure at the start of the buffer before enqueueing. Use the XDP > API for freeing the buffer when it returns to the driver on the TX > confirmation pa

Re: [PATCH net-next v3 2/7] dpaa_eth: add basic XDP support

2020-11-19 Thread Maciej Fijalkowski
On Thu, Nov 19, 2020 at 06:29:31PM +0200, Camelia Groza wrote: > Implement the XDP_DROP and XDP_PASS actions. > > Avoid draining and reconfiguring the buffer pool at each XDP > setup/teardown by increasing the frame headroom and reserving > XDP_PACKET_HEADROOM bytes from the start. Since we always

Re: [PATCH bpf-next 4/6] libbpf: add kernel module BTF support for CO-RE relocations

2020-11-19 Thread Maciej Fijalkowski
On Thu, Nov 19, 2020 at 03:22:42PM -0800, Andrii Nakryiko wrote: > Teach libbpf to search for candidate types for CO-RE relocations across kernel > modules BTFs, in addition to vmlinux BTF. If at least one candidate type is > found in vmlinux BTF, kernel module BTFs are not iterated. If vmlinux BTF

Re: [PATCH net-next v7 1/4] gve: Add support for raw addressing device option

2020-11-19 Thread Maciej Fijalkowski
On Thu, Nov 19, 2020 at 04:22:24PM -0800, David Awogbemila wrote: > On Thu, Nov 19, 2020 at 12:21 PM Saeed Mahameed wrote: > > > > On Wed, 2020-11-18 at 15:20 -0800, David Awogbemila wrote: > > > From: Catherine Sullivan > > > > > > Add support to describe device for parsing device options. As >

Re: [PATCH bpf-next 4/6] libbpf: add kernel module BTF support for CO-RE relocations

2020-11-19 Thread Maciej Fijalkowski
On Thu, Nov 19, 2020 at 05:24:43PM -0800, Andrii Nakryiko wrote: > On Thu, Nov 19, 2020 at 4:55 PM Maciej Fijalkowski > wrote: > > > > On Thu, Nov 19, 2020 at 03:22:42PM -0800, Andrii Nakryiko wrote: > > > Teach libbpf to search for candidate types for CO-RE reloc

Re: [EXT] Re: [PATCH v3] aquantia: Remove the build_skb path

2020-11-23 Thread Maciej Fijalkowski
On Fri, Nov 20, 2020 at 11:18:34AM +0300, Igor Russkikh wrote: > > > On 20/11/2020 1:49 am, Maciej Fijalkowski wrote: > > External Email > > > > -- > > On Thu, Nov 19, 2020 at 10:34:48PM +,

Re: [PATCH net-next v3 2/7] dpaa_eth: add basic XDP support

2020-11-23 Thread Maciej Fijalkowski
On Fri, Nov 20, 2020 at 06:50:28PM +, Camelia Alexandra Groza wrote: > > -Original Message- > > From: Maciej Fijalkowski > > Sent: Friday, November 20, 2020 02:19 > > To: Camelia Alexandra Groza > > Cc: k...@kernel.org; bro...@redhat.com; sa...@kerne

Re: [PATCH net-next v3 4/7] dpaa_eth: add XDP_TX support

2020-11-23 Thread Maciej Fijalkowski
On Fri, Nov 20, 2020 at 06:54:42PM +, Camelia Alexandra Groza wrote: > > -Original Message- > > From: Maciej Fijalkowski > > Sent: Friday, November 20, 2020 01:51 > > To: Camelia Alexandra Groza > > Cc: k...@kernel.org; bro...@redhat.com; sa...@kerne

Re: [PATCH net-next v4 2/7] dpaa_eth: add basic XDP support

2020-11-24 Thread Maciej Fijalkowski
On Mon, Nov 23, 2020 at 07:36:20PM +0200, Camelia Groza wrote: > Implement the XDP_DROP and XDP_PASS actions. > > Avoid draining and reconfiguring the buffer pool at each XDP > setup/teardown by increasing the frame headroom and reserving > XDP_PACKET_HEADROOM bytes from the start. Since we always

Re: [PATCH net-next v4 3/7] dpaa_eth: limit the possible MTU range when XDP is enabled

2020-11-24 Thread Maciej Fijalkowski
tu + VLAN_ETH_HLEN + ETH_FCS_LEN > max_contig_data) { Do you support VLAN double tagging? We normally take into acount to two vlan headers in these checks. Other than that: Reviewed-by: Maciej Fijalkowski > + dev_warn(priv->net_dev->dev.parent, > +

Re: [PATCH net-next v4 4/7] dpaa_eth: add XDP_TX support

2020-11-24 Thread Maciej Fijalkowski
n a word?) in here? One question below and: Reviewed-by: Maciej Fijalkowski > > This approach will be reused for XDP REDIRECT. > > Acked-by: Madalin Bucur > Signed-off-by: Camelia Groza > --- > Changes in v4: > - call xdp_rxq_info_is_reg() before unregistering >

Re: [PATCH net-next v4 5/7] dpaa_eth: add XDP_REDIRECT support

2020-11-24 Thread Maciej Fijalkowski
is implemented at this time. > > Acked-by: Madalin Bucur > Signed-off-by: Camelia Groza > --- > drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 48 > +- > drivers/net/ethernet/freescale/dpaa/dpaa_eth.h | 1 + > 2 files changed, 48 insertions(+)

Re: [PATCH net-next v4 7/7] dpaa_eth: implement the A050385 erratum workaround for XDP

2020-11-24 Thread Maciej Fijalkowski
On Mon, Nov 23, 2020 at 07:36:25PM +0200, Camelia Groza wrote: > For XDP TX, even tough we start out with correctly aligned buffers, the > XDP program might change the data's alignment. For REDIRECT, we have no > control over the alignment either. > > Create a new workaround for xdp_frame structur

Re: [PATCH net-next v4 4/7] dpaa_eth: add XDP_TX support

2020-11-27 Thread Maciej Fijalkowski
On Wed, Nov 25, 2020 at 03:49:45PM +, Camelia Alexandra Groza wrote: > > -Original Message- > > From: Maciej Fijalkowski > > Sent: Tuesday, November 24, 2020 21:52 > > To: Camelia Alexandra Groza > > Cc: k...@kernel.org; bro...@redhat.com; sa...@kerne

Re: [PATCH net-next v4 7/7] dpaa_eth: implement the A050385 erratum workaround for XDP

2020-11-27 Thread Maciej Fijalkowski
On Wed, Nov 25, 2020 at 03:52:33PM +, Camelia Alexandra Groza wrote: > > -Original Message- > > From: Maciej Fijalkowski > > Sent: Tuesday, November 24, 2020 22:51 > > To: Camelia Alexandra Groza > > Cc: k...@kernel.org; bro...@redhat.com; sa...@kerne

Re: [PATCH net-next v5 0/7] dpaa_eth: add XDP support

2020-11-28 Thread Maciej Fijalkowski
t would lead to a double free of the fq resources in 4/7 > > Changes in v5: > - report errors on XDP setup with extack in 2/7 > - checkpath fix in 4/7 > - add more details in the commit message in 4/7 > - reduce the impact of the A050385 erratum workaround code on non-erratum >

Re: [PATCH net-next v4 7/7] dpaa_eth: implement the A050385 erratum workaround for XDP

2020-11-28 Thread Maciej Fijalkowski
On Fri, Nov 27, 2020 at 05:35:00PM +, Camelia Alexandra Groza wrote: > > -Original Message- > > From: Maciej Fijalkowski > > Sent: Friday, November 27, 2020 16:44 > > To: Camelia Alexandra Groza > > Cc: k...@kernel.org; bro...@redhat.com; sa...@kerne

Re: [PATCH bpf-next] samples/bpf: add xdp_redirect_map with xdp_prog support

2020-11-10 Thread Maciej Fijalkowski
On Tue, Nov 10, 2020 at 03:25:10PM +0100, Jesper Dangaard Brouer wrote: > On Tue, 10 Nov 2020 20:46:39 +0800 > Hangbin Liu wrote: > > > This patch add running xdp program on egress interface support for > > xdp_redirect_map sample. The new prog will change the IP ttl based > > on egress ifindex.

Re: [PATCH v2 6/6] igb: avoid transmit queue timeout in xdp path

2020-10-18 Thread Maciej Fijalkowski
On Sat, Oct 17, 2020 at 09:12:38AM +0200, sven.auha...@voleatech.de wrote: > From: Sven Auhagen > > Since we share the transmit queue with the slow path, > it is possible that we run into a transmit queue timeout. > This will reset the queue. > This happens under high load when the fast path is u

Re: [PATCH v2 0/6] igb: xdp patches followup

2020-10-18 Thread Maciej Fijalkowski
eue timeout > that can occur when using xdp. > > Signed-off-by: Sven Auhagen Sorry for not getting back at v1 discussion, I took some time off. For the series: Acked-by: Maciej Fijalkowski Couple nits: - you don't need SOB line within cover letter, I suppose - next time please

Re: [PATCH net v2] ibmvnic: fix ibmvnic_set_mac

2020-10-21 Thread Maciej Fijalkowski
On Wed, Oct 21, 2020 at 01:07:12AM -0500, Lijun Pan wrote: > Jakub Kicinski brought up a concern in ibmvnic_set_mac(). > ibmvnic_set_mac() does this: > > ether_addr_copy(adapter->mac_addr, addr->sa_data); > if (adapter->state != VNIC_PROBED) > rc = __ibmvnic_set_mac(netde

Re: [PATCH bpf-next 6/6] i40e: use batched xsk Tx interfaces to increase performance

2020-11-04 Thread Maciej Fijalkowski
On Wed, Nov 04, 2020 at 03:09:02PM +0100, Magnus Karlsson wrote: > From: Magnus Karlsson > > Use the new batched xsk interfaces for the Tx path in the i40e driver > to improve performance. On my machine, this yields a throughput > increase of 4% for the l2fwd sample app in xdpsock. If we instead

Re: [PATCH net-next v2 16/21] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-11-09 Thread Maciej Fijalkowski
On Thu, Nov 09, 2023 at 07:11:46PM +0800, Xuan Zhuo wrote: > On Thu, 9 Nov 2023 03:12:27 -0500, "Michael S. Tsirkin" > wrote: > > On Tue, Nov 07, 2023 at 11:12:22AM +0800, Xuan Zhuo wrote: > > > Implement the logic of filling rq with XSK buffers. > > > > > > Signed-off-by: Xuan Zhuo > > > --- >

Re: [PATCH net-next v2 16/21] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-11-13 Thread Maciej Fijalkowski
On Fri, Nov 10, 2023 at 10:38:04AM +0800, Xuan Zhuo wrote: > On Thu, 9 Nov 2023 17:26:33 +0100, Maciej Fijalkowski > wrote: > > On Thu, Nov 09, 2023 at 07:11:46PM +0800, Xuan Zhuo wrote: > > > On Thu, 9 Nov 2023 03:12:27 -0500, "Michael S. Tsirkin" > > >

Re: [PATCH net-next v2 18/21] virtio_net: xsk: rx: introduce receive_xsk() to recv xsk buffer

2023-11-13 Thread Maciej Fijalkowski
On Tue, Nov 07, 2023 at 11:12:24AM +0800, Xuan Zhuo wrote: > The virtnet_xdp_handler() is re-used. But > > 1. We need to copy data to create skb for XDP_PASS. > 2. We need to call xsk_buff_free() to release the buffer. > 3. The handle for xdp_buff is difference. > > If we pushed this logic into e

[PATCH bpf-next 0/3] Introduce bpf_link in libbpf's xsk

2021-02-15 Thread Maciej Fijalkowski
...@intel.com/ In the meantime bpf_link was introduced and it seems that it can address the issue of refcounting the XDP prog on interface. More info on commit messages. Thanks. Maciej Fijalkowski (3): libbpf: xsk: use bpf_link libbpf: clear map_info before each bpf_obj_get_info_by_fd samples: bpf

[PATCH bpf-next 1/3] libbpf: xsk: use bpf_link

2021-02-15 Thread Maciej Fijalkowski
e, bail out or update the bpf_link's prog given the presence of XDP_FLAGS_UPDATE_IF_NOEXIST. Signed-off-by: Maciej Fijalkowski --- tools/lib/bpf/xsk.c | 143 +--- 1 file changed, 122 insertions(+), 21 deletions(-) diff --git a/tools/lib/bpf/xsk.c b/too

[PATCH bpf-next 3/3] samples: bpf: do not unload prog within xdpsock

2021-02-15 Thread Maciej Fijalkowski
no more active users. While at it, don't dump stats on error path. Signed-off-by: Maciej Fijalkowski --- samples/bpf/xdpsock_user.c | 55 ++ 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_

[PATCH bpf-next 2/3] libbpf: clear map_info before each bpf_obj_get_info_by_fd

2021-02-15 Thread Maciej Fijalkowski
;s convert it to strncmp and provide the length of the array name that we're looking for. Signed-off-by: Maciej Fijalkowski --- tools/lib/bpf/xsk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index 5911868efa43..fb259c0bba

Re: [PATCH bpf-next 1/3] libbpf: xsk: use bpf_link

2021-02-15 Thread Maciej Fijalkowski
On Mon, Feb 15, 2021 at 08:35:29PM +0100, Toke Høiland-Jørgensen wrote: > Björn Töpel writes: > > > On 2021-02-15 18:07, Toke Høiland-Jørgensen wrote: > >> Maciej Fijalkowski writes: > >> > >>> Currently, if there are multiple xdpsock instances runni

  1   2   3   4   >