From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
davejwatson@fb.com, borisp@mellanox.com, aviadye@mellanox.com,
john.fastabend@gmail.com, daniel@iogearbox.net,
atul.gupta@chelsio.com,
Jakub Kicinski <jakub.kicinski@netronome.com>,
John Hurley <john.hurley@netronome.com>,
Simon Horman <simon.horman@netronome.com>
Subject: [PATCH net-next 6/6] net/tls: allow compiling TLS TOE out
Date: Thu, 3 Oct 2019 11:18:59 -0700 [thread overview]
Message-ID: <20191003181859.24958-7-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20191003181859.24958-1-jakub.kicinski@netronome.com>
TLS "record layer offload" requires TOE, and bypasses most of
the normal networking stack. It is also significantly less
maintained. Allow users to compile it out to avoid issues.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
---
drivers/crypto/chelsio/Kconfig | 2 +-
net/tls/Kconfig | 10 ++++++++++
net/tls/Makefile | 3 ++-
net/tls/tls_main.c | 5 ++++-
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/chelsio/Kconfig b/drivers/crypto/chelsio/Kconfig
index 250150560e68..91e424378217 100644
--- a/drivers/crypto/chelsio/Kconfig
+++ b/drivers/crypto/chelsio/Kconfig
@@ -35,7 +35,7 @@ config CHELSIO_IPSEC_INLINE
config CRYPTO_DEV_CHELSIO_TLS
tristate "Chelsio Crypto Inline TLS Driver"
depends on CHELSIO_T4
- depends on TLS
+ depends on TLS_TOE
select CRYPTO_DEV_CHELSIO
---help---
Support Chelsio Inline TLS with Chelsio crypto accelerator.
diff --git a/net/tls/Kconfig b/net/tls/Kconfig
index e4328b3b72eb..61ec78521a60 100644
--- a/net/tls/Kconfig
+++ b/net/tls/Kconfig
@@ -26,3 +26,13 @@ config TLS_DEVICE
Enable kernel support for HW offload of the TLS protocol.
If unsure, say N.
+
+config TLS_TOE
+ bool "Transport Layer Security TCP stack bypass"
+ depends on TLS
+ default n
+ help
+ Enable kernel support for legacy HW offload of the TLS protocol,
+ which is incompatible with the Linux networking stack semantics.
+
+ If unsure, say N.
diff --git a/net/tls/Makefile b/net/tls/Makefile
index 322250e912db..95d8c06a14b9 100644
--- a/net/tls/Makefile
+++ b/net/tls/Makefile
@@ -5,6 +5,7 @@
obj-$(CONFIG_TLS) += tls.o
-tls-y := tls_main.o tls_sw.o tls_toe.o
+tls-y := tls_main.o tls_sw.o
+tls-$(CONFIG_TLS_TOE) += tls_toe.o
tls-$(CONFIG_TLS_DEVICE) += tls_device.o tls_device_fallback.o
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index 483dda6c3155..237e58e4928a 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -679,10 +679,11 @@ static void build_protos(struct proto prot[TLS_NUM_CONFIG][TLS_NUM_CONFIG],
prot[TLS_HW][TLS_HW] = prot[TLS_HW][TLS_SW];
#endif
-
+#ifdef CONFIG_TLS_TOE
prot[TLS_HW_RECORD][TLS_HW_RECORD] = *base;
prot[TLS_HW_RECORD][TLS_HW_RECORD].hash = tls_toe_hash;
prot[TLS_HW_RECORD][TLS_HW_RECORD].unhash = tls_toe_unhash;
+#endif
}
static int tls_init(struct sock *sk)
@@ -692,8 +693,10 @@ static int tls_init(struct sock *sk)
tls_build_proto(sk);
+#ifdef CONFIG_TLS_TOE
if (tls_toe_bypass(sk))
return 0;
+#endif
/* The TLS ulp is currently supported only for TCP sockets
* in ESTABLISHED state.
--
2.21.0
next prev parent reply other threads:[~2019-10-03 18:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-03 18:18 [PATCH net-next 0/6] net/tls: separate the TLS TOE code out Jakub Kicinski
2019-10-03 18:18 ` [PATCH net-next 1/6] net/tls: move TOE-related structures to a separate header Jakub Kicinski
2019-10-03 18:18 ` [PATCH net-next 2/6] net/tls: rename tls_device to tls_toe_device Jakub Kicinski
2019-10-03 18:18 ` [PATCH net-next 3/6] net/tls: move tls_build_proto() on init path Jakub Kicinski
2019-10-03 18:18 ` [PATCH net-next 4/6] net/tls: move TOE-related code to a separate file Jakub Kicinski
2019-10-03 18:18 ` [PATCH net-next 5/6] net/tls: rename tls_hw_* functions tls_toe_* Jakub Kicinski
2019-10-03 18:18 ` Jakub Kicinski [this message]
2019-10-04 14:31 ` [PATCH net-next 0/6] net/tls: separate the TLS TOE code out John Fastabend
2019-10-04 21:07 ` David Miller
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=20191003181859.24958-7-jakub.kicinski@netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=atul.gupta@chelsio.com \
--cc=aviadye@mellanox.com \
--cc=borisp@mellanox.com \
--cc=daniel@iogearbox.net \
--cc=davejwatson@fb.com \
--cc=davem@davemloft.net \
--cc=john.fastabend@gmail.com \
--cc=john.hurley@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
--cc=simon.horman@netronome.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).