Skip to contentSkip to conversation

net/iavf: fix queue pairs configuration

PATCH Applied Zhang,Alvin 4 participants 5 messages Dec 23, 2020 – Dec 28, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: fix queue pairs configuration

From: Alvin Zhang <[email protected]>

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")
---
 drivers/net/iavf/iavf_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_ethdev.c +3 -1
index 7e3c26a..f015121 100644
@@ -372,8 +372,10 @@ struct rte_iavf_xstats_name_off {
 	} 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;
Signature · 1 line
1.8.3.1
#1 lore raw

Hi, Alvin,

Quoted 38 lines

-----Original Message-----
From: Zhang,Alvin <[email protected]>
Sent: Wednesday, December 23, 2020 1:30 PM
To: Xing, Beilei <[email protected]>; Xu, Ting <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH] net/iavf: fix queue pairs configuration

From: Alvin Zhang <[email protected]>

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")
---
 drivers/net/iavf/iavf_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_ethdev.c +1 -0
index 7e3c26a..f015121 100644
@@ -372,8 +372,10 @@ struct rte_iavf_xstats_name_off {
 	} 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.

drivers/net/iavf/iavf_ethdev.c +2 -2
 		 */
-		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;
--
Quoted 1 line

1.8.3.1

Will it be better to change ret = iavf_queues_req_reset(dev, num_queue_pairs); to ret = iavf_queues_req_reset(dev, IAVF_MAX_NUM_QUEUES_DFLT); based on the original codes?
Since PF provides default 16 queue pairs to VF. If large VF is no need to be enabled, it may be better to reset the queue pairs number to 16. So that we don't need to compare the queue pairs number and request queues each time when it is no more than 16. If more, it turns to large VF to handle. The original codes here are not good.
Thanks.

#2 lore raw

Hi Xuting,

Thanks for your reply.
It's very efficient for CVL. But the FVL PF provides default 4 queue pairs to VF, if every VF request 16 queue pairs, there may be not enough queues pairs for all VFs.

BR,
Alvin

Quoted 60 lines

-----Original Message-----
From: Xu, Ting <[email protected]>
Sent: Wednesday, December 23, 2020 2:06 PM
To: Zhang, AlvinX <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: RE: [PATCH] net/iavf: fix queue pairs configuration

Hi, Alvin,

Quoted 40 lines

-----Original Message-----
From: Zhang,Alvin <[email protected]>
Sent: Wednesday, December 23, 2020 1:30 PM
To: Xing, Beilei <[email protected]>; Xu, Ting <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH] net/iavf: fix queue pairs configuration

From: Alvin Zhang <[email protected]>

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: [email protected]

---
 drivers/net/iavf/iavf_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/iavf/iavf_ethdev.c index 7e3c26a..f015121 100644

drivers/net/iavf/iavf_ethdev.c +1 -0
@@ -372,8 +372,10 @@ struct rte_iavf_xstats_name_off {
 	} 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.

drivers/net/iavf/iavf_ethdev.c +2 -2
 		 */
-		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;
--
Quoted 1 line

1.8.3.1

Will it be better to change ret = iavf_queues_req_reset(dev, num_queue_pairs); to ret = iavf_queues_req_reset(dev, IAVF_MAX_NUM_QUEUES_DFLT); based on the original codes?
Since PF provides default 16 queue pairs to VF. If large VF is no need to be enabled, it may be better to reset the queue pairs number to 16. So that we don't need to compare the queue pairs number and request queues each time when it is no more than 16. If more, it turns to large VF to handle. The original codes here are not good.
Thanks.

Tested-by on v1 1/1
#3 lore raw
In reply to Zhang,Alvin

Regards,
HuangZhiMin

Quoted 38 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Zhang,Alvin
Sent: Wednesday, December 23, 2020 1:30 PM
To: Xing, Beilei <[email protected]>; Xu, Ting <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] net/iavf: fix queue pairs configuration

From: Alvin Zhang <[email protected]>

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")
---
 drivers/net/iavf/iavf_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_ethdev.c index renamed from drivers/net/iavf/iavf_ethdev.c +0 -0

7e3c26a..f015121 100644

drivers/net/iavf/iavf_ethdev.c +3 -2
@@ -372,8 +372,10 @@ struct rte_iavf_xstats_name_off {
 	} 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;
--

1.8.3.1

Acked-by on v1 1/1 Applied
#4 lore raw
In reply to Zhang,Alvin
Quoted 11 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Zhang,Alvin
Sent: Wednesday, December 23, 2020 1:30 PM
To: Xing, Beilei <[email protected]>; Xu, Ting <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] net/iavf: fix queue pairs configuration

From: Alvin Zhang <[email protected]>

Quoted 7 lines

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")

Applied to dpdk-next-net-intel.

Thanks
Qi