From 403aebc44c04952f98fc7501e26eb77098d74bc8 Mon Sep 17 00:00:00 2001 From: Alvin Zhang Date: Wed, 23 Dec 2020 13:29:36 +0800 Subject: [PATCH] net/iavf: fix queue pairs configuration Check if there are enough queue pairs currently allocated, and if not, request PF to allocate them. Fixes: e436cd43835b ("net/iavf: negotiate large VF and request more queues") Cc: stable@dpdk.org Signed-off-by: Alvin Zhang Tested-by: Zhimin Huang Acked-by: Qi Zhang --- drivers/net/iavf/iavf_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index d2fa168256..7bf31d4f4e 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -375,8 +375,10 @@ iavf_dev_configure(struct rte_eth_dev *dev) } else { /* Check if large VF is already enabled. If so, disable and * release redundant queue resource. + * Or check if enough queue pairs. If not, request them from PF. */ - if (vf->lv_enabled) { + if (vf->lv_enabled || + num_queue_pairs > vf->vsi_res->num_queue_pairs) { ret = iavf_queues_req_reset(dev, num_queue_pairs); if (ret) return ret; -- 2.20.1