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 61328A055F; Mon, 17 Oct 2022 13:45:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 492B741101; Mon, 17 Oct 2022 13:45:48 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 99B7840A84 for ; Mon, 17 Oct 2022 13:45:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666007145; x=1697543145; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=MZkE2BhYeMTxAZlKloqSsOQ5PvQYywfYmwmnp/qtYZA=; b=YF208v9btNPXlXZAV0PWeej0H10DPxCnnYsfiIFkgZaqeV0fqjA6J9PA 1NzB4tS79YyvzPGYREDBpeDcaxA799b49EeDcXG8DBMbG3IXUvt9Jg/jx ElJxUZrucsdf48T/a7AklR58X5DxqXcRXAC3gwHVBF/QkXGMz3ZSVUMah eLbE8LHj/uFUGOrSEXsdRzHrmtYd7MfwjbP8hSNcmmBReqfHhBD5aHvOL 1g58WvxcfVs9OhAOhF7Es6HTe+UBwGstpU8Rcpew+jyuV/HC0AbJtutUk sAZY2JqNRfwG1SmF/rWkH/Lk59TI+Luy9970XDhlMAncOrYpV8TQ3txMA Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10502"; a="305763809" X-IronPort-AV: E=Sophos;i="5.95,191,1661842800"; d="scan'208";a="305763809" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2022 04:45:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10502"; a="623199906" X-IronPort-AV: E=Sophos;i="5.95,191,1661842800"; d="scan'208";a="623199906" Received: from dpdk-dipei.sh.intel.com ([10.67.110.251]) by orsmga007.jf.intel.com with ESMTP; 17 Oct 2022 04:45:37 -0700 From: Andy Pei To: dev@dpdk.org Cc: chenbo.xia@intel.com, rosen.xu@intel.com, wei.huang@intel.com, gang.cao@intel.com, maxime.coquelin@redhat.com Subject: [PATCH v6 2/8] vdpa/ifc: add multi-queue support Date: Mon, 17 Oct 2022 19:41:39 +0800 Message-Id: <1666006905-74029-3-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666006905-74029-1-git-send-email-andy.pei@intel.com> References: <1661229305-240952-2-git-send-email-andy.pei@intel.com> <1666006905-74029-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 Enable VHOST_USER_PROTOCOL_F_MQ feature. Expose IFCVF_MQ_OFFSET register to enable multi-queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 9 +++++++++ drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1 + 3 files changed, 12 insertions(+) diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c index f1e1474..81c68c0 100644 --- a/drivers/vdpa/ifc/base/ifcvf.c +++ b/drivers/vdpa/ifc/base/ifcvf.c @@ -90,6 +90,15 @@ if (!hw->lm_cfg) WARNINGOUT("HW support live migration not support!\n"); + /* For some hardware implementation, for example: + * the BAR 4 of PF is NULL, while BAR 4 of VF is not. + * This code makes sure hw->mq_cfg is a valid address. + */ + if (hw->mem_resource[4].addr) + hw->mq_cfg = hw->mem_resource[4].addr + IFCVF_MQ_OFFSET; + else + hw->mq_cfg = NULL; + if (hw->common_cfg == NULL || hw->notify_base == NULL || hw->isr == NULL || hw->dev_cfg == NULL) { DEBUGOUT("capability incomplete\n"); diff --git a/drivers/vdpa/ifc/base/ifcvf.h b/drivers/vdpa/ifc/base/ifcvf.h index ef7697a..d16d9ab 100644 --- a/drivers/vdpa/ifc/base/ifcvf.h +++ b/drivers/vdpa/ifc/base/ifcvf.h @@ -50,6 +50,7 @@ #define IFCVF_LM_CFG_SIZE 0x40 #define IFCVF_LM_RING_STATE_OFFSET 0x20 +#define IFCVF_MQ_OFFSET 0x28 #define IFCVF_LM_LOGGING_CTRL 0x0 @@ -149,6 +150,7 @@ struct ifcvf_hw { u16 *notify_base; u16 *notify_addr[IFCVF_MAX_QUEUES * 2]; u8 *lm_cfg; + u8 *mq_cfg; struct vring_info vring[IFCVF_MAX_QUEUES * 2]; u8 nr_vring; int device_type; diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index b4389a0..008cf89 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -1248,6 +1248,7 @@ struct rte_vdpa_dev_info { 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD | \ 1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER | \ 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD | \ + 1ULL << VHOST_USER_PROTOCOL_F_MQ | \ 1ULL << VHOST_USER_PROTOCOL_F_STATUS) #define VDPA_BLK_PROTOCOL_FEATURES \ -- 1.8.3.1