From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 79458F94 for ; Tue, 5 Mar 2019 17:19:18 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 989FB30EBE97; Tue, 5 Mar 2019 16:19:17 +0000 (UTC) Received: from [10.36.117.96] (ovpn-117-96.ams2.redhat.com [10.36.117.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id B89D061D1C; Tue, 5 Mar 2019 16:19:16 +0000 (UTC) To: "Yan, Zhirun" , "dev@dpdk.org" , "Zhang, Qi Z" References: <20190115145717.84697-1-zhirun.yan@intel.com> <1c8bba3d-b205-c629-73de-6dca2dfc998f@redhat.com> <2F9759EBFF61914290A3BA61BDBE2C860B9FB268@SHSMSX101.ccr.corp.intel.com> From: Kevin Traynor Message-ID: <95fa3488-081d-2bf8-e36e-352dc559e823@redhat.com> Date: Tue, 5 Mar 2019 16:19:14 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <2F9759EBFF61914290A3BA61BDBE2C860B9FB268@SHSMSX101.ccr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 05 Mar 2019 16:19:17 +0000 (UTC) Subject: Re: [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, 05 Mar 2019 16:19:19 -0000 On 17/01/2019 07:26, Yan, Zhirun wrote: > > >> -----Original Message----- >> From: Kevin Traynor [mailto:ktraynor@redhat.com] >> Sent: Wednesday, January 16, 2019 1:34 AM >> To: Yan, Zhirun ; dev@dpdk.org; Zhang, Qi Z >> >> Subject: Re: [dpdk-dev] [PATCH v1] net/i40e: support request any number of >> queues >> >> 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 > > Before PF alloc queue to VF, PF will check the queue number in i40e_res_pool_alloc(). > Suppose there are 15 queues left in PF, this part will check 12 as a valid value if request 12 queues, > But PF will refuse to alloc 16 queue. > Hello. In that scenario the vsi is reset and there is a failed setup, whereas it could be caught here and max rounded value sent back to vf. I will send a patch to show what I mean (compile tested only). Please take a look. >> >>> i40e_pf_host_process_cmd_reset_vf(vf); >>> >>> return 0; >>> >