DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: enable multi-queue Rx interrupt for VF
@ 2019-12-03 11:43 Lunyuan Cui
  2019-12-24  1:40 ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Lunyuan Cui @ 2019-12-03 11:43 UTC (permalink / raw)
  To: dev; +Cc: Beilei Xing, Qi Zhang, Qiming Yang, Lunyuan Cui

Current implementation is that only one Rx queue can support interrupt,
because all queues are mapped in the same vector id in vfio_enable_msix().
So VF can not support multi-queue Rx interrupt in the interrupt mode.

In this patch, if the packet I/O interrupt on datapath is enabled
(rte_intr_dp_is_en(intr_handle) is true), we map different interrupt
vectors to each queue and send this map to PF.
After PF sets the map to the register,
all Rx queue interrupts will be received.

In addition, vector id should less than the maximum vector value.
When queue number is more than vector value,
we set up a loop of interrupt vectors map.

Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 5dba0928b..b08583c03 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -651,12 +651,13 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	struct vf_cmd_info args;
 	uint8_t cmd_buffer[sizeof(struct virtchnl_irq_map_info) + \
-		sizeof(struct virtchnl_vector_map)];
+		sizeof(struct virtchnl_vector_map) * dev->data->nb_rx_queues];
 	struct virtchnl_irq_map_info *map_info;
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
 	uint32_t vector_id;
 	int i, err;
+	uint16_t nb_msix;
 
 	if (dev->data->dev_conf.intr_conf.rxq != 0 &&
 	    rte_intr_allow_others(intr_handle))
@@ -664,19 +665,25 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
 	else
 		vector_id = I40E_MISC_VEC_ID;
 
+	nb_msix = RTE_MIN(vf->vf_res->max_vectors,
+			intr_handle->nb_efd);
+
 	map_info = (struct virtchnl_irq_map_info *)cmd_buffer;
-	map_info->num_vectors = 1;
-	map_info->vecmap[0].rxitr_idx = I40E_ITR_INDEX_DEFAULT;
-	map_info->vecmap[0].vsi_id = vf->vsi_res->vsi_id;
-	/* Alway use default dynamic MSIX interrupt */
-	map_info->vecmap[0].vector_id = vector_id;
-	/* Don't map any tx queue */
-	map_info->vecmap[0].txq_map = 0;
-	map_info->vecmap[0].rxq_map = 0;
+	map_info->num_vectors = dev->data->nb_rx_queues;
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
-		map_info->vecmap[0].rxq_map |= 1 << i;
+		map_info->vecmap[i].rxitr_idx = I40E_ITR_INDEX_DEFAULT;
+		map_info->vecmap[i].vsi_id = vf->vsi_res->vsi_id;
+		/* Alway use default dynamic MSIX interrupt */
+		map_info->vecmap[i].vector_id = vector_id;
+		/* Don't map any tx queue */
+		map_info->vecmap[i].txq_map = 0;
+		map_info->vecmap[i].rxq_map = 1 << i;
 		if (rte_intr_dp_is_en(intr_handle))
 			intr_handle->intr_vec[i] = vector_id;
+		if (vector_id > I40E_MISC_VEC_ID)
+			vector_id++;
+		if (vector_id > nb_msix)
+			vector_id = I40E_RX_VEC_START;
 	}
 
 	args.ops = VIRTCHNL_OP_CONFIG_IRQ_MAP;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: enable multi-queue Rx interrupt for VF
  2019-12-03 11:43 [dpdk-dev] [PATCH] net/i40e: enable multi-queue Rx interrupt for VF Lunyuan Cui
@ 2019-12-24  1:40 ` Zhang, Qi Z
  2019-12-24  2:53   ` Ye Xiaolong
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Qi Z @ 2019-12-24  1:40 UTC (permalink / raw)
  To: Cui, LunyuanX, dev; +Cc: Xing, Beilei, Yang, Qiming



> -----Original Message-----
> From: Cui, LunyuanX <lunyuanx.cui@intel.com>
> Sent: Tuesday, December 3, 2019 7:44 PM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Yang, Qiming <qiming.yang@intel.com>; Cui, LunyuanX
> <lunyuanx.cui@intel.com>
> Subject: [PATCH] net/i40e: enable multi-queue Rx interrupt for VF
> 
> Current implementation is that only one Rx queue can support interrupt,
> because all queues are mapped in the same vector id in vfio_enable_msix().
> So VF can not support multi-queue Rx interrupt in the interrupt mode.
> 
> In this patch, if the packet I/O interrupt on datapath is enabled
> (rte_intr_dp_is_en(intr_handle) is true), we map different interrupt vectors to
> each queue and send this map to PF.
> After PF sets the map to the register,
> all Rx queue interrupts will be received.
> 
> In addition, vector id should less than the maximum vector value.
> When queue number is more than vector value, we set up a loop of interrupt
> vectors map.
> 
> Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: enable multi-queue Rx interrupt for VF
  2019-12-24  1:40 ` Zhang, Qi Z
@ 2019-12-24  2:53   ` Ye Xiaolong
  0 siblings, 0 replies; 3+ messages in thread
From: Ye Xiaolong @ 2019-12-24  2:53 UTC (permalink / raw)
  To: Zhang, Qi Z; +Cc: Cui, LunyuanX, dev, Xing, Beilei, Yang, Qiming

On 12/24, Zhang, Qi Z wrote:
>
>
>> -----Original Message-----
>> From: Cui, LunyuanX <lunyuanx.cui@intel.com>
>> Sent: Tuesday, December 3, 2019 7:44 PM
>> To: dev@dpdk.org
>> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
>> Yang, Qiming <qiming.yang@intel.com>; Cui, LunyuanX
>> <lunyuanx.cui@intel.com>
>> Subject: [PATCH] net/i40e: enable multi-queue Rx interrupt for VF
>> 
>> Current implementation is that only one Rx queue can support interrupt,
>> because all queues are mapped in the same vector id in vfio_enable_msix().
>> So VF can not support multi-queue Rx interrupt in the interrupt mode.
>> 
>> In this patch, if the packet I/O interrupt on datapath is enabled
>> (rte_intr_dp_is_en(intr_handle) is true), we map different interrupt vectors to
>> each queue and send this map to PF.
>> After PF sets the map to the register,
>> all Rx queue interrupts will be received.
>> 
>> In addition, vector id should less than the maximum vector value.
>> When queue number is more than vector value, we set up a loop of interrupt
>> vectors map.
>> 
>> Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
>
>Acked-by: Qi Zhang <qi.z.zhang@intel.com>
>


Applied to dpdk-next-net-intel, Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-24  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03 11:43 [dpdk-dev] [PATCH] net/i40e: enable multi-queue Rx interrupt for VF Lunyuan Cui
2019-12-24  1:40 ` Zhang, Qi Z
2019-12-24  2:53   ` Ye Xiaolong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).