From 334158853cd16a6d56d98cc99bf6be3b542eae35 Mon Sep 17 00:00:00 2001 From: Alex Vesker Date: Mon, 15 Feb 2021 18:06:02 +0200 Subject: [PATCH] mlx5: DR, Force QP drain on table creation [ Upstream commit 6b8e9bc15c187f8bee973d7675736697478e2f8c ] When a table is created we first write the data to the STE anchor that represents the table and then create/register the table using a FW CREATE_FLOW_TABLE command. Since we write data using an RC QP a theoretical race can happen between FW and SW, in case the FW will allow to access the FT anchor ICM address prior to getting a CQE on the anchor write. To resolve this a force drain will be done on the QP to assure the anchor is written successfully. Fixes: 94300b3e47cb ("mlx5: Expose steering table functionality") Signed-off-by: Alex Vesker Signed-off-by: Yishai Hadas Signed-off-by: Nicolas Morey-Chaisemartin --- providers/mlx5/dr_table.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/providers/mlx5/dr_table.c b/providers/mlx5/dr_table.c index 3f3a0658e..9b2f81261 100644 --- a/providers/mlx5/dr_table.c +++ b/providers/mlx5/dr_table.c @@ -199,6 +199,10 @@ struct mlx5dv_dr_table *mlx5dv_dr_table_create(struct mlx5dv_dr_domain *dmn, if (ret) goto free_tbl; + ret = dr_send_ring_force_drain(dmn); + if (ret) + goto uninit_tbl; + ret = dr_table_create_devx_tbl(tbl); if (ret) goto uninit_tbl;