diff options
author | David S. Miller <davem@davemloft.net> | 2019-12-19 17:46:51 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-12-19 17:46:51 -0800 |
commit | 5f04a6d8dfe804844c2f29c0a7f407d06202912c (patch) | |
tree | b2c2051ccd1bd7c86c374db1d96ddf97ca3220bc /include/net/tls.h | |
parent | Merge branch 'nfp-ipv6-tunnel' (diff) | |
parent | nfp: tls: implement the stream sync RX resync (diff) | |
download | linux-dev-5f04a6d8dfe804844c2f29c0a7f407d06202912c.tar.xz linux-dev-5f04a6d8dfe804844c2f29c0a7f407d06202912c.zip |
Merge branch 'nfp-tls-implement-the-stream-sync-RX-resync'
Jakub Kicinski says:
====================
nfp: tls: implement the stream sync RX resync
This small series adds support for using the device
in stream scan RX resync mode which improves the RX
resync success rate. Without stream scan it's pretty
much impossible to successfully resync a continuous
stream.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tls.h')
-rw-r--r-- | include/net/tls.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/tls.h b/include/net/tls.h index df630f5fc723..bf9eb4823933 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -641,6 +641,7 @@ int tls_sw_fallback_init(struct sock *sk, #ifdef CONFIG_TLS_DEVICE void tls_device_init(void); void tls_device_cleanup(void); +void tls_device_sk_destruct(struct sock *sk); int tls_set_device_offload(struct sock *sk, struct tls_context *ctx); void tls_device_free_resources_tx(struct sock *sk); int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx); @@ -649,6 +650,14 @@ void tls_device_rx_resync_new_rec(struct sock *sk, u32 rcd_len, u32 seq); void tls_offload_tx_resync_request(struct sock *sk, u32 got_seq, u32 exp_seq); int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx, struct sk_buff *skb, struct strp_msg *rxm); + +static inline bool tls_is_sk_rx_device_offloaded(struct sock *sk) +{ + if (!sk_fullsock(sk) || + smp_load_acquire(&sk->sk_destruct) != tls_device_sk_destruct) + return false; + return tls_get_ctx(sk)->rx_conf == TLS_HW; +} #else static inline void tls_device_init(void) {} static inline void tls_device_cleanup(void) {} |