[PATCH v9 05/13] vdpa/ifc: add vDPA interrupt relay for blk device
Xia, Chenbo
chenbo.xia at intel.com
Tue May 24 04:58:15 CEST 2022
> -----Original Message-----
> From: Pei, Andy <andy.pei at intel.com>
> Sent: Monday, May 23, 2022 5:35 PM
> To: dev at dpdk.org
> Cc: Xia, Chenbo <chenbo.xia at intel.com>; maxime.coquelin at redhat.com; Cao,
> Gang <gang.cao at intel.com>; Liu, Changpeng <changpeng.liu at intel.com>; Xu,
> Rosen <rosen.xu at intel.com>; Xiao, QimaiX <qimaix.xiao at intel.com>
> Subject: [PATCH v9 05/13] vdpa/ifc: add vDPA interrupt relay for blk
> device
>
> For the net device type, only interrupt of rxq needed to be relayed.
> But for block, since all the queues are used for both read and write
> requests. Interrupt of all queues needed to be relayed.
>
> Signed-off-by: Andy Pei <andy.pei at intel.com>
> ---
> drivers/vdpa/ifc/ifcvf_vdpa.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index c1fc1d7..1d05529 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -369,6 +369,7 @@ struct rte_vdpa_dev_info {
> irq_set->index = VFIO_PCI_MSIX_IRQ_INDEX;
> irq_set->start = 0;
> fd_ptr = (int *)&irq_set->data;
> + /* The first interrupt is for the configure space change
> notification */
> fd_ptr[RTE_INTR_VEC_ZERO_OFFSET] =
> rte_intr_fd_get(internal->pdev->intr_handle);
>
> @@ -378,7 +379,13 @@ struct rte_vdpa_dev_info {
> for (i = 0; i < nr_vring; i++) {
> rte_vhost_get_vhost_vring(internal->vid, i, &vring);
> fd_ptr[RTE_INTR_VEC_RXTX_OFFSET + i] = vring.callfd;
> - if ((i & 1) == 0 && m_rx == true) {
> + if (m_rx == true &&
> + ((i & 1) == 0 || internal->hw.device_type == IFCVF_BLK))
> {
> + /* For the net we only need to relay rx queue,
> + * which will change the mem of VM.
> + * For the blk we need to relay all the read cmd
> + * of each queue
> + */
> fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
> if (fd < 0) {
> DRV_LOG(ERR, "can't setup eventfd: %s",
> --
> 1.8.3.1
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
Btw: add my R-by in next version as I see in this version, they are missed.
More information about the dev
mailing list