Re: [PATCH bpf-next 2/2] libbpf: xsk: move barriers from libbpf_util.h to xsk.h

2021-03-10 Thread Jonathan Lemon
On Wed, Mar 10, 2021 at 09:09:29AM +0100, Björn Töpel wrote: > From: Björn Töpel > > The only user of libbpf_util.h is xsk.h. Move the barriers to xsk.h, > and remove libbpf_util.h. The barriers are used as an implementation > detail, and should not be considered part of the stable API. Does tha

Re: [PATCH net] net: tcp: don't allocate fast clones for fastopen SYN

2021-03-04 Thread Jonathan Lemon
On Thu, Mar 04, 2021 at 08:41:45PM +0100, Eric Dumazet wrote: > On Thu, Mar 4, 2021 at 8:06 PM Jakub Kicinski wrote: > > > > On Thu, 4 Mar 2021 13:51:15 +0100 Eric Dumazet wrote: > > > I think we are over thinking this really (especially if the fix needs > > > a change in core networking or driver

mlx5e compilation failure

2021-02-09 Thread Jonathan Lemon
On mlx5e fails to compile on the latesst net-next: CC drivers/net/ethernet/mellanox/mlx5/core/en_main.o In file included from ../drivers/net/ethernet/mellanox/mlx5/core/en_tc.h:40, from ../drivers/net/ethernet/mellanox/mlx5/core/en_main.c:45: ../drivers/net/ethernet/mellano

Re: [PATCH net-next 1/5] skbuff: rename fields of struct napi_alloc_cache to be more intuitive

2021-01-11 Thread Jonathan Lemon
On Mon, Jan 11, 2021 at 06:28:21PM +, Alexander Lobakin wrote: > skb_cache and skb_count fields are used to store skbuff_heads queued > for freeing to flush them by bulks, and aren't related to allocation > path. Give them more obvious names to improve code understanding and > allow to expand t

[RESEND PATCH net-next v1 00/13] Generic zcopy_* functions

2021-01-06 Thread Jonathan Lemon
. Patch 12: Replace open-coded assignments with skb_zcopy_init() Patch 13: Rename skb_zcopy_{get|put} to net_zcopy_{get|put} Jonathan Lemon (13): skbuff: remove unused skb_zcopy_abort function skbuff: simplify sock_zerocopy_put skbuff: Push status and refcounts into sock_zerocopy_callback

[RESEND PATCH net-next v1 07/13] skbuff: Call sock_zerocopy_put_abort from skb_zcopy_put_abort

2021-01-06 Thread Jonathan Lemon
The sock_zerocopy_put_abort function contains logic which is specific to the current zerocopy implementation. Add a wrapper which checks the callback and dispatches apppropriately. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 10 ++ net/core/skbuff.c | 12

[RESEND PATCH net-next v1 08/13] skbuff: Call skb_zcopy_clear() before unref'ing fragments

2021-01-06 Thread Jonathan Lemon
RX zerocopy fragment pages which are not allocated from the system page pool require special handling. Give the callback in skb_zcopy_clear() a chance to process them first. Signed-off-by: Jonathan Lemon --- net/core/skbuff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[RESEND PATCH net-next v1 04/13] skbuff: replace sock_zerocopy_put() with skb_zcopy_put()

2021-01-06 Thread Jonathan Lemon
Replace sock_zerocopy_put with the generic skb_zcopy_put() function. Pass 'true' as the success argument, as this is identical to no change. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 7 ++- net/core/skbuff.c | 9 + net/ipv4/tcp.c | 2 +

[RESEND PATCH net-next v1 12/13] tap/tun: add skb_zcopy_init() helper for initialization.

2021-01-06 Thread Jonathan Lemon
Replace direct assignments with skb_zcopy_init() for zerocopy cases where a new skb is initialized, without changing the reference counts. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/vhost/net.c| 1 + include/linux/skbuff.h | 9

[RESEND PATCH net-next v1 02/13] skbuff: simplify sock_zerocopy_put

2021-01-06 Thread Jonathan Lemon
All 'struct ubuf_info' users should have a callback defined as of commit 0a4a060bb204 ("sock: fix zerocopy_success regression with msg_zerocopy"). Remove the dead code path to consume_skb(), which makes assumptions about how the structure was allocated. Signed-off-by: Jona

[RESEND PATCH net-next v1 09/13] skbuff: rename sock_zerocopy_* to msg_zerocopy_*

2021-01-06 Thread Jonathan Lemon
At Willem's suggestion, rename the sock_zerocopy_* functions so that they match the MSG_ZEROCOPY flag, which makes it clear they are specific to this zerocopy implementation. Signed-off-by: Jonathan Lemon Acked-by: Willem de Bruijn --- include/linux/skbuff.h | 16 net

[RESEND PATCH net-next v1 10/13] net: group skb_shinfo zerocopy related bits together.

2021-01-06 Thread Jonathan Lemon
In preparation for expanded zerocopy (TX and RX), move the zerocopy related bits out of tx_flags into their own flag word. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/net/xen-netback/interface.c | 4

[RESEND PATCH net-next v1 06/13] skbuff: Add skb parameter to the ubuf zerocopy callback

2021-01-06 Thread Jonathan Lemon
Add an optional skb parameter to the zerocopy callback parameter, which is passed down from skb_zcopy_clear(). This gives access to the original skb, which is needed for upcoming RX zero-copy error handling. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 2 +- drivers

[RESEND PATCH net-next v1 13/13] skbuff: Rename skb_zcopy_{get|put} to net_zcopy_{get|put}

2021-01-06 Thread Jonathan Lemon
Unlike the rest of the skb_zcopy_ functions, these routines operate on a 'struct ubuf', not a skb. Remove the 'skb_' prefix from the naming to make things clearer. Suggested-by: Willem de Bruijn Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 10 +

[RESEND PATCH net-next v1 01/13] skbuff: remove unused skb_zcopy_abort function

2021-01-06 Thread Jonathan Lemon
skb_zcopy_abort() has no in-tree consumers, remove it. Signed-off-by: Jonathan Lemon Acked-by: Willem de Bruijn --- include/linux/skbuff.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 333bcdc39635..3ca8d7c7b30c 100644

[RESEND PATCH net-next v1 11/13] skbuff: add flags to ubuf_info for ubuf setup

2021-01-06 Thread Jonathan Lemon
Currently, when an ubuf is attached to a new skb, the shared flags word is initialized to a fixed value. Instead of doing this, set the default flags in the ubuf, and have new skbs inherit from this default. This is needed when setting up different zerocopy types. Signed-off-by: Jonathan Lemon

[RESEND PATCH net-next v1 03/13] skbuff: Push status and refcounts into sock_zerocopy_callback

2021-01-06 Thread Jonathan Lemon
, which saves the status and handles its own refcounts. This makes the behavior of the sock_zerocopy_callback identical to the tpacket and vhost callbacks. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 3 --- net/core/skbuff.c | 14 +++--- 2 files changed, 11 insertions

[RESEND PATCH net-next v1 05/13] skbuff: replace sock_zerocopy_get with skb_zcopy_get

2021-01-06 Thread Jonathan Lemon
Rename the get routines for consistency. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 12 ++-- net/core/skbuff.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a6c86839035b..5b8a53ab51fd

Re: [PATCH net-next v1 00/13] Generic zcopy_* functions

2021-01-05 Thread Jonathan Lemon
On Tue, Jan 05, 2021 at 03:45:55PM -0800, Florian Fainelli wrote: > On 1/5/21 3:40 PM, Jonathan Lemon wrote: > > On Tue, Jan 05, 2021 at 03:11:03PM -0800, Florian Fainelli wrote: > >> On 1/5/21 2:06 PM, Jonathan Lemon wrote: > >>> From: Jonathan Lemon > >>

Re: [PATCH net-next v1 00/13] Generic zcopy_* functions

2021-01-05 Thread Jonathan Lemon
On Tue, Jan 05, 2021 at 03:11:03PM -0800, Florian Fainelli wrote: > On 1/5/21 2:06 PM, Jonathan Lemon wrote: > > From: Jonathan Lemon > > > > This is set of cleanup patches for zerocopy which are intended > > to allow a introduction of a different zerocopy implementat

[PATCH net-next v1 05/13] skbuff: replace sock_zerocopy_get with skb_zcopy_get

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon Rename the get routines for consistency. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 12 ++-- net/core/skbuff.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index

[PATCH net-next v1 03/13] skbuff: Push status and refcounts into sock_zerocopy_callback

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon Before this change, the caller of sock_zerocopy_callback would need to save the zerocopy status, decrement and check the refcount, and then call the callback function - the callback was only invoked when the refcount reached zero. Now, the caller just passes the status into

[PATCH net-next v1 08/13] skbuff: Call skb_zcopy_clear() before unref'ing fragments

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon RX zerocopy fragment pages which are not allocated from the system page pool require special handling. Give the callback in skb_zcopy_clear() a chance to process them first. Signed-off-by: Jonathan Lemon --- net/core/skbuff.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH net-next v1 13/13] skbuff: Rename skb_zcopy_{get|put} to net_zcopy_{get|put}

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon Unlike the rest of the skb_zcopy_ functions, these routines operate on a 'struct ubuf', not a skb. Remove the 'skb_' prefix from the naming to make things clearer. Suggested-by: Willem de Bruijn Signed-off-by: Jonathan Lemon --- include

[PATCH net-next v1 00/13] Generic zcopy_* functions

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon This is set of cleanup patches for zerocopy which are intended to allow a introduction of a different zerocopy implementation. The top level API will use the skb_zcopy_*() functions, while the current TCP specific zerocopy ends up using msg_zerocopy_*() calls. There should

[PATCH net-next v1 01/13] skbuff: remove unused skb_zcopy_abort function

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon skb_zcopy_abort() has no in-tree consumers, remove it. Signed-off-by: Jonathan Lemon Acked-by: Willem de Bruijn --- include/linux/skbuff.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 333bcdc39635

[PATCH net-next v1 10/13] net: group skb_shinfo zerocopy related bits together.

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon In preparation for expanded zerocopy (TX and RX), move the zerocopy related bits out of tx_flags into their own flag word. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/net/xen-netback

[PATCH net-next v1 07/13] skbuff: Call sock_zerocopy_put_abort from skb_zcopy_put_abort

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon The sock_zerocopy_put_abort function contains logic which is specific to the current zerocopy implementation. Add a wrapper which checks the callback and dispatches apppropriately. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 10 ++ net/core

[PATCH net-next v1 11/13] skbuff: add flags to ubuf_info for ubuf setup

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon Currently, when an ubuf is attached to a new skb, the shared flags word is initialized to a fixed value. Instead of doing this, set the default flags in the ubuf, and have new skbs inherit from this default. This is needed when setting up different zerocopy types. Signed

[PATCH net-next v1 12/13] tap/tun: add skb_zcopy_init() helper for initialization.

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon Replace direct assignments with skb_zcopy_init() for zerocopy cases where a new skb is initialized, without changing the reference counts. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/vhost/net.c| 1

[PATCH net-next v1 04/13] skbuff: replace sock_zerocopy_put() with skb_zcopy_put()

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon Replace sock_zerocopy_put with the generic skb_zcopy_put() function. Pass 'true' as the success argument, as this is identical to no change. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 7 ++- net/core/skbuff.c | 9 + net/

[PATCH net-next v1 09/13] skbuff: rename sock_zerocopy_* to msg_zerocopy_*

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon At Willem's suggestion, rename the sock_zerocopy_* functions so that they match the MSG_ZEROCOPY flag, which makes it clear they are specific to this zerocopy implementation. Signed-off-by: Jonathan Lemon Acked-by: Willem de Bruijn --- include/linux/skbuff.h

[PATCH net-next v1 02/13] skbuff: simplify sock_zerocopy_put

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon All 'struct ubuf_info' users should have a callback defined as of commit 0a4a060bb204 ("sock: fix zerocopy_success regression with msg_zerocopy"). Remove the dead code path to consume_skb(), which makes assumptions about how the structure was alloc

[PATCH net-next v1 06/13] skbuff: Add skb parameter to the ubuf zerocopy callback

2021-01-05 Thread Jonathan Lemon
From: Jonathan Lemon Add an optional skb parameter to the zerocopy callback parameter, which is passed down from skb_zcopy_clear(). This gives access to the original skb, which is needed for upcoming RX zero-copy error handling. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c

Re: [RFC PATCH v3 00/12] Generic zcopy_* functions

2021-01-04 Thread Jonathan Lemon
On Mon, Jan 04, 2021 at 11:22:35PM -0500, Willem de Bruijn wrote: > On Mon, Jan 4, 2021 at 11:17 PM Jonathan Lemon > wrote: > > > > On Mon, Jan 04, 2021 at 12:39:35PM -0500, Willem de Bruijn wrote: > > > On Wed, Dec 30, 2020 at 2:12 PM Jonathan Lemon > > > w

Re: [RFC PATCH v3 00/12] Generic zcopy_* functions

2021-01-04 Thread Jonathan Lemon
On Mon, Jan 04, 2021 at 12:39:35PM -0500, Willem de Bruijn wrote: > On Wed, Dec 30, 2020 at 2:12 PM Jonathan Lemon > wrote: > > > > From: Jonathan Lemon > > > > This is set of cleanup patches for zerocopy which are intended > > to allow a introduction of

[RFC PATCH v3 00/12] Generic zcopy_* functions

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon This is set of cleanup patches for zerocopy which are intended to allow a introduction of a different zerocopy implementation. The top level API will use the skb_zcopy_*() functions, while the current TCP specific zerocopy ends up using msg_zerocopy_*() calls. There should

[RFC PATCH v3 12/12] tap/tun: add skb_zcopy_init() helper for initialization.

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Replace direct assignments with skb_zcopy_init() for zerocopy cases where a new skb is initialized, without changing the reference counts. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/vhost/net.c| 1

[RFC PATCH v3 11/12] skbuff: add flags to ubuf_info for ubuf setup

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Currently, when an ubuf is attached to a new skb, the shared flags word is initialized to a fixed value. Instead of doing this, set the default flags in the ubuf, and have new skbs inherit from this default. This is needed when setting up different zerocopy types. Signed

[RFC PATCH v3 08/12] skbuff: Call skb_zcopy_clear() before unref'ing fragments

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon RX zerocopy fragment pages which are not allocated from the system page pool require special handling. Give the callback in skb_zcopy_clear() a chance to process them first. Signed-off-by: Jonathan Lemon --- net/core/skbuff.c | 3 ++- 1 file changed, 2 insertions(+), 1

[RFC PATCH v3 02/12] skbuff: simplify sock_zerocopy_put

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon All 'struct ubuf_info' users should have a callback defined as of commit 0a4a060bb204 ("sock: fix zerocopy_success regression with msg_zerocopy"). Remove the dead code path to consume_skb(), which makes assumptions about how the structure was alloc

[RFC PATCH v3 04/12] skbuff: replace sock_zerocopy_put() with skb_zcopy_put()

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Replace sock_zerocopy_put with the generic skb_zcopy_put() function. Pass 'true' as the success argument, as this is identical to no change. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 7 ++- net/core/skbuff.c | 9 + net/

[RFC PATCH v3 09/12] skbuff: rename sock_zerocopy_* to msg_zerocopy_*

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon At Willem's suggestion, rename the sock_zerocopy_* functions so that they match the MSG_ZEROCOPY flag, which makes it clear they are specific to this zerocopy implementation. Signed-off-by: Jonathan Lemon Acked-by: Willem de Bruijn --- include/linux/skbuff.h

[RFC PATCH v3 07/12] skbuff: Call sock_zerocopy_put_abort from skb_zcopy_put_abort

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon The sock_zerocopy_put_abort function contains logic which is specific to the current zerocopy implementation. Add a wrapper which checks the callback and dispatches apppropriately. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 10 ++ net/core

[RFC PATCH v3 03/12] skbuff: Push status and refcounts into sock_zerocopy_callback

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Before this change, the caller of sock_zerocopy_callback would need to save the zerocopy status, decrement and check the refcount, and then call the callback function - the callback was only invoked when the refcount reached zero. Now, the caller just passes the status into

[RFC PATCH v3 01/12] skbuff: remove unused skb_zcopy_abort function

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon skb_zcopy_abort() has no in-tree consumers, remove it. Signed-off-by: Jonathan Lemon Acked-by: Willem de Bruijn --- include/linux/skbuff.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 333bcdc39635

[RFC PATCH v3 05/12] skbuff: replace sock_zerocopy_get with skb_zcopy_get

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Rename the get routines for consistency. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 12 ++-- net/core/skbuff.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index

[RFC PATCH v3 06/12] skbuff: Add skb parameter to the ubuf zerocopy callback

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Add an optional skb parameter to the zerocopy callback parameter, which is passed down from skb_zcopy_clear(). This gives access to the original skb, which is needed for upcoming RX zero-copy error handling. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c

[RFC PATCH v3 10/12] net: group skb_shinfo zerocopy related bits together.

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon In preparation for expanded zerocopy (TX and RX), move the zerocopy related bits out of tx_flags into their own flag word. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/net/xen-netback

Re: [PATCH 01/12 v2 RFC] net: group skb_shinfo zerocopy related bits together.

2020-12-22 Thread Jonathan Lemon
On Tue, Dec 22, 2020 at 05:26:15PM -0500, Willem de Bruijn wrote: > On Tue, Dec 22, 2020 at 12:22 PM Jonathan Lemon > wrote: > > > > On Tue, Dec 22, 2020 at 09:43:15AM -0500, Willem de Bruijn wrote: > > > On Mon, Dec 21, 2020 at 7:09 PM Jonathan Lemon > > > w

Re: [PATCH 09/12 v2 RFC] skbuff: add zc_flags to ubuf_info for ubuf setup

2020-12-22 Thread Jonathan Lemon
On Tue, Dec 22, 2020 at 10:00:37AM -0500, Willem de Bruijn wrote: > On Mon, Dec 21, 2020 at 7:09 PM Jonathan Lemon > wrote: > > > > From: Jonathan Lemon > > > > Currently, an ubuf is attached to a new skb, the skb zc_flags > > is initialized to a fixed value.

Re: [PATCH 04/12 v2 RFC] skbuff: Push status and refcounts into sock_zerocopy_callback

2020-12-22 Thread Jonathan Lemon
On Tue, Dec 22, 2020 at 09:43:39AM -0500, Willem de Bruijn wrote: > On Mon, Dec 21, 2020 at 7:09 PM Jonathan Lemon > wrote: > > > > From: Jonathan Lemon > > > > Before this change, the caller of sock_zerocopy_callback would > > need to save the zerocopy stat

Re: [PATCH 01/12 v2 RFC] net: group skb_shinfo zerocopy related bits together.

2020-12-22 Thread Jonathan Lemon
On Tue, Dec 22, 2020 at 09:43:15AM -0500, Willem de Bruijn wrote: > On Mon, Dec 21, 2020 at 7:09 PM Jonathan Lemon > wrote: > > > > From: Jonathan Lemon > > > > In preparation for expanded zerocopy (TX and RX), move > > the ZC related bits out of t

Re: [PATCH 05/12 v2 RFC] skbuff: replace sock_zerocopy_put() with skb_zcopy_put()

2020-12-22 Thread Jonathan Lemon
On Tue, Dec 22, 2020 at 09:42:40AM -0500, Willem de Bruijn wrote: > On Mon, Dec 21, 2020 at 7:09 PM Jonathan Lemon > wrote: > > > > From: Jonathan Lemon > > > > Replace sock_zerocopy_put with the generic skb_zcopy_put() > > function. Pass 'true

[PATCH 04/12 v2 RFC] skbuff: Push status and refcounts into sock_zerocopy_callback

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon Before this change, the caller of sock_zerocopy_callback would need to save the zerocopy status, decrement and check the refcount, and then call the callback function - the callback was only invoked when the refcount reached zero. Now, the caller just passes the status into

[PATCH 12/12 v2 RFC] skbuff: rename sock_zerocopy_* to msg_zerocopy_*

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon At Willem's suggestion, rename the sock_zerocopy_* functions so that they match the MSG_ZEROCOPY flag, which makes it clear they are specific to this zerocopy implementation. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 16 net/core/skb

[PATCH 10/12 v2 RFC] tap/tun: use skb_zcopy_set() instead of open coded assignment

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon Replace direct assignments with skb_zcopy_set() for clarity. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/vhost/net.c | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/tap.c b/drivers

[PATCH 00/12 v2 RFC] Generic zcopy_* functions

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon This is set of cleanup patches for zerocopy which are intended to allow a introduction of a different zerocopy implementation. The top level API will use the skb_zcopy_*() functions, while the current TCP specific zerocopy ends up using msg_zerocopy_*() calls. There should

[PATCH 07/12 v2 RFC] skbuff: Add skb parameter to the ubuf zerocopy callback

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon Add an optional skb parameter to the zerocopy callback parameter, which is passed down from skb_zcopy_clear(). This gives access to the original skb, which is needed for upcoming RX zero-copy error handling. Make the name of the the zerocopy success pararmeter consistent

[PATCH 08/12 v2 RFC] skbuff: Call sock_zerocopy_put_abort from skb_zcopy_put_abort

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon The sock_zerocopy_put_abort function contains logic which is specific to the current zerocopy implementation. Add a wrapper which checks the callback and dispatches apppropriately. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 10 ++ net/core

[PATCH 11/12 v2 RFC] skbuff: Call skb_zcopy_clear() before unref'ing fragments

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon RX zerocopy fragment pages which are not allocated from the system page pool require special handling. Give the callback in skb_zcopy_clear() a chance to process them first. Signed-off-by: Jonathan Lemon --- net/core/skbuff.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 09/12 v2 RFC] skbuff: add zc_flags to ubuf_info for ubuf setup

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon Currently, an ubuf is attached to a new skb, the skb zc_flags is initialized to a fixed value. Instead of doing this, set the default zc_flags in the ubuf, and have new skb's inherit from this default. This is needed when setting up different zerocopy types. Signed-o

[PATCH 06/12 v2 RFC] skbuff: replace sock_zerocopy_get with skb_zcopy_get

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon Rename the get routines for consistency. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 12 ++-- net/core/skbuff.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index

[PATCH 05/12 v2 RFC] skbuff: replace sock_zerocopy_put() with skb_zcopy_put()

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon Replace sock_zerocopy_put with the generic skb_zcopy_put() function. Pass 'true' as the success argument, as this is identical to no change. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 7 ++- net/core/skbuff.c | 9 + net/

[PATCH 01/12 v2 RFC] net: group skb_shinfo zerocopy related bits together.

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon In preparation for expanded zerocopy (TX and RX), move the ZC related bits out of tx_flags into their own flag word. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/net/xen-netback

[PATCH 03/12 v2 RFC] skbuff: simplify sock_zerocopy_put

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon All 'struct ubuf_info' users should have a callback defined. Remove the dead code path to consume_skb(), which makes unwarranted assumptions about how the structure was allocated. Signed-off-by: Jonathan Lemon --- net/core/skbuff.c | 8 ++-- 1 file

[PATCH 02/12 v2 RFC] skbuff: remove unused skb_zcopy_abort function

2020-12-21 Thread Jonathan Lemon
From: Jonathan Lemon skb_zcopy_abort() has no in-tree consumers, remove it. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 69588b304f83..fb6dd6af0f82 100644 --- a

Re: [PATCH 0/9 v1 RFC] Generic zcopy_* functions

2020-12-21 Thread Jonathan Lemon
On Mon, Dec 21, 2020 at 05:52:08PM -0500, Willem de Bruijn wrote: > > > > - marking the skb data as inaccessible so skb_condense() > > > > and skb_zeroocopy_clone() leave it alone. > > > > > > Yep. Skipping content access on the Rx path will be interesting. I > > > wonder if that should be a

Re: [PATCH 0/9 v1 RFC] Generic zcopy_* functions

2020-12-21 Thread Jonathan Lemon
On Sat, Dec 19, 2020 at 02:00:55PM -0500, Willem de Bruijn wrote: > On Fri, Dec 18, 2020 at 4:27 PM Jonathan Lemon > wrote: > > > > On Fri, Dec 18, 2020 at 03:49:44PM -0500, Willem de Bruijn wrote: > > > On Fri, Dec 18, 2020 at 3:23 PM Jonathan Lemon > > > w

Re: [PATCH 3/9 v1 RFC] skbuff: replace sock_zerocopy_put() with skb_zcopy_put()

2020-12-21 Thread Jonathan Lemon
On Sat, Dec 19, 2020 at 01:46:13PM -0500, Willem de Bruijn wrote: > On Fri, Dec 18, 2020 at 3:20 PM Jonathan Lemon > wrote: > > > > From: Jonathan Lemon > > > > In preparation for further work, the zcopy* routines will > > become basic building blocks,

Re: [PATCH 0/9 v1 RFC] Generic zcopy_* functions

2020-12-18 Thread Jonathan Lemon
On Fri, Dec 18, 2020 at 03:49:44PM -0500, Willem de Bruijn wrote: > On Fri, Dec 18, 2020 at 3:23 PM Jonathan Lemon > wrote: > > > > From: Jonathan Lemon > > > > This is set of cleanup patches for zerocopy which are intended > > to allow a introduction of

[PATCH 8/9 v1 RFC] tap/tun: use skb_zcopy_set() instead of open coded assignment

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon Replace direct assignments with skb_zcopy_set() for clarity. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/vhost/net.c | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/tap.c b/drivers

[PATCH 6/9 v1 RFC] skbuff: Call sock_zerocopy_put_abort from skb_zcopy_put_abort

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon The sock_zerocopy_put_abort function contains logic which is specific to the current zerocopy implementation. Add a wrapper which checks the callback and dispatches apppropriately. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 10 ++ net/core

[PATCH 1/9 v1 RFC] net: group skb_shinfo zerocopy related bits together.

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon In preparation for expanded zerocopy (TX and RX), move the ZC related bits out of tx_flags into their own flag word. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/net/xen-netback

[PATCH 5/9 v1 RFC] skbuff: Add skb parameter to the ubuf zerocopy callback

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon Add an optional skb parameter to the zerocopy callback parameter, which is passed down from skb_zcopy_clear(). This gives access to the original skb, which is needed for upcoming RX zero-copy error handling. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c

[PATCH 4/9 v1 RFC] skbuff: replace sock_zerocopy_get with skb_zcopy_get

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon Rename the get routines for consistency. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 4 ++-- net/core/skbuff.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index df98d61e8c51

[PATCH 9/9 v1 RFC] skbuff: Call skb_zcopy_clear() before unref'ing fragments

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon RX zerocopy fragment pages which are not allocated from the system page pool require special handling. Give the callback in skb_zcopy_clear() a chance to process them first. Signed-off-by: Jonathan Lemon --- net/core/skbuff.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 0/9 v1 RFC] Generic zcopy_* functions

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon This is set of cleanup patches for zerocopy which are intended to allow a introduction of a different zerocopy implementation. The top level api will use the skb_zcopy_*() functions, while the current TCP specific zerocopy would use the sock_zerocopy_*() calls. There

[PATCH 2/9 v1 RFC] skbuff: remove unused skb_zcopy_abort function

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon skb_zcopy_abort() has no in-tree consumers, remove it. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 69588b304f83..fb6dd6af0f82 100644 --- a

[PATCH 3/9 v1 RFC] skbuff: replace sock_zerocopy_put() with skb_zcopy_put()

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon In preparation for further work, the zcopy* routines will become basic building blocks, while the zerocopy* ones will be specific for the existing zerocopy implementation. All uargs should have a callback function, (unless nouarg is set), so push all special case logic

[PATCH 7/9 v1 RFC] skbuff: add zc_flags to ubuf_info for ubuf setup

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon Currently, an ubuf is attached to a new skb, the skb zc_flags is initialized to a fixed value. Instead of doing this, set the default zc_flags in the ubuf, and have new skb's inherit from this default. This is needed when setting up different zerocopy types. Signed-o

[PATCH 2/3 v4 bpf-next] bpf: Use thread_group_leader()

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon Instead of directly comparing task->tgid and task->pid, use the thread_group_leader() helper. This helps with readability, and there should be no functional change. Signed-off-by: Jonathan Lemon --- kernel/bpf/task_iter.c | 2 +- 1 file changed, 1 insertion

[PATCH 3/3 v4 bpf-next] bpf: optimize task iteration

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon Only obtain the task reference count at the end of the RCU section instead of repeatedly obtaining/releasing it when iterating though a thread group. Jump to the correct branch when it is known that the task is NULL. Signed-off-by: Jonathan Lemon --- kernel/bpf

[PATCH 1/3 v4 bpf-next] bpf: save correct stopping point in file seq iteration.

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon On some systems, some variant of the following splat is repeatedly seen. The common factor in all traces seems to be the entry point to task_file_seq_next(). With the patch, all warnings go away. rcu: INFO: rcu_sched self-detected stall on CPU rcu: \x0926

[PATCH 0/3 v4 bpf-next] bpf: increment and use correct thread iterator

2020-12-18 Thread Jonathan Lemon
From: Jonathan Lemon v3->v4: Split commit into separate patches. v2->v3: Add splat to commitlog descriptions v1->v2 Use Fixes: shas from correct tree Jonathan Lemon (3): bpf: save correct stopping point in file seq iteration. bpf: Use thread_group_leader() bpf: opti

Re: [PATCH 1/1 v3 bpf-next] bpf: increment and use correct thread iterator

2020-12-18 Thread Jonathan Lemon
On Fri, Dec 18, 2020 at 08:53:22AM -0800, Yonghong Song wrote: > > > On 12/11/20 9:11 AM, Jonathan Lemon wrote: > > From: Jonathan Lemon > > > > On some systems, some variant of the following splat is > > repeatedly seen. The common factor in all traces s

Re: [PATCH v1 net-next 02/15] net: Introduce direct data placement tcp offload

2020-12-11 Thread Jonathan Lemon
On Fri, Dec 11, 2020 at 12:59:52PM -0700, David Ahern wrote: > On 12/11/20 11:45 AM, Jakub Kicinski wrote: > > Ack, these patches are not exciting (to me), so I'm wondering if there > > is a better way. The only reason NIC would have to understand a ULP for > > ZC is to parse out header/message len

Re: [PATCH 1/1 v3 bpf-next] bpf: increment and use correct thread iterator

2020-12-11 Thread Jonathan Lemon
On Fri, Dec 11, 2020 at 12:23:34PM -0800, Andrii Nakryiko wrote: > > @@ -164,7 +164,7 @@ task_file_seq_get_next(struct > > bpf_iter_seq_task_file_info *info) > > curr_files = get_files_struct(curr_task); > > if (!curr_files) { > > put_task_st

[PATCH 0/1 v3 bpf-next] bpf: increment and use correct thread iterator

2020-12-11 Thread Jonathan Lemon
From: Jonathan Lemon Reposting with one of the many splats seen. v2->v3: Add splat to commitlog descriptions v1->v2 Use Fixes: shas from correct tree Jonathan Lemon (1): bpf: increment and use correct thread iterator kernel/bpf/task_iter.c | 8 1 file changed, 4 inse

[PATCH 1/1 v3 bpf-next] bpf: increment and use correct thread iterator

2020-12-11 Thread Jonathan Lemon
From: Jonathan Lemon On some systems, some variant of the following splat is repeatedly seen. The common factor in all traces seems to be the entry point to task_file_seq_next(). With the patch, all warnings go away. rcu: INFO: rcu_sched self-detected stall on CPU rcu: \x0926

Re: [PATCH v2 bpf-next] bpf: increment and use correct thread iterator

2020-12-11 Thread Jonathan Lemon
On Wed, Dec 09, 2020 at 11:02:54AM -0800, Yonghong Song wrote: > > > Maybe you can post v3 of the patch with the above information in the > commit description so people can better understand what the problem > you are trying to solve here? > > Also, could you also send to b...@vger.kernel.org?

Re: [PATCH v2 bpf-next] bpf: increment and use correct thread iterator

2020-12-04 Thread Jonathan Lemon
On Fri, Dec 04, 2020 at 12:01:53AM -0800, Yonghong Song wrote: > > > On 12/3/20 7:43 PM, Jonathan Lemon wrote: > > From: Jonathan Lemon > > Could you explain in the commit log what problem this patch > tries to solve? What bad things could happen without this patch?

[PATCH 1/1 v3 net-next] ptp: Add clock driver for the OpenCompute TimeCard.

2020-12-03 Thread Jonathan Lemon
The OpenCompute time card is an atomic clock along with a GPS receiver that provides a Grandmaster clock source for a PTP enabled network. More information is available at http://www.timingcard.com/ Signed-off-by: Jonathan Lemon --- drivers/ptp/Kconfig | 14 ++ drivers/ptp/Makefile | 1

[PATCH 0/1 v3 net-next] Add OpenCompute timecard driver

2020-12-03 Thread Jonathan Lemon
From: Jonathan Lemon v2->v3: remove dev_info() informational lines v1->v2: make the driver dependent on CONFIG_PCI, for the test robot. move the config option under PTP_1588_CLOCK hierarcy v1: initial submission Jonathan Lemon (1): ptp: Add clock driver for the OpenCompute Ti

[PATCH v2 bpf-next] bpf: increment and use correct thread iterator

2020-12-03 Thread Jonathan Lemon
From: Jonathan Lemon If unable to obtain the file structure for the current task, proceed to the next task number after the one returned from task_seq_get_next(), instead of the next task number from the original iterator. Use thread_group_leader() instead of comparing tgid vs pid, which might

Re: [PATCH v2 net-next] ptp: Add clock driver for the OpenCompute TimeCard.

2020-12-03 Thread Jonathan Lemon
On Thu, Dec 03, 2020 at 04:56:24PM -0800, Richard Cochran wrote: > On Thu, Dec 03, 2020 at 10:29:25AM -0800, Jonathan Lemon wrote: > > The OpenCompute time card is an atomic clock along with > > a GPS receiver that provides a Grandmaster clock source > > for a PTP enabled n

[PATCH bpf-next] bpf: increment and use correct thread iterator

2020-12-03 Thread Jonathan Lemon
From: Jonathan Lemon If unable to obtain the file structure for the current task, proceed to the next task number after the one returned from task_seq_get_next(), instead of the next task number from the original iterator. Use thread_group_leader() instead of comparing tgid vs pid, which might

[PATCH v2 net-next] ptp: Add clock driver for the OpenCompute TimeCard.

2020-12-03 Thread Jonathan Lemon
The OpenCompute time card is an atomic clock along with a GPS receiver that provides a Grandmaster clock source for a PTP enabled network. More information is available at http://www.timingcard.com/ Signed-off-by: Jonathan Lemon --- drivers/ptp/Kconfig | 14 ++ drivers/ptp/Makefile | 1

[PATCH] ptp: Add clock driver for the OpenCompute TimeCard.

2020-12-01 Thread Jonathan Lemon
The OpenCompute time card is an atomic clock along with a GPS receiver that provides a Grandmaster clock source for a PTP enabled network. More information is available at http://www.timingcard.com/ Signed-off-by: Jonathan Lemon --- drivers/ptp/Kconfig | 13 ++ drivers/ptp/Makefile | 1

Re: MSG_ZEROCOPY_FIXED

2020-11-10 Thread Jonathan Lemon
On Wed, Nov 11, 2020 at 12:20:22AM +, Victor Stewart wrote: > On Wed, Nov 11, 2020 at 12:09 AM Jonathan Lemon > wrote: > > > > On Sun, Nov 08, 2020 at 05:04:41PM +, Victor Stewart wrote: > > > hi all, > > > > > > i'm seeking input

  1   2   3   4   >