DPDK patches and discussions
 help / color / mirror / Atom feed
From: Martin Havlik <xhavli56@stud.fit.vutbr.cz>
To: xhavli56@stud.fit.vutbr.cz, Chas Williams <chas3@att.com>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>,
	Aman Deep Singh <aman.deep.singh@intel.com>,
	Chengwen Feng <fengchengwen@huawei.com>,
	Kiran KN <kirankn@juniper.net>,
	RongQing Li <lirongqing@baidu.com>
Cc: Jan Viktorin <viktorin@cesnet.cz>, dev@dpdk.org, haiyue.wang@intel.com
Subject: [dpdk-dev] [PATCH 2/2] net/bonding: ensure device is started for dedicated queues setup
Date: Tue,  5 Oct 2021 19:19:39 +0200	[thread overview]
Message-ID: <20211005171939.2989-1-xhavli56@stud.fit.vutbr.cz> (raw)

The flow rule governing dedicated queues is now created
when the slave allows it. That is before or after the start
of the slave device, as the PMD is able to.

Signed-off-by: Martin Havlik <xhavli56@stud.fit.vutbr.cz>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 8ed9e036f4..66b38610f8 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1685,6 +1685,7 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 
 	int errval;
 	uint16_t q_id;
+	bool device_started = false;
 	struct rte_flow_error flow_error;
 
 	struct bond_dev_private *internals = bonded_eth_dev->data->dev_private;
@@ -1815,6 +1816,16 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 					internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id],
 					&flow_error);
 
+		if (slave_eth_dev->dev_capa & RTE_ETH_DEV_CAPA_FLOW_CREATE_BEFORE_START == 0) {
+			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 errval;
+			}
+		}
+		device_started = true;
+
 		errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev,
 				slave_eth_dev->data->port_id);
 		if (errval != 0) {
@@ -1825,12 +1836,14 @@ slave_configure(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 (!device_started) {
+		/* 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 RSS is enabled for bonding, synchronize RETA */
-- 
2.27.0


             reply	other threads:[~2021-10-05 17:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05 17:19 Martin Havlik [this message]
2023-10-31 21:38 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211005171939.2989-1-xhavli56@stud.fit.vutbr.cz \
    --to=xhavli56@stud.fit.vutbr.cz \
    --cc=ajit.khaparde@broadcom.com \
    --cc=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=ferruh.yigit@intel.com \
    --cc=haiyue.wang@intel.com \
    --cc=humin29@huawei.com \
    --cc=ivan.ilchenko@oktetlabs.ru \
    --cc=kirankn@juniper.net \
    --cc=lirongqing@baidu.com \
    --cc=thomas@monjalon.net \
    --cc=viktorin@cesnet.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).