From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) (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 AA1973E1D0B for ; Fri, 8 May 2026 14:53:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778252040; cv=none; b=oVu9BxYCUbEzl0vOrtLndlXsZVpb0HsAIr3x5uacYrT7mYMDi7x0HD4oX9xp39wl4lqAnjjCjIIGbZ3gx336aLKtrnma9FEleoyZ4n45vY1ja9rxxf8I0vaSSWtiilzziYy8K19lfwMPxGdhbgO+Ip0C94sPQGApPFBXOvHQvFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778252040; c=relaxed/simple; bh=nXs/4DWqryu4+JAyntBAhrhB85pWzV+OLPNXFOFy1zk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=NPzzbtYfoivRCoXCgX0yKurCPSN0g+VA4kRZWwVYm1AUNqY9WD1wpqZAKGAFQWRju28XheNdKDjS5GjFvB5eG8lNoYkyhfmBuT+hwfnuvPUUC9bCrpMvQgWAJJGRv8sU2yP2FXz9PQFaqOCcXYYcnLuwtwTAa4S+urdt7XPKMQY= 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=bOLkqDc3; arc=none smtp.client-ip=209.85.160.49 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="bOLkqDc3" Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-4042905015cso1588758fac.0 for ; Fri, 08 May 2026 07:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778252037; x=1778856837; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=oW0JV5YHJoHP9APafUOMSje4n7Yn/urY8p671I1K7jg=; b=bOLkqDc3i6nzmGJryQ+RzogDgJSw0Ou6E/nWeI4KreAZ5OrJZpcDwsS1JHeGucWbMT q0pvvVvvHHjcZMcMhinaIxhsE6Va4GiIsa5Odi4qD8SQFnEH1JddeNet5G+79G1eXXbc o1qyOgtL3gqTp81NClm7tOpyM8m+fEZGnCEztZwc2gPN7+bASFU0aRZWowvRwENioKgu HBJgHxX6ltaV88mD0Eu2KSAF40XPP6YFugHiS05snQZJ4LRLBc/OzZy51LaIS6s6j5qW M1h3XEorq4rgC1NERmOgJsimmYmfe5t8T9TYf6fXJUMyphapdqI5G5F5vf7cKrZ5iY77 HN2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778252037; x=1778856837; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oW0JV5YHJoHP9APafUOMSje4n7Yn/urY8p671I1K7jg=; b=muKXMusKMOntE0QKNGSX93LyXvMahKUXe3PoK+Lzaa+LkCpqFV6ub1av8ZoYSUTegH ScQK86H7LAs3qvZzxSvc/Fn2hGDqWGklYTvhHds0Iii2hnkHw/FNumakvVRkksfsPkNm /8r76GA9FcqT2kOf8HV8o4B3shHzdFViT9wpSao1S09/sBkrP9A8t5C9Mb7fSyMUTzZC 9L19ksv33SCVofcxv56q9+h790qLQQ3tX92a8dEN3lnmYQwRW+jajQjNt87KsInYMydj VB4FP1+a2nUdYsf1HXHu+oTCC61qjGJST6yB1N6FIVBmhcewNAIHNr/+Jkapo1ryv4J9 QNMQ== X-Forwarded-Encrypted: i=1; AFNElJ/Zx2NqOa3isxaRDTZu0jXKgeR3q2OA5IkAwMHB/hxXz/m9Lm4Gm25GBivh5G7b9jezyaK8zznq1NdR6LU=@vger.kernel.org X-Gm-Message-State: AOJu0YwDDPobCzuT1aOqeqMiEQ8jrDtNyoyPYa+dCKYTTMd+tfoYF+5n NjQ3z4Z0ZOYPXh7fiAzJGT3rdVHORgo3dV6LNNO93TuUpdVMpiF2hyYE X-Gm-Gg: AeBDieu3Xpsvx6nph/B/aaKTu0djvBJBkQHaM7Oem4i0U6ahnscspL6rovMhVqfX1PY aophgPfMDcHdyas/vbbuSVsKO2rQdYyTHvGxJtQC0/3Ff/sldJB7M2ZrCSTz9bM7wOtFkX9z+B8 NmwK25r3TiODO4jQBPyVqLSqcMh77VpD1JxcV2JzP4LMTeMAN4tSl6qwIDjYzGGbJjGQBhHC+WN TTvqbw861GfW0OEx/Yy0DTbcjiEsU9b9IFvJUWvto4/FDEZuICTOcTPw7RBHnko19NxAiqDu8zy 79eE4EKDebBxAlI9AfV3cvLf5iADpyMp1fKM0/9++3mNP8ufQx0HNuixdPGa5pfTau1sUuC1MGf v5Iq9KGrdYPfxcQW3VdXDljdMVZJTIq9EZ0Iwdu3OFU3eA+odCHO/O0G1sMcKpTe6Hv/OhanoIA uuUsJO2AxLRrTurdI97OoThQnWLIwCeH8Gxfml809CW1W28uh0bOcZlpdGvYn9gA== X-Received: by 2002:a05:6870:9a1c:b0:42f:ee6c:35fb with SMTP id 586e51a60fabf-434f64e9150mr7554864fac.20.1778252037459; Fri, 08 May 2026 07:53:57 -0700 (PDT) Received: from localhost ([2a03:2880:10ff:2::]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e94edsm1993038fac.13.2026.05.08.07.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2026 07:53:57 -0700 (PDT) From: Daniel Zahka Subject: [PATCH net-next 0/6] netdevsim: psp: implement real crypto operations from the PSP spec Date: Fri, 08 May 2026 07:53:43 -0700 Message-Id: <20260508-nsim-psp-crypto-v1-0-4b50ed09b794@gmail.com> 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 X-B4-Tracking: v=1; b=H4sIAPf4/WkC/x3MwQqDMAyA4VeRnA2k7RjMVxEP4tIth6WlKaIU3 92y43f4/wbGRdhgGhoU3sUkaYcbB9i+q34Y5d0NnvyTHoFQTX6YLeNWzlwTUnCOYvSvEB30Khe OcvyPMyhXVD4qLNd1A6Qs1BdrAAAA To: Jakub Kicinski , Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , Willem de Bruijn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.13.0 My motivation for this series is to enable packetdrill [1] testing to work with netdevsim the same way it would work against a real NIC + driver stack. That means being able to write already enapsulated and encrypted packets from userspace into a packet socket (skips normal psp tx path), yet still trigger the psp rx path (decapsulation and metadata creation) just based on parsing the bytes "on the wire". I will add that I believe this also has the benefit of making the netdevsim code higher fidelity by removing the fake authentication hack used by data_send_bad_key testcase in psp.py, and replacing with true authentication from aes-gcm. The header parsing in nsim_poll() may have some side effects on non-psp paths from the pskb_may_pull'ing in nsim_psp_handle_rx(), but that can be avoided by not configuring psp. As for the code, I believe it is fairly straightforward. It implements what is described in the psp spec. It preserves passing behavior of the psp.py tests, and I have tested the crypto interoperability with an nvidia cx7 card. [1]: https://github.com/google/packetdrill/pull/100 Signed-off-by: Daniel Zahka --- Daniel Zahka (6): netdevsim: psp: reset spi on key rotation and check for exhaustion on alloc netdevsim: psp: remove unnecessary UDP checksum computation netdevsim: psp: move rx processing into nsim_poll() netdevsim: psp: implement kdf from psp spec netdevsim: psp: add real aes-gcm encryption and decryption netdevsim: psp: count rx authentication and length errors drivers/net/Kconfig | 2 + drivers/net/netdevsim/netdev.c | 18 +-- drivers/net/netdevsim/netdevsim.h | 19 ++- drivers/net/netdevsim/psp.c | 333 ++++++++++++++++++++++++++++---------- 4 files changed, 272 insertions(+), 100 deletions(-) --- base-commit: 6a4c4656b0d2d4056a1f0c35442db4e8a5cf8021 change-id: 20260430-nsim-psp-crypto-03110ff293f1 Best regards, -- Daniel Zahka