From patchwork Thu Nov 12 07:09:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Helin" X-Patchwork-Id: 8873 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id E4653918F; Thu, 12 Nov 2015 08:09:11 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id A008E8F9D for ; Thu, 12 Nov 2015 08:09:10 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 11 Nov 2015 23:09:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,280,1444719600"; d="scan'208";a="598883563" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 11 Nov 2015 23:09:08 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id tAC796Vj025003; Thu, 12 Nov 2015 15:09:06 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tAC7933g012253; Thu, 12 Nov 2015 15:09:05 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id tAC793c0012249; Thu, 12 Nov 2015 15:09:03 +0800 From: Helin Zhang To: dev@dpdk.org Date: Thu, 12 Nov 2015 15:09:03 +0800 Message-Id: <1447312143-12215-1-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] i40e: fix the issue of trying more VSIs for VMDq than available X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" It fixes the issue of trying to allocate more VSIs for VMDq than hardware remaining. It adds a check of the hardware remaining before allocating VSIs for VMDq. Fixes: c80707a0fd9c ("i40e: fix VMDq pool limit") Signed-off-by: Helin Zhang --- drivers/net/i40e/i40e_ethdev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index e4684d3..323b1ff 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -3118,7 +3118,8 @@ i40e_pf_parameter_init(struct rte_eth_dev *dev) pf->vmdq_nb_qps = 0; pf->max_nb_vmdq_vsi = 0; if (hw->func_caps.vmdq) { - if (qp_count < hw->func_caps.num_tx_qp) { + if (qp_count < hw->func_caps.num_tx_qp && + vsi_count < hw->func_caps.num_vsis) { pf->max_nb_vmdq_vsi = (hw->func_caps.num_tx_qp - qp_count) / pf->vmdq_nb_qp_max; @@ -3126,6 +3127,8 @@ i40e_pf_parameter_init(struct rte_eth_dev *dev) * ethdev can support */ pf->max_nb_vmdq_vsi = RTE_MIN(pf->max_nb_vmdq_vsi, + hw->func_caps.num_vsis - vsi_count); + pf->max_nb_vmdq_vsi = RTE_MIN(pf->max_nb_vmdq_vsi, ETH_64_POOLS); if (pf->max_nb_vmdq_vsi) { pf->flags |= I40E_FLAG_VMDQ; @@ -3140,7 +3143,7 @@ i40e_pf_parameter_init(struct rte_eth_dev *dev) "VMDq"); } } else { - PMD_DRV_LOG(INFO, "No queue left for VMDq"); + PMD_DRV_LOG(INFO, "No queue or VSI left for VMDq"); } } qp_count += pf->vmdq_nb_qps * pf->max_nb_vmdq_vsi;