Skip to content

Commit f3fe1ab

Browse files
twilfredogregkh
authored andcommitted
nvme/tcp: handle tls partially sent records in write_space()
[ Upstream commit 5a869d0 ] With TLS enabled, records that are encrypted and appended to TLS TX list can fail to see a retry if the underlying TCP socket is busy, for example, hitting an EAGAIN from tcp_sendmsg_locked(). This is not known to the NVMe TCP driver, as the TLS layer successfully generated a record. Typically, the TLS write_space() callback would ensure such records are retried, but in the NVMe TCP Host driver, write_space() invokes nvme_tcp_write_space(). This causes a partially sent record in the TLS TX list to timeout after not being retried. This patch fixes the above by calling queue->write_space(), which calls into the TLS layer to retry any pending records. Fixes: be8e82c ("nvme-tcp: enable TLS handshake upcall") Signed-off-by: Wilfred Mallawa <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Keith Busch <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 2a87a1c commit f3fe1ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/nvme/host/tcp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,9 @@ static void nvme_tcp_write_space(struct sock *sk)
10751075
queue = sk->sk_user_data;
10761076
if (likely(queue && sk_stream_is_writeable(sk))) {
10771077
clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
1078+
/* Ensure pending TLS partial records are retried */
1079+
if (nvme_tcp_queue_tls(queue))
1080+
queue->write_space(sk);
10781081
queue_work_on(queue->io_cpu, nvme_tcp_wq, &queue->io_work);
10791082
}
10801083
read_unlock_bh(&sk->sk_callback_lock);

0 commit comments

Comments
 (0)