net/qede: fix for devargs

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>
This commit is contained in:
Rasesh Mody 2018-05-22 16:16:04 -07:00 committed by Ferruh Yigit
parent d121a6b5f7
commit a16aef523c

View File

@ -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)) {