BPF List
 help / color / mirror / Atom feed
From: Marcus Wichelmann <marcus.wichelmann@hetzner-cloud.de>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, linux-kselftest@vger.kernel.org
Cc: jasowang@redhat.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
	yonghong.song@linux.dev, john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com,
	jolsa@kernel.org, mykolal@fb.com, shuah@kernel.org,
	hawk@kernel.org
Subject: Re: [PATCH bpf-next v2 2/6] net: tun: enable transfer of XDP metadata to skb
Date: Wed, 19 Feb 2025 16:15:17 +0100	[thread overview]
Message-ID: <fea35f08-3f29-4f7e-8be5-c77d4cee8be1@hetzner-cloud.de> (raw)
In-Reply-To: <67b5f392408d7_1b78d8294e7@willemb.c.googlers.com.notmuch>

Am 19.02.25 um 16:06 schrieb Willem de Bruijn:
> Marcus Wichelmann wrote:
>> Am 18.02.25 um 02:47 schrieb Willem de Bruijn:
>>> [...]
>>> This is pointer comparison, which is tricky wrt type. It likely is
>>> ptrdiff_t and thus signed. But may want to use max_t(long int, ..) to
>>> make this explicit.
>>
>> Ah, I see, good point.
>>
>> So like that?
>>
>> 	metasize = max_t(long int, xdp->data - xdp->data_meta, 0);
>> 	if (metasize)
>> 		skb_metadata_set(skb, metasize);
> 
> Or just this? Also ensures the test uses signed int.
> 
>      int metasize;
> 
>      ...
> 
> 
>      metasize = xdp->data - xdp->data_meta;
>      if (metasize > 0)
>              skb_metadata_set(skb, metasize);
> 

Well, yeah, just keep it simple I guess. ;) Will do that.

I'll send a V3 patch series with the change.

Thanks!

Marcus

  reply	other threads:[~2025-02-19 15:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 17:23 [PATCH bpf-next v2 0/6] XDP metadata support for tun driver Marcus Wichelmann
2025-02-17 17:23 ` [PATCH bpf-next v2 1/6] net: tun: enable XDP metadata support Marcus Wichelmann
2025-02-19  3:17   ` Jason Wang
2025-02-17 17:23 ` [PATCH bpf-next v2 2/6] net: tun: enable transfer of XDP metadata to skb Marcus Wichelmann
2025-02-18  1:45   ` Willem de Bruijn
2025-02-18  1:47   ` Willem de Bruijn
2025-02-19 14:47     ` Marcus Wichelmann
2025-02-19 15:06       ` Willem de Bruijn
2025-02-19 15:15         ` Marcus Wichelmann [this message]
2025-02-17 17:23 ` [PATCH bpf-next v2 3/6] selftests/bpf: move open_tuntap to network helpers Marcus Wichelmann
2025-02-18  1:50   ` Willem de Bruijn
2025-02-17 17:23 ` [PATCH bpf-next v2 4/6] selftests/bpf: refactor xdp_context_functional test and bpf program Marcus Wichelmann
2025-02-17 17:23 ` [PATCH bpf-next v2 5/6] selftests/bpf: add test for XDP metadata support in tun driver Marcus Wichelmann
2025-02-17 17:23 ` [PATCH bpf-next v2 6/6] selftests/bpf: fix file descriptor assertion in open_tuntap helper Marcus Wichelmann
2025-02-18  1:56   ` Willem de Bruijn
2025-02-19 14:58     ` Marcus Wichelmann

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=fea35f08-3f29-4f7e-8be5-c77d4cee8be1@hetzner-cloud.de \
    --to=marcus.wichelmann@hetzner-cloud.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=haoluo@google.com \
    --cc=hawk@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=yonghong.song@linux.dev \
    /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