From: Leon Romanovsky <leon@kernel.org>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Raed Salem <raeds@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Paul Blakey <paulb@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>
Subject: [PATCH xfrm-next 4/9] xfrm: add new device offload acquire flag
Date: Tue, 14 Mar 2023 10:58:39 +0200 [thread overview]
Message-ID: <f5da0834d8c6b82ab9ba38bd4a0c55e71f0e3dab.1678714336.git.leon@kernel.org> (raw)
In-Reply-To: <cover.1678714336.git.leon@kernel.org>
From: Raed Salem <raeds@nvidia.com>
During XFRM acquire flow, a default SA is created to be updated later,
once acquire netlink message is handled in user space. When the relevant
policy is offloaded this default SA is also offloaded to IPsec offload
supporting driver, however this SA does not have context suitable for
offloading in HW, nor is interesting to offload to HW, consequently needs
a special driver handling apart from other offloaded SA(s).
Add a special flag that marks such SA so driver can handle it correctly.
Signed-off-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
include/net/xfrm.h | 5 +++++
net/xfrm/xfrm_state.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 3e1f70e8e424..33ee3f5936e6 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -138,6 +138,10 @@ enum {
XFRM_DEV_OFFLOAD_PACKET,
};
+enum {
+ XFRM_DEV_OFFLOAD_FLAG_ACQ = 1,
+};
+
struct xfrm_dev_offload {
struct net_device *dev;
netdevice_tracker dev_tracker;
@@ -145,6 +149,7 @@ struct xfrm_dev_offload {
unsigned long offload_handle;
u8 dir : 2;
u8 type : 2;
+ u8 flags : 2;
};
struct xfrm_mode {
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 2ab3e09e2227..7cca0a1fa5ff 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1272,6 +1272,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
xso->dir = xdo->dir;
xso->dev = xdo->dev;
xso->real_dev = xdo->real_dev;
+ xso->flags = XFRM_DEV_OFFLOAD_FLAG_ACQ;
netdev_tracker_alloc(xso->dev, &xso->dev_tracker,
GFP_ATOMIC);
error = xso->dev->xfrmdev_ops->xdo_dev_state_add(x, NULL);
--
2.39.2
next prev parent reply other threads:[~2023-03-14 8:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 8:58 [PATCH xfrm-next 0/9] Extend packet offload to fully support libreswan Leon Romanovsky
2023-03-14 8:58 ` [PATCH xfrm-next 1/9] net/mlx5: fs_chains: Refactor to detach chains from tc usage Leon Romanovsky
2023-03-14 8:58 ` [PATCH xfrm-next 2/9] net/mlx5: fs_core: Allow ignore_flow_level on TX dest Leon Romanovsky
2023-03-14 8:58 ` [PATCH xfrm-next 3/9] net/mlx5e: Use chains for IPsec policy priority offload Leon Romanovsky
2023-03-14 8:58 ` Leon Romanovsky [this message]
2023-03-20 9:13 ` [PATCH xfrm-next 4/9] xfrm: add new device offload acquire flag Steffen Klassert
2023-03-14 8:58 ` [PATCH xfrm-next 5/9] xfrm: copy_to_user_state fetch offloaded SA packets/bytes statistics Leon Romanovsky
2023-03-20 9:13 ` Steffen Klassert
2023-03-14 8:58 ` [PATCH xfrm-next 6/9] net/mlx5e: Allow policies with reqid 0, to support IKE policy holes Leon Romanovsky
2023-03-14 8:58 ` [PATCH xfrm-next 7/9] net/mlx5e: Support IPsec acquire default SA Leon Romanovsky
2023-03-14 8:58 ` [PATCH xfrm-next 8/9] net/mlx5e: Use one rule to count all IPsec Tx offloaded traffic Leon Romanovsky
2023-03-14 8:58 ` [PATCH xfrm-next 9/9] net/mlx5e: Update IPsec per SA packets/bytes count Leon Romanovsky
2023-03-19 7:23 ` [PATCH xfrm-next 0/9] Extend packet offload to fully support libreswan Leon Romanovsky
2023-03-20 8:56 ` Steffen Klassert
2023-03-20 9:09 ` 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=f5da0834d8c6b82ab9ba38bd4a0c55e71f0e3dab.1678714336.git.leon@kernel.org \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paulb@nvidia.com \
--cc=raeds@nvidia.com \
--cc=saeedm@nvidia.com \
--cc=steffen.klassert@secunet.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).