Skip to content

Commit

Permalink
net/bonding: set initial value of descriptor count alignment
Browse files Browse the repository at this point in the history
[ upstream commit 550e8d6d340f93882e4a1183314fd5f4a408595f ]

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 5be3b40 ("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

Bugzilla ID: 1118
Fixes: d03c0e83cc00 ("net/bonding: fix descriptor limit reporting")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
Tested-by: Weiyuan Li <weiyuanx.li@intel.com>
  • Loading branch information
ol-ivanmal authored and cpaelzer committed Nov 16, 2022
1 parent eba01af commit 011fd38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/bonding/rte_eth_bond_pmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3332,6 +3332,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));
Expand Down

0 comments on commit 011fd38

Please sign in to comment.