From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Leon Romanovsky <leon@kernel.org>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Ayush Sawal <ayush.sawal@chelsio.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Eric Dumazet <edumazet@google.com>,
Geetha sowjanya <gakula@marvell.com>,
hariprasad <hkelam@marvell.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
intel-wired-lan@lists.osuosl.org,
Jakub Kicinski <kuba@kernel.org>, Jay Vosburgh <jv@jvosburgh.net>,
Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org, linux-rdma@vger.kernel.org,
Louis Peens <louis.peens@corigine.com>,
netdev@vger.kernel.org, oss-drivers@corigine.com,
Paolo Abeni <pabeni@redhat.com>,
Potnuri Bharat Teja <bharat@chelsio.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
Sunil Goutham <sgoutham@marvell.com>,
Tariq Toukan <tariqt@nvidia.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Ilia Lin <ilia.lin@kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH ipsec-next 4/5] xfrm: provide common xdo_dev_offload_ok callback implementation
Date: Sun, 16 Feb 2025 13:36:17 +0100 [thread overview]
Message-ID: <6775786f-ee86-4990-8db8-ea95d4313973@linux.dev> (raw)
In-Reply-To: <20250216110711.GU17863@unreal>
在 2025/2/16 12:07, Leon Romanovsky 写道:
> On Sun, Feb 16, 2025 at 10:33:59AM +0100, Zhu Yanjun wrote:
>> 在 2025/2/5 19:20, Leon Romanovsky 写道:
>>> From: Leon Romanovsky <leonro@nvidia.com>
>>>
>>> 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 <leonro@nvidia.com>
>>> ---
>>> 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."
Got it.
I mean "... and return true of false to signify its support..."
^^
should be "... and return true or false to signify its support..."
^_^
Zhu Yanjun
>
>> of --> should be "or"
>>
>> Thanks a lot.
>> Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> 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)
--
Best Regards,
Yanjun.Zhu
WARNING: multiple messages have this Message-ID (diff)
From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Leon Romanovsky <leon@kernel.org>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Ayush Sawal <ayush.sawal@chelsio.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Eric Dumazet <edumazet@google.com>,
Geetha sowjanya <gakula@marvell.com>,
hariprasad <hkelam@marvell.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
intel-wired-lan@lists.osuosl.org,
Jakub Kicinski <kuba@kernel.org>, Jay Vosburgh <jv@jvosburgh.net>,
Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org, linux-rdma@vger.kernel.org,
Louis Peens <louis.peens@corigine.com>,
netdev@vger.kernel.org, oss-drivers@corigine.com,
Paolo Abeni <pabeni@redhat.com>,
Potnuri Bharat Teja <bharat@chelsio.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
Sunil Goutham <sgoutham@marvell.com>,
Tariq Toukan <tariqt@nvidia.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Ilia Lin <ilia.lin@kernel.org>
Subject: Re: [PATCH ipsec-next 4/5] xfrm: provide common xdo_dev_offload_ok callback implementation
Date: Sun, 16 Feb 2025 13:36:17 +0100 [thread overview]
Message-ID: <6775786f-ee86-4990-8db8-ea95d4313973@linux.dev> (raw)
In-Reply-To: <20250216110711.GU17863@unreal>
在 2025/2/16 12:07, Leon Romanovsky 写道:
> On Sun, Feb 16, 2025 at 10:33:59AM +0100, Zhu Yanjun wrote:
>> 在 2025/2/5 19:20, Leon Romanovsky 写道:
>>> From: Leon Romanovsky <leonro@nvidia.com>
>>>
>>> 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 <leonro@nvidia.com>
>>> ---
>>> 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."
Got it.
I mean "... and return true of false to signify its support..."
^^
should be "... and return true or false to signify its support..."
^_^
Zhu Yanjun
>
>> of --> should be "or"
>>
>> Thanks a lot.
>> Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> 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)
--
Best Regards,
Yanjun.Zhu
next prev parent reply other threads:[~2025-02-16 12:36 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 18:20 [Intel-wired-lan] [PATCH ipsec-next 0/5] Support PTMU in tunnel mode for packet offload Leon Romanovsky
2025-02-05 18:20 ` Leon Romanovsky
2025-02-05 18:20 ` [Intel-wired-lan] [PATCH ipsec-next 1/5] xfrm: delay initialization of offload path till its actually requested Leon Romanovsky
2025-02-05 18:20 ` Leon Romanovsky
2025-02-06 8:46 ` [Intel-wired-lan] " Bharat Bhushan
2025-02-06 8:46 ` Bharat Bhushan
2025-02-06 8:54 ` [Intel-wired-lan] " Leon Romanovsky
2025-02-06 8:54 ` Leon Romanovsky
2025-02-06 13:59 ` [Intel-wired-lan] " Bharat Bhushan
2025-02-06 13:59 ` Bharat Bhushan
2025-02-06 14:26 ` [Intel-wired-lan] " Leon Romanovsky
2025-02-06 14:26 ` Leon Romanovsky
2025-02-05 18:20 ` [Intel-wired-lan] [PATCH ipsec-next 2/5] xfrm: simplify SA initialization routine Leon Romanovsky
2025-02-05 18:20 ` Leon Romanovsky
2025-02-12 11:56 ` [Intel-wired-lan] " Steffen Klassert
2025-02-12 11:56 ` Steffen Klassert
2025-02-12 18:30 ` [Intel-wired-lan] " Leon Romanovsky
2025-02-12 18:30 ` Leon Romanovsky
2025-02-14 9:29 ` [Intel-wired-lan] " Steffen Klassert
2025-02-14 9:29 ` Steffen Klassert
2025-02-14 11:14 ` [Intel-wired-lan] " Leon Romanovsky
2025-02-14 11:14 ` Leon Romanovsky
2025-02-05 18:20 ` [Intel-wired-lan] [PATCH ipsec-next 3/5] xfrm: rely on XFRM offload Leon Romanovsky
2025-02-05 18:20 ` Leon Romanovsky
2025-02-18 20:39 ` [Intel-wired-lan] " Zhu Yanjun
2025-02-18 20:39 ` Zhu Yanjun
2025-02-05 18:20 ` [Intel-wired-lan] [PATCH ipsec-next 4/5] xfrm: provide common xdo_dev_offload_ok callback implementation Leon Romanovsky
2025-02-05 18:20 ` Leon Romanovsky
2025-02-16 9:33 ` [Intel-wired-lan] " Zhu Yanjun
2025-02-16 9:33 ` Zhu Yanjun
2025-02-16 11:07 ` [Intel-wired-lan] " Leon Romanovsky
2025-02-16 11:07 ` Leon Romanovsky
2025-02-16 12:36 ` Zhu Yanjun [this message]
2025-02-16 12:36 ` Zhu Yanjun
2025-02-05 18:20 ` [Intel-wired-lan] [PATCH ipsec-next 5/5] xfrm: check for PMTU in tunnel mode for packet offload Leon Romanovsky
2025-02-05 18:20 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6775786f-ee86-4990-8db8-ea95d4313973@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=ayush.sawal@chelsio.com \
--cc=bbhushan2@marvell.com \
--cc=bharat@chelsio.com \
--cc=corbet@lwn.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=herbert@gondor.apana.org.au \
--cc=hkelam@marvell.com \
--cc=ilia.lin@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=louis.peens@corigine.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@corigine.com \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=saeedm@nvidia.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=steffen.klassert@secunet.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.