]> git.baikalelectronics.ru Git - kernel.git/commit
vdpa/mlx5: Fix MQ to support non power of two num queues
authorEli Cohen <elic@nvidia.com>
Mon, 12 Sep 2022 12:50:19 +0000 (15:50 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 27 Sep 2022 22:32:45 +0000 (18:32 -0400)
commit47bca5b2b43a2c0dc2b8f3491facd1f3fe18fdbb
tree322fb3cf0275d89bdb24516dc537bf806acbe090
parent52635c092b829e1176d4d73a6c2ccf0cb300e7ef
vdpa/mlx5: Fix MQ to support non power of two num queues

RQT objects require that a power of two value be configured for both
rqt_max_size and rqt_actual size.

For create_rqt, make sure to round up to the power of two the value of
given by the user who created the vdpa device and given by
ndev->rqt_size. The actual size is also rounded up to the power of two
using the current number of VQs given by ndev->cur_num_vqs.

Same goes with modify_rqt where we need to make sure act size is power
of two based on the new number of QPs.

Without this patch, attempt to create a device with non power of two QPs
would result in error from firmware.

Fixes: b4cb1a4cf42c ("vdpa/mlx5: Add multiqueue support")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Message-Id: <20220912125019.833708-1-elic@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c