From: Rishikesh Jethwani <rjethwani@purestorage.com>
To: netdev@vger.kernel.org
Cc: Rishikesh Jethwani <rjethwani@purestorage.com>,
John Fastabend <john.fastabend@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
Sabrina Dubroca <sd@queasysnail.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
Simon Horman <horms@kernel.org>
Subject: [PATCH net v3 4/9] tls: device: remove the dead start marker bypass in TX fallback
Date: Fri, 4 Dec 2026 16:53:51 -0700 [thread overview]
Message-ID: <20261204235642.36653-5-rjethwani@purestorage.com> (raw)
In-Reply-To: <20261204235642.36653-1-rjethwani@purestorage.com>
Pre-offload skbs now bypass tls_sw_fallback() before record lookup,
and TCP does not merge them with marked data across the start marker.
Remove the unreachable bypass and its special case in fill_sg_in().
Keep the marker itself: record lookup and ACK cleanup still count it.
No functional change.
Signed-off-by: Rishikesh Jethwani <rjethwani@purestorage.com>
---
net/tls/tls_device_fallback.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/net/tls/tls_device_fallback.c b/net/tls/tls_device_fallback.c
index 42afbe7e60b5..da875fdf5b54 100644
--- a/net/tls/tls_device_fallback.c
+++ b/net/tls/tls_device_fallback.c
@@ -237,8 +237,6 @@ static int fill_sg_in(struct scatterlist *sg_in,
*sync_size = tcp_seq - tls_record_start_seq(record);
if (*sync_size < 0) {
- int is_start_marker = tls_record_is_start_marker(record);
-
spin_unlock_irqrestore(&ctx->lock, flags);
/* This should only occur if the relevant record was
* already acked. In that case it should be ok
@@ -250,8 +248,6 @@ static int fill_sg_in(struct scatterlist *sg_in,
* on TCP to retransmit a packet that doesn't contain
* already acked payload.
*/
- if (!is_start_marker)
- *sync_size = 0;
return -EINVAL;
}
@@ -394,12 +390,9 @@ static struct sk_buff *tls_sw_fallback(struct sock *sk, struct sk_buff *skb)
sg_init_table(sg_in, sg_in_max_elements);
sg_init_table(sg_out, ARRAY_SIZE(sg_out));
- if (fill_sg_in(sg_in, skb, ctx, &rcd_sn, &sync_size, &resync_sgs)) {
- /* bypass packets before kernel TLS socket option was set */
- if (sync_size < 0 && payload_len <= -sync_size)
- nskb = skb_get(skb);
+ /* Its record was acked and freed: drop it */
+ if (fill_sg_in(sg_in, skb, ctx, &rcd_sn, &sync_size, &resync_sgs))
goto put_sg;
- }
nskb = tls_enc_skb(tls_ctx, sg_out, sg_in, skb, sync_size, rcd_sn);
--
2.50.1
next prev parent reply other threads:[~2026-12-04 23:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 23:53 [PATCH net v3 0/9] tls: device: don't put offload plaintext on the wire Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 1/9] net: don't fragment skbs that still need device crypto Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 2/9] tls: device: keep tls_sw_fallback() from encrypting its own output Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 3/9] tls: device: don't let the NIC encrypt fallback output again Rishikesh Jethwani
2026-12-04 23:53 ` Rishikesh Jethwani [this message]
2026-12-04 23:53 ` [PATCH net v3 5/9] selftests: net: py: reap commands that fail to report ready Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 6/9] selftests: net: py: add a timeout argument to bkg() Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 7/9] selftests: net: add TLS offload over bond tests Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 8/9] selftests: net: test TLS fallback after rerouting to an upper device Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 9/9] selftests: net: verify that IP refuses to fragment TLS offload data Rishikesh Jethwani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261204235642.36653-5-rjethwani@purestorage.com \
--to=rjethwani@purestorage.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox