Jason Wang
2021-Dec-14 08:53 UTC
[PATCH v2 00/10] Allow for configuring max number of virtqueue pairs
On Tue, Dec 14, 2021 at 3:32 PM Eli Cohen <elic at nvidia.com> wrote:> > On Tue, Dec 14, 2021 at 11:17:00AM +0800, Jason Wang wrote: > > On Mon, Dec 13, 2021 at 10:43 PM Eli Cohen <elic at nvidia.com> wrote: > > > > > > Allow the user to configure the max number of virtqueue pairs for a vdpa > > > instance. The user can then control the actual number of virtqueue pairs > > > using ethtool. > > > > > > Example, set number of VQPs to 2: > > > $ ethtool -L ens1 combined 2 > > > > > > A user can check the max supported virtqueues for a management device by > > > runnig: > > > > > > vdpa dev show > > > vdpa-a: type network mgmtdev auxiliary/mlx5_core.sf.1 vendor_id 5555 \ > > > max_vqp 3 max_vq_size 256 max_supported_vqs 256 > > > > I think the maxsupported_vqs should be an odd number since it should > > contain control vq. > > I was thinking we should report data virtqueues. If some upstream driver > or device does not support CVQ, this should still be an even number. > > Moreover, if we want to include the CVQ, we might want to indicate that > explicitly.Can we expose driver features in this case? Thanks> > > > > > > > > and refer to this value when adding a device. > > > > > > To create a device with a max of 5 VQPs: > > > vdpa dev add name vdpa-a mgmtdev auxiliary/mlx5_core.sf.1 max_vqp 5 > > > > A question, consider the parent support both net and block, if user use > > > > vdpa dev add name vdpa-a mgmtdev auxiliary/mlx5_core.sf.1 > > > > How do we know it's a net or block device? Or do you expect some block > > specific attributes to be added? > > > > Thanks > > > > > > > > V1 -> V2: > > > 1. Do not return the index of the control VQ. Instead return an > > > indication if Ctrl VQ was negotiated. > > > 2. Do not returen conig information if FEATURES_OK is not set to avoid > > > reporting out of sync information. > > > 3. Minor fixes as described by the individual patches > > > 4. Add patches to return the max virtqueues a device is capable of > > > supporting. > > > > > > Eli Cohen (10): > > > vdpa: Provide interface to read driver features > > > vdpa/mlx5: Distribute RX virtqueues in RQT object > > > vdpa: Read device configuration only if FEATURES_OK > > > vdpa: Allow to configure max data virtqueues > > > vdpa/mlx5: Fix config_attr_mask assignment > > > vdpa/mlx5: Support configuring max data virtqueue pairs > > > vdpa: Add support for returning device configuration information > > > vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps() > > > vdpa: Support reporting max device virtqueues > > > vdpa/mlx5: Configure max supported virtqueues > > > > > > drivers/vdpa/alibaba/eni_vdpa.c | 16 +++-- > > > drivers/vdpa/ifcvf/ifcvf_main.c | 16 +++-- > > > drivers/vdpa/mlx5/net/mlx5_vnet.c | 94 +++++++++++++++++------------- > > > drivers/vdpa/vdpa.c | 42 ++++++++++++- > > > drivers/vdpa/vdpa_sim/vdpa_sim.c | 21 +++++-- > > > drivers/vdpa/vdpa_user/vduse_dev.c | 16 +++-- > > > drivers/vdpa/virtio_pci/vp_vdpa.c | 16 +++-- > > > drivers/vhost/vdpa.c | 2 +- > > > drivers/virtio/virtio_vdpa.c | 2 +- > > > include/linux/vdpa.h | 16 +++-- > > > include/uapi/linux/vdpa.h | 9 +++ > > > 11 files changed, 178 insertions(+), 72 deletions(-) > > > > > > -- > > > 2.33.1 > > > > > >