Skip to contentSkip to conversation

net/i40e: support request any number of queues

PATCH Applied Zhirun Yan 3 participants 5 messages Jan 15, 2019 – Mar 5, 2019 Network drivers

lore
Share & tools
lore

Zhirun Yan

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/i40e/i40e_pf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/i40e/i40e_pf.c +4 -1
index 092e0d3e9..d110dffb7 100644
@@ -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;
Signature · 1 line
2.17.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Yan, Zhirun
Sent: Tuesday, January 15, 2019 10:57 PM
To: [email protected]; Zhang, Qi Z <[email protected]>
Cc: Yan, Zhirun <[email protected]>
Subject: [PATCH v1] net/i40e: support request any number of queues

Quoted 5 lines

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.

Applied to dpdk-next-net-intel.

Thanks
Qi

#2 lore raw
In reply to Zhirun Yan
Quoted 14 lines · Zhirun Yan

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.

---
 drivers/net/i40e/i40e_pf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/i40e/i40e_pf.c +0 -0
index 092e0d3e9..d110dffb7 100644

drivers/net/i40e/i40e_pf.c i40e_pf_host_process_cmd_request_queues(struct i40e_pf_vf *vf, uint8_t *msg) · line 1277

Quoted 8 lines
drivers/net/i40e/i40e_pf.c +4 -1
@@ -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

Quoted 4 lines
drivers/net/i40e/i40e_pf.c +0 -0
 		i40e_pf_host_process_cmd_reset_vf(vf);
 
 		return 0;
#3 lore raw
Quoted 27 lines

-----Original Message-----
From: Kevin Traynor [mailto:[email protected]]
Sent: Wednesday, January 16, 2019 1:34 AM
To: Yan, Zhirun <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1] net/i40e: support request any number of queues

drivers/net/i40e/i40e_pf.c

Quoted 14 lines · Zhirun Yan

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.

---
 drivers/net/i40e/i40e_pf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/i40e/i40e_pf.c +0 -0
index 092e0d3e9..d110dffb7 100644
@@ -1271,7 +1271,10 @@

i40e_pf_host_process_cmd_request_queues(struct i40e_pf_vf *vf, uint8_t *msg)

Quoted 11 lines

drivers/net/i40e/i40e_pf.c i40e_pf_host_process_cmd_request_queues(struct i40e_pf_vf *vf, uint8_t *msg) · line 1277

Quoted 8 lines
drivers/net/i40e/i40e_pf.c +4 -1
 	} 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.

Quoted 5 lines
Quoted 5 lines
drivers/net/i40e/i40e_pf.c +0 -0
 		i40e_pf_host_process_cmd_reset_vf(vf);
 
 		return 0;
#4 lore raw
Quoted 39 lines · Zhirun
Quoted 27 lines

-----Original Message-----
From: Kevin Traynor [mailto:[email protected]]
Sent: Wednesday, January 16, 2019 1:34 AM
To: Yan, Zhirun <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1] net/i40e: support request any number of queues

drivers/net/i40e/i40e_pf.c

Quoted 14 lines · Zhirun Yan

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.

---
 drivers/net/i40e/i40e_pf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/i40e/i40e_pf.c +0 -0
index 092e0d3e9..d110dffb7 100644
@@ -1271,7 +1271,10 @@

i40e_pf_host_process_cmd_request_queues(struct i40e_pf_vf *vf, uint8_t *msg)

Quoted 11 lines

drivers/net/i40e/i40e_pf.c i40e_pf_host_process_cmd_request_queues(struct i40e_pf_vf *vf, uint8_t *msg) · line 1277

Quoted 8 lines
drivers/net/i40e/i40e_pf.c +4 -1
 	} 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

Quoted 4 lines

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.

Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
drivers/net/i40e/i40e_pf.c +0 -0
 		i40e_pf_host_process_cmd_reset_vf(vf);
 
 		return 0;