From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACA972BE043 for ; Mon, 11 May 2026 17:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778521623; cv=none; b=H/d8t/hXV+r69ZumcjhI2D/a3TVwcjIL1gnQm/bhhwZPbs70J841jBiNJZCgnIcwoTzWb6LLEy2XDezS+7sv9V7PjN50lwLuUl7TC2VPAxsGiEdTl+QtpMWFzGJD94/ZOiJWG6oCe0Kc6v5scky9YSGi50J5qJlFMtHhNtU3aQ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778521623; c=relaxed/simple; bh=a+/7fyNOQVtQPVWzzMaXJnotUAV583J2IHOTBuxQCWk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=T9UImaRVzFWDceuSPOnf4sQ5KbROwSCwv3BvxAh0yFsyv/vzJdFI3IgMOZ8sm/3Q0hE6GQfHlR3st+JKS9LgR0Xa90773A5NsMfVtZmgnmObSTzTZZgmKSYf0HW10v1JFGA93UgCVleIS+uJgU4YqNkzooAZoDVdpv4b6v2Xw9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EVyk3XcK; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EVyk3XcK" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-8bb4e8a5240so51525696d6.1 for ; Mon, 11 May 2026 10:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778521621; x=1779126421; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Fn8w0ZMT4ktQ/u7MVa+/JHs31exhvHQ6lISI5LWtIow=; b=EVyk3XcKfwJ7J1sNz5bft4xy8bEGxFIny3dzxtvzUgfw6PejdB21AQwpXi71uBEEqK qvGHNZ42BQIn284CDCyplwqaQ4F8B8w6FMYL1bODUXZ+fJoRXGv0aYCsEcpAA9D4Bxa1 PpOnQuq5faHV+JCLvS9REG0vp8p4M69PqhC7KhXhOsdjtDTdEIipBPE0QJKDtfSeosrl M6fcA2ZMILVkZCDwSJTb/waYMt3bbi+kYq3Sw1Syu2pJan2OdpkjtTgieiQMuUky8ET/ hzR59TeUMD6Jvc2y0ifWSlw9cq2xF5vq1abNg/sDt5gmbiJL9/ZaoUgyMK/hTye3Ovkv PXTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778521621; x=1779126421; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Fn8w0ZMT4ktQ/u7MVa+/JHs31exhvHQ6lISI5LWtIow=; b=b2rFidmXbIcWJmve/qEL+aeExetgI6rkyif/YfSQBhpJc7aZweKwKeyPb+nHACDgfU O1QrcfyNerz0PJ6UsUCtN8MbZ2iXHmQmz/j2wVuUuDF7XrU2K0wvOaLQzx0+k/PxnBU1 Tb+yyZYjzBx7LBcAl/58jJ3fwnyTLwRc0Ayp9WhoiEWx1NEZEqWJKKArJ9pl8WQUnYce 07MJYfJvO8O7piYrmYcsttT3lTJfoPHUSHN9ry8pMFYHA4jQGey1SALm0/2uCPFssWDh bYdVz8nnUGLOb8mEGxzuHFPc4Gbsk1FAiPRqo91S6sE/tWY7MjKZ1jE/q4Cv/tcJFDKB 6aGQ== X-Forwarded-Encrypted: i=1; AFNElJ9HJrv3ZkpM2r5gNdq9hH3KYab/YezQx7RWSBMQInU9EB8z/nfxERMccpsCuqHeHeb+feiBq0Eq1b/rwe0=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9Ob6w/BinIbxsJS4dNzMx1OoHmZVt9eHc4Fdrz1RMv/DOz6Ed uuUjDKu834xMzNgcsleRcaeRua5Jn18qSGhiiYPFq93i3KU5AyInd6cO1sHoFA== X-Gm-Gg: Acq92OGSG3+naXrHUDhc1zMqz5NXTZMBbxcaR3evX/2kT2190iUI12M1wW2CEEB7xXh PrrwJD+cfnD9UJDGzrRipYLRP7aKAPkfOSh9Jl4ljS+9UljNeiBQBliRRMfLrqr0VrqHBKWw8eX MNHpYUHxEEc48fIaN2LaF+i46hYQ70xsnUK+4bQ6L7VAYeDRKMsw+M+1MXnO53ivz7jEq3oSgcR ddeNKn3YXkUWnCDfOOutM40qQA6WPsCSJsnISzRKSzBEKIQkMJmWoPYR2l73rlJY5KwomZ9CfJC a2nmfNWSHbILzesB44VjqJmrrS95lZflM34427DWCoD5qlcY2cpAUqlHvNjKw6zH4Jf8NqCcMsf gOUFSF7EcvpvprQgPOlGc8A17fclO8Ub92SNMUVS788XqukyXRRpEoI0gU7StoDFmchRnLwaycR lPhk5Eand2XdCWhTdHLNX9U96WyRwvUr7Q199ENLk7Nir+m2q8UdIU5sBxCVCWAZLndVSetQ== X-Received: by 2002:a05:6214:3d08:b0:8ac:ab30:fffa with SMTP id 6a1803df08f44-8bf4341334dmr257303186d6.32.1778521620639; Mon, 11 May 2026 10:47:00 -0700 (PDT) Received: from ?IPV6:2620:10d:c0a8:11d1::1011? ([2620:10d:c091:400::5:9448]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8bf3a71be9csm102375116d6.17.2026.05.11.10.46.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 10:47:00 -0700 (PDT) Message-ID: Date: Mon, 11 May 2026 13:46:59 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 2/6] netdevsim: psp: remove unnecessary UDP checksum computation To: Willem de Bruijn , Jakub Kicinski , Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260508-nsim-psp-crypto-v1-0-4b50ed09b794@gmail.com> <20260508-nsim-psp-crypto-v1-2-4b50ed09b794@gmail.com> Content-Language: en-US From: Daniel Zahka In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/11/26 1:01 PM, Willem de Bruijn wrote: > Daniel Zahka wrote: >> The PSP spec requires the implementations accept 0 checksum in psp-udp >> header. Let's take advantage of that to trim netdevsim's psp code >> down. psp_dev_encapsulate() already sets uh->check to 0. >> >> Assisted-by: Claude:claude-opus-4.6 >> Signed-off-by: Daniel Zahka >> --- >> drivers/net/netdevsim/psp.c | 32 -------------------------------- >> 1 file changed, 32 deletions(-) >> >> diff --git a/drivers/net/netdevsim/psp.c b/drivers/net/netdevsim/psp.c >> index 5073bda60883..75740e2a731f 100644 >> --- a/drivers/net/netdevsim/psp.c >> +++ b/drivers/net/netdevsim/psp.c >> @@ -1,8 +1,6 @@ >> // SPDX-License-Identifier: GPL-2.0 >> >> -#include >> #include >> -#include >> #include >> #include >> >> @@ -81,36 +79,6 @@ nsim_do_psp(struct sk_buff *skb, struct netdevsim *ns, >> skb->len - skb_inner_transport_offset(skb)); >> u64_stats_update_end(&ns->psp.syncp); >> } else { >> - struct ipv6hdr *ip6h __maybe_unused; >> - struct iphdr *iph; >> - struct udphdr *uh; >> - __wsum csum; >> - >> - /* Do not decapsulate. Receive the skb with the udp and psp >> - * headers still there as if this is a normal udp packet. >> - * psp_dev_encapsulate() sets udp checksum to 0, so we need to >> - * provide a valid checksum here, so the skb isn't dropped. >> - */ > Perhaps this was here as IPv6 does not allow zero checksums except for > tunneling in specific cases (RFC 6936)? Yes it was originally here for IPv6. It was needed to make a test case pass that ultimately never got upstreamed (yet). The test basically used the psp_dev_ops::set_config() function to turn psp rx off midflow, and then tried to catch packets with a udp socket listening on port 1000. At the time I didn't realize that I could probably make the test work by opting the socket into a setting for RFC 6936 with setsockopt(). > It seems benign enough to keep the code. Do you have a specific reason > to remove it, beyond reducing LoC? It was just to reduce LoC for the series :) I can put it back in if you like, though as I mentioned, none of the current tests cover that the psp-udp csum is correct.