From 5c89c420861ab938151f0bb0a298bb04d590ff2b Mon Sep 17 00:00:00 2001 From: Mohammed Hawari Date: Wed, 17 May 2017 15:52:02 +0200 Subject: Added support for Virtio-user interfaces by means of a new VNET_DPDK_PORT_TYPE. Change-Id: I101e32cee8d9de51227b39ec2639c9fb44da1e6c Signed-off-by: Mohammed Hawari --- src/plugins/dpdk/device/dpdk.h | 5 ++++- src/plugins/dpdk/device/format.c | 8 ++++++++ src/plugins/dpdk/device/init.c | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h index ab5da567..d82ba5dd 100644 --- a/src/plugins/dpdk/device/dpdk.h +++ b/src/plugins/dpdk/device/dpdk.h @@ -73,7 +73,9 @@ extern vlib_node_registration_t dpdk_input_node; _ ("net_cxgbe", CXGBE) \ _ ("net_mlx4", MLX4) \ _ ("net_mlx5", MLX5) \ - _ ("net_dpaa2", DPAA2) + _ ("net_dpaa2", DPAA2) \ + _ ("net_virtio_user", VIRTIO_USER) + typedef enum { @@ -95,6 +97,7 @@ typedef enum VNET_DPDK_PORT_TYPE_ETH_SWITCH, VNET_DPDK_PORT_TYPE_AF_PACKET, VNET_DPDK_PORT_TYPE_ETH_VF, + VNET_DPDK_PORT_TYPE_VIRTIO_USER, 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 8fe66891..c4ddbe24 100644 --- a/src/plugins/dpdk/device/format.c +++ b/src/plugins/dpdk/device/format.c @@ -205,6 +205,10 @@ format_dpdk_device_name (u8 * s, va_list * args) rte_eth_dev_info_get (i, &dev_info); return format (s, "af_packet%d", dm->devices[i].port_id); + case VNET_DPDK_PORT_TYPE_VIRTIO_USER: + device_name = "VirtioUser"; + break; + default: case VNET_DPDK_PORT_TYPE_UNKNOWN: device_name = "UnknownEthernet"; @@ -302,6 +306,10 @@ format_dpdk_device_type (u8 * s, va_list * args) dev_type = "NXP DPAA2 Mac"; break; + case VNET_DPDK_PMD_VIRTIO_USER: + dev_type = "Virtio User"; + break; + default: case VNET_DPDK_PMD_UNKNOWN: dev_type = "### UNKNOWN ###"; diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index a972394c..90968075 100755 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -410,6 +410,10 @@ dpdk_lib_init (dpdk_main_t * dm) xd->port_id = bond_ether_port_id++; break; + case VNET_DPDK_PMD_VIRTIO_USER: + xd->port_type = VNET_DPDK_PORT_TYPE_VIRTIO_USER; + break; + default: xd->port_type = VNET_DPDK_PORT_TYPE_UNKNOWN; } -- cgit 1.2.3-korg