From: Kevin Traynor Subject: Re: [PATCH v1] net/i40e: support request any number of queues Date: Tue, 15 Jan 2019 17:33:34 +0000 Message-ID: <1c8bba3d-b205-c629-73de-6dca2dfc998f@redhat.com> References: <20190115145717.84697-1-zhirun.yan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Zhirun Yan , dev@dpdk.org, qi.z.zhang@intel.com Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 7F17D2BAB for ; Tue, 15 Jan 2019 18:33:37 +0100 (CET) In-Reply-To: <20190115145717.84697-1-zhirun.yan@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 01/15/2019 02:57 PM, Zhirun Yan wrote: > 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; Shouldn't you do this before you validate against the number of free queue pairs? or it is somehow handled > i40e_pf_host_process_cmd_reset_vf(vf); > > return 0; >