DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bonding: fix reset active slave
       [not found] <no>
@ 2019-02-18 11:59 ` Hari Kumar Vemula
  2019-02-18 15:58   ` Radu Nicolau
  0 siblings, 1 reply; 7+ messages in thread
From: Hari Kumar Vemula @ 2019-02-18 11:59 UTC (permalink / raw)
  To: dev
  Cc: reshma.pattan, radu.nicolau, jananeex.m.parthasarathy,
	Hari Kumar Vemula, stable

test_alb_reply_from_client test fails due to incorrect active slave
array's index. This was due to invalid active slave count.

Count of internals->active_slave is not updated even when active slave
is deactivated.
Hence active slave count always keeps incrementing beyond the actual
active slaves.

Fix is to set the internals->active_slave to starting index 0 whenever
it exceeds the number of slaves in active slave list and also update
the active slave count during slave de-activation.

Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness")
Cc: stable@dpdk.org

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
---
 drivers/net/bonding/rte_eth_bond_api.c | 6 ++++++
 drivers/net/bonding/rte_eth_bond_pmd.c | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index e5e146540..ac084c4fd 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -129,6 +129,12 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id)
 	RTE_ASSERT(active_count < RTE_DIM(internals->active_slaves));
 	internals->active_slave_count = active_count;
 
+	/* Resetting active_slave when reaches to max
+	 * no of slaves in active list
+	 */
+	if (internals->active_slave >= active_count)
+		internals->active_slave = 0;
+
 	if (eth_dev->data->dev_started) {
 		if (internals->mode == BONDING_MODE_8023AD) {
 			bond_mode_8023ad_start(eth_dev);
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 23cec2549..319215c0b 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -84,7 +84,7 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			active_slave = 0;
 	}
 
-	if (++internals->active_slave == slave_count)
+	if (++internals->active_slave >= slave_count)
 		internals->active_slave = 0;
 	return num_rx_total;
 }
@@ -288,7 +288,7 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs,
 			active_slave = 0;
 	}
 
-	if (++internals->active_slave == slave_count)
+	if (++internals->active_slave >= slave_count)
 		internals->active_slave = 0;
 
 	return num_rx_total;
@@ -474,7 +474,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 			idx = 0;
 	}
 
-	if (++internals->active_slave == slave_count)
+	if (++internals->active_slave >= slave_count)
 		internals->active_slave = 0;
 
 	return num_rx_total;
-- 
2.17.2

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

* Re: [dpdk-dev] [PATCH] net/bonding: fix reset active slave
  2019-02-18 11:59 ` [dpdk-dev] [PATCH] net/bonding: fix reset active slave Hari Kumar Vemula
@ 2019-02-18 15:58   ` Radu Nicolau
  2019-02-20 12:33     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 7+ messages in thread
From: Radu Nicolau @ 2019-02-18 15:58 UTC (permalink / raw)
  To: Hari Kumar Vemula, dev
  Cc: Pattan, Reshma, JananeeX M, Declan, jananeex.m.parthasarathy, stable



On 2/18/2019 11:59 AM, Hari Kumar Vemula wrote:
> test_alb_reply_from_client test fails due to incorrect active slave
> array's index. This was due to invalid active slave count.
>
> Count of internals->active_slave is not updated even when active slave
> is deactivated.
> Hence active slave count always keeps incrementing beyond the actual
> active slaves.
>
> Fix is to set the internals->active_slave to starting index 0 whenever
> it exceeds the number of slaves in active slave list and also update
> the active slave count during slave de-activation.
>
> Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness")
> Cc: stable@dpdk.org
>
> Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
> ---
>
Acked-by: Radu Nicolau <radu.nicolau@intel.com 
<mailto:radu.nicolau@intel.com>>

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/bonding: fix reset active slave
  2019-02-18 15:58   ` Radu Nicolau
@ 2019-02-20 12:33     ` Ferruh Yigit
  2019-02-20 14:56       ` Radu Nicolau
  0 siblings, 1 reply; 7+ messages in thread
From: Ferruh Yigit @ 2019-02-20 12:33 UTC (permalink / raw)
  To: Radu Nicolau, Hari Kumar Vemula, dev
  Cc: Pattan, Reshma, JananeeX M, Declan, stable, Hyong Youb Kim

On 2/18/2019 3:58 PM, Radu Nicolau wrote:
> 
> 
> On 2/18/2019 11:59 AM, Hari Kumar Vemula wrote:
>> test_alb_reply_from_client test fails due to incorrect active slave
>> array's index. This was due to invalid active slave count.
>>
>> Count of internals->active_slave is not updated even when active slave
>> is deactivated.
>> Hence active slave count always keeps incrementing beyond the actual
>> active slaves.
>>
>> Fix is to set the internals->active_slave to starting index 0 whenever
>> it exceeds the number of slaves in active slave list and also update
>> the active slave count during slave de-activation.
>>
>> Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
>> ---
>>
> Acked-by: Radu Nicolau <radu.nicolau@intel.com 
> <mailto:radu.nicolau@intel.com>>

Hi Radu, Hari,

There is another bonding patch, can you please check how related are they and if
are these fixing same root cause:

net/bonding: avoid the next active slave going out of bound
https://patches.dpdk.org/patch/49573/

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/bonding: fix reset active slave
  2019-02-20 12:33     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
@ 2019-02-20 14:56       ` Radu Nicolau
  2019-02-20 15:16         ` Hyong Youb Kim
  0 siblings, 1 reply; 7+ messages in thread
From: Radu Nicolau @ 2019-02-20 14:56 UTC (permalink / raw)
  To: Ferruh Yigit, Hari Kumar Vemula, dev
  Cc: Pattan, Reshma, JananeeX M, Declan, stable, Hyong Youb Kim



On 2/20/2019 12:33 PM, Ferruh Yigit wrote:
> On 2/18/2019 3:58 PM, Radu Nicolau wrote:
>>
>> On 2/18/2019 11:59 AM, Hari Kumar Vemula wrote:
>>> test_alb_reply_from_client test fails due to incorrect active slave
>>> array's index. This was due to invalid active slave count.
>>>
>>> Count of internals->active_slave is not updated even when active slave
>>> is deactivated.
>>> Hence active slave count always keeps incrementing beyond the actual
>>> active slaves.
>>>
>>> Fix is to set the internals->active_slave to starting index 0 whenever
>>> it exceeds the number of slaves in active slave list and also update
>>> the active slave count during slave de-activation.
>>>
>>> Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
>>> ---
>>>
>> Acked-by: Radu Nicolau <radu.nicolau@intel.com
>> <mailto:radu.nicolau@intel.com>>
> Hi Radu, Hari,
>
> There is another bonding patch, can you please check how related are they and if
> are these fixing same root cause:
>
> net/bonding: avoid the next active slave going out of bound
> https://patches.dpdk.org/patch/49573/
>
Hi, it's a similar fix for the same root cause, but this one covers more 
(or all) situations that can cause active_slave to go out of bounds.

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/bonding: fix reset active slave
  2019-02-20 14:56       ` Radu Nicolau
@ 2019-02-20 15:16         ` Hyong Youb Kim
  2019-02-22  1:52           ` Chas Williams
  0 siblings, 1 reply; 7+ messages in thread
From: Hyong Youb Kim @ 2019-02-20 15:16 UTC (permalink / raw)
  To: Radu Nicolau
  Cc: Ferruh Yigit, Hari Kumar Vemula, dev, Pattan, Reshma, JananeeX M,
	Declan, stable

On Wed, Feb 20, 2019 at 02:56:36PM +0000, Radu Nicolau wrote:
> 
> 
> On 2/20/2019 12:33 PM, Ferruh Yigit wrote:
> > On 2/18/2019 3:58 PM, Radu Nicolau wrote:
> > > 
> > > On 2/18/2019 11:59 AM, Hari Kumar Vemula wrote:
> > > > test_alb_reply_from_client test fails due to incorrect active slave
> > > > array's index. This was due to invalid active slave count.
> > > > 
> > > > Count of internals->active_slave is not updated even when active slave
> > > > is deactivated.
> > > > Hence active slave count always keeps incrementing beyond the actual
> > > > active slaves.
> > > > 
> > > > Fix is to set the internals->active_slave to starting index 0 whenever
> > > > it exceeds the number of slaves in active slave list and also update
> > > > the active slave count during slave de-activation.
> > > > 
> > > > Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness")
> > > > Cc: stable@dpdk.org
> > > > 
> > > > Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
> > > > ---
> > > > 
> > > Acked-by: Radu Nicolau <radu.nicolau@intel.com
> > > <mailto:radu.nicolau@intel.com>>
> > Hi Radu, Hari,
> > 
> > There is another bonding patch, can you please check how related are they and if
> > are these fixing same root cause:
> > 
> > net/bonding: avoid the next active slave going out of bound
> > https://patches.dpdk.org/patch/49573/
> > 
> Hi, it's a similar fix for the same root cause, but this one covers more (or
> all) situations that can cause active_slave to go out of bounds.

If it covers more cases, please go with the new patch and drop mine. I
just want to see the issue fixed :-)

Thanks.
-Hyong

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/bonding: fix reset active slave
  2019-02-20 15:16         ` Hyong Youb Kim
@ 2019-02-22  1:52           ` Chas Williams
  2019-02-22 13:57             ` Ferruh Yigit
  0 siblings, 1 reply; 7+ messages in thread
From: Chas Williams @ 2019-02-22  1:52 UTC (permalink / raw)
  To: Hyong Youb Kim, Radu Nicolau
  Cc: Ferruh Yigit, Hari Kumar Vemula, dev, Pattan, Reshma, JananeeX M,
	Declan, stable



On 2/20/19 10:16 AM, Hyong Youb Kim wrote:
> On Wed, Feb 20, 2019 at 02:56:36PM +0000, Radu Nicolau wrote:
>>
>>
>> On 2/20/2019 12:33 PM, Ferruh Yigit wrote:
>>> On 2/18/2019 3:58 PM, Radu Nicolau wrote:
>>>>
>>>> On 2/18/2019 11:59 AM, Hari Kumar Vemula wrote:
>>>>> test_alb_reply_from_client test fails due to incorrect active slave
>>>>> array's index. This was due to invalid active slave count.
>>>>>
>>>>> Count of internals->active_slave is not updated even when active slave
>>>>> is deactivated.
>>>>> Hence active slave count always keeps incrementing beyond the actual
>>>>> active slaves.
>>>>>
>>>>> Fix is to set the internals->active_slave to starting index 0 whenever
>>>>> it exceeds the number of slaves in active slave list and also update
>>>>> the active slave count during slave de-activation.
>>>>>
>>>>> Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness")
>>>>> Cc: stable@dpdk.org
>>>>>
>>>>> Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
>>>>> ---
>>>>>
>>>> Acked-by: Radu Nicolau <radu.nicolau@intel.com

Acked-by: Chas Williams <chas3@att.com>

>>>> <mailto:radu.nicolau@intel.com>>
>>> Hi Radu, Hari,
>>>
>>> There is another bonding patch, can you please check how related are they and if
>>> are these fixing same root cause:
>>>
>>> net/bonding: avoid the next active slave going out of bound
>>> https://patches.dpdk.org/patch/49573/
>>>
>> Hi, it's a similar fix for the same root cause, but this one covers more (or
>> all) situations that can cause active_slave to go out of bounds.
> 
> If it covers more cases, please go with the new patch and drop mine. I
> just want to see the issue fixed :-)

Yes, it does cover a few more cases. There really isn't any coordination
between slave activation/deactivation and the rx/tx burst routines. So
checking at the beginning or the end of the various routines is about
the same.

> Thanks.
> -Hyong
> 

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/bonding: fix reset active slave
  2019-02-22  1:52           ` Chas Williams
@ 2019-02-22 13:57             ` Ferruh Yigit
  0 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2019-02-22 13:57 UTC (permalink / raw)
  To: Chas Williams, Hyong Youb Kim, Radu Nicolau
  Cc: Hari Kumar Vemula, dev, Pattan, Reshma, JananeeX M, Declan, stable

On 2/22/2019 1:52 AM, Chas Williams wrote:
> 
> 
> On 2/20/19 10:16 AM, Hyong Youb Kim wrote:
>> On Wed, Feb 20, 2019 at 02:56:36PM +0000, Radu Nicolau wrote:
>>>
>>>
>>> On 2/20/2019 12:33 PM, Ferruh Yigit wrote:
>>>> On 2/18/2019 3:58 PM, Radu Nicolau wrote:
>>>>>
>>>>> On 2/18/2019 11:59 AM, Hari Kumar Vemula wrote:
>>>>>> test_alb_reply_from_client test fails due to incorrect active slave
>>>>>> array's index. This was due to invalid active slave count.
>>>>>>
>>>>>> Count of internals->active_slave is not updated even when active slave
>>>>>> is deactivated.
>>>>>> Hence active slave count always keeps incrementing beyond the actual
>>>>>> active slaves.
>>>>>>
>>>>>> Fix is to set the internals->active_slave to starting index 0 whenever
>>>>>> it exceeds the number of slaves in active slave list and also update
>>>>>> the active slave count during slave de-activation.
>>>>>>
>>>>>> Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness")
>>>>>> Cc: stable@dpdk.org
>>>>>>
>>>>>> Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
>>>>>> ---
>>>>>>
>>>>> Acked-by: Radu Nicolau <radu.nicolau@intel.com
> 
> Acked-by: Chas Williams <chas3@att.com>

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

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

end of thread, other threads:[~2019-02-22 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <no>
2019-02-18 11:59 ` [dpdk-dev] [PATCH] net/bonding: fix reset active slave Hari Kumar Vemula
2019-02-18 15:58   ` Radu Nicolau
2019-02-20 12:33     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-02-20 14:56       ` Radu Nicolau
2019-02-20 15:16         ` Hyong Youb Kim
2019-02-22  1:52           ` Chas Williams
2019-02-22 13:57             ` Ferruh Yigit

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