summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/dpdk/device/dpdk.h4
-rw-r--r--src/plugins/dpdk/device/format.c4
-rwxr-xr-xsrc/plugins/dpdk/device/init.c4
3 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index 6328d115b42..06d89adb3b5 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -220,8 +220,8 @@ typedef struct
dpdk_device_hqos_per_worker_thread_t *hqos_wt;
dpdk_device_hqos_per_hqos_thread_t *hqos_ht;
- /* af_packet */
- u8 af_packet_port_id;
+ /* af_packet or BondEthernet instance number */
+ u8 port_id;
struct rte_eth_link link;
f64 time_last_link_update;
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index 25a8c5cbe85..a09a3f83b57 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -177,7 +177,7 @@ format_dpdk_device_name (u8 * s, va_list * args)
break;
case VNET_DPDK_PORT_TYPE_ETH_BOND:
- return format (s, "BondEthernet%d", dm->devices[i].device_index);
+ return format (s, "BondEthernet%d", dm->devices[i].port_id);
case VNET_DPDK_PORT_TYPE_ETH_SWITCH:
device_name = "EthernetSwitch";
@@ -185,7 +185,7 @@ format_dpdk_device_name (u8 * s, va_list * args)
case VNET_DPDK_PORT_TYPE_AF_PACKET:
rte_eth_dev_info_get (i, &dev_info);
- return format (s, "af_packet%d", dm->devices[i].af_packet_port_id);
+ return format (s, "af_packet%d", dm->devices[i].port_id);
default:
case VNET_DPDK_PORT_TYPE_UNKNOWN:
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index ca9053264dc..145162ebb5a 100755
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -516,6 +516,7 @@ dpdk_lib_init (dpdk_main_t * dm)
u32 next_cpu = 0, next_hqos_cpu = 0;
u8 af_packet_port_id = 0;
+ u8 bond_ether_port_id = 0;
last_pci_addr.as_u32 = ~0;
dm->input_cpu_first_index = 0;
@@ -862,12 +863,13 @@ dpdk_lib_init (dpdk_main_t * dm)
case VNET_DPDK_PMD_AF_PACKET:
xd->port_type = VNET_DPDK_PORT_TYPE_AF_PACKET;
- xd->af_packet_port_id = af_packet_port_id++;
+ xd->port_id = af_packet_port_id++;
break;
case VNET_DPDK_PMD_BOND:
xd->flags |= DPDK_DEVICE_FLAG_PMD_SUPPORTS_PTYPE;
xd->port_type = VNET_DPDK_PORT_TYPE_ETH_BOND;
+ xd->port_id = bond_ether_port_id++;
break;
default: