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 44A04A04FD; Mon, 23 May 2022 12:23:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3157A42B72; Mon, 23 May 2022 12:22:44 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 404064281C for ; Mon, 23 May 2022 12:22:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653301363; x=1684837363; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=sVBFE3rhLiVJycha7dhdlb6HMYWMwQJlPEd4Vd1PKq8=; b=F0CzsOrepTfp4k6M21mWreu+TdBAxEzL/Rqq5FvMpFdLHjCJyXxJbA35 zDiR7cPwZIU9nvWquWh00LWpLXgD+A9k3Hwh2DShyEPzCNPPK54uVxEEA T8r6zYHlxK2eDK7QdKMNlluBbKdVl/Cg6SGwZ4hWcCHPVCy3dP3yWeCnB RF3H3It07XzVOMRE9q+qvFrd1tEEvIbticf6kq/NvM/6X/2lKESEEPrAj SWjO367/APFb3VVwEbymiO79HHN38WyZcmkYGY9GrJwiTBfJGBMbX3K8Q 1dSBeaa+AwXtpJANC6s+sXT4ZwnzUij5cq2LA5blJPI6OO149nk6QqbxB w==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="255239311" X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="255239311" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 03:22:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="547889436" Received: from dpdk-dipei.sh.intel.com ([10.67.110.238]) by orsmga006.jf.intel.com with ESMTP; 23 May 2022 03:22:40 -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 v9 05/13] vdpa/ifc: add vDPA interrupt relay for blk device Date: Mon, 23 May 2022 17:35:16 +0800 Message-Id: <1653298524-232138-6-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1653298524-232138-1-git-send-email-andy.pei@intel.com> References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1653298524-232138-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 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