diff options
author | Dirk van der Merwe <dirk.vandermerwe@netronome.com> | 2019-07-09 05:53:13 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-09 06:21:09 +0300 |
commit | b5d9a834f4fd1b6abfa527ec351c871084dd23a3 (patch) | |
tree | c000cc90aec8e553040f920c62f64e530cf6de6b /net/tls/tls_device.c | |
parent | 427545b3046326cd7b4dbbd7869f08737df2ad2b (diff) | |
download | linux-b5d9a834f4fd1b6abfa527ec351c871084dd23a3.tar.xz |
net/tls: don't clear TX resync flag on error
Introduce a return code for the tls_dev_resync callback.
When the driver TX resync fails, kernel can retry the resync again
until it succeeds. This prevents drivers from attempting to offload
TLS packets if the connection is known to be out of sync.
We don't worry about the RX resync since they will be retried naturally
as more encrypted records get received.
Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls/tls_device.c')
-rw-r--r-- | net/tls/tls_device.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 92fd1352c037..77fa3b5f2b49 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -214,6 +214,7 @@ static void tls_device_resync_tx(struct sock *sk, struct tls_context *tls_ctx, { struct net_device *netdev; struct sk_buff *skb; + int err = 0; u8 *rcd_sn; skb = tcp_write_queue_tail(sk); @@ -225,9 +226,12 @@ static void tls_device_resync_tx(struct sock *sk, struct tls_context *tls_ctx, down_read(&device_offload_lock); netdev = tls_ctx->netdev; if (netdev) - netdev->tlsdev_ops->tls_dev_resync(netdev, sk, seq, rcd_sn, - TLS_OFFLOAD_CTX_DIR_TX); + err = netdev->tlsdev_ops->tls_dev_resync(netdev, sk, seq, + rcd_sn, + TLS_OFFLOAD_CTX_DIR_TX); up_read(&device_offload_lock); + if (err) + return; clear_bit_unlock(TLS_TX_SYNC_SCHED, &tls_ctx->flags); } |