DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/bonding: fix error in bonding mode 4 with dedicated queues enabled
@ 2022-09-24 14:19 Usman Tanveer
  2022-09-25 10:42 ` Chas Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Usman Tanveer @ 2022-09-24 14:19 UTC (permalink / raw)
  To: chas3, humin29; +Cc: dev, Usman Tanveer

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.tanveer@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 */
-- 
2.25.1


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

* Re: [PATCH] net/bonding: fix error in bonding mode 4 with dedicated queues enabled
  2022-09-24 14:19 [PATCH] net/bonding: fix error in bonding mode 4 with dedicated queues enabled Usman Tanveer
@ 2022-09-25 10:42 ` Chas Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Chas Williams @ 2022-09-25 10:42 UTC (permalink / raw)
  To: Usman Tanveer, chas3, humin29; +Cc: dev

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.tanveer@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 */

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

end of thread, other threads:[~2022-09-25 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-24 14:19 [PATCH] net/bonding: fix error in bonding mode 4 with dedicated queues enabled Usman Tanveer
2022-09-25 10:42 ` 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).