DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@cavium.com>
To: dev@dpdk.org
Cc: Rasesh Mody <rasesh.mody@cavium.com>,
	ferruh.yigit@intel.com, Dept-EngDPDKDev@cavium.com
Subject: [dpdk-dev] [PATCH 3/5] net/qede: add devarg to disable NPAR Tx switching
Date: Tue, 27 Mar 2018 17:15:53 -0700	[thread overview]
Message-ID: <1522196155-30972-3-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1522196155-30972-1-git-send-email-rasesh.mody@cavium.com>

Added a run-time argument npar_tx_switching to enable/disable
Tx switching for multi-fucntion devices (NPAR).
Rename vf_txswitch option to vf_tx_switching.

Sample usage to disable Tx switching for NPAR or VF is something like...

 -w 05:00.0,npar_tx_switching=0 -w 05:00.1,npar_tx_switching=0
 -w 05:00.0,vf_tx_switching=0 -w 05:00.1,vf_tx_switching=0

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/qede_ethdev.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index f25fb91..025cd2a 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -499,6 +499,9 @@ static void qede_reset_queue_stats(struct qede_dev *qdev, bool xstats)
 	return 0;
 }
 
+#define QEDE_NPAR_TX_SWITCHING		"npar_tx_switching"
+#define QEDE_VF_TX_SWITCHING		"vf_tx_switching"
+
 /* Activate or deactivate vport via vport-update */
 int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg)
 {
@@ -516,10 +519,12 @@ int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg)
 	params.vport_active_rx_flg = flg;
 	params.vport_active_tx_flg = flg;
 	if (!qdev->enable_tx_switching) {
-		if (IS_VF(edev)) {
+		if ((QEDE_NPAR_TX_SWITCHING != NULL) ||
+		    ((QEDE_VF_TX_SWITCHING != NULL) && IS_VF(edev))) {
 			params.update_tx_switching_flg = 1;
 			params.tx_switching_flg = !flg;
-			DP_INFO(edev, "VF tx-switching is disabled\n");
+			DP_INFO(edev, "%s tx-switching is disabled\n",
+				QEDE_NPAR_TX_SWITCHING ? "NPAR" : "VF");
 		}
 	}
 	for_each_hwfn(edev, i) {
@@ -1373,10 +1378,9 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev)
 	DP_INFO(edev, "Device is stopped\n");
 }
 
-#define QEDE_TX_SWITCHING		"vf_txswitch"
-
 const char *valid_args[] = {
-	QEDE_TX_SWITCHING,
+	QEDE_NPAR_TX_SWITCHING,
+	QEDE_VF_TX_SWITCHING,
 	NULL,
 };
 
@@ -1395,7 +1399,8 @@ static int qede_args_check(const char *key, const char *val, void *opaque)
 		return errno;
 	}
 
-	if (strcmp(QEDE_TX_SWITCHING, key) == 0)
+	if ((strcmp(QEDE_NPAR_TX_SWITCHING, key) == 0) ||
+	    (strcmp(QEDE_VF_TX_SWITCHING, key) == 0))
 		qdev->enable_tx_switching = !!tmp;
 
 	return ret;
-- 
1.7.10.3

  parent reply	other threads:[~2018-03-28  0:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  0:15 [dpdk-dev] [PATCH 1/5] net/qede: convert to new Rx/Tx offloads API Rasesh Mody
2018-03-28  0:15 ` [dpdk-dev] [PATCH 2/5] net/qede: enable IPGRE offload support Rasesh Mody
2018-03-28  0:15 ` Rasesh Mody [this message]
2018-03-28  0:15 ` [dpdk-dev] [PATCH 4/5] net/qede: fix device stop to remove primary MAC Rasesh Mody
2018-03-28  0:15 ` [dpdk-dev] [PATCH 5/5] net/qede: fix to prevent overwriting packet type Rasesh Mody
2018-03-30 10:39 ` [dpdk-dev] [PATCH 1/5] net/qede: convert to new Rx/Tx offloads API Ferruh Yigit
2018-05-11  9:16 ` Andrew Rybchenko
2018-05-14 12:53   ` Ferruh Yigit
2018-05-15 19:47     ` Mody, Rasesh

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=1522196155-30972-3-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /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).