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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 0825DC021A4 for ; Sun, 16 Feb 2025 11:07:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8BC7A40B43; Sun, 16 Feb 2025 11:07:22 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id jePjSE3hRHMl; Sun, 16 Feb 2025 11:07:21 +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 smtp4.osuosl.org 7E4B740B46 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1739704041; bh=A6fpiFeoeSG+Py7TrTf9HpbPeewou5vIWvbCfxmXA88=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WVlC8Qo8dIlnFv+ZwysOHRdwETgXM21K8JdopK+6YvmmczxpXilajWOtcc24Gjmki z9kw0QrJdEJY8Vgw01uXk8H0OSZCS+EnqwwWZwM2noEqlckFz+cYs/StsL00GtKM7L aQG/qE6yrysO971+jtL/J/eoUz8uVxxR0WKX/6oFnrsDWqK+Ybs5XhMLkbV6Rz403O 9oHiG4vMO9yJYK2fOrdrEWk4d7tvCXASrlVBqgxYNxBG5XCYA+SUitynpN2CJyLqU+ b77AdKFCJzD1vtsiJTnQYgk+KPElNKm75lfG4qkf0s6xtsg5f8eUfJ3ubiIXzAHrg/ 49M2I+yNZA+tA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 7E4B740B46; Sun, 16 Feb 2025 11:07:21 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists1.osuosl.org (Postfix) with ESMTP id 175F7DE for ; Sun, 16 Feb 2025 11:07:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id ECA2540FA0 for ; Sun, 16 Feb 2025 11:07:19 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id E6OPaR_KO9jm for ; Sun, 16 Feb 2025 11:07:19 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=147.75.193.91; helo=nyc.source.kernel.org; envelope-from=leon@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org C0A3A40F8F DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org C0A3A40F8F Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by smtp2.osuosl.org (Postfix) with ESMTPS id C0A3A40F8F for ; Sun, 16 Feb 2025 11:07:18 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 2CBDAA40B52; Sun, 16 Feb 2025 11:05:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08955C4CEDD; Sun, 16 Feb 2025 11:07:16 +0000 (UTC) Date: Sun, 16 Feb 2025 13:07:11 +0200 From: Leon Romanovsky To: Zhu Yanjun Cc: Steffen Klassert , Andrew Lunn , Ayush Sawal , Bharat Bhushan , Eric Dumazet , Geetha sowjanya , hariprasad , Herbert Xu , intel-wired-lan@lists.osuosl.org, Jakub Kicinski , Jay Vosburgh , Jonathan Corbet , linux-doc@vger.kernel.org, linux-rdma@vger.kernel.org, Louis Peens , netdev@vger.kernel.org, oss-drivers@corigine.com, Paolo Abeni , Potnuri Bharat Teja , Przemek Kitszel , Saeed Mahameed , Subbaraya Sundeep , Sunil Goutham , Tariq Toukan , Tony Nguyen , Ilia Lin Message-ID: <20250216110711.GU17863@unreal> References: <647895d9-e8d1-4921-b5ba-b38b2176604e@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <647895d9-e8d1-4921-b5ba-b38b2176604e@linux.dev> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739704036; bh=Uk6rLoER8BRIA7iCbn8kKYYcjuD4hDrsTvEO8AmLDFo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Iuj+7qei6zcPfTh3qOoDezjkO34QekJqHIdM6/d+4DBfpRS2vnXYyEdLPfzxfzwin OdUkhcBIZVIXIERPlgZMgC3YM2uySi/ffPGKarWx9Fsr1AL+D4AJGE71efsicDUs1j +9yAdBE1sQtZffUDZCbeQjtHM1zwyXN6vutu0OscvkByjBBk4nqPCV5ZePJxnmMT9O H17A3qTgTZNOlHfwh3qcZvCk/IaNL+hUUXEhYNsJ9KzE8rEOeQM3r2RFVLbsPhHEvC JmJygg65bFuQJLnBK9owt5d2kAbYvwrq0NBESuPY+4mm8a2k6iXhB9KFJG/Vlc6CtS yp9zUJuh6Z8AQ== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Iuj+7qei Subject: Re: [Intel-wired-lan] [PATCH ipsec-next 4/5] xfrm: provide common xdo_dev_offload_ok callback implementation 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 Sun, Feb 16, 2025 at 10:33:59AM +0100, Zhu Yanjun wrote: > 在 2025/2/5 19:20, Leon Romanovsky 写道: > > From: Leon Romanovsky > > > > Almost all drivers except bond and nsim had same check if device > > can perform XFRM offload on that specific packet. The check was that > > packet doesn't have IPv4 options and IPv6 extensions. > > > > In NIC drivers, the IPv4 HELEN comparison was slightly different, but > > the intent was to check for the same conditions. So let's chose more > > strict variant as a common base. > > > > Signed-off-by: Leon Romanovsky > > --- > > Documentation/networking/xfrm_device.rst | 3 ++- > > drivers/net/bonding/bond_main.c | 16 +++++--------- > > .../net/ethernet/chelsio/cxgb4/cxgb4_main.c | 21 ------------------- > > .../inline_crypto/ch_ipsec/chcr_ipsec.c | 16 -------------- > > .../net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 21 ------------------- > > drivers/net/ethernet/intel/ixgbevf/ipsec.c | 21 ------------------- > > .../marvell/octeontx2/nic/cn10k_ipsec.c | 15 ------------- > > .../mellanox/mlx5/core/en_accel/ipsec.c | 16 -------------- > > .../net/ethernet/netronome/nfp/crypto/ipsec.c | 11 ---------- > > drivers/net/netdevsim/ipsec.c | 11 ---------- > > drivers/net/netdevsim/netdevsim.h | 1 - > > net/xfrm/xfrm_device.c | 15 +++++++++++++ > > 12 files changed, 22 insertions(+), 145 deletions(-) > > > > diff --git a/Documentation/networking/xfrm_device.rst b/Documentation/networking/xfrm_device.rst > > index 66f6e9a9b59a..39bb98939d1f 100644 > > --- a/Documentation/networking/xfrm_device.rst > > +++ b/Documentation/networking/xfrm_device.rst > > @@ -126,7 +126,8 @@ been setup for offload, it first calls into xdo_dev_offload_ok() with > > the skb and the intended offload state to ask the driver if the offload > > will serviceable. This can check the packet information to be sure the > > offload can be supported (e.g. IPv4 or IPv6, no IPv4 options, etc) and > > -return true of false to signify its support. > > +return true of false to signify its support. In case driver doesn't implement > > In this commit, remove the functions cxgb4_ipsec_offload_ok, > ch_ipsec_offload_ok, ixgbe_ipsec_offload_ok, ixgbevf_ipsec_offload_ok, > cn10k_ipsec_offload_ok, mlx5e_ipsec_offload_ok, nfp_net_ipsec_offload_ok and > nsim_ipsec_offload_ok, use the function xfrm_dev_offload_ok to do the same > work. > > But in the file xfrm_device.rst, "return true or false to signify its > support"? This sentence continued in the xfrm_device.rst: "... In case driver doesn't implement this callback, the stack provides reasonable defaults." > > of --> should be "or" > > Thanks a lot. > Reviewed-by: Zhu Yanjun Thanks > > Zhu Yanjun > > > +this callback, the stack provides reasonable defaults. > > Crypto offload mode: > > When ready to send, the driver needs to inspect the Tx packet for the > > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c > > index e45bba240cbc..bfb55c23380b 100644 > > --- a/drivers/net/bonding/bond_main.c > > +++ b/drivers/net/bonding/bond_main.c > > @@ -676,22 +676,16 @@ static void bond_ipsec_free_sa(struct xfrm_state *xs) > > static bool bond_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *xs)