From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 42A0DA04FF; Tue, 24 May 2022 05:36:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23F1F42B73; Tue, 24 May 2022 05:35:40 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 1ADC3427FF for ; Tue, 24 May 2022 05:35:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653363338; x=1684899338; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=y9UEly9sJA1NJDD3iw4wrPO5vv2ZlBIXOio7m4/KTWs=; b=jBDNta+MEp3V2RQNzyb9xRB/xwIzHEhVVgyFpZEkhjorjkR/anPXrxqp drjjFJ31MjfTBkJkG8Koj+ggip/CIaNuTJOAhV1Sf1USlP4RnB2EPFQOj U8QeXLv4cL3hT46tvR9q22OrGhf2H0fWFukUv1RAyyK7/LqkVDR7wz6kR mPccrMKjULFtgxsaifRI2tS1f+yl/4ZUuHuY9eImufxCZgauXT7gfFRCc CW7orwMFLOF5J+Gfc9O/gcgjfRMAho8lMK8olMuJlYJ7654o7hhlymPki d0ggYwkjU+qrUhNeYmpEf4GwMYbSd5dWGmwA3A4tPFHXccY1P2b98vHyR g==; X-IronPort-AV: E=McAfee;i="6400,9594,10356"; a="273533610" X-IronPort-AV: E=Sophos;i="5.91,247,1647327600"; d="scan'208";a="273533610" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 20:35:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,247,1647327600"; d="scan'208";a="745046955" Received: from dpdk-dipei.sh.intel.com ([10.67.110.238]) by orsmga005.jf.intel.com with ESMTP; 23 May 2022 20:35:35 -0700 From: Andy Pei To: dev@dpdk.org Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com, gang.cao@intel.com, changpeng.liu@intel.com, rosen.xu@intel.com, qimaix.xiao@intel.com Subject: [PATCH v10 05/13] vdpa/ifc: add vDPA interrupt relay for blk device Date: Tue, 24 May 2022 10:48:09 +0800 Message-Id: <1653360497-18080-6-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1653360497-18080-1-git-send-email-andy.pei@intel.com> References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1653360497-18080-1-git-send-email-andy.pei@intel.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Reviewed-by: Chenbo Xia --- 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 10a4a25..61fb427 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