[dpdk-dev] bonding: fix initialisation of current_primary_port

Message ID 1458754205-11261-1-git-send-email-bernard.iremonger@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Iremonger, Bernard March 23, 2016, 5:30 p.m. UTC
  The current_primary_port is initialised to an invalid value
during bonded device creation.
It should be set to a valid value later.
This fix sets it to a valid value when the first slave port
is added to the bonding device.

Fixes: 2efb58cbab6e ("bond: new link bonding library")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/bonding/rte_eth_bond_api.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Bruce Richardson March 25, 2016, 2:09 p.m. UTC | #1
On Wed, Mar 23, 2016 at 05:30:05PM +0000, Bernard Iremonger wrote:
> The current_primary_port is initialised to an invalid value
> during bonded device creation.
> It should be set to a valid value later.
> This fix sets it to a valid value when the first slave port
> is added to the bonding device.
> 
> Fixes: 2efb58cbab6e ("bond: new link bonding library")
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied to dpdk-next-net/rel_16_04

/Bruce
  

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 3fca764..d473ac2 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -352,6 +352,7 @@  __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)
 
 		/* Make primary slave */
 		internals->primary_port = slave_port_id;
+		internals->current_primary_port = slave_port_id;
 
 		/* Inherit queues settings from first slave */
 		internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues;