int rv;
int j;
- ASSERT (os_get_cpu_number () == 0);
+ ASSERT (vlib_get_thread_index () == 0);
if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
{
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;
case VNET_DPDK_PMD_MLX5:
{
- char *pn_100g[] = { "MCX415A-CCAT", "MCX416A-CCAT", 0 };
+ char *pn_100g[] = { "MCX415A-CCAT", "MCX416A-CCAT",
+ "MCX556A-ECAT", "MCX556A-EDAT", "MCX555A-ECAT",
+ "MCX515A-CCAT", "MCX516A-CCAT", "MCX516A-CDAT", 0
+ };
char *pn_40g[] = { "MCX413A-BCAT", "MCX414A-BCAT",
"MCX415A-BCAT", "MCX416A-BCAT", "MCX4131A-BCAT", 0
};
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:
{
for (i = 0; i < nports; i++)
{
- struct rte_eth_dev_info dev_info;
- rte_eth_dev_info_get (i, &dev_info);
- if (!dev_info.driver_name)
- dev_info.driver_name = dev_info.pci_dev->driver->driver.name;
-
- ASSERT (dev_info.driver_name);
- if (strncmp (dev_info.driver_name, "rte_bond_pmd", 12) == 0)
+ xd = &dm->devices[i];
+ ASSERT (i == xd->device_index);
+ if (xd->pmd == VNET_DPDK_PMD_BOND)
{
u8 addr[6];
u8 slink[16];
int rv;
/* Get MAC of 1st slave link */
- rte_eth_macaddr_get (slink[0],
- (struct ether_addr *) addr);
+ rte_eth_macaddr_get
+ (slink[0], (struct ether_addr *) addr);
+
/* Set MAC of bounded interface to that of 1st slave link */
- rv =
- rte_eth_bond_mac_address_set (i,
- (struct ether_addr *)
- addr);
- if (rv < 0)
- clib_warning ("Failed to set MAC address");
+ clib_warning ("Set MAC for bond dev# %d", i);
+ rv = rte_eth_bond_mac_address_set
+ (i, (struct ether_addr *) addr);
+ if (rv)
+ clib_warning ("Set MAC addr failure rv=%d", rv);
/* Populate MAC of bonded interface in VPP hw tables */
- bhi =
- vnet_get_hw_interface (vnm,
- dm->devices[i].vlib_hw_if_index);
- bei =
- pool_elt_at_index (em->interfaces, bhi->hw_instance);
+ bhi = vnet_get_hw_interface
+ (vnm, dm->devices[i].vlib_hw_if_index);
+ bei = pool_elt_at_index
+ (em->interfaces, bhi->hw_instance);
clib_memcpy (bhi->hw_address, addr, 6);
clib_memcpy (bei->address, addr, 6);
+
/* Init l3 packet size allowed on bonded interface */
bhi->max_packet_bytes = ETHERNET_MAX_PACKET_BYTES;
bhi->max_l3_packet_bytes[VLIB_RX] =
dpdk_device_t *sdev = &dm->devices[slave];
vnet_hw_interface_t *shi;
vnet_sw_interface_t *ssi;
+ ethernet_interface_t *sei;
/* Add MAC to all slave links except the first one */
if (nlink)
- rte_eth_dev_mac_addr_add (slave,
- (struct ether_addr *)
- addr, 0);
+ {
+ clib_warning ("Add MAC for slave dev# %d", slave);
+ rv = rte_eth_dev_mac_addr_add
+ (slave, (struct ether_addr *) addr, 0);
+ if (rv)
+ clib_warning ("Add MAC addr failure rv=%d", rv);
+ }
/* Set slaves bitmap for bonded interface */
- bhi->bond_info =
- clib_bitmap_set (bhi->bond_info,
- sdev->vlib_hw_if_index, 1);
+ bhi->bond_info = clib_bitmap_set
+ (bhi->bond_info, sdev->vlib_hw_if_index, 1);
/* Set slave link flags on slave interface */
- shi =
- vnet_get_hw_interface (vnm, sdev->vlib_hw_if_index);
- ssi =
- vnet_get_sw_interface (vnm, sdev->vlib_sw_if_index);
+ shi = vnet_get_hw_interface
+ (vnm, sdev->vlib_hw_if_index);
+ ssi = vnet_get_sw_interface
+ (vnm, sdev->vlib_sw_if_index);
+ sei = pool_elt_at_index
+ (em->interfaces, shi->hw_instance);
+
shi->bond_info = VNET_HW_INTERFACE_BOND_INFO_SLAVE;
ssi->flags |= VNET_SW_INTERFACE_FLAG_BOND_SLAVE;
+ clib_memcpy (shi->hw_address, addr, 6);
+ clib_memcpy (sei->address, addr, 6);
/* Set l3 packet size allowed as the lowest of slave */
if (bhi->max_l3_packet_bytes[VLIB_RX] >