From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 50A841B0FB for ; Tue, 15 Jan 2019 08:21:15 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 23:21:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,481,1539673200"; d="scan'208";a="114763299" Received: from dpdk-server.sh.intel.com ([10.67.110.163]) by fmsmga007.fm.intel.com with ESMTP; 14 Jan 2019 23:21:13 -0800 From: Zhirun Yan To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Zhirun Yan Date: Tue, 15 Jan 2019 14:57:17 +0000 Message-Id: <20190115145717.84697-1-zhirun.yan@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] net/i40e: support request any number of queues 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: Tue, 15 Jan 2019 07:21:15 -0000 Before this patch, VF must request a specific queues(1/2/4/8/16) with DPDK PF. This patch align the number of requested queues to next power of 2. So VF can request any number queues from 1 to 16. Signed-off-by: Zhirun Yan --- drivers/net/i40e/i40e_pf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 092e0d3e9..d110dffb7 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -1271,7 +1271,10 @@ i40e_pf_host_process_cmd_request_queues(struct i40e_pf_vf *vf, uint8_t *msg) } else { i40e_vc_notify_vf_reset(vf); vf->vsi->nb_qps = req_pairs; - pf->vf_nb_qps = req_pairs; + if (rte_is_power_of_2(req_pairs)) + pf->vf_nb_qps = req_pairs; + else + pf->vf_nb_qps = i40e_align_floor(req_pairs) << 1; i40e_pf_host_process_cmd_reset_vf(vf); return 0; -- 2.17.1