X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fbonding%2Frte_eth_bond_pmd.c;h=707a0f3cdd73377ea08f71b45d35f33d4ef8815a;hb=f9dd7539423b32c17c5b411260e696570fec4e2c;hp=e1034e7ccf1235a1aead42d71db0ea482a7b9628;hpb=73e83bf50015f77b84008d26d9a53e7119cb3041;p=dpdk.git diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index e1034e7ccf..707a0f3cdd 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -21,8 +21,8 @@ #include #include "rte_eth_bond.h" -#include "rte_eth_bond_private.h" -#include "rte_eth_bond_8023ad_private.h" +#include "eth_bond_private.h" +#include "eth_bond_8023ad_private.h" #define REORDER_PERIOD_MS 10 #define DEFAULT_POLLING_INTERVAL_10_MS (10) @@ -2439,7 +2439,8 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) bond_ctx->mode4.slave_link.link_autoneg; ethdev->data->dev_link.link_duplex = bond_ctx->mode4.slave_link.link_duplex; - /* fall through to update link speed */ + /* fall through */ + /* to update link speed */ case BONDING_MODE_ROUND_ROBIN: case BONDING_MODE_BALANCE: case BONDING_MODE_TLB: @@ -2642,12 +2643,12 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev) return ret; } -static void +static int bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev) { struct bond_dev_private *internals = eth_dev->data->dev_private; int i; - int ret; + int ret = 0; uint16_t port_id; switch (internals->mode) { @@ -2655,7 +2656,9 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev) case BONDING_MODE_ROUND_ROBIN: case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: - case BONDING_MODE_8023AD: + case BONDING_MODE_8023AD: { + unsigned int slave_ok = 0; + for (i = 0; i < internals->slave_count; i++) { port_id = internals->slaves[i].port_id; @@ -2664,8 +2667,17 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev) RTE_BOND_LOG(ERR, "Failed to enable allmulti mode for port %u: %s", port_id, rte_strerror(-ret)); + else + slave_ok++; } + /* + * Report success if operation is successful on at least + * on one slave. Otherwise return last error code. + */ + if (slave_ok > 0) + ret = 0; break; + } /* allmulti mode is propagated only to primary slave */ case BONDING_MODE_ACTIVE_BACKUP: case BONDING_MODE_TLB: @@ -2681,14 +2693,16 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev) "Failed to enable allmulti mode for port %u: %s", port_id, rte_strerror(-ret)); } + + return ret; } -static void +static int bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev) { struct bond_dev_private *internals = eth_dev->data->dev_private; int i; - int ret; + int ret = 0; uint16_t port_id; switch (internals->mode) { @@ -2696,7 +2710,9 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev) case BONDING_MODE_ROUND_ROBIN: case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: - case BONDING_MODE_8023AD: + case BONDING_MODE_8023AD: { + unsigned int slave_ok = 0; + for (i = 0; i < internals->slave_count; i++) { uint16_t port_id = internals->slaves[i].port_id; @@ -2710,8 +2726,17 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev) RTE_BOND_LOG(ERR, "Failed to disable allmulti mode for port %u: %s", port_id, rte_strerror(-ret)); + else + slave_ok++; } + /* + * Report success if operation is successful on at least + * on one slave. Otherwise return last error code. + */ + if (slave_ok > 0) + ret = 0; break; + } /* allmulti mode is propagated only to primary slave */ case BONDING_MODE_ACTIVE_BACKUP: case BONDING_MODE_TLB: @@ -2727,6 +2752,8 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev) "Failed to disable allmulti mode for port %u: %s", port_id, rte_strerror(-ret)); } + + return ret; } static void