aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/dpdk/device/dpdk.h1
-rw-r--r--src/plugins/dpdk/device/format.c4
-rwxr-xr-xsrc/plugins/dpdk/device/init.c27
3 files changed, 13 insertions, 19 deletions
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index 53f79ff2..8dbc0915 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -108,6 +108,7 @@ typedef enum
{
VNET_DPDK_PORT_TYPE_ETH_1G,
VNET_DPDK_PORT_TYPE_ETH_10G,
+ VNET_DPDK_PORT_TYPE_ETH_25G,
VNET_DPDK_PORT_TYPE_ETH_40G,
VNET_DPDK_PORT_TYPE_ETH_100G,
VNET_DPDK_PORT_TYPE_ETH_BOND,
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index 93eca524..389cd8b6 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -168,6 +168,10 @@ format_dpdk_device_name (u8 * s, va_list * args)
device_name = "TenGigabitEthernet";
break;
+ case VNET_DPDK_PORT_TYPE_ETH_25G:
+ device_name = "TwentyFiveGigabitEthernet";
+ break;
+
case VNET_DPDK_PORT_TYPE_ETH_40G:
device_name = "FortyGigabitEthernet";
break;
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 2d21bfd9..c45edc9b 100755
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -444,25 +444,14 @@ dpdk_lib_init (dpdk_main_t * dm)
xd->flags |= DPDK_DEVICE_FLAG_PMD_SUPPORTS_PTYPE;
xd->port_type = VNET_DPDK_PORT_TYPE_ETH_40G;
- switch (dev_info.pci_dev->id.device_id)
- {
- case I40E_DEV_ID_10G_BASE_T:
- case I40E_DEV_ID_SFP_XL710:
- xd->port_type = VNET_DPDK_PORT_TYPE_ETH_10G;
- break;
- case I40E_DEV_ID_QSFP_A:
- case I40E_DEV_ID_QSFP_B:
- case I40E_DEV_ID_QSFP_C:
- xd->port_type = VNET_DPDK_PORT_TYPE_ETH_40G;
- break;
- case I40E_DEV_ID_VF:
- rte_eth_link_get_nowait (i, &l);
- xd->port_type = l.link_speed == 10000 ?
- VNET_DPDK_PORT_TYPE_ETH_10G : VNET_DPDK_PORT_TYPE_ETH_40G;
- break;
- default:
- xd->port_type = VNET_DPDK_PORT_TYPE_UNKNOWN;
- }
+ if (dev_info.speed_capa & ETH_LINK_SPEED_40G)
+ xd->port_type = VNET_DPDK_PORT_TYPE_ETH_40G;
+ else if (dev_info.speed_capa & ETH_LINK_SPEED_25G)
+ xd->port_type = VNET_DPDK_PORT_TYPE_ETH_25G;
+ else if (dev_info.speed_capa & ETH_LINK_SPEED_10G)
+ xd->port_type = VNET_DPDK_PORT_TYPE_ETH_10G;
+ else
+ xd->port_type = VNET_DPDK_PORT_TYPE_UNKNOWN;
break;
case VNET_DPDK_PMD_CXGBE: