From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mail.toke.dk (Postfix) with ESMTPS id 17129A2A190 for ; Thu, 14 Sep 2023 18:19:42 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=G7285r3R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694708383; x=1726244383; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=FLzoe7Abpt3b6cn6wwfKeEHi+nZmwvp4FPPUN2C0feM=; b=G7285r3RxIGGcClECg8Mv5s7qd3pNmJJ6+ttRJUWLquI4hTHE8ntbzdi Ow/K0Wae+efwupcnD50psXOEVoMn1XV1nPRHPh2o6eBq6SaFv2VbAxyfh w5YdLOnh6qA3X9RKIr9cnuqEWo0Ksnx2ekV2cyA4O+zQhNsqvuFiawEkD P7w10rIDJN7oRjvFE4+nArDQZiRYzzBScmunBfBsxk6a3wxJJBuaiwad2 5PX5VYJZdPHHX3Sl6RPqC15rGyiBMWpBUo/qpke2SQE+tpNDy7b2tDmJD AHzk+b26dpwNV/XU/tymDmlcj6qDqH4hG9UTs4ITsgOswveMuC5o1TZ6S w==; X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="409944864" X-IronPort-AV: E=Sophos;i="6.02,146,1688454000"; d="scan'208";a="409944864" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2023 09:19:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="779711278" X-IronPort-AV: E=Sophos;i="6.02,146,1688454000"; d="scan'208";a="779711278" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 14 Sep 2023 09:19:37 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 14 Sep 2023 09:19:37 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Thu, 14 Sep 2023 09:19:37 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Thu, 14 Sep 2023 09:19:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VZVohcFk9JDCQnaXLQs4Y0k5qVUKj7C9UbOBC0NqZDl6bM+i342mdXeKrNvNL+oHMsfiKWNyTqa5kabwSvJuDO6j96DtWNdYq5oP2vJYrBFbgHjPB8egaEgUDMmjL8vSqruC8YY41DbDDqqRdVQJeF6B6KDWl3t2X+6g6p//KYFwHmswCBO3BEp4wxm6Z4RhIfWtYQaQLTmbpb3f7T52YLbTpZy/PnLhpqv4TP5Hzo8SaMkrBaqsbQ0bzndjNektgV5XIc9N6e7TB9fbRgsWN3lwTtXIpjav0Dz0/NJ86eSgnDbduj90pZEhB+ji2EqHacinNyVoIzwmev302IUmYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fzLzknMIdcot2Meo3y9DwQM+y+W5376EjS+YpAOTbDs=; b=mIcS1AAtEGxvYHNcYR4GN+XawEiPbTw+lJgQ2pe4VH8GQMJjr+336zZWZDDop69Kif5trH4f8aypxh+KuoicC3elw4J4cauIRf01nvuWYbe0nyyWYQdWteYyHFfYAHHl9wWcgRiKzs/F3sqtgviUv6lS7npTfZrO/PKLAL7aIjrpIeerRO+yfXkuo+xgF5TXSKOK4WrTlr4OFl8Y5jjphJ0EGH3bvxibdMmWbmbkXQsDscpn2b1sbi5ZUl59L04it3tGNRiCkeMQYhk+deCbQ2LF/JtZE1/36K3/IWjuhpE2NDTvXMJPgyY216Vvqi0pjl8AUraWmH95YHpUwFf0mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM6PR11MB3625.namprd11.prod.outlook.com (2603:10b6:5:13a::21) by BN9PR11MB5356.namprd11.prod.outlook.com (2603:10b6:408:11d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Thu, 14 Sep 2023 16:19:34 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::bede:bd20:31e9:fcb4]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::bede:bd20:31e9:fcb4%7]) with mapi id 15.20.6768.029; Thu, 14 Sep 2023 16:19:34 +0000 Message-ID: <2c1f16fe-df92-08bc-e24f-a95edb2eadd0@intel.com> Date: Thu, 14 Sep 2023 18:18:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Larysa Zaremba References: <20230824192703.712881-1-larysa.zaremba@intel.com> <20230824192703.712881-10-larysa.zaremba@intel.com> From: Alexander Lobakin In-Reply-To: <20230824192703.712881-10-larysa.zaremba@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR4P281CA0079.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cd::9) To DM6PR11MB3625.namprd11.prod.outlook.com (2603:10b6:5:13a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR11MB3625:EE_|BN9PR11MB5356:EE_ X-MS-Office365-Filtering-Correlation-Id: b635bd9b-b606-4ecb-fd66-08dbb53e6222 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tKA7hDa8LQsgZBpqRWTnWwiVVER30NMQBk/pqCy9PEtZpcjadNQ9wxqCFbEN5cMO7nNN/A0C/esky24eSqOtLeS5MKj8ZW24OqSwfkPMW99KfjYs3g6G4IhotQSNo6aTiz6ojqDaPzbdB01xFWQ2HSuycBxdCCkS9jEXvuv+IdtECECUu2Q6N7Bo1+GWkKhwKqzNr8e1NpI4FVa1/4iG+hAFUe72uJJwEDHPxCHDF9fw2kinfXE2zVs5KZ8x/PaPfAn9dmoo5JMEWngzfDKzZiAPHwGTtYxU5hOcvnW8rlN/gZvBmTr2iLOVrbceOAPehXoMBgeNAuBg4O8v8Bu617dL5wMncvKGlTZPD1E3vScsFXBDQNz6Cpyi3OXurtGKE8SNNMPYi68Gh7sSudTlppnAL+3hfVunjONRs8oa0+aQ0C488TDmpNWJp1SBtErgooRMT9sKtuSH18Iwmm0FdYdZXjspo1RkNN7RLrigZimnOSPynWtLrAfP0ce5GieY+RuMS79/bF/i9CrZjZEbT4MpeMgIvjGcDxZnIPlhIBHotX8ob8TYLSRaISJ3qP/XCGxGj2+a7zkBUnYoTzIOL99d7DojkWEsfpDAlsMMHBFB11a9vChOm+WGlYEoyu+FdRgHxhWUKt8IprcFcUSQuw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3625.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39860400002)(136003)(346002)(396003)(366004)(451199024)(186009)(1800799009)(2906002)(31696002)(86362001)(6512007)(26005)(2616005)(478600001)(36756003)(6666004)(6486002)(6506007)(82960400001)(83380400001)(38100700002)(41300700001)(7416002)(5660300002)(31686004)(4326008)(8676002)(6862004)(8936002)(37006003)(66556008)(66476007)(66946007)(316002)(6636002)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NTh0bVR1dFFWbGp6ZEFNUlNNUUNRcGlBcVVJL3kvY3NOdjZxenhwaDRFZzU5?= =?utf-8?B?Wjl5MFFXcHErSGViaXZqQ0poTW9vOEw1U2VyYW5pYlp3Wmh2MHV6d0VSTGt5?= =?utf-8?B?c291dERVZTRhVGUvTHV0cVBYRjd3bjJzdnhCWnRXVEtWMFd2d1JIQ0c5dTlh?= =?utf-8?B?NkFNY2h3aVhSMWxxOU13U1lCS1lCakpoUXh4NEpaczBrODlnd0RHOXZnNC80?= =?utf-8?B?cVpmS0J0S2Qxb1MzNHoxcFR0cS9vNHBnQnZrOERnR25FOENBN2FGS2p6d3lE?= =?utf-8?B?U2JhSzZDS1p1anloeE1MZFgwTHVOaDhXVVhpSE5yK2J4RG5wOXNGSXg1enBp?= =?utf-8?B?TzZLLzY3V3d2ejkwUSs2TmRudVd3NEwwMjgzRzhrREgxd3o2UEVvTitTd0o1?= =?utf-8?B?N1BWZUMybHpQKzRGSk5NdHp4aktKbys3aTlJaDVZeUc3djB2S3dFTEgxam9q?= =?utf-8?B?T0VZUFUxaG9GTGdCQzhJWjdYLzF2MGZEbjRHU2tYZDNB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c3I4WWE1eXZleUc0TDNGZmFUM0J4WllYOEhR?= =?utf-8?B?TFpsdjZSR3dSVm1XWVZEWnpYL3dNT2NwOEU0MzFDUlhMUmdWWHBIRTllV1Q4?= =?utf-8?B?M1B4WmQrWFl5ejN3SkhhVXE2NGFYNmFlRkxKY01IOWwrbmIwTkVpSThsakEr?= =?utf-8?B?cHNxd0hEWi9lVjlXVU9OV0ozZmcrR1EwQktEa1VhdzJOcGEwbnAzbnNobnBz?= =?utf-8?B?eTdNcU5BRHk5L2Y5blZOeWdVTnVpRCtObDF3NElYMXQ3T1Vvb2h4Tk1GRFRD?= =?utf-8?B?ckI3d2FiUnpNOVRPWGMvY2pUWmVRcWhTRUJ2MjNGdVpvZ2pBUkE0TW9jWUQ5?= =?utf-8?B?TjdPbWNETys2bkplRlhSZExEc0NzeFZuMHFWcmNjaTFKWEtyTVorOGw0WmJw?= =?utf-8?B?clFlYm11UHR2LzZteGpmZG1qRnFlTGVKY1RwQzgrTnNvaEJKTmFWTWpTaFo3?= =?utf-8?B?aDFuUndWOWx5OGpja3B6THg5ZkgyR2VYWXBQU1NxSnM3aUU1eGlpSFAvTXA1?= =?utf-8?B?OEJqZ2cxa3VOcThyeVpya1NsZFdtTis5NDlFTVJjSWZ4TzJZZDdTT1VVMm5G?= =?utf-8?B?YmJ3cTZnRzNDZjE2R2FTMTBwa3pDQWdHOStxTXZTc3lUN1Y5clRIQWpNcWtL?= =?utf-8?B?THVlTGIzbU04a3VJRnU1Q2Yvb2pQQWNQeWJ6R0tSelMyYkxnQ3FyOVpmN1d2?= =?utf-8?B?M0s3YUtsUFdDZllMclJxbXVTdjFobkZIZXBOU3lGMWZVVDNWNUdJOGFvM1dz?= =?utf-8?B?Nmc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: b635bd9b-b606-4ecb-fd66-08dbb53e6222 X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3625.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2023 16:19:34.6222 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fb2gTSItJ0i/GlYcldSy0otDcJfZeHzQIb8H2R2miOmPQQESoh2Qo9GVrBahyLVJ5eSEvFTYOcbnp1fVoZzZMW4SRvn2Z9UcsnJwAwUerUk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5356 X-OriginatorOrg: intel.com Message-ID-Hash: OMPEJXNHJT3RUA2XI77NVTNTLTD22C6J X-Message-ID-Hash: OMPEJXNHJT3RUA2XI77NVTNTLTD22C6J X-MailFrom: aleksander.lobakin@intel.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: bpf@vger.kernel.org, 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 , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org, Willem de Bruijn , Alexei Starovoitov , Simon Horman , Tariq Toukan , Saeed Mahameed X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [RFC bpf-next 09/23] xdp: Add VLAN tag hint List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Larysa Zaremba Date: Thu, 24 Aug 2023 21:26:48 +0200 > Implement functionality that enables drivers to expose VLAN tag > to XDP code. I'd leave a couple more words here. Mention that it exports both tag and protocol, for example. That TCI is host-Endian and proto is BE (just like how skb stores them and it's fine). > > Signed-off-by: Larysa Zaremba > --- > Documentation/networking/xdp-rx-metadata.rst | 8 ++++- > include/net/xdp.h | 4 +++ > kernel/bpf/offload.c | 2 ++ > net/core/xdp.c | 34 ++++++++++++++++++++ > 4 files changed, 47 insertions(+), 1 deletion(-) > > diff --git a/Documentation/networking/xdp-rx-metadata.rst b/Documentation/networking/xdp-rx-metadata.rst > index 25ce72af81c2..ea6dd79a21d3 100644 > --- a/Documentation/networking/xdp-rx-metadata.rst > +++ b/Documentation/networking/xdp-rx-metadata.rst > @@ -18,7 +18,13 @@ Currently, the following kfuncs are supported. In the future, as more > metadata is supported, this set will grow: > > .. kernel-doc:: net/core/xdp.c > - :identifiers: bpf_xdp_metadata_rx_timestamp bpf_xdp_metadata_rx_hash > + :identifiers: bpf_xdp_metadata_rx_timestamp > + > +.. kernel-doc:: net/core/xdp.c > + :identifiers: bpf_xdp_metadata_rx_hash > + > +.. kernel-doc:: net/core/xdp.c > + :identifiers: bpf_xdp_metadata_rx_vlan_tag > > An XDP program can use these kfuncs to read the metadata into stack > variables for its own consumption. Or, to pass the metadata on to other > diff --git a/include/net/xdp.h b/include/net/xdp.h > index 1e9870d5f025..8bb64fc76498 100644 > --- a/include/net/xdp.h > +++ b/include/net/xdp.h > @@ -388,6 +388,8 @@ void xdp_attachment_setup(struct xdp_attachment_info *info, > bpf_xdp_metadata_rx_timestamp) \ > XDP_METADATA_KFUNC(XDP_METADATA_KFUNC_RX_HASH, \ > bpf_xdp_metadata_rx_hash) \ > + XDP_METADATA_KFUNC(XDP_METADATA_KFUNC_RX_VLAN_TAG, \ > + bpf_xdp_metadata_rx_vlan_tag) \ > > enum { > #define XDP_METADATA_KFUNC(name, _) name, > @@ -449,6 +451,8 @@ struct xdp_metadata_ops { > int (*xmo_rx_timestamp)(const struct xdp_md *ctx, u64 *timestamp); > int (*xmo_rx_hash)(const struct xdp_md *ctx, u32 *hash, > enum xdp_rss_hash_type *rss_type); > + int (*xmo_rx_vlan_tag)(const struct xdp_md *ctx, u16 *vlan_tci, > + __be16 *vlan_proto); Was "TCI first, proto second" aligned with something or I can ask "why not proto first, TCI second"? > }; > > #ifdef CONFIG_NET [...] Thanks, Olek