diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-06-05 14:11:38 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-06 14:13:40 -0700 |
commit | 2d6b51c6924c1bba8e4948dc4a2dbc96bf685b97 (patch) | |
tree | f71ba1b022aea260280960530411100a89fbbadb /include/net/tls.h | |
parent | 5584c0f82501ad8637953ee2a4d3e6ea29b2f0b3 (diff) | |
download | linux-2d6b51c6924c1bba8e4948dc4a2dbc96bf685b97.tar.bz2 |
net/tls: split the TLS_DRIVER_STATE_SIZE and bump TX to 16 bytes
8 bytes of driver state has been enough so far, but for drivers
which have to store 8 byte handle it's no longer practical to
store the state directly in the context.
Drivers generally don't need much extra state on RX side, while
TX side has to be tracking TCP sequence numbers. Split the
lengths of max driver state size on RX and TX.
The struct tls_offload_context_tx currently stands at 616 bytes and
struct tls_offload_context_rx stands at 368 bytes. Upcoming work
will consume extra 8 bytes in both for kernel-driven resync.
This means that we can bump TX side to 16 bytes and still fit
into the same number of cache lines but on RX side we would be 8
bytes over.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tls.h')
-rw-r--r-- | include/net/tls.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/net/tls.h b/include/net/tls.h index 0a0072636009..3094db5398a9 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -202,12 +202,12 @@ struct tls_offload_context_tx { * Currently the belief is that there is not enough * driver specific state to justify another layer of indirection */ -#define TLS_DRIVER_STATE_SIZE (max_t(size_t, 8, sizeof(void *))) +#define TLS_DRIVER_STATE_SIZE_TX 16 }; #define TLS_OFFLOAD_CONTEXT_SIZE_TX \ (ALIGN(sizeof(struct tls_offload_context_tx), sizeof(void *)) + \ - TLS_DRIVER_STATE_SIZE) + TLS_DRIVER_STATE_SIZE_TX) struct cipher_context { char *iv; @@ -307,11 +307,12 @@ struct tls_offload_context_rx { * Currently the belief is that there is not enough * driver specific state to justify another layer of indirection */ +#define TLS_DRIVER_STATE_SIZE_RX 8 }; #define TLS_OFFLOAD_CONTEXT_SIZE_RX \ (ALIGN(sizeof(struct tls_offload_context_rx), sizeof(void *)) + \ - TLS_DRIVER_STATE_SIZE) + TLS_DRIVER_STATE_SIZE_RX) int wait_on_pending_writer(struct sock *sk, long *timeo); int tls_sk_query(struct sock *sk, int optname, char __user *optval, |