From: Rasesh Mody Date: Tue, 22 May 2018 23:16:04 +0000 (-0700) Subject: net/qede: fix for devargs X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a16aef523c11b6e64a809242c77ff7f2c5e9a864;p=dpdk.git 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 --- diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 8f3713988e..137f91060d 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)) {