aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-05-08 18:19:45 +0200
committerChris Luke <chris_luke@comcast.com>2017-05-08 20:29:40 +0000
commit1ea82dfe5dabb0f9bbfa5ba953ef31328c987b89 (patch)
treebfdab60f531e58813b71691cb0f8ca20d59247c9 /src/plugins/dpdk
parent3c785e09a039a20517dd9aab9c32d121a19f9d38 (diff)
dpdk: use speed_capa to detect i40e device speed
Change-Id: I1decca6fb5ce6de74ccbcd5a262ebd3db6f55cdc Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk')
-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 53f79ff2d30..8dbc0915dbc 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 93eca524380..389cd8b6c33 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 2d21bfd91ca..c45edc9ba63 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: