]> git.baikalelectronics.ru Git - kernel.git/commit
tls: Skip tls_append_frag on zero copy size
authorMaxim Mikityanskiy <maximmi@nvidia.com>
Tue, 26 Apr 2022 15:49:49 +0000 (18:49 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Apr 2022 22:25:20 +0000 (15:25 -0700)
commit10c1e548668d51e8ac69fb7a4c21281656aa92a0
treeefff78b7c6c93d66a433399132337d1c0e9c6497
parent0c6e5c6a3e0598a5fd5889c44f43415a48b4c562
tls: Skip tls_append_frag on zero copy size

Calling tls_append_frag when max_open_record_len == record->len might
add an empty fragment to the TLS record if the call happens to be on the
page boundary. Normally tls_append_frag coalesces the zero-sized
fragment to the previous one, but not if it's on page boundary.

If a resync happens then, the mlx5 driver posts dump WQEs in
tx_post_resync_dump, and the empty fragment may become a data segment
with byte_count == 0, which will confuse the NIC and lead to a CQE
error.

This commit fixes the described issue by skipping tls_append_frag on
zero size to avoid adding empty fragments. The fix is not in the driver,
because an empty fragment is hardly the desired behavior.

Fixes: e31ec02c9978 ("net/tls: Add generic NIC offload infrastructure")
Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20220426154949.159055-1-maximmi@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_device.c