ofed: fix rwq buffer allocation

Fixes a wrong rwq->buf_size assignment. The field was assigned 0 upon a
successful call to ibv_init_wq.

Fixes:		a687910fc4
Sponsored by:	Juniper Networks, Inc.
MFC after:	1 week
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45833
This commit is contained in:
Ka Ho Ng 2024-07-03 13:32:06 -04:00
parent 07d359787f
commit 25ef056f74

View file

@ -2077,6 +2077,10 @@ struct ibv_wq *mlx5_create_wq(struct ibv_context *context,
if (!rwq)
return NULL;
ret = ibv_init_wq(&rwq->wq);
if (ret < 0)
goto err;
rwq->wq_sig = rwq_sig_enabled(context);
if (rwq->wq_sig)
cmd.drv.flags = MLX5_RWQ_FLAG_SIGNATURE;
@ -2084,13 +2088,9 @@ struct ibv_wq *mlx5_create_wq(struct ibv_context *context,
ret = mlx5_calc_rwq_size(ctx, rwq, attr);
if (ret < 0) {
errno = -ret;
goto err;
goto err_cleanup_wq;
}
ret = ibv_init_wq(&rwq->wq);
if (ret < 0)
goto err;
rwq->buf_size = ret;
if (mlx5_alloc_rwq_buf(context, rwq, ret))
goto err_cleanup_wq;