From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Lesokhin Subject: [PATCH v3 net-next 4/6] net: Add TLS offload netdev ops Date: Mon, 18 Dec 2017 13:10:31 +0200 Message-ID: <20171218111033.13256-5-ilyal@mellanox.com> References: <20171218111033.13256-1-ilyal@mellanox.com> Cc: davejwatson@fb.com, tom@herbertland.com, hannes@stressinduktion.org, borisp@mellanox.com, aviadye@mellanox.com, liranl@mellanox.com, Ilya Lesokhin To: netdev@vger.kernel.org, davem@davemloft.net Return-path: Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:55224 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758109AbdLRLKw (ORCPT ); Mon, 18 Dec 2017 06:10:52 -0500 In-Reply-To: <20171218111033.13256-1-ilyal@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: Add new netdev ops to add and delete tls context Signed-off-by: Boris Pismenny Signed-off-by: Ilya Lesokhin Signed-off-by: Aviad Yehezkel --- include/linux/netdevice.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index cc4ce7456e38..48f26fe67b82 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -845,6 +845,25 @@ 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); + 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[]; @@ -1730,6 +1749,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; -- 2.15.0.317.g14c63a9