From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CF48C43458 for ; Mon, 13 Jul 2026 15:16:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C070B40906; Mon, 13 Jul 2026 15:16:32 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id b1MiXcczNLKI; Mon, 13 Jul 2026 15:16:32 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org F039F408E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1783955792; bh=VWBjaJanp528VpTu2TOH4GFEEplwcn9VXFowenlC8oo=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=C0VLPVwMeooo7t1yIAVnWT+5DvL1MQzJHaNu784l9jS/OPvYlRHaCgRhWijMgkvia yL6e/qZqOuHFc5K+XU3PLpRIUlusULxqAn6SZo+wJCjtj4zvdt8i4SfgspjRs2Fw4h dPPPGq+ivnyHPe/5ShkrZDU3lOAbn3rGj+56OZlOOenm6KgoZqm5oGGvNJo10Iadrh ck6Tgo1WXAz3nZlTg1bKbg7uqAnir+CY6+Mdo6Z4vMQJWoke2S6FavLumK/clyeORC T283PL9gkTB9t4AZphCq3LMyBZHxKQfwtoiGCnw60Jtk2u4smKbHEEoOzxKoQNoCmU hDpkfBofhPLHw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id F039F408E0; Mon, 13 Jul 2026 15:16:31 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 7A01F2FE for ; Fri, 10 Jul 2026 19:07:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6309081024 for ; Fri, 10 Jul 2026 19:07:19 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id zMnu40BXI-re for ; Fri, 10 Jul 2026 19:07:18 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:3b::; helo=mail-pz2-x00.google.com; envelope-from=sdf.kernel@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 7AAC680ED7 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7AAC680ED7 Received: from mail-pz2-x00.google.com (mail-pz2-x00.google.com [IPv6:2607:f8b0:4864:3b::]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7AAC680ED7 for ; Fri, 10 Jul 2026 19:07:18 +0000 (UTC) Received: by mail-pz2-x00.google.com with SMTP id 41be03b00d2f7-c95bd574471so512866a12.0 for ; Fri, 10 Jul 2026 12:07:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783710437; x=1784315237; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=VWBjaJanp528VpTu2TOH4GF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X-Received: by 2002:a05:6a00:180b:b0:848:2eac:bfb2 with SMTP id d2e1a72fcca58-848895db4e2mr303610b3a.13.1783710437502; Fri, 10 Jul 2026 12:07:17 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:4f::]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84856e7c8edsm3299574b3a.36.2026.07.10.12.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 12:07:17 -0700 (PDT) Date: Fri, 10 Jul 2026 12:05:23 -0700 From: Stanislav Fomichev To: Vladimir Vdovin Cc: Lorenzo Bianconi , Donald Hunter , Jakub Kicinski , "David S . Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Andrew Lunn , Tony Nguyen , Przemek Kitszel , Alexander Lobakin , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa , Shuah Khan , Maciej Fijalkowski , Jakub Sitnicki , Aleksandr Loktionov , netdev@vger.kernel.org, bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kselftest@vger.kernel.org Message-ID: References: <20260708203410.45121-1-deliran@verdict.gg> <20260708203410.45121-2-deliran@verdict.gg> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260708203410.45121-2-deliran@verdict.gg> X-Mailman-Approved-At: Mon, 13 Jul 2026 15:16:30 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783710437; x=1784315237; darn=lists.osuosl.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=VWBjaJanp528VpTu2TOH4GFEEplwcn9VXFowenlC8oo=; b=StdM3qb36qmcL5fP9kPM9rtMVPGyYDFaB/NM8YWt8ZxhWJTJWYY5Oo9fTHdlnV4V0/ O+LttcMKKTHLcKNRn0Ito3IRkbRIUEgk+JSGoPdhyOWyrFLcChKKvj0HYfJA9+J1ah/H ELgNvyBGnA2SK+GSpT80hc83CKaCHNqy/xWM6povR0h2nFlEfCXnRlIyQ8BqeI8CUqQ9 wqdzEJ4Y0u47+2Uoxu/hRRLbDA9nwUSbkbHhqQ02yF3MSjN1JLZ2avY/gx+SkzXLv5BX KgHAzNDAIRlSvDRv5IjFgWGH8ewu3Uprcj2WS2VUaGJF9mZNySFkQ/QHDcPlSR+ac/2u +Hxg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=StdM3qb3 Subject: Re: [Intel-wired-lan] [PATCH bpf-next v4 1/6] netlink: specs: Add XDP RX checksum capability to XDP metadata specs X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On 07/08, Vladimir Vdovin wrote: > From: Lorenzo Bianconi > > Introduce XDP RX checksum capability to XDP metadata specs. XDP RX > checksum will be use by devices capable of exposing receive checksum > result via bpf_xdp_metadata_rx_checksum(). > Moreover, introduce xmo_rx_checksum netdev callback in order to allow > the eBPF program bound to the device to retrieve the RX checksum result > computed by the hw NIC and reported via DMA descriptors. > > Signed-off-by: Lorenzo Bianconi > Signed-off-by: Vladimir Vdovin > --- > Documentation/netlink/specs/netdev.yaml | 5 ++++ > include/net/xdp.h | 18 ++++++++++++++ > include/uapi/linux/netdev.h | 3 +++ > net/core/xdp.c | 32 +++++++++++++++++++++++++ > tools/include/uapi/linux/netdev.h | 3 +++ > 5 files changed, 61 insertions(+) > > diff --git a/Documentation/netlink/specs/netdev.yaml b/Documentation/netlink/specs/netdev.yaml > index 5f143da7458c..6d0d90d3a614 100644 > --- a/Documentation/netlink/specs/netdev.yaml > +++ b/Documentation/netlink/specs/netdev.yaml > @@ -61,6 +61,11 @@ definitions: > doc: | > Device is capable of exposing receive packet VLAN tag via > bpf_xdp_metadata_rx_vlan_tag(). > + - > + name: checksum > + doc: | > + Device is capable of exposing receive checksum result via > + bpf_xdp_metadata_rx_checksum(). > - > type: flags > name: xsk-flags > diff --git a/include/net/xdp.h b/include/net/xdp.h > index aa742f413c35..e255ff786131 100644 > --- a/include/net/xdp.h > +++ b/include/net/xdp.h > @@ -586,6 +586,10 @@ void xdp_attachment_setup(struct xdp_attachment_info *info, > NETDEV_XDP_RX_METADATA_VLAN_TAG, \ > bpf_xdp_metadata_rx_vlan_tag, \ > xmo_rx_vlan_tag) \ > + XDP_METADATA_KFUNC(XDP_METADATA_KFUNC_RX_CHECKSUM, \ > + NETDEV_XDP_RX_METADATA_CHECKSUM, \ > + bpf_xdp_metadata_rx_checksum, \ > + xmo_rx_checksum) > > enum xdp_rx_metadata { > #define XDP_METADATA_KFUNC(name, _, __, ___) name, > @@ -643,12 +647,26 @@ enum xdp_rss_hash_type { > XDP_RSS_TYPE_L4_IPV6_SCTP_EX = XDP_RSS_TYPE_L4_IPV6_SCTP | XDP_RSS_L3_DYNHDR, > }; [..] > +/* Please note the driver is required to invalidate the checksum if the NIC > + * reports CHECKSUM_UNNECESSARY or CHECKSUM_COMPLETE and the eBPF program > + * modifies the packet since it can change some fields validated by the > + * checksum. > + */ Sorry, a bit confused about this part. IIUC this is in response to this discussion https://lore.kernel.org/bpf/aaLYfWnuuf_ne72u@lore-desk/ ? Looking at a few drivers: - bnxt (bnxt_rx_pkt) does UNNECESSARY - ok - mlx5 (mlx5e_handle_csum) does UNNECESSARY and skips COMPLETE if there is bpf prog attached - fbnic (fbnic_rx_csum) - can do COMPLETE even with xdp attached? - gve (gve_rx) - can do COMPLETE even with xdp attached? So none of the drivers invalidate anything (and nether the bpf machinery), some choose to (correctly?) not report COMPLETE when there is XDP. So was the discussion about documenting this and giving some guidance? This probably belongs to that `DOC: skb checksums` section of include/linux/skbuff.h? Also, can you add your new rx_checksum to Documentation/networking/xdp-rx-metadata.rst's list of supported kfuncs?