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 9613CA0560; Tue, 18 Oct 2022 14:58:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2849A41147; Tue, 18 Oct 2022 14:58:31 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id C99BF4021D for ; Tue, 18 Oct 2022 14:58:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666097908; x=1697633908; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=MZkE2BhYeMTxAZlKloqSsOQ5PvQYywfYmwmnp/qtYZA=; b=NlAxpux8IhPjm2DKK9/rbyz2OYezKkHG5kmD+anqaZjW1n2kTnvgdBFK oqHcvf3xxrdzP9G/R5eo3PQFzwieZdvPxL0AwUUTl622JI+DMZmeEg7zO Lq1AHWGd250NWUMfc/kYtwa+UDhH3K4WM5ioIzp8Zf9dVtCKQt+6p7r3l UmcZILN6RyKIh8onV+NuHvf2IF9WcRHj/3nAqZc6FDYw36/DB+0mcJe8T 6NEGrAnnhB9ivGfQ09xIwXeFoI/U13uW4X1BWNORBNqfT0RcIhLHPz5h+ VnDvlG8kJAMyA+GLPhIJE+xbmOJ8FUn9VoUqE+1cQmPdJmDNND8YtZli5 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="307179409" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="307179409" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 05:58:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="733614382" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="733614382" Received: from dpdk-dipei.sh.intel.com ([10.67.110.251]) by fmsmga002.fm.intel.com with ESMTP; 18 Oct 2022 05:58:08 -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 v8 02/12] vdpa/ifc: add multi-queue support Date: Tue, 18 Oct 2022 20:07:41 +0800 Message-Id: <1666094871-25721-3-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666094871-25721-1-git-send-email-andy.pei@intel.com> References: <1661229305-240952-2-git-send-email-andy.pei@intel.com> <1666094871-25721-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