From patchwork Tue Oct 24 08:45:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao1, Wei" X-Patchwork-Id: 30764 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BAB731B778; Tue, 24 Oct 2017 10:56:22 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 1BD801B776 for ; Tue, 24 Oct 2017 10:56:20 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2017 01:56:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.43,427,1503385200"; d="scan'208"; a="1234510437" Received: from dpdk4.bj.intel.com ([172.16.182.85]) by fmsmga002.fm.intel.com with ESMTP; 24 Oct 2017 01:56:18 -0700 From: Wei Zhao To: dev@dpdk.org Cc: Wei Zhao Date: Tue, 24 Oct 2017 16:45:10 +0800 Message-Id: <1508834710-23801-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] net/i40e: fix queue number error in queue region 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" when VSI is enabled with smaller number of queues, for example, 1 or 6, it will cause error.64 is the max number of queues that can be used for RSS, but VSI might be created with only few queues. Fixes: 7cbecc2f742 ("net/i40e: support queue region set and flush") Signed-off-by: Wei Zhao Reviewed-by: Ferruh Yigit --- drivers/net/i40e/rte_pmd_i40e.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index 4881ea0..909368d 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -2825,6 +2825,7 @@ i40e_flush_queue_region_all_conf(struct rte_eth_dev *dev, { int32_t ret = -EINVAL; struct i40e_queue_regions *info = &pf->queue_region; + struct i40e_vsi *main_vsi = pf->main_vsi; if (on) { i40e_queue_region_pf_flowtype_conf(hw, pf); @@ -2845,7 +2846,7 @@ i40e_flush_queue_region_all_conf(struct rte_eth_dev *dev, } info->queue_region_number = 1; - info->region[0].queue_num = 64; + info->region[0].queue_num = main_vsi->nb_used_qps; info->region[0].queue_start_index = 0; ret = i40e_vsi_update_queue_region_mapping(hw, pf);