summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2022-05-07 09:19:47 +0200
committerSteffen Klassert <steffen.klassert@secunet.com>2022-05-07 09:19:47 +0200
commit0f9008e5c5103e32e788d260558d170c2fc9c2be (patch)
treec20b9dd17aa82558fbd12f2e573cfdef0456d841 /include
parent949dfdcf343c1646d26ee0ef320d6b2a4a39af28 (diff)
parent254c4a824c7c6a53360bc4974710e4213b8b7f5d (diff)
downloadcachepc-linux-0f9008e5c5103e32e788d260558d170c2fc9c2be.tar.gz
cachepc-linux-0f9008e5c5103e32e788d260558d170c2fc9c2be.zip
Merge branch 'Be explicit with XFRM offload direction'
Leon Romanovsky says: ==================== I may admit that the title of this series is not the best one as it contains straightforward cleanups and code that converts flags to something less confusing. This series follows removal of FPGA IPsec code from the mlx5 driver and based on net-next commit 4950b6990e3b ("Merge branch 'ocelot-vcap-cleanups'"). As such, first two patches delete code that was used by mlx5 FPGA code but isn't needed anymore. Third patch is simple struct rename. Rest of the patches separate user's provided flags variable from driver's usage. This allows us to created more simple in-kernel interface, that supports type checking without blending different properties into one variable. It is achieved by converting flags to specific bitfield variables with clear, meaningful names. Such change allows us more clear addition of new input flags needed to mark IPsec offload type. The followup code uses this extensively: https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=xfrm-next ==================== Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/xfrm.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 6fb899ff5afc..736c349de8bf 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -126,13 +126,17 @@ struct xfrm_state_walk {
struct xfrm_address_filter *filter;
};
-struct xfrm_state_offload {
+enum {
+ XFRM_DEV_OFFLOAD_IN = 1,
+ XFRM_DEV_OFFLOAD_OUT,
+};
+
+struct xfrm_dev_offload {
struct net_device *dev;
netdevice_tracker dev_tracker;
struct net_device *real_dev;
unsigned long offload_handle;
- unsigned int num_exthdrs;
- u8 flags;
+ u8 dir : 2;
};
struct xfrm_mode {
@@ -247,7 +251,7 @@ struct xfrm_state {
struct xfrm_lifetime_cur curlft;
struct hrtimer mtimer;
- struct xfrm_state_offload xso;
+ struct xfrm_dev_offload xso;
/* used to fix curlft->add_time when changing date */
long saved_tmo;
@@ -1006,7 +1010,7 @@ struct xfrm_offload {
#define CRYPTO_FALLBACK 8
#define XFRM_GSO_SEGMENT 16
#define XFRM_GRO 32
-#define XFRM_ESP_NO_TRAILER 64
+/* 64 is free */
#define XFRM_DEV_RESUME 128
#define XFRM_XMIT 256
@@ -1866,7 +1870,7 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x);
static inline void xfrm_dev_state_advance_esn(struct xfrm_state *x)
{
- struct xfrm_state_offload *xso = &x->xso;
+ struct xfrm_dev_offload *xso = &x->xso;
if (xso->dev && xso->dev->xfrmdev_ops->xdo_dev_state_advance_esn)
xso->dev->xfrmdev_ops->xdo_dev_state_advance_esn(x);
@@ -1892,7 +1896,7 @@ static inline bool xfrm_dst_offload_ok(struct dst_entry *dst)
static inline void xfrm_dev_state_delete(struct xfrm_state *x)
{
- struct xfrm_state_offload *xso = &x->xso;
+ struct xfrm_dev_offload *xso = &x->xso;
if (xso->dev)
xso->dev->xfrmdev_ops->xdo_dev_state_delete(x);
@@ -1900,7 +1904,7 @@ static inline void xfrm_dev_state_delete(struct xfrm_state *x)
static inline void xfrm_dev_state_free(struct xfrm_state *x)
{
- struct xfrm_state_offload *xso = &x->xso;
+ struct xfrm_dev_offload *xso = &x->xso;
struct net_device *dev = xso->dev;
if (dev && dev->xfrmdev_ops) {