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 6F48CA00C3; Fri, 13 May 2022 10:34:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F97E40E64; Fri, 13 May 2022 10:34:44 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id EE48F40DDE for ; Fri, 13 May 2022 10:34:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652430882; x=1683966882; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=GX8GdVnGKJ1PhsmM53R70otvGEv9d0NseWyNQzabO+g=; b=S94q54K1d/sb4GQElgkh/0leQimRoPwb8izgVO4sfY9hN/iJl6PhY6Cm 2PvbBOKAjzp59PSy+Ex3ZD6oGG2rvxfEDkf3uaED6v8HdwYpnbMal6R7H l2oK9FW9XkJcV+j6XN6BkyIOM9yoPd8DwzYhuuknoKrbrB72PQG8vF1vE V/LsXhS3mGxykT+7QnzQdsEM5j9OnbabvTm9CmCMJ6wlTDwf8d9n/uCAo cN9wU0OvaEhT4RNOcyNosY7X3dZG+fK0PAy+3bZsQU+obZFBAPLFA55vs jVyHsvLZusACr/8pM+rcAiEtIgePoCvSpweXv+1B6UTCbXRYuwEDZZ2pv w==; X-IronPort-AV: E=McAfee;i="6400,9594,10345"; a="356680311" X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="356680311" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 01:34:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="554141195" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga002.jf.intel.com with ESMTP; 13 May 2022 01:34:39 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 13 May 2022 01:34:39 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 13 May 2022 01:34:38 -0700 Received: from fmsmsx612.amr.corp.intel.com ([10.18.126.92]) by fmsmsx612.amr.corp.intel.com ([10.18.126.92]) with mapi id 15.01.2308.027; Fri, 13 May 2022 01:34:38 -0700 From: "Pei, Andy" To: "Xia, Chenbo" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Cao, Gang" , "Liu, Changpeng" Subject: RE: [PATCH v7 12/18] vdpa/ifc: add some log at vDPA launch before qemu connect Thread-Topic: [PATCH v7 12/18] vdpa/ifc: add some log at vDPA launch before qemu connect Thread-Index: AQHYWheGH1gzokP+yUOZBQI/QkzTZq0bWhzwgAE3soA= Date: Fri, 13 May 2022 08:34:38 +0000 Message-ID: <6a12484f659347bc853d337b8358a61e@intel.com> References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1651048206-282372-1-git-send-email-andy.pei@intel.com> <1651048206-282372-13-git-send-email-andy.pei@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.401.20 dlp-reaction: no-action x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 Hi Chenbo, Thanks for your reply. My reply is inline. > -----Original Message----- > From: Xia, Chenbo > Sent: Thursday, May 12, 2022 9:53 PM > To: Pei, Andy ; dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Cao, Gang ; Liu, > Changpeng > Subject: RE: [PATCH v7 12/18] vdpa/ifc: add some log at vDPA launch befor= e > qemu connect >=20 > > -----Original Message----- > > From: Pei, Andy > > Sent: Wednesday, April 27, 2022 4:30 PM > > To: dev@dpdk.org > > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; > > Cao, Gang ; Liu, Changpeng > > > > Subject: [PATCH v7 12/18] vdpa/ifc: add some log at vDPA launch before > > qemu connect >=20 > Title can be: >=20 > vdpa/ifc: add log for config space of virtio blk >=20 Sure. > > > > Add some log of virtio blk device config space information at VDPA > > launch before qemu connects. > > > > Signed-off-by: Andy Pei > > --- > > drivers/vdpa/ifc/ifcvf_vdpa.c | 28 ++++++++++++++++++++++++++++ > > 1 file changed, 28 insertions(+) > > > > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c > > b/drivers/vdpa/ifc/ifcvf_vdpa.c index ca49bc3..4060a44 100644 > > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > > @@ -1363,6 +1363,9 @@ struct rte_vdpa_dev_info dev_info[] =3D { > > struct rte_kvargs *kvlist =3D NULL; > > int ret =3D 0; > > int16_t device_id; > > + uint64_t capacity =3D 0; > > + uint8_t *byte; > > + uint32_t i; > > > > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) > > return 0; > > @@ -1429,6 +1432,31 @@ struct rte_vdpa_dev_info dev_info[] =3D { > > internal->features =3D features & > > ~(1ULL << > VIRTIO_F_IOMMU_PLATFORM); > > internal->features |=3D dev_info[IFCVF_BLK].features; > > + > > + /* cannot read 64-bit register in one attempt, > > + * so read byte by byte. > > + */ > > + for (i =3D 0; i < sizeof(internal->hw.blk_cfg->capacity); i++) { > > + byte =3D (uint8_t *)&internal->hw.blk_cfg->capacity + i; > > + capacity |=3D (uint64_t)*byte << (i * 8); > > + } > > + DRV_LOG(INFO, "capacity : %"PRIu64"G", capacity >> 21); >=20 > I believe this '21' should be calculated rather than hard-code. >=20 /* The capacity (in 512-byte sectors). */ So right shift 1 we gwt in K. Another right shift 10 we get in M, right shi= ft 10 more bits, we get in G. 10 + 10 + 1 =3D 21. I think add some comments in code is fine, what do you think? > And should these log all be debug log? >=20 These information is hardware ability. I think INFO is fine. > Thanks, > Chenbo >=20 > > + > > + 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 =3D internal; > > -- > > 1.8.3.1 >=20