From patchwork Wed Apr 27 08:29:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pei, Andy" X-Patchwork-Id: 110311 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 684B5A0507; Wed, 27 Apr 2022 11:17:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C0344280C; Wed, 27 Apr 2022 11:16:50 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 4E02E427F9 for ; Wed, 27 Apr 2022 11:16:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651051007; x=1682587007; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=nhDz1GDcUFS4P/yyd4KLPaZs9X8THWHjTZMM432Rau0=; b=EfsDNnkV7YodfU9PBJ2UbduQ6yLIW0sW1cmY+yBHz0vpPETDupPLg7wT ttBTisLLBo3PgV0+PMiv1hgeI9jYt+ig2kDh5mnhHC9Z5dybCjjpJI/sE k77ZgsjrQR3b/59xB+pcU637Xh7OmiuBoCkg0zqsgp352b+29Umm5R2HL 6fIvThFFwmOG9eborrxm2J+6gc44VwRhYuL5Pw2jqO4itTHmCsv+WXZfZ SZLAni6iiR5yuR7Hz6Lc1xzyxAQP3WcAE/IqTgQacPqFgqNwyhna8g609 Inkv3nO+Rdh1Lck8v1DsPMw2Sl44njGieV5Z9uhA51jPmHRvmG0oAydol A==; X-IronPort-AV: E=McAfee;i="6400,9594,10329"; a="352308254" X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="352308254" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2022 02:16:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="580488684" Received: from dpdk-dipei.sh.intel.com ([10.67.110.238]) by orsmga008.jf.intel.com with ESMTP; 27 Apr 2022 02:16:31 -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 Subject: [PATCH v7 05/18] vdpa/ifc: add vDPA interrupt for blk device Date: Wed, 27 Apr 2022 16:29:53 +0800 Message-Id: <1651048206-282372-6-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1651048206-282372-1-git-send-email-andy.pei@intel.com> References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1651048206-282372-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 block device type, we use one queue to transfer both read and write requests, so we have to relay commands on all queues. 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 8ee041f..07fc3ca 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -370,6 +370,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); @@ -379,7 +380,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->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",