It's probably cleaner to just move the bond_ethdev_8023ad_flow_set
until after the device start. For the reader, they don't need to
understand why you might not have started the device earlier.
On 9/24/22 10:19, Usman Tanveer wrote:
when dedicated queues are enable with bonding mode 4 (mlx5), the
application sets the flow, which cannot be set if the device is not
started. This fixed the issue by starting the device just before
setting the flow. Because device should be started to set the flow.
Also it does not effect other driver codes (I have tried on ixgbe).
Bugzilla ID: 759
Signed-off-by: Usman Tanveer <usman.tanv...@emumba.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c
b/drivers/net/bonding/rte_eth_bond_pmd.c
index 73e6972035..2dfb613ea6 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1829,6 +1829,13 @@ slave_start(struct rte_eth_dev *bonded_eth_dev,
slave_eth_dev->data->port_id, errval);
}
+ errval = rte_eth_dev_start(slave_eth_dev->data->port_id);
+ if (errval != 0) {
+ RTE_BOND_LOG(ERR, "rte_eth_dev_start: port=%u, err
(%d)",
+ slave_eth_dev->data->port_id, errval);
+ return -1;
+ }
+
errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev,
slave_eth_dev->data->port_id);
if (errval != 0) {
@@ -1840,11 +1847,13 @@ slave_start(struct rte_eth_dev *bonded_eth_dev,
}
/* Start device */
- errval = rte_eth_dev_start(slave_eth_dev->data->port_id);
- if (errval != 0) {
- RTE_BOND_LOG(ERR, "rte_eth_dev_start: port=%u, err (%d)",
- slave_eth_dev->data->port_id, errval);
- return -1;
+ if (!slave_eth_dev->data->dev_started) {
+ errval = rte_eth_dev_start(slave_eth_dev->data->port_id);
+ if (errval != 0) {
+ RTE_BOND_LOG(ERR, "rte_eth_dev_start: port=%u, err
(%d)",
+ slave_eth_dev->data->port_id, errval);
+ return -1;
+ }
}
/* If RSS is enabled for bonding, synchronize RETA */