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,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] net/qede: fix for devargs
Date: Tue, 22 May 2018 16:16:04 -0700	[thread overview]
Message-ID: <1527030964-17525-2-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1527030964-17525-1-git-send-email-rasesh.mody@cavium.com>

Do not error out on invalid devarg, log the message and continue.
Decide updating the tx-switching config in check args. Add a check for
VF when disabling tx-switching

Fixes: 612ce81b2007 ("net/qede: add devargs to disable NPAR Tx switching")
Fixes: f64b91b0eb5d ("net/qede: replace config option with run-time arg")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 8c320c6..4ab1572 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -518,14 +518,9 @@ int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg)
 	params.update_vport_active_tx_flg = 1;
 	params.vport_active_rx_flg = flg;
 	params.vport_active_tx_flg = flg;
-	if (!qdev->enable_tx_switching) {
-		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, "%s tx-switching is disabled\n",
-				QEDE_NPAR_TX_SWITCHING ? "NPAR" : "VF");
-		}
+	if (~qdev->enable_tx_switching & flg) {
+		params.update_tx_switching_flg = 1;
+		params.tx_switching_flg = !flg;
 	}
 	for_each_hwfn(edev, i) {
 		p_hwfn = &edev->hwfns[i];
@@ -1362,8 +1357,12 @@ static int qede_args_check(const char *key, const char *val, void *opaque)
 	}
 
 	if ((strcmp(QEDE_NPAR_TX_SWITCHING, key) == 0) ||
-	    (strcmp(QEDE_VF_TX_SWITCHING, key) == 0))
+	    ((strcmp(QEDE_VF_TX_SWITCHING, key) == 0) && IS_VF(edev))) {
 		qdev->enable_tx_switching = !!tmp;
+		DP_INFO(edev, "Disabling %s tx-switching\n",
+			strcmp(QEDE_NPAR_TX_SWITCHING, key) ?
+			"VF" : "NPAR");
+	}
 
 	return ret;
 }
@@ -1438,7 +1437,8 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	/* Parse devargs and fix up rxmode */
 	if (qede_args(eth_dev))
-		return -ENOTSUP;
+		DP_NOTICE(edev, false,
+			  "Invalid devargs supplied, requested change will not take effect\n");
 
 	if (!(rxmode->mq_mode == ETH_MQ_RX_NONE ||
 	      rxmode->mq_mode == ETH_MQ_RX_RSS)) {
-- 
1.7.10.3

  reply	other threads:[~2018-05-22 23:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 23:16 [dpdk-dev] [PATCH 1/2] net/qede: fix to update VF MTU Rasesh Mody
2018-05-22 23:16 ` Rasesh Mody [this message]
2018-05-23 15:47 ` Ferruh Yigit
2018-05-23 17:16   ` Mody, Rasesh
2018-05-31 16:35 ` Ferruh Yigit

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=1527030964-17525-2-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 \
    --cc=stable@dpdk.org \
    /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).