Skip to content

Commit

Permalink
net/tls: allow compiling TLS TOE out
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and davem330 committed Oct 4, 2019
1 parent 0eb8745 commit 53b4414
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/crypto/chelsio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions net/tls/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 2 additions & 1 deletion net/tls/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion net/tls/tls_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down

0 comments on commit 53b4414

Please sign in to comment.