[ovs-dev] [PATCH v3 4/5] netdev-dpdk: Add vhost-user 'get_features' & 'get_status' functions

Ciara Loftus ciara.loftus at intel.com
Thu Jul 28 16:21:14 UTC 2016


Implementations for the netdev functions 'get_features' and
'get_status' are now available for vhost-user thanks to the addition of
the vHost PMD.

Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
---
 lib/netdev-dpdk.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index d6ceeec..f843902 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1964,15 +1964,18 @@ netdev_dpdk_get_status(const struct netdev *netdev, struct smap *args)
     smap_add_format(args, "max_rx_queues", "%u", dev_info.max_rx_queues);
     smap_add_format(args, "max_tx_queues", "%u", dev_info.max_tx_queues);
     smap_add_format(args, "max_mac_addrs", "%u", dev_info.max_mac_addrs);
-    smap_add_format(args, "max_hash_mac_addrs", "%u", dev_info.max_hash_mac_addrs);
-    smap_add_format(args, "max_vfs", "%u", dev_info.max_vfs);
-    smap_add_format(args, "max_vmdq_pools", "%u", dev_info.max_vmdq_pools);
 
-    if (dev_info.pci_dev) {
-        smap_add_format(args, "pci-vendor_id", "0x%u",
-                        dev_info.pci_dev->id.vendor_id);
-        smap_add_format(args, "pci-device_id", "0x%x",
-                        dev_info.pci_dev->id.device_id);
+    if (dev->type == DPDK_DEV_ETH) {
+        smap_add_format(args, "max_hash_mac_addrs", "%u",
+                        dev_info.max_hash_mac_addrs);
+        smap_add_format(args, "max_vfs", "%u", dev_info.max_vfs);
+        smap_add_format(args, "max_vmdq_pools", "%u", dev_info.max_vmdq_pools);
+        if (dev_info.pci_dev) {
+            smap_add_format(args, "pci-vendor_id", "0x%u",
+                            dev_info.pci_dev->id.vendor_id);
+            smap_add_format(args, "pci-device_id", "0x%x",
+                            dev_info.pci_dev->id.device_id);
+        }
     }
 
     return 0;
@@ -3028,8 +3031,8 @@ static const struct netdev_class OVS_UNUSED dpdk_vhost_class =
         netdev_dpdk_vhost_send,
         netdev_dpdk_get_carrier,
         netdev_dpdk_get_stats,
-        NULL,
-        NULL,
+        netdev_dpdk_get_features,
+        netdev_dpdk_get_status,
         netdev_dpdk_vhost_reconfigure,
         netdev_dpdk_rxq_recv);
 
-- 
2.4.3




More information about the dev mailing list