Blame SOURCES/0061-netdrv-net-mlx5e-kTLS-Fix-missing-SQ-edge-fill.patch

d8f823
From 16c3d368f72223cdfc308be9d40852d1d3cea81b Mon Sep 17 00:00:00 2001
d8f823
From: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Date: Sun, 10 May 2020 14:52:36 -0400
d8f823
Subject: [PATCH 061/312] [netdrv] net/mlx5e: kTLS, Fix missing SQ edge fill
d8f823
d8f823
Message-id: <20200510145245.10054-74-ahleihel@redhat.com>
d8f823
Patchwork-id: 306614
d8f823
Patchwork-instance: patchwork
d8f823
O-Subject: [RHEL8.3 BZ 1789378 v2 73/82] net/mlx5e: kTLS, Fix missing SQ edge fill
d8f823
Bugzilla: 1789378
d8f823
RH-Acked-by: Kamal Heib <kheib@redhat.com>
d8f823
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
d8f823
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
d8f823
RH-Acked-by: Jonathan Toppins <jtoppins@redhat.com>
d8f823
d8f823
Bugzilla: http://bugzilla.redhat.com/1789378
d8f823
Upstream: v5.4-rc6
d8f823
d8f823
commit 700ec497424069fa4d8f3715759c4aaec016e840
d8f823
Author: Tariq Toukan <tariqt@mellanox.com>
d8f823
Date:   Mon Oct 7 13:59:11 2019 +0300
d8f823
d8f823
    net/mlx5e: kTLS, Fix missing SQ edge fill
d8f823
d8f823
    Before posting the context params WQEs, make sure there is enough
d8f823
    contiguous room for them, and fill frag edge if needed.
d8f823
d8f823
    When posting only a nop, no need for room check, as it needs a single
d8f823
    WQEBB, meaning no contiguity issue.
d8f823
d8f823
    Fixes: d2ead1f360e8 ("net/mlx5e: Add kTLS TX HW offload support")
d8f823
    Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
d8f823
    Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com>
d8f823
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
d8f823
d8f823
Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
d8f823
---
d8f823
 .../ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 28 +++++++++++++++-------
d8f823
 1 file changed, 20 insertions(+), 8 deletions(-)
d8f823
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
d8f823
index 5f1d18fb644e..59e3f48470d9 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
d8f823
@@ -168,6 +168,14 @@ mlx5e_ktls_tx_post_param_wqes(struct mlx5e_txqsq *sq,
d8f823
 			      bool skip_static_post, bool fence_first_post)
d8f823
 {
d8f823
 	bool progress_fence = skip_static_post || !fence_first_post;
d8f823
+	struct mlx5_wq_cyc *wq = &sq->wq;
d8f823
+	u16 contig_wqebbs_room, pi;
d8f823
+
d8f823
+	pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
d8f823
+	contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi);
d8f823
+	if (unlikely(contig_wqebbs_room <
d8f823
+		     MLX5E_KTLS_STATIC_WQEBBS + MLX5E_KTLS_PROGRESS_WQEBBS))
d8f823
+		mlx5e_fill_sq_frag_edge(sq, wq, pi, contig_wqebbs_room);
d8f823
 
d8f823
 	if (!skip_static_post)
d8f823
 		post_static_params(sq, priv_tx, fence_first_post);
d8f823
@@ -355,10 +363,20 @@ mlx5e_ktls_tx_handle_ooo(struct mlx5e_ktls_offload_context_tx *priv_tx,
d8f823
 
d8f823
 	stats->tls_ooo++;
d8f823
 
d8f823
-	num_wqebbs = MLX5E_KTLS_STATIC_WQEBBS + MLX5E_KTLS_PROGRESS_WQEBBS +
d8f823
-		(info.nr_frags ? info.nr_frags * MLX5E_KTLS_DUMP_WQEBBS : 1);
d8f823
+	tx_post_resync_params(sq, priv_tx, info.rcd_sn);
d8f823
+
d8f823
+	/* If no dump WQE was sent, we need to have a fence NOP WQE before the
d8f823
+	 * actual data xmit.
d8f823
+	 */
d8f823
+	if (!info.nr_frags) {
d8f823
+		tx_post_fence_nop(sq);
d8f823
+		return skb;
d8f823
+	}
d8f823
+
d8f823
+	num_wqebbs = info.nr_frags * MLX5E_KTLS_DUMP_WQEBBS;
d8f823
 	pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
d8f823
 	contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi);
d8f823
+
d8f823
 	if (unlikely(contig_wqebbs_room < num_wqebbs))
d8f823
 		mlx5e_fill_sq_frag_edge(sq, wq, pi, contig_wqebbs_room);
d8f823
 
d8f823
@@ -368,12 +386,6 @@ mlx5e_ktls_tx_handle_ooo(struct mlx5e_ktls_offload_context_tx *priv_tx,
d8f823
 		if (tx_post_resync_dump(sq, &info.frags[i], priv_tx->tisn, !i))
d8f823
 			goto err_out;
d8f823
 
d8f823
-	/* If no dump WQE was sent, we need to have a fence NOP WQE before the
d8f823
-	 * actual data xmit.
d8f823
-	 */
d8f823
-	if (!info.nr_frags)
d8f823
-		tx_post_fence_nop(sq);
d8f823
-
d8f823
 	return skb;
d8f823
 
d8f823
 err_out:
d8f823
-- 
d8f823
2.13.6
d8f823