[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c4da3c2-bc18-5fe9-2189-4b22cc910a25@redhat.com>
Date: Tue, 4 Jul 2023 13:03:37 +0200
From: Jesper Dangaard Brouer <jbrouer@...hat.com>
To: Larysa Zaremba <larysa.zaremba@...el.com>, bpf@...r.kernel.org
Cc: 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 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).
--Jesper
Powered by blists - more mailing lists