From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (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 379DA4C9544 for ; Mon, 11 May 2026 19:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778526098; cv=none; b=QBnp/CVfObW8gIf0Gmt7iluGeu1zwsCaJPHDerpcOtVo9GxHpO2VEBvtf3QKCWgSoZ5bU+Tx6sZLU4pSjAecEU3Mk7KO/K5274DJhviDhcDK7cZupUIa09uI0UTE05xXA0QLeHjDstAkHcBESa3+jWQ/nYiegyHgD+J8QzXHlR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778526098; c=relaxed/simple; bh=smi0QfFjJ/pXy+wPRSayNlNgmogl1aS96tF3z1WFN6c=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=HusrKD3gIzXWGmMAk6AQYjuUvf426yvGj/UKeHCOwjyDa5SJ+4Cai/F3mCx1uzB2pvztPhyqLzUf4zyRM7Zgwi2PVJ6LQHAZoNFtwcjeebY1vweUgZBLhQ1k/47n+LNwWtVY4ihXvbQnwPo/Q1oK9oH0XEvCnb6x9swxFVKcShM= 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=BByl0tDg; arc=none smtp.client-ip=209.85.128.175 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="BByl0tDg" Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-7c52e49d978so1237807b3.2 for ; Mon, 11 May 2026 12:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778526096; x=1779130896; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ucU2Gm/Nk/kOZTXm8ln7sSpAKy9+jkch9yKABS+orjU=; b=BByl0tDgPBUVYu7j2us1Y0Q5aHGWD9Q53G+Vyw0wsEdz8KJL6mavaOGjcs7/6wTBAS l0wN8GHOpEje4XzdcytrrhawTxn4E5QBdlih2eC6N+MaFyf7xHUj14eQjCrtqSp0Cxow k5gNIifFY7IZ++NQfl6+GC8MKxRJ6GENJQn+vnEsmJuADCM0x1Vnv+OWpgx5iIqux8JH FL1RhadBGYNyRAwFqJRMGT/3fnX23SIZMGObdP20LeaUn7Br7Uwp6gvtPyoGfOQHlqBJ YCg96k2ZixH+a9BnyRZIgiXO9fP1bP5x4LM4r0mTiMAVpWcWsrGd0eqMJatUeQZvRNcQ ptdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778526096; x=1779130896; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ucU2Gm/Nk/kOZTXm8ln7sSpAKy9+jkch9yKABS+orjU=; b=swI7SDnLdneYHgnK5fi8laNUiMf/gVy7N5fti7TMGGWcQdkSblC/7aTAo7vC13/0UJ EIRsYDyMJyj1iVWYo+LIaap2hpUrYEnyO+YrjrzSzYhKkDoZBti9PJDgo76LKq+85NBv mWpB4Lrtbf4jmB4zZz/oJAtJtk2EB7xRYgrKf8gJz+T4GbOFmz036AOSwSivzCTfeOFg OksL+Z/z6Wg2zQOx+yXDkaRvJoDAvbINLoywNPFZbioq81JAOiRR2uBluPYOrZqlfrU/ w0skk0BBMjhVo28ok01UKVsIFa/20YfWWtqrgZb9deN+BYSledj9TmEpomwvkmSH2bam fHQQ== X-Forwarded-Encrypted: i=1; AFNElJ97f+pLau8JDUbAQH4OHHYEd+OjKsiYdWv+w6ymXUx68/7fa1cYdIFa/3Ijpu2Nk4ADRgcZEQad+mS4l5c=@vger.kernel.org X-Gm-Message-State: AOJu0YyCvkQ4pLbuv4DufwO6+KKrQzbMigvQgpsPMGR4eNHsHWGo/EBo pQaxDEgEuDUNzamQi4wxREd6gqFDuVp1+TawJ+6WsDTS1uPf3Fr7VW6H X-Gm-Gg: Acq92OExHvrFaROzJiKiMW94rITPPt2syUXx2BmvnMYO0HTcCWGECak4p56pU6Px76z BLBHoAl8cbnR3pQpstpm8IFFf3Fok6eaHxcqqDBkYlRq+iE5CpST90DacIG8BFjeS1JtqdVkc4B Uhvalkjp1l4KJ4hj4Oj2qwBL01mmQz7rxWHvCyqbnutKyNW0vvhnJPKSaSa4V+dkeKFYV0coH+b RAbXBFPp2WQdTAWRx3dd8pzdBXVuUWRPfMEkO6ErSUTY0LEA1iGrTkBYxGh3b7+4e5zL4Jgl1d+ jTpE14uKJ9uxNzHwk9sPKO9yMEPD4fGU2qk+5ZWhWY0UvzhOCkvmTpJLoU7duN5riN90FSwheRv n9y7rSDynumbhSmtZSss+mGmdgV+oS2cswdmTfPryMX54vho8WMy+Or1GHEnm9+S5Z/LNuPQ/Ru /o3e5+JgKziUqIZ+/m6UvJiJF/mMG8HNsa3e9ZZeFxYt9yyX7cHQzpImQPzIbtthURUe76g8eKv xED X-Received: by 2002:a05:690c:a056:b0:79f:3715:1980 with SMTP id 00721157ae682-7bdf5dc19aemr235993897b3.12.1778526096113; Mon, 11 May 2026 12:01:36 -0700 (PDT) Received: from gmail.com (172.235.85.34.bc.googleusercontent.com. [34.85.235.172]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7bed8946d5dsm72547227b3.14.2026.05.11.12.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 12:01:35 -0700 (PDT) Date: Mon, 11 May 2026 15:01:34 -0400 From: Willem de Bruijn To: Daniel Zahka , Willem de Bruijn , Jakub Kicinski , Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: In-Reply-To: References: <20260508-nsim-psp-crypto-v1-0-4b50ed09b794@gmail.com> <20260508-nsim-psp-crypto-v1-2-4b50ed09b794@gmail.com> Subject: Re: [PATCH net-next 2/6] netdevsim: psp: remove unnecessary UDP checksum computation Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Daniel Zahka wrote: > > 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 Reviewed-by: Willem de Bruijn > >> --- > >> 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(). Just curious: which setsockopt is this? > > > 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, No, fine to remove then > though as I mentioned, none of the current tests cover that the > psp-udp csum is correct. .. actually based on this, preferable even