From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 AACA130EF77 for ; Thu, 11 Jun 2026 12:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781180244; cv=none; b=SfAGOj3GTzzFFkO/+ZcrXe/b6WQyhqSLQAtbZYe/18yZ4VID+Eg4NTA4KrS/jtwkRY/MMUjtmLfzfzQJtIe+ThVubgH+tgR+sh8TUGIjAFNeCX4aXRh8WLrBMcBZnyAa/Y4aBYfdlXq7l1VQIBcKv9jYS8RmJ8XoMEwxqnsV7Rk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781180244; c=relaxed/simple; bh=rgVYSbR9nGU825Ny5DIQRKXtJgO2UBjS+6c1oxdgHEI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cFxxNVbkrFec0JLC7oB6Y8/rySjRA9d44HJxzj/xBVUQog6c1GjREsPa4jPBCUf4rOaF5sRe0WJwn6gIY9dYcd4Tl6KrufXoTH9GYFtnzFoFS5JvX2emk2bEHa+JSZLAMc0HFZfJSx8Z1JpQvHczJYF6ZzwAqiHMHl5chlUhCH0= 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=MLI4Pf+/; arc=none smtp.client-ip=209.85.216.44 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="MLI4Pf+/" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-36b9ec98144so6600934a91.1 for ; Thu, 11 Jun 2026 05:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781180243; x=1781785043; 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=xKVTpr4aNyZx4lSh79VinADzKQEIbf4Ts/2xtaUoVwc=; b=MLI4Pf+/Fcbnmfr4ssc1QksgYABd3MMy4k4UjenxEnL18e7h5XGBBvIgroSZQLyel4 QHbWXFigntayJpgq/OhKIJFUPhI7QI9vsimJx/2L/xmXbmoZ9yE8Ymn62k/QlPuu425Q xU3y38VKZ4BjKca2PGef3xlJLHnaNbYyf60PYM8CMoFwY6WMKZHnN7oFfNqqEy3Xno1X DTnmPdUDSHukAEQU7DEXKnHiXm8fLS1HjJkMNqEUjtaneP3EmvBZanh/na87xpUtp8eM 5DOV/IVPNkZrUur9f1mOU6qpjRdiexJ40Y3eIPh4VFZCiYefm38OLYd7myNRjyvuoDhD h3WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781180243; x=1781785043; 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=xKVTpr4aNyZx4lSh79VinADzKQEIbf4Ts/2xtaUoVwc=; b=Hzkj38cAa6cnP89Gv5KRXMj9KWWokC2BxVkag/tMMCw+JcDZITR7ZpN/mc8YlEGnFl Knr/AllWzTo6UyihnuZcH/8I/Vk6aR/+Co+GKH70+hPDr2w1ZGTL0WB/3QLNZq4ylebG O33GZK0eRV5yT3z3XNdO0/9Cj9FsSJgV4wJs3tSyItNw6/zpe3BFmifBYA8/OvEbKC+P W6yttlOaekSAAc5AJw/ZNNnMTHIgwVi4Sd/CWZ0066+h+5GBSbk/8CQHYkxWNkrjet1B Kw8vMOnw8jNYRSqsW1JtPis3IYB+nc+aajZoOY7fEGfSSHdx3W1k8bT3fUWJH2389B9+ TExA== X-Forwarded-Encrypted: i=1; AFNElJ/hjShf323p0Xr3Rxv8+QsieHsEyL0Cz8RmaB+012ITwWU4/jrq19Q7FlbIKPkZh8giChxdD0+d8ZqWSNk=@vger.kernel.org X-Gm-Message-State: AOJu0YxtpjH+QsIKC/BwN9iMCODWqRaBd4DXPHsBbWndKhhcXauq/MtS KY+GgyFPKt8W9/365dLTsXqBxWGrldlh6i2TFnjjZBx6pf3p+AXosYEx X-Gm-Gg: Acq92OEql9HjXM9s0ZBtcm3BCqYS0Ua+v+d9DEU6UIPPzhxBBYF/mlJKzkgmpFIkDgb cK1BmidIYE3oc8sBswX8WP00cBCQ4Y7L6i0Mh+EHQpA/RZmv+0YD5FS7keLOZFHM8Um38R1sAJt 8lmtjbaCajE5AEAaBzilGNYlGq9HUcVBwIDXfsflMUAzWlFRP1s3Lr1qnBGIOJJc77Mk+thDXdt jjPu39IaGcsCU3wb0kvwNw0qM2wIXYvQZvyBO11OMfhu/Ho6FmhCkItQG+F/TcfFCnlJowS/evp TpBuaQSROsSu5VtCotkT6p7Bzp8U/T/BvVZVX0pVLrjXIgBsUq7ru8pskcW34fCOVxnu5hEhgQU sWQl0NIFtIerpqNW4zAEzcFZ13sASKpm74MPoreQ0WByZtIVwTQPoXIEYQr/0ooVCe7Cb1qLGq6 8CHVq4kZn86jSpLQdUeTYw/FWxs6BwVzlLgHrSkjZWMxMNducrf+zA X-Received: by 2002:a17:90b:5607:b0:35e:d015:d675 with SMTP id 98e67ed59e1d1-3779d7a1208mr3111460a91.7.1781180242867; Thu, 11 Jun 2026 05:17:22 -0700 (PDT) Received: from [192.168.89.2] ([27.232.220.71]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3775558f317sm2486069a91.9.2026.06.11.05.17.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Jun 2026 05:17:22 -0700 (PDT) Message-ID: Date: Thu, 11 Jun 2026 21:17:18 +0900 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 2/3] crypto: inside-secure: add EIP93 ESP packet backend To: Simon Horman Cc: Christian Marangi , Antoine Tenart , Herbert Xu , "David S . Miller" , Lorenzo Bianconi , Andrew Lunn , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org References: <20260523121522.3023992-1-hurryman2212@gmail.com> <20260523121522.3023992-3-hurryman2212@gmail.com> <20260527100824.GJ2256768@horms.kernel.org> Content-Language: en-US From: Jihong Min In-Reply-To: <20260527100824.GJ2256768@horms.kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/27/26 19:08, Simon Horman wrote: > On Sat, May 23, 2026 at 09:15:21PM +0900, Jihong Min wrote: >> Expose an EIP93 packet-mode IPsec backend for netdev drivers that need >> ESP encapsulation and decapsulation offload without advertising EIP93 >> itself as a netdev. >> >> Add provider selection, capability reporting, SA lifecycle management, >> IPsec request completion, and provider fault notification around the >> existing EIP93 descriptor path. >> >> Assisted-by: Codex:gpt-5.5 >> Signed-off-by: Jihong Min > > ... > >> diff --git a/drivers/crypto/inside-secure/eip93/eip93-ipsec.c b/drivers/crypto/inside-secure/eip93/eip93-ipsec.c > > ... > >> +static void eip93_ipsec_abort_requests(struct eip93_ipsec *ipsec, int err) >> +{ >> + struct eip93_ipsec_sa *sa; >> + >> + while (true) { >> + bool found = false; >> + >> + spin_lock_bh(&ipsec->lock); >> + list_for_each_entry(sa, &ipsec->sa_list, node) { >> + spin_lock(&sa->lock); >> + if (sa->aborting) { >> + spin_unlock(&sa->lock); >> + continue; >> + } >> + >> + sa->aborting = true; >> + found = refcount_inc_not_zero(&sa->refcnt); >> + spin_unlock(&sa->lock); >> + if (found) >> + break; >> + } >> + spin_unlock_bh(&ipsec->lock); >> + if (!found) >> + return; >> + >> + eip93_ipsec_abort_sa(sa, err); >> + eip93_ipsec_sa_put(sa); > > sa is the iterator for the list_for_each_entry loop. > However, here it is used outside of that context. > > "If list_for_each_entry, etc complete a traversal of the list, the > iterator variable ends up pointing to an address at an offset from > the list head, and not a meaningful structure. Thus this value > should not be used after the end of the iterator. > > https://www.spinics.net/lists/linux-kernel-janitors/msg11994.html > > Flagged by Coccinelle. > Hi Simon, Thanks for the feedback, and sorry for noticing this mail so late. Your point is correct. The `list_for_each_entry()` iterator should not be used outside the loop like that. If I continued with this series, I would fix it by keeping a separate selected SA pointer before dropping the lock. At this point, though, I think the right thing is to withdraw this EIP93/Airoha series. The reason is that many Airoha SoCs also have a higher-performance IP block called SOE (Secure Offload Engine). I recently wrote and tested a driver for that block, and I am currently carrying it here: [kernel: add bonding LAG XFRM offload infrastructure and Airoha support](https://github.com/hurryman2212/OpenW1700k-test/commit/fbfe8f919f836bb62b3849f803865a4d9b8dc76f). With the EIP93 path I could get around 1 Gbps, while the SOE path can reach about 5 Gbps in my current setup. Because of that, integrating this EIP93 ESP packet path directly into `airoha_eth` is no longer the most useful direction for Airoha Ethernet. That said, SOE exists only on some Airoha SoCs. EIP93 can still be useful on other platforms as a look-aside ESP packet offloader, but I think that needs a cleaner infrastructure than this series had. The look-aside offloader should be able to live as a separate module, not be tied directly to one specific netdev driver, while still allowing compatible netdevs to attach it into the XFRM path. I think that needs a more general infrastructure extension, so I would rather revisit the EIP93 work later on top of that kind of model. Sincerely, Jihong Min >> + } >> +} > > ...