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 93782A04A9; Tue, 25 Jan 2022 07:54:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9501F42878; Tue, 25 Jan 2022 07:53:33 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 2153342878 for ; Tue, 25 Jan 2022 07:53:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643093612; x=1674629612; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=RP8MZzDlK94sqHiey5HuZVVinOlXw0d6JHwDfo1Thk8=; b=Re3hnIPPTHiW8usDkcRELcoVGwXs1GuHnSZVoPriwPhFEAxoskxyEZLQ IklI2YR1Yl78DSwhZW+31rscDv2m/HcQF2Bonneo1v2PAOxk+lu6xGQw+ aDIm4XRL0Qfhd90KyBxNaTWlFQyNgSORa0WX47ZskcjNUmVaTO2itU0jV +OOo76NKW8m2A96uauwt2sSspzMfGKcsUCa0DeXv5Ft/Q6S8JfK+zWicX tydUi1omSIjFVFfO85y5na4Tixrd/g7vJQ/E21nKE5tEZqUFaQ2BrBVNQ WQ07V3/fOqKfI6qwcENGvAyLRZ+bwn8r+TgzxNjUYbcpqDBHOr01RtA45 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="246181335" X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="246181335" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 22:53:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="695724330" Received: from dpdk-dipei.sh.intel.com ([10.67.111.91]) by orsmga005.jf.intel.com with ESMTP; 24 Jan 2022 22:53:30 -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 09/15] vdpa/ifc: add some log at VDPA lauch before qemu connect Date: Tue, 25 Jan 2022 14:47:32 +0800 Message-Id: <1643093258-47258-10-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1643093258-47258-1-git-send-email-andy.pei@intel.com> References: <1643093258-47258-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 Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index eff6ff3..0b4b77f 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -1447,6 +1447,9 @@ struct rte_vdpa_dev_info dev_info[] = { struct rte_kvargs *kvlist = NULL; int ret = 0; int16_t device_id; + __u64 capacity = 0; + uint8_t *byte; + uint32_t i; if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; @@ -1513,6 +1516,32 @@ struct rte_vdpa_dev_info dev_info[] = { internal->features = features & ~(1ULL << VIRTIO_F_IOMMU_PLATFORM); internal->features |= dev_info[IFCVF_BLK].features; + + /** + ** cannot read 64-bit register in one attempt, + ** so read byte by byte. + **/ + for (i = 0; i < sizeof(internal->hw.blk_cfg->capacity); i++) { + byte = (uint8_t *)&internal->hw.blk_cfg->capacity + i; + capacity |= (__u64)*byte << (i * 8); + } + DRV_LOG(INFO, "capacity : %quG", capacity >> 21); + + DRV_LOG(INFO, "size_max : 0x%08x", + internal->hw.blk_cfg->size_max); + DRV_LOG(INFO, "seg_max : 0x%08x", + internal->hw.blk_cfg->seg_max); + DRV_LOG(INFO, "blk_size : 0x%08x", + internal->hw.blk_cfg->blk_size); + DRV_LOG(INFO, "geometry"); + DRV_LOG(INFO, " cylinders: %u", + internal->hw.blk_cfg->geometry.cylinders); + DRV_LOG(INFO, " heads : %u", + internal->hw.blk_cfg->geometry.heads); + DRV_LOG(INFO, " sectors : %u", + internal->hw.blk_cfg->geometry.sectors); + DRV_LOG(INFO, "num_queues: 0x%08x", + internal->hw.blk_cfg->num_queues); } list->internal = internal; -- 1.8.3.1