Netdev List
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn@kernel.org>
To: Magnus Karlsson <magnus.karlsson@intel.com>,
	netdev@vger.kernel.org, magnus.karlsson@intel.com,
	magnus.karlsson@gmail.com, maciej.fijalkowski@intel.com,
	sdf@fomichev.me, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	kerneljasonxing@gmail.com
Cc: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com,
	przemyslaw.kitszel@intel.com, jacob.e.keller@intel.com
Subject: Re: [PATCH net-next 1/5] xsk: add USO support for skb path
Date: Mon, 23 Nov 2026 12:59:03 +0100	[thread overview]
Message-ID: <877bi321yw.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <20261119165340.1071525-2-magnus.karlsson@intel.com>

Magnus Karlsson <magnus.karlsson@intel.com> writes:

> diff --git a/net/xdp/Makefile b/net/xdp/Makefile
> index 30cdc4315f42..b6109e0e5547 100644
> --- a/net/xdp/Makefile
> +++ b/net/xdp/Makefile
> @@ -986,12 +990,62 @@ static void xsk_drop_skb(struct sk_buff *skb)
>  	xs->skb = NULL;
>  }
>  
> +static int xsk_skb_uso(struct sk_buff *skb)
> +{
> +	struct xsk_tx_uso_info uso = {
> +		.metadata.request = {
> +			.gso_size = skb_shinfo(skb)->gso_size,
> +			.csum_start = skb_transport_offset(skb),
> +			.network_offset = skb_network_offset(skb),
> +		},
> +		.header_len = skb_transport_offset(skb) + sizeof(struct udphdr),
> +		.len = skb->len,
> +	};
> +	int depth, err;
> +
> +	/* Best effort: a bond or team device can change type while the pool
> +	 * is bound, also after this check.
> +	 */

What would be the effect of that? Would it make sense to be more
restrictive?

> @@ -999,18 +1053,43 @@ static int xsk_skb_metadata(struct sk_buff *skb, void *buffer,
>  
>  	meta = buffer - pool->tx_metadata_len;
>  	if (unlikely(!xsk_buff_valid_tx_metadata(pool, meta, &flags)))
> -		return -EINVAL;
> +		goto err;
> +
> +	if (flags & XDP_TXMD_FLAGS_USO) {
> +		u16 nhoff = READ_ONCE(meta->request.network_offset);
> +		u16 offset = READ_ONCE(meta->request.csum_offset);
> +		u16 thoff = READ_ONCE(meta->request.csum_start);
> +		u16 size = READ_ONCE(meta->request.gso_size);

Instead of all these READ_ONCE, maybe snapshot (as in patch 3) here as
well?

> @@ -1021,6 +1100,9 @@ static int xsk_skb_metadata(struct sk_buff *skb, void *buffer,
>  	xsk_tx_metadata_to_compl(meta, &skb_shinfo(skb)->xsk_meta);
>  
>  	return 0;
> +
> +err:
> +	return flags & XDP_TXMD_FLAGS_USO ? -EOVERFLOW : err;

Seems error prone? Better to set the proper error further up, or am I
missing something?


Björn

  parent reply	other threads:[~2026-11-23 11:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 16:53 [PATCH net-next 0/5] xsk: ice: USO support for AF_XDP Magnus Karlsson
2026-11-19 16:53 ` [PATCH net-next 1/5] xsk: add USO support for skb path Magnus Karlsson
2026-11-19 18:47   ` Maciej Fijalkowski
2026-11-20  8:55     ` Magnus Karlsson
2026-11-20 11:43       ` Maciej Fijalkowski
2026-11-20 17:22   ` Stanislav Fomichev
2026-11-23  8:52     ` Magnus Karlsson
2026-11-23 11:59   ` Björn Töpel [this message]
2026-11-19 16:53 ` [PATCH net-next 2/5] ice: add Tx descriptor builders and header length check Magnus Karlsson
2026-11-20 11:59   ` Maciej Fijalkowski
2026-11-19 16:53 ` [PATCH net-next 3/5] xsk: ice: add USO zero-copy support Magnus Karlsson
2026-11-20 14:22   ` Maciej Fijalkowski
2026-11-23  8:40     ` Magnus Karlsson
2026-11-23  9:04       ` Maciej Fijalkowski
2026-11-23 12:45   ` Björn Töpel
2026-11-19 16:53 ` [PATCH net-next 4/5] xsk: add KUnit tests for AF_XDP USO header helpers Magnus Karlsson
2026-11-19 16:53 ` [PATCH net-next 5/5] selftests: net: add AF_XDP USO test Magnus Karlsson
2026-11-19 19:05   ` Maciej Fijalkowski
2026-11-20  8:35     ` Magnus Karlsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877bi321yw.fsf@all.your.base.are.belong.to.us \
    --to=bjorn@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sdf@fomichev.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox