From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Pismenny Subject: [PATCH V9 net-next 04/14] net: Add TLS offload netdev ops Date: Sun, 29 Apr 2018 11:06:39 +0300 Message-ID: <1524989209-5866-5-git-send-email-borisp@mellanox.com> References: <1524989209-5866-1-git-send-email-borisp@mellanox.com> Cc: netdev@vger.kernel.org, saeedm@mellanox.com, borisp@mellanox.com, davejwatson@fb.com, ktkhai@virtuozzo.com, Ilya Lesokhin , Aviad Yehezkel To: davem@davemloft.net Return-path: Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:46314 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752937AbeD2IG5 (ORCPT ); Sun, 29 Apr 2018 04:06:57 -0400 In-Reply-To: <1524989209-5866-1-git-send-email-borisp@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Ilya Lesokhin Add new netdev ops to add and delete tls context Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Signed-off-by: Aviad Yehezkel --- include/linux/netdevice.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 366c328..b7f8f9d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -865,6 +865,26 @@ struct xfrmdev_ops { }; #endif +#if IS_ENABLED(CONFIG_TLS_DEVICE) +enum tls_offload_ctx_dir { + TLS_OFFLOAD_CTX_DIR_RX, + TLS_OFFLOAD_CTX_DIR_TX, +}; + +struct tls_crypto_info; +struct tls_context; + +struct tlsdev_ops { + int (*tls_dev_add)(struct net_device *netdev, struct sock *sk, + enum tls_offload_ctx_dir direction, + struct tls_crypto_info *crypto_info, + u32 start_offload_tcp_sn); + void (*tls_dev_del)(struct net_device *netdev, + struct tls_context *ctx, + enum tls_offload_ctx_dir direction); +}; +#endif + struct dev_ifalias { struct rcu_head rcuhead; char ifalias[]; @@ -1750,6 +1770,10 @@ struct net_device { const struct xfrmdev_ops *xfrmdev_ops; #endif +#if IS_ENABLED(CONFIG_TLS_DEVICE) + const struct tlsdev_ops *tlsdev_ops; +#endif + const struct header_ops *header_ops; unsigned int flags; -- 1.8.3.1