Skip to content

Commit 4bd1d5d

Browse files
author
Mohammad Kabat
committed
net/mlx5: ASO, Create the ASO SQ with the correct timestamp format
Bugzilla: https://bugzilla.redhat.com/2112947 Upstream-status: v6.1-rc3 commit 0f3caaa Author: Saeed Mahameed <saeedm@nvidia.com> Date: Wed Oct 26 14:51:44 2022 +0100 net/mlx5: ASO, Create the ASO SQ with the correct timestamp format mlx5 SQs must select the timestamp format explicitly according to the active clock mode, select the current active timestamp mode so ASO SQ create will succeed. This fixes the following error prints when trying to create ipsec ASO SQ while the timestamp format is real time mode. mlx5_cmd_out_err:778:(pid 34874): CREATE_SQ(0x904) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0xd61c0b), err(-22) mlx5_aso_create_sq:285:(pid 34874): Failed to open aso wq sq, err=-22 mlx5e_ipsec_init:436:(pid 34874): IPSec initialization failed, -22 Fixes: cdd04f4 ("net/mlx5: Add support to create SQ and CQ for ASO") Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Reported-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Link: https://lore.kernel.org/r/20221026135153.154807-7-saeed@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Mohammad Kabat <mkabat@redhat.com>
1 parent 0bed820 commit 4bd1d5d

File tree

1 file changed

+7
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/lib

1 file changed

+7
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <linux/mlx5/device.h>
55
#include <linux/mlx5/transobj.h>
6+
#include "clock.h"
67
#include "aso.h"
78
#include "wq.h"
89

@@ -179,6 +180,7 @@ static int create_aso_sq(struct mlx5_core_dev *mdev, int pdn,
179180
{
180181
void *in, *sqc, *wq;
181182
int inlen, err;
183+
u8 ts_format;
182184

183185
inlen = MLX5_ST_SZ_BYTES(create_sq_in) +
184186
sizeof(u64) * sq->wq_ctrl.buf.npages;
@@ -195,6 +197,11 @@ static int create_aso_sq(struct mlx5_core_dev *mdev, int pdn,
195197
MLX5_SET(sqc, sqc, state, MLX5_SQC_STATE_RST);
196198
MLX5_SET(sqc, sqc, flush_in_error_en, 1);
197199

200+
ts_format = mlx5_is_real_time_sq(mdev) ?
201+
MLX5_TIMESTAMP_FORMAT_REAL_TIME :
202+
MLX5_TIMESTAMP_FORMAT_FREE_RUNNING;
203+
MLX5_SET(sqc, sqc, ts_format, ts_format);
204+
198205
MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_CYCLIC);
199206
MLX5_SET(wq, wq, uar_page, mdev->mlx5e_res.hw_objs.bfreg.index);
200207
MLX5_SET(wq, wq, log_wq_pg_sz, sq->wq_ctrl.buf.page_shift -

0 commit comments

Comments
 (0)