DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bonding: set dev_started later
@ 2018-03-16 16:34 Chas Williams
  2018-03-23 17:05 ` [dpdk-dev] [PATCH v2] net/bonding: clear dev_started if start fails Chas Williams
  2018-06-14 17:10 ` [dpdk-dev] [PATCH] net/bonding: set dev_started later Ferruh Yigit
  0 siblings, 2 replies; 6+ messages in thread
From: Chas Williams @ 2018-03-16 16:34 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Charles (Chas) Williams, stable

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(-)

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(
-- 
2.13.6

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] net/bonding: clear dev_started if start fails
  2018-03-16 16:34 [dpdk-dev] [PATCH] net/bonding: set dev_started later Chas Williams
@ 2018-03-23 17:05 ` Chas Williams
  2018-04-05 10:58   ` Radu Nicolau
  2018-06-14 17:10 ` [dpdk-dev] [PATCH] net/bonding: set dev_started later Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Chas Williams @ 2018-03-23 17:05 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Charles (Chas) Williams, stable

From: "Charles (Chas) Williams" <chas3@att.com>

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: 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 | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/bonding: clear dev_started if start fails
  2018-03-23 17:05 ` [dpdk-dev] [PATCH v2] net/bonding: clear dev_started if start fails Chas Williams
@ 2018-04-05 10:58   ` Radu Nicolau
  2018-04-06 10:03     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Radu Nicolau @ 2018-04-05 10:58 UTC (permalink / raw)
  To: Chas Williams, dev; +Cc: declan.doherty, Charles (Chas) Williams, stable



On 3/23/2018 5:05 PM, Chas Williams wrote:
> From: "Charles (Chas) Williams" <chas3@att.com>
>
> 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: 2efb58cbab ("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> 
<mailto:radu.nicolau@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] net/bonding: clear dev_started if start fails
  2018-04-05 10:58   ` Radu Nicolau
@ 2018-04-06 10:03     ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2018-04-06 10:03 UTC (permalink / raw)
  To: Radu Nicolau, Chas Williams, dev
  Cc: declan.doherty, Charles (Chas) Williams, stable

On 4/5/2018 11:58 AM, Radu Nicolau wrote:
> 
> 
> On 3/23/2018 5:05 PM, Chas Williams wrote:
>> From: "Charles (Chas) Williams" <chas3@att.com>
>>
>> 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: 2efb58cbab ("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> 

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bonding: set dev_started later
  2018-03-16 16:34 [dpdk-dev] [PATCH] net/bonding: set dev_started later Chas Williams
  2018-03-23 17:05 ` [dpdk-dev] [PATCH v2] net/bonding: clear dev_started if start fails Chas Williams
@ 2018-06-14 17:10 ` Ferruh Yigit
  2018-06-14 20:22   ` Chas Williams
  1 sibling, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2018-06-14 17:10 UTC (permalink / raw)
  To: Chas Williams, dev; +Cc: declan.doherty, Charles (Chas) Williams, stable

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?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bonding: set dev_started later
  2018-06-14 17:10 ` [dpdk-dev] [PATCH] net/bonding: set dev_started later Ferruh Yigit
@ 2018-06-14 20:22   ` Chas Williams
  0 siblings, 0 replies; 6+ messages in thread
From: Chas Williams @ 2018-06-14 20:22 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Declan Doherty, Chas Williams, stable

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?
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-14 20:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16 16:34 [dpdk-dev] [PATCH] net/bonding: set dev_started later Chas Williams
2018-03-23 17:05 ` [dpdk-dev] [PATCH v2] net/bonding: clear dev_started if start fails Chas Williams
2018-04-05 10:58   ` Radu Nicolau
2018-04-06 10:03     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2018-06-14 17:10 ` [dpdk-dev] [PATCH] net/bonding: set dev_started later Ferruh Yigit
2018-06-14 20:22   ` Chas Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).