lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a553dnkm.fsf@cloudflare.com>
Date: Thu, 17 Jul 2025 14:11:21 +0200
From: Jakub Sitnicki <jakub@...udflare.com>
To: Jesper Dangaard Brouer <hawk@...nel.org>
Cc: bpf@...r.kernel.org,  netdev@...r.kernel.org,  Jakub Kicinski
 <kuba@...nel.org>,  lorenzo@...nel.org,  Alexei Starovoitov
 <ast@...nel.org>,  Daniel Borkmann <borkmann@...earbox.net>,  Eric Dumazet
 <eric.dumazet@...il.com>,  "David S. Miller" <davem@...emloft.net>,  Paolo
 Abeni <pabeni@...hat.com>,  sdf@...ichev.me,  kernel-team@...udflare.com,
  arthur@...hurfabre.com
Subject: Re: [PATCH bpf-next V2 5/7] net: veth: Read xdp metadata from
 rx_meta struct if available

On Wed, Jul 02, 2025 at 04:58 PM +02, Jesper Dangaard Brouer wrote:
> From: Lorenzo Bianconi <lorenzo@...nel.org>
>
> Report xdp_rx_meta info if available in xdp_buff struct in
> xdp_metadata_ops callbacks for veth driver
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
> ---
>  drivers/net/veth.c |   12 +++++++++++
>  include/net/xdp.h  |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 69 insertions(+)

[...]

> diff --git a/include/net/xdp.h b/include/net/xdp.h
> index 3d1a9711fe82..2b495feedfb0 100644
> --- a/include/net/xdp.h
> +++ b/include/net/xdp.h
> @@ -158,6 +158,23 @@ static __always_inline bool xdp_buff_has_valid_meta_area(struct xdp_buff *xdp)
>  	return !!(xdp->flags & XDP_FLAGS_META_AREA);
>  }
>  
> +static __always_inline bool
> +xdp_buff_has_rx_meta_hash(const struct xdp_buff *xdp)
> +{
> +	return !!(xdp->flags & XDP_FLAGS_META_RX_HASH);
> +}
> +
> +static __always_inline bool
> +xdp_buff_has_rx_meta_vlan(const struct xdp_buff *xdp)
> +{
> +	return !!(xdp->flags & XDP_FLAGS_META_RX_VLAN);
> +}
> +
> +static __always_inline bool xdp_buff_has_rx_meta_ts(const struct xdp_buff *xdp)
> +{
> +	return !!(xdp->flags & XDP_FLAGS_META_RX_TS);
> +}
> +
>  static __always_inline void
>  xdp_init_buff(struct xdp_buff *xdp, u32 frame_sz, struct xdp_rxq_info *rxq)
>  {

Nit: Why not have one set of generic helpers (macros) for checking if
the flags are set? If you want strict type checking, you can
additionally use _Generic type dispatch.

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ