static int
bond_mode_8023ad_register_lacp_mac(uint16_t slave_id)
{
+ int ret;
+
rte_eth_allmulticast_enable(slave_id);
if (rte_eth_allmulticast_get(slave_id)) {
RTE_BOND_LOG(DEBUG, "forced allmulti for port %u",
return 0;
}
- rte_eth_promiscuous_enable(slave_id);
+ ret = rte_eth_promiscuous_enable(slave_id);
+ if (ret != 0) {
+ RTE_BOND_LOG(ERR,
+ "failed to enable promiscuous mode for port %u: %s",
+ slave_id, rte_strerror(-ret));
+ }
if (rte_eth_promiscuous_get(slave_id)) {
RTE_BOND_LOG(DEBUG, "forced promiscuous for port %u",
slave_id);
static void
bond_mode_8023ad_unregister_lacp_mac(uint16_t slave_id)
{
+ int ret;
+
switch (bond_mode_8023ad_ports[slave_id].forced_rx_flags) {
case BOND_8023AD_FORCED_ALLMULTI:
RTE_BOND_LOG(DEBUG, "unset allmulti for port %u", slave_id);
case BOND_8023AD_FORCED_PROMISC:
RTE_BOND_LOG(DEBUG, "unset promisc for port %u", slave_id);
- rte_eth_promiscuous_disable(slave_id);
+ ret = rte_eth_promiscuous_disable(slave_id);
+ if (ret != 0)
+ RTE_BOND_LOG(ERR,
+ "failed to disable promiscuous mode for port %u: %s",
+ slave_id, rte_strerror(-ret));
break;
default:
{
struct bond_dev_private *internals = eth_dev->data->dev_private;
int i;
+ int ret = 0;
+ uint16_t port_id;
switch (internals->mode) {
/* Promiscuous mode is propagated to all slaves */
case BONDING_MODE_BROADCAST:
case BONDING_MODE_8023AD:
for (i = 0; i < internals->slave_count; i++) {
- uint16_t port_id = internals->slaves[i].port_id;
+ port_id = internals->slaves[i].port_id;
- rte_eth_promiscuous_enable(port_id);
+ ret = rte_eth_promiscuous_enable(port_id);
+ if (ret != 0)
+ RTE_BOND_LOG(ERR,
+ "Failed to enable promiscuous mode for port %u: %s",
+ port_id, rte_strerror(-ret));
}
break;
/* Promiscuous mode is propagated only to primary slave */
/* Do not touch promisc when there cannot be primary ports */
if (internals->slave_count == 0)
break;
- rte_eth_promiscuous_enable(internals->current_primary_port);
+ port_id = internals->current_primary_port;
+ ret = rte_eth_promiscuous_enable(port_id);
+ if (ret != 0)
+ RTE_BOND_LOG(ERR,
+ "Failed to enable promiscuous mode for port %u: %s",
+ port_id, rte_strerror(-ret));
}
}
{
struct bond_dev_private *internals = dev->data->dev_private;
int i;
+ int ret;
+ uint16_t port_id;
switch (internals->mode) {
/* Promiscuous mode is propagated to all slaves */
case BONDING_MODE_BROADCAST:
case BONDING_MODE_8023AD:
for (i = 0; i < internals->slave_count; i++) {
- uint16_t port_id = internals->slaves[i].port_id;
+ port_id = internals->slaves[i].port_id;
if (internals->mode == BONDING_MODE_8023AD &&
bond_mode_8023ad_ports[port_id].forced_rx_flags ==
BOND_8023AD_FORCED_PROMISC)
continue;
- rte_eth_promiscuous_disable(port_id);
+ ret = rte_eth_promiscuous_disable(port_id);
+ if (ret != 0)
+ RTE_BOND_LOG(ERR,
+ "Failed to disable promiscuous mode for port %u: %s",
+ port_id, rte_strerror(-ret));
}
break;
/* Promiscuous mode is propagated only to primary slave */
/* Do not touch promisc when there cannot be primary ports */
if (internals->slave_count == 0)
break;
- rte_eth_promiscuous_disable(internals->current_primary_port);
+ port_id = internals->current_primary_port;
+ ret = rte_eth_promiscuous_disable(port_id);
+ if (ret != 0)
+ RTE_BOND_LOG(ERR,
+ "Failed to disable promiscuous mode for port %u: %s",
+ port_id, rte_strerror(-ret));
}
}