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 1738AA00C4; Sat, 29 Jan 2022 04:10:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EC784287C; Sat, 29 Jan 2022 04:10:07 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 757664287C for ; Sat, 29 Jan 2022 04:10:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643425805; x=1674961805; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=R+qNdOwaAl9rT7qqmMsCSuCALqb077qFtF0bAkVlzu8=; b=i3cbV07S7l1zIsWrvyR9xxW8jWMvsHEsoZBDGl059Bl+842EK71YOXVq JUMzodtiXp3tI8hQIj7Dc/fH2sdVOZCZuens0NTg57Rw4g70P1BPqEF3l 0RWmp2SzF4qzjfSTXMLJip95dGeRBnUoWV5dUqrcirmFo1doQ/DuHYOv6 MynauWgzIInQ4ENA+ZDmvRArUpxVgiP+I6Rb8er6QqE3dxOPWQPMqS8vQ CdHqvYHDQ4TRZ6rseBrdmQ/QnrviiK2A/9+D5wYqM6x34MCKfBzmhap4a 2yIACLrM15eprGmP+yyYIrRhwx8KCVGld7vQAbpOSNvFxuWlokFPqqad4 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10241"; a="246076647" X-IronPort-AV: E=Sophos;i="5.88,325,1635231600"; d="scan'208";a="246076647" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2022 19:10:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,325,1635231600"; d="scan'208";a="582047924" Received: from dpdk-dipei.sh.intel.com ([10.67.111.91]) by fmsmga008.fm.intel.com with ESMTP; 28 Jan 2022 19:10:03 -0800 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 v3 12/15] vdpa/ifc: add is_blk flag to ifcvf_hw, and init is_blk during probe Date: Sat, 29 Jan 2022 11:03:34 +0800 Message-Id: <1643425417-215270-13-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643425417-215270-1-git-send-email-andy.pei@intel.com> References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1643425417-215270-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 Add is_blk flag to ifcvf_hw, and init is_blk during probe. Signed-off-by: Andy Pei --- drivers/vdpa/ifc/base/ifcvf.h | 1 + drivers/vdpa/ifc/ifcvf_vdpa.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/vdpa/ifc/base/ifcvf.h b/drivers/vdpa/ifc/base/ifcvf.h index 6dd7925..8e602af 100644 --- a/drivers/vdpa/ifc/base/ifcvf.h +++ b/drivers/vdpa/ifc/base/ifcvf.h @@ -149,6 +149,7 @@ struct ifcvf_hw { u8 *lm_cfg; struct vring_info vring[IFCVF_MAX_QUEUES * 2]; u8 nr_vring; + u8 is_blk; struct ifcvf_pci_mem_resource mem_resource[IFCVF_PCI_MAX_RESOURCE]; }; diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 37fa45e..b65e3a3 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -1608,11 +1608,13 @@ struct rte_vdpa_dev_info dev_info[] = { if (device_id == VIRTIO_ID_NET) { internal->device_type = IFCVF_NET; + internal->hw.is_blk = IFCVF_NET; internal->features = features & ~(1ULL << VIRTIO_F_IOMMU_PLATFORM); internal->features |= dev_info[IFCVF_NET].features; } else if (device_id == VIRTIO_ID_BLOCK) { internal->device_type = IFCVF_BLK; + internal->hw.is_blk = IFCVF_BLK; internal->features = features & ~(1ULL << VIRTIO_F_IOMMU_PLATFORM); internal->features |= dev_info[IFCVF_BLK].features; -- 1.8.3.1