From: Zhirun Yan Date: Tue, 15 Jan 2019 14:57:17 +0000 (+0000) Subject: net/i40e: support request any number of queues X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=76469c0631adbc007e89f70f2503ed9b5e3f7f8b;p=dpdk.git net/i40e: support request any number of queues 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 Acked-by: Qi Zhang --- diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index d6e83e3403..585b21cbcc 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;