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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 BBE19C4453A for ; Wed, 22 Jul 2026 18:00:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 69DE780DF9; Wed, 22 Jul 2026 18:00:40 +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 mDplEikL9KXo; Wed, 22 Jul 2026 18:00:38 +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 smtp1.osuosl.org A450080DE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1784743238; bh=HnNlfSj3fIGtu585qe6eLWjGneo6zvxtz8A2jHYq8n0=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GaDfh75H9HPV1vEgywJ82Llvl0gWOp0ivMPRRWJZ2UEj8oThAvNDWVEV1OGvF4TUs 0qfPt/dUBfIEyvimxQnB3/GPhwjqGYvWU3tMw5UOEugf6WsMxXYtFzRHvoFwcH790D XzCtsrHRyWMQ66+A2phRi42CxZOKow8ZyMQpNdqRjnqtWypiqz/KeLJnQzxcNCx4tx 8ioEPNRWT6rX7RaHMuv6uWpk+9HRB6zpucu4jGDF+UtJ2PrHJz9wYFCxq/krLnRQL5 EVE2iCrGmyf+WhEu4iMaVQRRp8tFd0izC8ZTg+DfHD3cDS6DPMTd1BvhZ1m67B5JR0 KjgbB9EzadFwQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id A450080DE8; Wed, 22 Jul 2026 18:00:38 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 09709313 for ; Wed, 22 Jul 2026 18:00:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id EF2F080DD0 for ; Wed, 22 Jul 2026 18:00:36 +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 Ng-m0sQyhOJz for ; Wed, 22 Jul 2026 18:00:36 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:3b::1; helo=mail-pz2-x01.google.com; envelope-from=sdf.kernel@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 160AF80DDC DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 160AF80DDC Received: from mail-pz2-x01.google.com (mail-pz2-x01.google.com [IPv6:2607:f8b0:4864:3b::1]) by smtp1.osuosl.org (Postfix) with ESMTPS id 160AF80DDC for ; Wed, 22 Jul 2026 18:00:35 +0000 (UTC) Received: by mail-pz2-x01.google.com with SMTP id 41be03b00d2f7-c9fcd903839so6167861a12.1 for ; Wed, 22 Jul 2026 11:00:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784743235; x=1785348035; 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=HnN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CPkU4R8K5AyYQ== X-Received: by 2002:aa7:8744:0:b0:84e:89a:b8ed with SMTP id d2e1a72fcca58-84e089ab9d8mr6443533b3a.70.1784743234973; Wed, 22 Jul 2026 11:00:34 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:4::]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84e17266107sm1750442b3a.17.2026.07.22.11.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 11:00:33 -0700 (PDT) Date: Wed, 22 Jul 2026 11:00:07 -0700 From: Stanislav Fomichev To: Jakub Kicinski Cc: Lorenzo Bianconi , Donald Hunter , "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 , Jonathan Corbet , Shuah Khan , Kumar Kartikeya Dwivedi , Emil Tsalapatis , Vladimir Vdovin , Jakub Sitnicki , netdev@vger.kernel.org, bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Message-ID: References: <20260715-bpf-xdp-meta-rxcksum-v5-0-623d5c0d0ab7@kernel.org> <20260715-bpf-xdp-meta-rxcksum-v5-8-623d5c0d0ab7@kernel.org> <20260721082728.74142e6c@kernel.org> <20260721183256.6f49d6e1@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260721183256.6f49d6e1@kernel.org> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784743235; x=1785348035; 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=HnNlfSj3fIGtu585qe6eLWjGneo6zvxtz8A2jHYq8n0=; b=FmEVVO6uV4vWDU9sRhhvZuxu5DMH/T4q17QPnvEo1odu/R/EXE+oueFdWswgtZO4BF rfHao9xz+/jcj8XOGE0+om7ut1eWKVZ4naGenuOizGo3mBqzPgR38S49Z6SbWiz5+cNG MPQHbbFkbtu0QXqq+WSOKHoiZvzgXsdbc6cf9nfKixWmo9mhbyglnlN891M3sFZisHOA gQgxWH/PivMsuRK6fpKNMloKuXv274ZfCCbuX3uYf3MduFUQubinpOGCa+WA0ggao9ht v08dIKPni7mdhVyYx6ILoX3lhE43u1tpD+uRd9l+nS+a615DNaWCbtOSa3A/O+mWwIV8 s7Rw== 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=FmEVVO6u Subject: Re: [Intel-wired-lan] [PATCH bpf-next v5 8/8] selftests: net: add test for XDP_PASS skb checksum invalidation 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/21, Jakub Kicinski wrote: > On Tue, 21 Jul 2026 16:03:37 -0700 Stanislav Fomichev wrote: > > > > For unnecessary, I think the safe expectation is that the bpf program > > > > will update the value of the checksum in the packet if it touches the data? > > > > > > Documenting as expected behavior which no driver currently follows > > > is a bit silly. I thought the ask was to sketch out the plan of > > > explicitly updating/invalidating the checksum even if we don't > > > implement it today? > > > > This is about current drivers that only report UNNECESSARY with xdp: the xdp > > prog has to maintain in-packet checksum if it changes the payload. I think > > it's a fair assumption? > > What about decap? If we decap the header that device validated > as UNNECESSARY there's no possibility of maintaining the checksum > (by which IIUC you mean correcting it in along the payload changes). > > I think we'd need some API to "decrement the csum level" ? > Or some heuristic in the drivers to decrement if the head moved > by at least len(IP+UDP) into the packet ? True :-/ I guess one more case to document? > > In terms of documentation, here is what I have on my side, lmk if that makes > > sense, roughly: > > > > - TODAY > > - some drivers (correctly) disable reporting COMPLETE when XDP is attached > > - the xdp program has to modify the packet checksum value if it > > changes the payload > > - some drivers (incorrectly?) report COMPLETE for xdp-to-skb path -> unsafe, > > needs to be fixed > > - updating the payload doesn't update skb->csum, so the safest > > option right now is to only do UNNECESSARY with xdp for all drivers > > Yes, that sounds fair. > > > - the hw test needs to make sure that the csum is either > > NONE or UNNECESSARY, and will error out on COMPLETE > > Driver can report COMPLETE to XDP, just not to the stack. > I think we can use a tracepoint (bpftrace) or attach in TCP > to check the skb state? No strong opinion on this, it seems easier to report the same to both xdp and bpf (at least initially)