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 2BC19A0503; Wed, 18 May 2022 15:01:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A40F542B6F; Wed, 18 May 2022 15:00:39 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 5FDD142B6E for ; Wed, 18 May 2022 15:00:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652878838; x=1684414838; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=2psPMGbtrAxXB7QXkGsn33hx0gaygu6MzUlp4kIFvyQ=; b=HcdT79SPl1OiLuBRIz0YYIHjQQuKxZVfnEy+lFlQhaI3Xrbx5zQvB4Ew 7KVUiTEFXynkuIR36iKPk87Tdi9hHhRaxJrXfX7v5pwGzo9ey6tjqWcBQ sV69kUjV/zI9abhbj8O6HQ/wKFk1j1iId0PI2t/OzzzQ5Hk2J8u2abSZH 0uYsi6M4841hSjexjDEDR9SjnDmZPuGp8rkvkwXz8A3r9rxuJJei8+9ak Y/5Y7a9sJFTBfDd8aDYBeVsvjblm5QthktE0aKVJIpqAtu+n3khv4zTsJ J1XkjLpTM67/Xe9Kk2xsPNOkp3K44+W8bw7Nrmegq56ZqhlfJ2QcDc59K w==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="271353633" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="271353633" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2022 06:00:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="556312228" Received: from dpdk-dipei.sh.intel.com ([10.67.110.238]) by orsmga002.jf.intel.com with ESMTP; 18 May 2022 06:00: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 v8 05/13] vdpa/ifc: add vDPA interrupt relay for blk device Date: Wed, 18 May 2022 20:13:47 +0800 Message-Id: <1652876035-70513-6-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1652876035-70513-1-git-send-email-andy.pei@intel.com> References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1652876035-70513-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 --- 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 350214a..509a1ed 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