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: <ZKP8tsdN3Kzokbf1@lincoln>
Date: Tue, 4 Jul 2023 13:04:22 +0200
From: Larysa Zaremba <larysa.zaremba@...el.com>
To: Jesper Dangaard Brouer <jbrouer@...hat.com>
CC: <bpf@...r.kernel.org>, <brouer@...hat.com>, <ast@...nel.org>,
	<daniel@...earbox.net>, <andrii@...nel.org>, <martin.lau@...ux.dev>,
	<song@...nel.org>, <yhs@...com>, <john.fastabend@...il.com>,
	<kpsingh@...nel.org>, <sdf@...gle.com>, <haoluo@...gle.com>,
	<jolsa@...nel.org>, David Ahern <dsahern@...il.com>, Jakub Kicinski
	<kuba@...nel.org>, Willem de Bruijn <willemb@...gle.com>, Anatoly Burakov
	<anatoly.burakov@...el.com>, Alexander Lobakin <alexandr.lobakin@...el.com>,
	Magnus Karlsson <magnus.karlsson@...il.com>, Maryam Tahhan
	<mtahhan@...hat.com>, <xdp-hints@...-project.net>, <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next v2 16/20] selftests/bpf: Add flags and new hints
 to xdp_hw_metadata

On Tue, Jul 04, 2023 at 01:03:37PM +0200, Jesper Dangaard Brouer wrote:
> 
> On 03/07/2023 20.12, Larysa Zaremba wrote:
> > diff --git a/tools/testing/selftests/bpf/xdp_hw_metadata.c b/tools/testing/selftests/bpf/xdp_hw_metadata.c
> > index 613321eb84c1..d234cbcc9103 100644
> > --- a/tools/testing/selftests/bpf/xdp_hw_metadata.c
> > +++ b/tools/testing/selftests/bpf/xdp_hw_metadata.c
> > @@ -19,6 +19,9 @@
> >   #include "xsk.h"
> >   #include <error.h>
> > +#include <linux/kernel.h>
> > +#include <linux/bits.h>
> > +#include <linux/bitfield.h>
> >   #include <linux/errqueue.h>
> >   #include <linux/if_link.h>
> >   #include <linux/net_tstamp.h>
> > @@ -150,21 +153,34 @@ static __u64 gettime(clockid_t clock_id)
> >   	return (__u64) t.tv_sec * NANOSEC_PER_SEC + t.tv_nsec;
> >   }
> > +#define VLAN_PRIO_MASK		GENMASK(15, 13) /* Priority Code Point */
> > +#define VLAN_CFI_MASK		GENMASK(12, 12) /* Canonical Format / Drop Eligible Indicator */
> > +#define VLAN_VID_MASK		GENMASK(11, 0)	/* VLAN Identifier */
> > +static void print_vlan_tag(__u16 tag)
> > +{
> > +	__u16 vlan_id = FIELD_GET(VLAN_VID_MASK, tag);
> > +	__u8 pcp = FIELD_GET(VLAN_PRIO_MASK, tag);
> > +	bool cfi = FIELD_GET(VLAN_CFI_MASK, tag);
> > +
> > +	printf("PCP=%u, CFI=%d, VID=0x%X\n", pcp, cfi, vlan_id);
> > +}
> > +
> 
> Shouldn't we use DEI instead of CFI ?
> 
> This is new code, and CFI have been deprecated (it was only relevant for
> IEEE 802.5 Token Ring LAN).

You are right, should be DEI.

> 
> --Jesper
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ