From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 6C21D1B1B9 for ; Wed, 24 Jan 2018 16:42:31 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1FA0E22705; Wed, 24 Jan 2018 10:42:31 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:42:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=D507qEva7XrpGBTyv rJzBRuHq/GGdICWpMBD8NlSUHY=; b=G6pNsaImacznazCFF3kwCLxCczpeGnNGT qIhDEBGAlKtAvBW46z/wZStzFheIVLmmg8Gne0gtVTmQGRlPKwKAlSiczOTFiW7E xE4xSjIbs22v6IGUpAwPZo+vuIBAKPd72ozUdguvxN5qfYAi6MmbajEzK5CWfVr8 Ux6X59/f+45lfB0cgq5ow/dBs7V/CErFyzz/RjqNkIOYiVhw1p4mqxjCmlv79DNY aFnnCrS8C1JXHMRJ4Yp5Kr+xZj1Wee7eNy/H0w219MV73Cu8UNVGkqksAOnnWc2L YprcRzM3uUp/XL0SG0346qoXPHDDM3xWt2jvqs8xsTbyZb3k1WoKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=D507qEva7XrpGBTyvrJzBRuHq/GGdICWpMBD8NlSUHY=; b=hGkGl4r+ 8+lgTTR2Jm47o5m1OvLE6uL89+uPtXcSolMHs1/phhyhp8Sxpq7wIfEgNAqYkrKB VohMd56/E7ZlDyRUvTyv8t/ms29CpBZVPLJoKT5U0OUtRejoEr5fAuqr5OQmnTLR wa8SqnljsgmUXe5AKRuIF4XBb7ige5JxgK1efRnMCBHuuCgRTlHHgFvaNppTyxCT c/rEXBDxrKYZ2nVxQ1kLvgZQ5CAEWfoi6DyLhIeyLh4ue59YM02NbFiprlX5hKzM maPjB6U35UqMxXr0txjSJ8hHyIsHlBJDkz+C3fHte0YTcrnJm9YMKmib8yC3Ck8e nHNqs/Z+i9HiXw== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 658F77E3DB; Wed, 24 Jan 2018 10:42:29 -0500 (EST) From: Yuanhan Liu To: Rasesh Mody Cc: dpdk stable Date: Wed, 24 Jan 2018 23:33:36 +0800 Message-Id: <1516808026-25523-148-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/qede: replace config option with run-time arg' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 15:42:31 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 3bcc2ecb4f47574d4c7176c9034577121b904e52 Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Fri, 12 Jan 2018 13:50:01 -0800 Subject: [PATCH] net/qede: replace config option with run-time arg [ upstream commit f64b91b0eb5d4721bbc93cbcc5b6044c1bb04300 ] This patch adds support for handling run-time driver arguments. We have removed config option for per VF Tx switching and added a run-time argument vf_txswitch. By default, the VF Tx switching is enabled however it can be disabled using run-time argument. Sample usage to disable per port VF Tx switching is something like... -w 05:00.0,vf_txswitch=0 -w 05:00.1,vf_txswitch=0 Fixes: 1282943aa05b ("net/qede: fix default config option") Signed-off-by: Rasesh Mody --- config/common_base | 1 - drivers/net/qede/qede_ethdev.c | 82 ++++++++++++++++++++++++++++++++++++++---- drivers/net/qede/qede_ethdev.h | 1 + 3 files changed, 77 insertions(+), 7 deletions(-) diff --git a/config/common_base b/config/common_base index 67c2432..214d9a2 100644 --- a/config/common_base +++ b/config/common_base @@ -414,7 +414,6 @@ CONFIG_RTE_LIBRTE_QEDE_DEBUG_INFO=n CONFIG_RTE_LIBRTE_QEDE_DEBUG_DRIVER=n CONFIG_RTE_LIBRTE_QEDE_DEBUG_TX=n CONFIG_RTE_LIBRTE_QEDE_DEBUG_RX=n -CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH=y #Provides abs path/name of the firmware file. #Empty string denotes driver will use default firmware CONFIG_RTE_LIBRTE_QEDE_FW="" diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 0128cec..b0c0997 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -9,6 +9,7 @@ #include "qede_ethdev.h" #include #include +#include /* Globals */ static const struct qed_eth_ops *qed_ops; @@ -453,13 +454,13 @@ 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; -#ifndef RTE_LIBRTE_QEDE_VF_TX_SWITCH - if (IS_VF(edev)) { - params.update_tx_switching_flg = 1; - params.tx_switching_flg = !flg; - DP_INFO(edev, "VF tx-switching is disabled\n"); + if (!qdev->enable_tx_switching) { + if (IS_VF(edev)) { + params.update_tx_switching_flg = 1; + params.tx_switching_flg = !flg; + DP_INFO(edev, "VF tx-switching is disabled\n"); + } } -#endif for_each_hwfn(edev, i) { p_hwfn = &edev->hwfns[i]; params.opaque_fid = p_hwfn->hw_info.opaque_fid; @@ -1208,6 +1209,68 @@ 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, + NULL, +}; + +static int qede_args_check(const char *key, const char *val, void *opaque) +{ + unsigned long tmp; + int ret = 0; + struct rte_eth_dev *eth_dev = opaque; + struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); +#ifdef RTE_LIBRTE_QEDE_DEBUG_INFO + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); +#endif + + errno = 0; + tmp = strtoul(val, NULL, 0); + if (errno) { + DP_INFO(edev, "%s: \"%s\" is not a valid integer", key, val); + return errno; + } + + if (strcmp(QEDE_TX_SWITCHING, key) == 0) + qdev->enable_tx_switching = !!tmp; + + return ret; +} + +static int qede_args(struct rte_eth_dev *eth_dev) +{ + struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(eth_dev->device); + struct rte_kvargs *kvlist; + struct rte_devargs *devargs; + int ret; + int i; + + devargs = pci_dev->device.devargs; + if (!devargs) + return 0; /* return success */ + + kvlist = rte_kvargs_parse(devargs->args, valid_args); + if (kvlist == NULL) + return -EINVAL; + + /* Process parameters. */ + for (i = 0; (valid_args[i] != NULL); ++i) { + if (rte_kvargs_count(kvlist, valid_args[i])) { + ret = rte_kvargs_process(kvlist, valid_args[i], + qede_args_check, eth_dev); + if (ret != ECORE_SUCCESS) { + rte_kvargs_free(kvlist); + return ret; + } + } + } + rte_kvargs_free(kvlist); + + return 0; +} + static int qede_dev_configure(struct rte_eth_dev *eth_dev) { struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); @@ -1241,6 +1304,13 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) return -EINVAL; } + /* Enable Tx switching by default */ + qdev->enable_tx_switching = 1; + + /* Parse devargs and fix up rxmode */ + if (qede_args(eth_dev)) + return -ENOTSUP; + /* Sanity checks and throw warnings */ if (rxmode->enable_scatter) eth_dev->data->scattered_rx = 1; diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h index 021de5c..8f21b33 100644 --- a/drivers/net/qede/qede_ethdev.h +++ b/drivers/net/qede/qede_ethdev.h @@ -185,6 +185,7 @@ struct qede_dev { struct qede_fastpath *fp_array; uint16_t mtu; uint16_t new_mtu; + bool enable_tx_switching; bool rss_enable; struct rte_eth_rss_conf rss_conf; uint16_t rss_ind_table[ECORE_RSS_IND_TABLE_SIZE]; -- 2.7.4