From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mail.toke.dk (Postfix) with ESMTPS id C7AB7A15D65 for ; Tue, 4 Jul 2023 13:03:43 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AdqtOcU2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688468622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jkIQtT7fkEw20o8Q57TiLOVB+SLOAMJBhpTw+/UA+lQ=; b=AdqtOcU2nUD35LpJssVYvmVY2VELquomq8VVmcpWgILcSBJGvy9J1EwmBPVatX1DetttHN vosUf+FQ0BEuagq6UhQgOCmWVvK7x7pi6Q1xjY8Ta5HIzO4jdpZau3zO+4hJHVFveibn7X 99uTCmByvbC/vXWQbCEqmX5GwGWJ6ZE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-sBsudeLzNjSEF47l-Ek-CA-1; Tue, 04 Jul 2023 07:03:41 -0400 X-MC-Unique: sBsudeLzNjSEF47l-Ek-CA-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-31286355338so3168233f8f.0 for ; Tue, 04 Jul 2023 04:03:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688468620; x=1691060620; h=content-transfer-encoding:in-reply-to:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jkIQtT7fkEw20o8Q57TiLOVB+SLOAMJBhpTw+/UA+lQ=; b=WQn0k/rlQc+vL0fWOMwnHuMHsReo7CIFFPZpTJM33PMiNB+Asl5R3aEtjMgdTk6Ehr IskaQ4XN36FiEAagBEhNDu2/F/KMTgk+aEoSFbVNiiRLJWLTo+FJEJwlAdCnjyolOZYa pmysT4mpoR10rlaQ1PGrvJQrmIgkkWY1MVZf/1zLjruYtF01mLxqfNpCVxQnUoCmzD5m 5Vr+sDO3I8uc2XYE0ybOSdAZ1oj31Unw12J3zLavd2jU3HS/CPKUu6vZEymp2XKLz+nJ LLT1fiHE3zSFkXFeB4Qcz5ZOxQW3WnmoHhg4zqWhOrG927oUdeKeSBzkat1tEKm/Kx0a bQKw== X-Gm-Message-State: ABy/qLaLrEZjsAkxMYRjT7uneEx7duFmKcKPvnwGZp9S41TEJXpll5mg +ousEcYQsMms4V2ALE9mS8fFxsPaJwMmvxFh8xM3rtMxd1CEkoi28R+HKyqfQ6fharewe3D/rzi SQs7V6PGoh+Zqx4lYqUQbqcbt3IRk X-Received: by 2002:adf:dfd2:0:b0:314:1c51:18 with SMTP id q18-20020adfdfd2000000b003141c510018mr10286152wrn.70.1688468620329; Tue, 04 Jul 2023 04:03:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlEZcKXe8KQolcHrsJt7dZ+zDCkP8OEpkpyB112fx1VeZ9iWuFZ5lBwBA+XrdKJxckcobKwa6A== X-Received: by 2002:adf:dfd2:0:b0:314:1c51:18 with SMTP id q18-20020adfdfd2000000b003141c510018mr10286126wrn.70.1688468620064; Tue, 04 Jul 2023 04:03:40 -0700 (PDT) Received: from [192.168.42.100] (194-45-78-10.static.kviknet.net. [194.45.78.10]) by smtp.gmail.com with ESMTPSA id w12-20020a5d4b4c000000b0031434936f0dsm6274425wrs.68.2023.07.04.04.03.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jul 2023 04:03:39 -0700 (PDT) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: <8c4da3c2-bc18-5fe9-2189-4b22cc910a25@redhat.com> Date: Tue, 4 Jul 2023 13:03:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 To: Larysa Zaremba , bpf@vger.kernel.org References: <20230703181226.19380-1-larysa.zaremba@intel.com> <20230703181226.19380-17-larysa.zaremba@intel.com> In-Reply-To: <20230703181226.19380-17-larysa.zaremba@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: K3BOFS5J34TCDGHNLCGKYUBM3WWR3PTJ X-Message-ID-Hash: K3BOFS5J34TCDGHNLCGKYUBM3WWR3PTJ X-MailFrom: jbrouer@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: brouer@redhat.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , Willem de Bruijn , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v2 16/20] selftests/bpf: Add flags and new hints to xdp_hw_metadata List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 > +#include > +#include > +#include > #include > #include > #include > @@ -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