From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16C0F217723 for ; Fri, 10 Oct 2025 09:03:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760086985; cv=none; b=heOwO+gKnJszhAdBXkhoxt76nYtYRgMeKaExrkO4gPFbt8SkdPGa40HqK03A9C4oMH5s65a7Dcypxt9I8SvIyinfyfJB/96p9HF9XX1LW3WeEOSGOg/DDndWflulj6MNpUpRMgIaYUIeXkdTtZfSLf1KujteEVdBAeCKv/vMpqc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760086985; c=relaxed/simple; bh=uE+4skj4m3VP2+CPxKRpxzman6xCQ3FqT9RkrihJWas=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YnnDz+oWEswzZUXhKapTyqKZFSwCAvBGBbxkWvj5E1XG0fpToCyOMD5Tae9ehvbk9XhVjrE/9YZrJtBkQvYy3tnrBhifQ49u5/IiiMbKB377EJo++veB+qvlPdcFYD3GhZNpBknKZhHvjwQkmKNZAIxtv9mDvdflH8TofrOwhmE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=GfFW+YpG; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=dET5+Qv2; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=GfFW+YpG; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=dET5+Qv2; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="GfFW+YpG"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="dET5+Qv2"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="GfFW+YpG"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="dET5+Qv2" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 12F8A1F393; Fri, 10 Oct 2025 09:03:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760086982; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rF7BMpVZThR98Bnp9/4MuMCPLSZwN4/7FLEGXoFhOKI=; b=GfFW+YpGuEBN55+5IYb9P5DfsWcw5oly3QWY3uyqfcA5uMdwz39ze/FqIYd+Y5t/MYq4Qr cienmn2x6D7ADGCacxmnmEofmoLPjfd4BE919IuRkSKNuxB8552cMZUbInjX6Xeezb0MEE zHRXzee8SHZPJiua9ekBfHiu8gsYXZA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760086982; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rF7BMpVZThR98Bnp9/4MuMCPLSZwN4/7FLEGXoFhOKI=; b=dET5+Qv2vYZ66/Yg1xFzbvyqKGt/P2l1AJxsGEgNN1qeR0pNAw4ZKUQMi1MYAdhoXZ0023 Ck9ey12/zw5UzEAg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=GfFW+YpG; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=dET5+Qv2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760086982; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rF7BMpVZThR98Bnp9/4MuMCPLSZwN4/7FLEGXoFhOKI=; b=GfFW+YpGuEBN55+5IYb9P5DfsWcw5oly3QWY3uyqfcA5uMdwz39ze/FqIYd+Y5t/MYq4Qr cienmn2x6D7ADGCacxmnmEofmoLPjfd4BE919IuRkSKNuxB8552cMZUbInjX6Xeezb0MEE zHRXzee8SHZPJiua9ekBfHiu8gsYXZA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760086982; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rF7BMpVZThR98Bnp9/4MuMCPLSZwN4/7FLEGXoFhOKI=; b=dET5+Qv2vYZ66/Yg1xFzbvyqKGt/P2l1AJxsGEgNN1qeR0pNAw4ZKUQMi1MYAdhoXZ0023 Ck9ey12/zw5UzEAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EC35513A40; Fri, 10 Oct 2025 09:03:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id K+jSOMXL6GhkWQAAD6G6ig (envelope-from ); Fri, 10 Oct 2025 09:03:01 +0000 Message-ID: <6cd3e802-1137-48b6-85b6-e5db1442ee64@suse.de> Date: Fri, 10 Oct 2025 11:03:01 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] nvme/tcp: handle tls partially sent records in write_space() To: Wilfred Mallawa , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Wilfred Mallawa References: <20251010071939.709063-4-wilfred.opensource@gmail.com> Content-Language: en-US From: Hannes Reinecke In-Reply-To: <20251010071939.709063-4-wilfred.opensource@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spam-Flag: NO X-Rspamd-Queue-Id: 12F8A1F393 X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_TO(0.00)[gmail.com,lists.infradead.org,vger.kernel.org]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; DKIM_TRACE(0.00)[suse.de:+]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_VIA_SMTP_AUTH(0.00)[]; TAGGED_RCPT(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo] X-Spam-Score: -3.01 On 10/10/25 09:19, Wilfred Mallawa wrote: > From: Wilfred Mallawa > > 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: be8e82caa685 ("nvme-tcp: enable TLS handshake upcall") > Signed-off-by: Wilfred Mallawa > --- > V2->V3: Minor Style Changes > --- > drivers/nvme/host/tcp.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c > index 1413788ca7d5..9a96df1a511c 100644 > --- a/drivers/nvme/host/tcp.c > +++ b/drivers/nvme/host/tcp.c > @@ -1081,6 +1081,9 @@ static void nvme_tcp_write_space(struct sock *sk) > queue = sk->sk_user_data; > if (likely(queue && sk_stream_is_writeable(sk))) { > clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags); > + /* Ensure pending TLS partial records are retried */ > + if (nvme_tcp_queue_tls(queue)) > + queue->write_space(sk); > queue_work_on(queue->io_cpu, nvme_tcp_wq, &queue->io_work); > } > read_unlock_bh(&sk->sk_callback_lock); Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich