From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 9AAF61B29A for ; Mon, 25 Dec 2017 13:00:49 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Dec 2017 04:00:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,454,1508828400"; d="scan'208";a="5575559" Received: from dpdk6.bj.intel.com ([172.16.182.87]) by orsmga006.jf.intel.com with ESMTP; 25 Dec 2017 04:00:46 -0800 From: Wei Dai To: jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, Wei Dai Date: Mon, 25 Dec 2017 19:45:09 +0800 Message-Id: <1514202309-56359-1-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1512698026-52834-1-git-send-email-wei.dai@intel.com> References: <1512698026-52834-1-git-send-email-wei.dai@intel.com> Subject: [dpdk-dev] [PATCH v8] net/i40e: determine number of queues per VF during run time X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Dec 2017 12:00:50 -0000 Without this patch, the number of queues per i40e VF is defined as 4 by CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4 in config/common_base. It is fixed value determined in building time and can't be changed during run time. With this patch, the number of queues per i40e VF can be determinated during run time. For example, if the PCI address of an i40e PF is aaaa:bb.cc, with the EAL parameter -w aaaa:bb.cc,queue-num-per-vf=8 , the number of queues per VF created from this PF is 8. If there is no "queue-num-per-vf" setting in EAL parameters, it is 4 by default as before. And if the value after the "queue-num-per-vf" is invalid, it is set as 4 forcibly. The valid values include 1, 2, 4, 8, 16 . Signed-off-by: Wei Dai Acked-by: Konstantin Ananyev --- v8: As v7 patch has been accepted into dpdk-next-net-intel, this patch is based on v7 patch. add description in i40e document fix the last member of valid_keys[] for rte_kvargs_parse( ) add RTE_PMD_REGISTER_PARAM_STRING for this feature v7: use the macro instead of natural number correct git log message as the EAL parameter is only valid for PF v6: fix a small bug when detecting end character of strtoul v5: fix git log message and WARNING of coding stype v4: use rte_kvargs instead of pervious parsing function; use malloc/free instead of rte_zmalloc/rte_free. v3: fix WARNING of coding style issues from checkpatch@dpdk.org v2: fix WARNING of coding style issues from checkpatch@dpdk.org --- doc/guides/nics/i40e.rst | 12 ++++++++---- drivers/net/i40e/i40e_ethdev.c | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index 2507d5f..68ae8eb 100644 --- a/doc/guides/nics/i40e.rst +++ b/doc/guides/nics/i40e.rst @@ -117,10 +117,6 @@ Please note that enabling debugging options may affect system performance. - ``CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF`` (default ``4``) - Number of queues reserved for each SR-IOV VF. - -- ``CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM`` (default ``4``) - Number of queues reserved for each VMDQ Pool. - ``CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL`` (default ``-1``) @@ -374,6 +370,14 @@ configuration passed on the EAL command line. The floating VEB functionality requires a NIC firmware version of 5.0 or greater. +Number of Queues per VF +~~~~~~~~~~~~~~~~~~~~~~~ + +The number of queue per VF is determined by its host PF. If the PCI address of +an i40e PF is aaaa:bb.cc, the number of queues per VF can be configured with +EAL paramter like -w aaaa:bb.cc,queue-num-per-vf=n. The value n can be 1, 2, 4, +8 or 16. If no such paramter is configured, the number of queues per VF is 4 +by default. Limitations or Known issues --------------------------- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 9916f49..24dae37 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -3973,6 +3973,8 @@ i40e_get_cap(struct i40e_hw *hw) #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4 #define QUEUE_NUM_PER_VF_ARG "queue-num-per-vf" +RTE_PMD_REGISTER_PARAM_STRING(net_i40e, QUEUE_NUM_PER_VF_ARG "=1|2|4|8|16"); + static int i40e_pf_parse_vf_queue_number_handler(const char *key, const char *value, void *opaque) @@ -4005,7 +4007,7 @@ static int i40e_pf_parse_vf_queue_number_handler(const char *key, static int i40e_pf_config_vf_rxq_number(struct rte_eth_dev *dev) { - static const char * const valid_keys[] = {QUEUE_NUM_PER_VF_ARG, ""}; + static const char * const valid_keys[] = {QUEUE_NUM_PER_VF_ARG, NULL}; struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct rte_kvargs *kvlist; -- 2.7.5