]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: kTLS, Fix corner-case checks in TX resync flow
authorTariq Toukan <tariqt@mellanox.com>
Sun, 12 Jan 2020 14:22:14 +0000 (16:22 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 24 Jan 2020 20:04:35 +0000 (12:04 -0800)
commitf77269e1176fd7c1ecd7a1c1d6a56631cbeac73e
treee98dcb5fadb78f29039f556e41e0bee6d986b0aa
parent4eb01403cace067b9f8e123f8c0c8924178a87f5
net/mlx5e: kTLS, Fix corner-case checks in TX resync flow

There are the following cases:

1. Packet ends before start marker: bypass offload.
2. Packet starts before start marker and ends after it: drop,
   not supported, breaks contract with kernel.
3. packet ends before tls record info starts: drop,
   this packet was already acknowledged and its record info
   was released.

Add the above as comment in code.

Mind possible wraparounds of the TCP seq, replace the simple comparison
with a call to the TCP before() method.

In addition, remove logic that handles negative sync_len values,
as it became impossible.

Fixes: 78c1118ca47b ("net/mlx5e: Add kTLS TX HW offload support")
Fixes: 66969befb3ce ("net/mlx5e: kTLS, Enhance TX resync flow")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Boris Pismenny <borisp@mellanox.com>
Reviewed-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c