vDPA/ifcvf: enable multiqueue and control vq
authorZhu Lingshan <lingshan.zhu@intel.com>
Wed, 18 Aug 2021 09:57:14 +0000 (17:57 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 5 Sep 2021 20:23:07 +0000 (16:23 -0400)
This commit enbales multi-queue and control vq
features for ifcvf

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Link: https://lore.kernel.org/r/20210818095714.3220-3-lingshan.zhu@intel.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
drivers/vdpa/ifcvf/ifcvf_base.h
drivers/vdpa/ifcvf/ifcvf_main.c

index 97d9019..09918af 100644 (file)
 #define N3000_DEVICE_ID                0x1041
 #define N3000_SUBSYS_DEVICE_ID 0x001A
 
-#define IFCVF_NET_SUPPORTED_FEATURES \
-               ((1ULL << VIRTIO_NET_F_MAC)                     | \
-                (1ULL << VIRTIO_F_ANY_LAYOUT)                  | \
-                (1ULL << VIRTIO_F_VERSION_1)                   | \
-                (1ULL << VIRTIO_NET_F_STATUS)                  | \
-                (1ULL << VIRTIO_F_ORDER_PLATFORM)              | \
-                (1ULL << VIRTIO_F_ACCESS_PLATFORM)             | \
-                (1ULL << VIRTIO_NET_F_MRG_RXBUF))
-
 /* Max 8 data queue pairs(16 queues) and one control vq for now. */
 #define IFCVF_MAX_QUEUES       17
 
index 37675c9..bfc3d7d 100644 (file)
@@ -174,17 +174,12 @@ static u64 ifcvf_vdpa_get_features(struct vdpa_device *vdpa_dev)
        struct ifcvf_adapter *adapter = vdpa_to_adapter(vdpa_dev);
        struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev);
        struct pci_dev *pdev = adapter->pdev;
-
+       u32 type = vf->dev_type;
        u64 features;
 
-       switch (vf->dev_type) {
-       case VIRTIO_ID_NET:
-               features = ifcvf_get_features(vf) & IFCVF_NET_SUPPORTED_FEATURES;
-               break;
-       case VIRTIO_ID_BLOCK:
+       if (type == VIRTIO_ID_NET || type == VIRTIO_ID_BLOCK)
                features = ifcvf_get_features(vf);
-               break;
-       default:
+       else {
                features = 0;
                IFCVF_ERR(pdev, "VIRTIO ID %u not supported\n", vf->dev_type);
        }