[RFC net-next 0/7] [Cover Letter] net/mlx5e: kTLS TX fixes for WQEs in flight
From: Tariq Toukan
Date: Mon Nov 09 2026 - 06:52:42 EST
Hi,
This series fixes kTLS TX offload cases where WQEs that a connection
posted are still in flight while its device state is released, changed
from another SQ, or assumed to be in sync. Records then go out wrongly
encrypted, or the TIS and DEK are released while still in use.
kTLS TX WQEs update the TIS crypto and record tracking state of a
connection as they execute, and the device orders WQEs only within an
SQ. The series makes sure that:
- An skb dropped after WQEs were posted for it is held until they
complete, and a connection whose WQEs were lost is resynced fully
(patches 1-2).
- The context params are posted only for an skb that uses them, on the
SQ of the connection's data (patch 3).
- The old and new SQs never execute together across a channels switch
(patch 4).
- The TX queue of an offloaded socket does not change while it has
packets in flight, in the stack and in the mlx5e queue selection
(patches 5-6). An skb that still reaches another SQ meanwhile, e.g.
after tc skbedit queue_mapping, is dropped before anything is posted
(patch 7).
Patches 1-6 are fixes, for net. Patch 7 is for net-next, on top of
them. TLS 1.3 rekey support for device offload builds on this series.
Tested on ConnectX-6 Dx, with a software kTLS receiver that checks
every byte. The commit messages describe the reproduction and the
results of each fix.
Link: https://lore.kernel.org/netdev/20261022181751.1349984-1-rjethwani@xxxxxxxxxxxxxxx/
Regards,
Tariq
Tariq Toukan (7):
net/mlx5e: kTLS, Hold a dropped skb until its posted WQEs complete
net/mlx5e: kTLS, Resync TX fully after its WQEs were lost
net/mlx5e: kTLS, Post TX context params only for skbs that use them
net/mlx5e: Drain old TX SQs before activating new channels
net: tls: keep the TX queue of a device-offloaded socket stable
net/mlx5e: kTLS, Keep the TX queue of an offloaded socket stable
net/mlx5e: kTLS, Keep a TX connection on one SQ at a time
Documentation/admin-guide/sysctl/net.rst | 3 +
.../ethernet/mellanox/mlx5/counters.rst | 7 +
Documentation/networking/tls-offload.rst | 20 +++
.../net/ethernet/mellanox/mlx5/core/en/selq.c | 96 ++++++++--
.../net/ethernet/mellanox/mlx5/core/en/txrx.h | 2 +
.../mellanox/mlx5/core/en_accel/ktls.c | 1 +
.../mellanox/mlx5/core/en_accel/ktls_tx.c | 165 +++++++++++++++---
.../mellanox/mlx5/core/en_accel/ktls_txrx.h | 21 +++
.../net/ethernet/mellanox/mlx5/core/en_main.c | 88 +++++++++-
.../ethernet/mellanox/mlx5/core/en_stats.c | 4 +
.../ethernet/mellanox/mlx5/core/en_stats.h | 2 +
.../net/ethernet/mellanox/mlx5/core/en_tx.c | 98 +++++++++--
include/net/sock.h | 33 +++-
include/net/tls.h | 13 ++
net/core/dev.c | 3 +-
net/core/sock.c | 2 +-
net/ipv4/tcp_output.c | 7 +-
net/tls/tls_device.c | 3 +
18 files changed, 503 insertions(+), 65 deletions(-)
base-commit: fa5196392691051963726787944db872420dfa75
--
2.44.0