net/bonding: set dev_started later
Subsystems (2)
PATCH 1/1 net/bonding: set dev_started later
From: "Charles (Chas) Williams" <[email protected]>
There are several error paths where the bonding device may not start. Don't set dev_started until we know that we are sure start is going to succeed.
--- drivers/net/bonding/rte_eth_bond_pmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_pmd.c +3 -1
@@ -2028,7 +2028,6 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) } eth_dev->data->dev_link.link_status =ETH_LINK_DOWN ; - eth_dev->data->dev_started =1 ; internals = eth_dev->data->dev_private;
@@ -2089,6 +2088,9 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)if (internals->slaves[i].link_status_poll_enabled) internals->link_status_polling_enabled =1 ; } + + eth_dev->data->dev_started =1 ; +/* start polling if needed */ if (internals->link_status_polling_enabled) { rte_eal_alarm_set(
Signature · 1 line
2.13.6
PATCH v2 1/1 net/bonding: clear dev_started if start fails
From: "Charles (Chas) Williams" <[email protected]>
There are several error paths where the bonding device may not start. Clear dev_started before we return if we take one of these paths.
--- drivers/net/bonding/rte_eth_bond_pmd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/bonding/rte_eth_bond_pmd.c +10 -5
@@ -2034,7 +2034,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)if (internals->slave_count ==0 ) {RTE_BOND_LOG (ERR ,"Cannot start port since there are no slave devices" ); -return -1 ; + goto out_err; }if (internals->user_defined_mac ==0 ) {
@@ -2045,18 +2045,18 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) new_mac_addr = &internals->slaves[i].persisted_mac_addr;if (new_mac_addr ==NULL ) -return -1 ; + goto out_err;if (mac_address_set (eth_dev, new_mac_addr) !=0 ) {RTE_BOND_LOG (ERR ,"bonded port (%d) failed to update MAC address" , eth_dev->data->port_id); -return -1 ; + goto out_err; } }/* Update all slave devices MACs*/ if (mac_address_slaves_update (eth_dev) !=0 ) -return -1 ; + goto out_err;/* If bonded device is configure in promiscuous mode then re-apply config */ if (internals->promiscuous_en)
@@ -2081,7 +2081,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)"bonded port (%d) failed to reconfigure slave device (%d)" , eth_dev->data->port_id, internals->slaves[i].port_id); -return -1 ; + goto out_err; }/* We will need to poll for link status if any slave doesn't * support interrupts
@@ -2089,6 +2089,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)if (internals->slaves[i].link_status_poll_enabled) internals->link_status_polling_enabled =1 ; } +/* start polling if needed */ if (internals->link_status_polling_enabled) { rte_eal_alarm_set(
@@ -2108,6 +2109,10 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)bond_tlb_enable (internals);return 0 ; + +out_err: + eth_dev->data->dev_started =0 ; +return -1 ; } static void
Signature · 1 line
2.13.6
Re: [PATCH v2] net/bonding: clear dev_started if start fails
Quoted 11 lines · Chas Williams
From: "Charles (Chas) Williams" <[email protected]>
There are several error paths where the bonding device may not start. Clear
dev_startedbefore we return if we take one of these paths.Fixes 2efb58cbab ("bond: new link bonding library")Signed-off-by Chas Williams <[email protected]>---
Ferruh Yigit
AppliedRe: [dpdk-stable] [PATCH v2] net/bonding: clear dev_started if start fails
Quoted 8 lines · Radu Nicolau
Quoted 5 lines · Chas Williams
From: "Charles (Chas) Williams" <[email protected]>
There are several error paths where the bonding device may not start. Clear
dev_startedbefore we return if we take one of these paths.
Quoted 7 lines
Quoted 6 lines
Fixes 2efb58cbab ("bond: new link bonding library")Signed-off-by Chas Williams <[email protected]>---
Acked-by Radu Nicolau <[email protected]>
Applied to dpdk-next-net/master, thanks.
Quoted 10 lines · Chas Williams
From: "Charles (Chas) Williams" <[email protected]>
There are several error paths where the bonding device may not start. Don't set
dev_starteduntil we know that we are sure start is going to succeed.Fixes 2efb58cbab ("bond: new link bonding library")Signed-off-by Chas Williams <[email protected]>
Hi Chas,
Is this patch still valid to consider for v18.08?
Chas Williams
Acked-by Radu NicolauNo. This was fixed by
net/bonding: clear started state if start fails
There are several error paths where the bonding device may not start. Clear dev_started before we return if we take one of these paths.
which was less clumsy attempt at the fix.
Quoted 17 lines · Ferruh Yigit
Quoted 10 lines · Chas Williams
From: "Charles (Chas) Williams" <[email protected]>
There are several error paths where the bonding device may not start. Don't set
dev_starteduntil we know that we are sure start is going to succeed.Fixes 2efb58cbab ("bond: new link bonding library")Signed-off-by Chas Williams <[email protected]>Hi Chas,
Is this patch still valid to consider for v18.08?