Skip to content

Commit a5c37c6

Browse files
Ilya Lesokhindavem330
authored andcommitted
net: Add TLS offload netdev ops
Add new netdev ops to add and delete tls context Signed-off-by: Ilya Lesokhin <[email protected]> Signed-off-by: Boris Pismenny <[email protected]> Signed-off-by: Aviad Yehezkel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ebf4e80 commit a5c37c6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

include/linux/netdevice.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,26 @@ struct xfrmdev_ops {
865865
};
866866
#endif
867867

868+
#if IS_ENABLED(CONFIG_TLS_DEVICE)
869+
enum tls_offload_ctx_dir {
870+
TLS_OFFLOAD_CTX_DIR_RX,
871+
TLS_OFFLOAD_CTX_DIR_TX,
872+
};
873+
874+
struct tls_crypto_info;
875+
struct tls_context;
876+
877+
struct tlsdev_ops {
878+
int (*tls_dev_add)(struct net_device *netdev, struct sock *sk,
879+
enum tls_offload_ctx_dir direction,
880+
struct tls_crypto_info *crypto_info,
881+
u32 start_offload_tcp_sn);
882+
void (*tls_dev_del)(struct net_device *netdev,
883+
struct tls_context *ctx,
884+
enum tls_offload_ctx_dir direction);
885+
};
886+
#endif
887+
868888
struct dev_ifalias {
869889
struct rcu_head rcuhead;
870890
char ifalias[];
@@ -1750,6 +1770,10 @@ struct net_device {
17501770
const struct xfrmdev_ops *xfrmdev_ops;
17511771
#endif
17521772

1773+
#if IS_ENABLED(CONFIG_TLS_DEVICE)
1774+
const struct tlsdev_ops *tlsdev_ops;
1775+
#endif
1776+
17531777
const struct header_ops *header_ops;
17541778

17551779
unsigned int flags;

0 commit comments

Comments
 (0)