From 2504ac699e423f1ca840a63247ce55cb27735e0a Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 27 Jul 2017 14:54:44 -0700 Subject: devices: Display VhostEthernet instead of UnknownEthernet for dpdk net_vhost driver Added a new macro VNET_DPDK_PORT_TYPE_VHOST_ETHER for dpdk net_vhost driver to display VhostEthernet instead of UnknownEthernet. Change-Id: Ie407d83ebbbd60e4d11be79f0ebc44e2867a5f3b Signed-off-by: Steven --- src/plugins/dpdk/device/dpdk.h | 5 +++-- src/plugins/dpdk/device/format.c | 7 +++++++ src/plugins/dpdk/device/init.c | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h index 1e34e3fb..849e687b 100644 --- a/src/plugins/dpdk/device/dpdk.h +++ b/src/plugins/dpdk/device/dpdk.h @@ -75,8 +75,8 @@ extern vlib_node_registration_t dpdk_input_node; _ ("net_mlx4", MLX4) \ _ ("net_mlx5", MLX5) \ _ ("net_dpaa2", DPAA2) \ - _ ("net_virtio_user", VIRTIO_USER) - + _ ("net_virtio_user", VIRTIO_USER) \ + _ ("net_vhost", VHOST_ETHER) typedef enum { @@ -100,6 +100,7 @@ typedef enum VNET_DPDK_PORT_TYPE_AF_PACKET, VNET_DPDK_PORT_TYPE_ETH_VF, VNET_DPDK_PORT_TYPE_VIRTIO_USER, + VNET_DPDK_PORT_TYPE_VHOST_ETHER, VNET_DPDK_PORT_TYPE_UNKNOWN, } dpdk_port_type_t; diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c index cfe8851f..21475ac9 100644 --- a/src/plugins/dpdk/device/format.c +++ b/src/plugins/dpdk/device/format.c @@ -213,6 +213,10 @@ format_dpdk_device_name (u8 * s, va_list * args) device_name = "VirtioUser"; break; + case VNET_DPDK_PORT_TYPE_VHOST_ETHER: + device_name = "VhostEthernet"; + break; + default: case VNET_DPDK_PORT_TYPE_UNKNOWN: device_name = "UnknownEthernet"; @@ -316,6 +320,9 @@ format_dpdk_device_type (u8 * s, va_list * args) case VNET_DPDK_PMD_THUNDERX: dev_type = "Cavium ThunderX"; + + case VNET_DPDK_PMD_VHOST_ETHER: + dev_type = "VhostEthernet"; break; default: diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 59df808d..95176fb8 100755 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -420,6 +420,10 @@ dpdk_lib_init (dpdk_main_t * dm) xd->port_type = VNET_DPDK_PORT_TYPE_VIRTIO_USER; break; + case VNET_DPDK_PMD_VHOST_ETHER: + xd->port_type = VNET_DPDK_PORT_TYPE_VHOST_ETHER; + break; + default: xd->port_type = VNET_DPDK_PORT_TYPE_UNKNOWN; } -- cgit 1.2.3-korg