From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mail.toke.dk (Postfix) with ESMTPS id 0D7A1982FB9 for ; Tue, 28 Jun 2022 21:50:11 +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=OR8nrWxD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656445812; x=1687981812; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ht3UfTVIR3bDx+pf/6oyHp02PGIIQJZ5QLXufKfdPmY=; b=OR8nrWxDamsbj0s5hDTX7vB/NLusH7p8JXzfRvEMmib6ohcQI+PZPkvl gAHxY49yVT14bYkpIa9wQkEb/AfV0oseNfusxR8CiouBrbAPudiTq2kZe TD1J2YVceMQlKEydvPWIttjGPCy61Hk/OToaHtaR1iWiC3RUJ5PZGawMU yIt9kgsn+MRDGmMome6iDx98uQJUCgu0l41b0JpttXaToOaNCd34MNcqL uuWfTEZAQYxb6Ndrwap9l86nRVe6eCghcaGSAMLEH1T7WxMsAT5NNcpG3 dxYGZDVnNZkPH20mq+ItrvDxQsduDtQsz8BTGdLYTJjpRvEbHOYdYn4yv A==; X-IronPort-AV: E=McAfee;i="6400,9594,10392"; a="368146995" X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="368146995" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 12:49:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="658257552" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by fmsmga004.fm.intel.com with ESMTP; 28 Jun 2022 12:49:47 -0700 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 25SJmr9d022013; Tue, 28 Jun 2022 20:49:45 +0100 From: Alexander Lobakin To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Date: Tue, 28 Jun 2022 21:47:59 +0200 Message-Id: <20220628194812.1453059-40-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220628194812.1453059-1-alexandr.lobakin@intel.com> References: <20220628194812.1453059-1-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: GPXLODXKH4H57JTRKX2KHVS6CGQIZS35 X-Message-ID-Hash: GPXLODXKH4H57JTRKX2KHVS6CGQIZS35 X-MailFrom: alexandr.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: Alexander Lobakin , Larysa Zaremba , Michal Swiatkowski , Jesper Dangaard Brouer , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , Toke Hoiland-Jorgensen , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jesse Brandeburg , John Fastabend , Yajun Deng , Willem de Bruijn , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, xdp-hints@xdp-project.net X-Mailman-Version: 3.3.5 Precedence: list Subject: [xdp-hints] [PATCH RFC bpf-next 39/52] net, xdp: make &xdp_attachment_info a bit more useful in drivers List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add a new field which will store an arbitrary 'driver cookie', the closest usage is to store enum there corresponding to the metadata types supported by a driver to shortcut them on hotpath. In fact, it's just reusing the 4-byte padding at the end. Also, make it possible to store BTF ID in LE rather than CPU byteorder, so that drivers could save some cycles on [potential] byteswapping on hotpath. Signed-off-by: Alexander Lobakin --- include/net/xdp.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/net/xdp.h b/include/net/xdp.h index d1fd809655be..5762ce18885f 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -380,8 +380,12 @@ void xdp_unreg_mem_model(struct xdp_mem_info *mem); struct xdp_attachment_info { struct bpf_prog *prog; - u64 btf_id; + union { + __le64 btf_id_le; + u64 btf_id; + }; u32 meta_thresh; + u32 drv_cookie; }; struct netdev_bpf; -- 2.36.1