[dpdk-dev] net/bonding: set dev_started later

Message ID 20180316163441.31898-1-3chas3@gmail.com (mailing list archive)
State Rejected, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Chas Williams March 16, 2018, 4:34 p.m. UTC
  From: "Charles (Chas) Williams" <chas3@att.com>

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.

Fixes: 2efb58cbab ("bond: new link bonding library")
Cc: stable@dpdk.org

Signed-off-by: Chas Williams <chas3@att.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit June 14, 2018, 5:10 p.m. UTC | #1
On 3/16/2018 4:34 PM, Chas Williams wrote:
> From: "Charles (Chas) Williams" <chas3@att.com>
> 
> 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.
> 
> Fixes: 2efb58cbab ("bond: new link bonding library")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chas Williams <chas3@att.com>

Hi Chas,

Is this patch still valid to consider for v18.08?
  
Chas Williams June 14, 2018, 8:22 p.m. UTC | #2
No.  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.

    Fixes: 2efb58cbab6e ("bond: new link bonding library")
    Cc: stable@dpdk.org

    Signed-off-by: Chas Williams <chas3@att.com>
    Acked-by: Radu Nicolau <radu.nicolau@intel.com>

which was less clumsy attempt at the fix.

On Thu, Jun 14, 2018 at 1:10 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 3/16/2018 4:34 PM, Chas Williams wrote:
> > From: "Charles (Chas) Williams" <chas3@att.com>
> >
> > 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.
> >
> > Fixes: 2efb58cbab ("bond: new link bonding library")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Chas Williams <chas3@att.com>
>
> Hi Chas,
>
> Is this patch still valid to consider for v18.08?
>
>
  

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index b59ba9f7c..6d738f8c2 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -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(