vdpa/mlx5: Distribute RX virtqueues in RQT object
authorEli Cohen <elic@nvidia.com>
Wed, 5 Jan 2022 11:46:34 +0000 (13:46 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 14 Jan 2022 23:50:53 +0000 (18:50 -0500)
commita7f46ba42485394edf9836969e220878f4908465
tree22d5c1656381efb0173d201791d936b84608eb5e
parenta64917bc2e9b1e0aa716b783c4ec879fdd280300
vdpa/mlx5: Distribute RX virtqueues in RQT object

Distribute the available rx virtqueues amongst the available RQT
entries.

RQTs require to have a power of two entries. When creating or modifying
the RQT, use the lowest number of power of two entries that is not less
than the number of rx virtqueues. Distribute them in the available
entries such that some virtqueus may be referenced twice.

This allows to configure any number of virtqueue pairs when multiqueue
is used.

Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20220105114646.577224-3-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c