patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/bonding: set initial value of descriptor count alignment
@ 2022-10-31 13:17 Ivan Malov
  2022-11-01  2:21 ` humin (Q)
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Malov @ 2022-10-31 13:17 UTC (permalink / raw)
  To: dev
  Cc: Li, WeiyuanX, Chas Williams, Min Hu (Connor),
	Hari Kumar Vemula, stable, Andrew Rybchenko

The driver had once been broken by patch [1] looking to have
a non-zero "nb_max" value in a use case not involving adding
any back-end ports. That was addressed afterwards ([2]). But,
as per report [3], similar test cases exist which attempt to
setup Rx queues on a void bond before attaching any back-end
ports. Rx queue setup, in turn, involves device info get API
invocation, and one of the checks on received data causes an
exception (division by zero). The "nb_align" value is indeed
zero at that time, but, as explained in [2], such test cases
are totally incorrect since a bond device must have at least
one back-end port plugged before any ethdev APIs can be used.

Once again, to avoid any problems with fixing the test cases,
this patch adjusts the bond PMD itself to workaround the bug.

[1] commit 5be3b40fea60 ("net/bonding: fix values of descriptor limits")
[2] commit d03c0e83cc00 ("net/bonding: fix descriptor limit reporting")
[3] https://bugs.dpdk.org/show_bug.cgi?id=1118

Fixes: d03c0e83cc00 ("net/bonding: fix descriptor limit reporting")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index dc74852137..145cb7099f 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3426,6 +3426,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
 	 */
 	internals->rx_desc_lim.nb_max = UINT16_MAX;
 	internals->tx_desc_lim.nb_max = UINT16_MAX;
+	internals->rx_desc_lim.nb_align = 1;
+	internals->tx_desc_lim.nb_align = 1;
 
 	memset(internals->active_slaves, 0, sizeof(internals->active_slaves));
 	memset(internals->slaves, 0, sizeof(internals->slaves));
-- 
2.30.2


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

* Re: [PATCH] net/bonding: set initial value of descriptor count alignment
  2022-10-31 13:17 [PATCH] net/bonding: set initial value of descriptor count alignment Ivan Malov
@ 2022-11-01  2:21 ` humin (Q)
  2022-11-02  7:07   ` Li, WeiyuanX
  0 siblings, 1 reply; 4+ messages in thread
From: humin (Q) @ 2022-11-01  2:21 UTC (permalink / raw)
  To: Ivan Malov, dev
  Cc: Li, WeiyuanX, Chas Williams, Hari Kumar Vemula, stable, Andrew Rybchenko

Acked-by: Min Hu (Connor) <humin29@huawei.com>

在 2022/10/31 21:17, Ivan Malov 写道:
> The driver had once been broken by patch [1] looking to have
> a non-zero "nb_max" value in a use case not involving adding
> any back-end ports. That was addressed afterwards ([2]). But,
> as per report [3], similar test cases exist which attempt to
> setup Rx queues on a void bond before attaching any back-end
> ports. Rx queue setup, in turn, involves device info get API
> invocation, and one of the checks on received data causes an
> exception (division by zero). The "nb_align" value is indeed
> zero at that time, but, as explained in [2], such test cases
> are totally incorrect since a bond device must have at least
> one back-end port plugged before any ethdev APIs can be used.
>
> Once again, to avoid any problems with fixing the test cases,
> this patch adjusts the bond PMD itself to workaround the bug.
>
> [1] commit 5be3b40fea60 ("net/bonding: fix values of descriptor limits")
> [2] commit d03c0e83cc00 ("net/bonding: fix descriptor limit reporting")
> [3] https://bugs.dpdk.org/show_bug.cgi?id=1118
>
> Fixes: d03c0e83cc00 ("net/bonding: fix descriptor limit reporting")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
>   drivers/net/bonding/rte_eth_bond_pmd.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index dc74852137..145cb7099f 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -3426,6 +3426,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
>   	 */
>   	internals->rx_desc_lim.nb_max = UINT16_MAX;
>   	internals->tx_desc_lim.nb_max = UINT16_MAX;
> +	internals->rx_desc_lim.nb_align = 1;
> +	internals->tx_desc_lim.nb_align = 1;
>   
>   	memset(internals->active_slaves, 0, sizeof(internals->active_slaves));
>   	memset(internals->slaves, 0, sizeof(internals->slaves));

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

* RE: [PATCH] net/bonding: set initial value of descriptor count alignment
  2022-11-01  2:21 ` humin (Q)
@ 2022-11-02  7:07   ` Li, WeiyuanX
  2022-11-06  9:40     ` Andrew Rybchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Li, WeiyuanX @ 2022-11-02  7:07 UTC (permalink / raw)
  To: humin (Q), Ivan Malov, dev
  Cc: Chas Williams, Hari Kumar Vemula, stable, Andrew Rybchenko

> -----Original Message-----
> From: humin (Q) <humin29@huawei.com>
> Sent: Tuesday, November 1, 2022 10:21 AM
> To: Ivan Malov <ivan.malov@oktetlabs.ru>; dev@dpdk.org
> Cc: Li, WeiyuanX <weiyuanx.li@intel.com>; Chas Williams <chas3@att.com>;
> Hari Kumar Vemula <hari.kumarx.vemula@intel.com>; stable@dpdk.org;
> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Subject: Re: [PATCH] net/bonding: set initial value of descriptor count
> alignment
> 
> Acked-by: Min Hu (Connor) <humin29@huawei.com>
> 
> 在 2022/10/31 21:17, Ivan Malov 写道:
> > The driver had once been broken by patch [1] looking to have a
> > non-zero "nb_max" value in a use case not involving adding any
> > back-end ports. That was addressed afterwards ([2]). But, as per
> > report [3], similar test cases exist which attempt to setup Rx queues
> > on a void bond before attaching any back-end ports. Rx queue setup, in
> > turn, involves device info get API invocation, and one of the checks
> > on received data causes an exception (division by zero). The
> > "nb_align" value is indeed zero at that time, but, as explained in
> > [2], such test cases are totally incorrect since a bond device must
> > have at least one back-end port plugged before any ethdev APIs can be
> > used.
> >
> > Once again, to avoid any problems with fixing the test cases, this
> > patch adjusts the bond PMD itself to workaround the bug.
> >
> > [1] commit 5be3b40fea60 ("net/bonding: fix values of descriptor
> > limits") [2] commit d03c0e83cc00 ("net/bonding: fix descriptor limit
> > reporting") [3] https://bugs.dpdk.org/show_bug.cgi?id=1118
> >
> > Fixes: d03c0e83cc00 ("net/bonding: fix descriptor limit reporting")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
> > Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> > ---
Tested-by: Weiyuan Li <weiyuanx.li@intel.com>

This patch needs to be applied additionally https://patches.dpdk.org/project/dpdk/patch/20221101161853.2702425-1-ivan.malov@oktetlabs.ru/  can be verified to pass


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

* Re: [PATCH] net/bonding: set initial value of descriptor count alignment
  2022-11-02  7:07   ` Li, WeiyuanX
@ 2022-11-06  9:40     ` Andrew Rybchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2022-11-06  9:40 UTC (permalink / raw)
  To: Li, WeiyuanX, humin (Q), Ivan Malov, dev
  Cc: Chas Williams, Hari Kumar Vemula, stable

On 11/2/22 10:07, Li, WeiyuanX wrote:
>> -----Original Message-----
>> From: humin (Q) <humin29@huawei.com>
>> Sent: Tuesday, November 1, 2022 10:21 AM
>> To: Ivan Malov <ivan.malov@oktetlabs.ru>; dev@dpdk.org
>> Cc: Li, WeiyuanX <weiyuanx.li@intel.com>; Chas Williams <chas3@att.com>;
>> Hari Kumar Vemula <hari.kumarx.vemula@intel.com>; stable@dpdk.org;
>> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>> Subject: Re: [PATCH] net/bonding: set initial value of descriptor count
>> alignment
>>
>> Acked-by: Min Hu (Connor) <humin29@huawei.com>
>>
>> 在 2022/10/31 21:17, Ivan Malov 写道:
>>> The driver had once been broken by patch [1] looking to have a
>>> non-zero "nb_max" value in a use case not involving adding any
>>> back-end ports. That was addressed afterwards ([2]). But, as per
>>> report [3], similar test cases exist which attempt to setup Rx queues
>>> on a void bond before attaching any back-end ports. Rx queue setup, in
>>> turn, involves device info get API invocation, and one of the checks
>>> on received data causes an exception (division by zero). The
>>> "nb_align" value is indeed zero at that time, but, as explained in
>>> [2], such test cases are totally incorrect since a bond device must
>>> have at least one back-end port plugged before any ethdev APIs can be
>>> used.
>>>
>>> Once again, to avoid any problems with fixing the test cases, this
>>> patch adjusts the bond PMD itself to workaround the bug.
>>>
>>> [1] commit 5be3b40fea60 ("net/bonding: fix values of descriptor
>>> limits") [2] commit d03c0e83cc00 ("net/bonding: fix descriptor limit
>>> reporting") [3] https://bugs.dpdk.org/show_bug.cgi?id=1118
>>>
>>> Fixes: d03c0e83cc00 ("net/bonding: fix descriptor limit reporting")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
>>> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>>> ---
> Tested-by: Weiyuan Li <weiyuanx.li@intel.com>
> 
> This patch needs to be applied additionally https://patches.dpdk.org/project/dpdk/patch/20221101161853.2702425-1-ivan.malov@oktetlabs.ru/  can be verified to pass
> 

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


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

end of thread, other threads:[~2022-11-06  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 13:17 [PATCH] net/bonding: set initial value of descriptor count alignment Ivan Malov
2022-11-01  2:21 ` humin (Q)
2022-11-02  7:07   ` Li, WeiyuanX
2022-11-06  9:40     ` Andrew Rybchenko

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