src/dpdk/drivers/net/bonding/rte_eth_bond_pmd.c
int
slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
		uint16_t slave_port_id)
{
	int i, ret;
	struct rte_ether_addr *mac_addr;

	for (i = 1; i < BOND_MAX_MAC_ADDRS; i++) {
		mac_addr = &bonded_eth_dev->data->mac_addrs[i];
		if (rte_is_same_ether_addr(mac_addr, &null_mac_addr))
			break;

		ret = rte_eth_dev_mac_addr_add(slave_port_id, mac_addr, 0);
		if (ret < 0) {
			/* rollback */
			for (i--; i > 0; i--)
				rte_eth_dev_mac_addr_remove(slave_port_id,
					&bonded_eth_dev->data->mac_addrs[i]);
			return ret;
		}
	}

	return 0;
}
/*
 * Add additional MAC addresses to the slave
 */
Add additional MAC addresses to the slave
Add additional MAC addresses to the slave
int
slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
		uint16_t slave_port_id)
{
	int i, ret;
	struct rte_ether_addr *mac_addr;
	for (i = 1; i < BOND_MAX_MAC_ADDRS; i++) {
		mac_addr = &bonded_eth_dev->data->mac_addrs[i];
		if (rte_is_same_ether_addr(mac_addr, &null_mac_addr))
			break;
		ret = rte_eth_dev_mac_addr_add(slave_port_id, mac_addr, 0);
		if (ret < 0) {
			for (i--; i > 0; i--)
				rte_eth_dev_mac_addr_remove(slave_port_id,
					&bonded_eth_dev->data->mac_addrs[i]);
			return ret;
		}
	}
	return 0;
}
int slave_add_mac_addresses ( struct rte_eth_dev * bonded_eth_dev , uint16_t slave_port_id ) { int i , ret ; struct rte_ether_addr * mac_addr ; for ( i = 1 ; i < BOND_MAX_MAC_ADDRS ; i ++ ) { mac_addr = & bonded_eth_dev -> data -> mac_addrs [ i ] ; if ( rte_is_same_ether_addr ( mac_addr , & null_mac_addr ) ) break ; ret = rte_eth_dev_mac_addr_add ( slave_port_id , mac_addr , 0 ) ; if ( ret < 0 ) { for ( i -- ; i > 0 ; i -- ) rte_eth_dev_mac_addr_remove ( slave_port_id , & bonded_eth_dev -> data -> mac_addrs [ i ] ) ; return ret ; } } return 0 ; }
Add additional MAC addresses to the slave
Add additional MAC addresses to the slave
/* rollback */