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 C9A46A04FD; Mon, 23 May 2022 09:46:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7850D4014F; Mon, 23 May 2022 09:46:14 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id D2D8F40041 for ; Mon, 23 May 2022 09:46:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653291973; x=1684827973; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=DL+BmhsZxYhd65BZl31bpziGM0IGuCScuBMw8i0wgig=; b=dTsPNa7ZwicioGbhhvi86czVz3zLLTzWYqpBB3F/itKoVWMiwHZVt5oY 5guQcgDPRoD05mHHbeRiH3LDNr8K/F4GZJ94ClyIPnq1kUgvrbvlAotlB MgpY1h6b22K3zdX78bT5RPEsr3VraQq2+TuGvjIDy1T3EEB0hflItypuA K5h5b1F2H8D9NnTkFZz/A/2kCbjj7iPUIXgL5M2S4ljBaq+m1LfZqjNwC sLKSKp9UrKQosfhLu7q/jIvm+zuEsmacgqVqlkETHgBxw0kkwaUA2I00S 8Fhk6Cm57Jwj5qxfBPLCC16kuB+4ekhVysSvy+q47Szz2aCM+HoDGqp6c Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="253013729" X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="253013729" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 00:46:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="629243528" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga008.fm.intel.com with ESMTP; 23 May 2022 00:46:11 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 00:46:11 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 00:46:11 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 23 May 2022 00:46:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aZrW0XzS2CcvxpgqWv26W5y+Qc2a1uDnPE2VnHm2qks+Swo7h9nn5xzYLe5IwA+zrp/vjX3MSEMIt5O/L+Fn34vE+pgLgPHVv5QB1uyWJGuBICEM8GwMcwxdDoRSSMf5WnJdql9Sl871i+Y6Ni0fiGo8TJpxxujmNyYfA3PD120rKQUVij5On/zKd2AthKz03+5XXFfWUwY7O+FTSOwKiSzOtT0iHOI6wMjsD0zvLOc4tXfjmsdZc9Td7NAMdqWyZUbmUv6dUN9qlukRAlmA7BNcE+Jtb6GZ7JpSF25q28XjIRr/nXr66+bqXm4AcN+QPY51JG6z1een+Q8xAB2nrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EBls8QL30GKPGaVTNCVY1L1u/uble/rU5p3Q9v3IqLA=; b=IKID88DDb0cQBYlLEgl/Tnm6/DHNKIelWLQXWzV0Cvoi4t/RFa3dmQetIhIIvGJFFgzd9OYhx0STcrTdzmg4sUrmaaaDgWdERJp2SWIFSDxVrvmfxgi8KbOP2FKvey6d7LeHaMZOh6oDmpTYACqKFZlOZiBFbTtzX5klqswFjJZngkWKiJI6KAc+ENmmcVXdMl2LcLdUJwNdB8BLJJfbLeifxHasaTAoinmZHoKnxBsBcQg+tcMGCi1hrjHf8tJVuPZUwSIxLzGybLEnx2TQUx0cXO6nRwEK9peBWdT774EVYkmd9rWbw4+tx7qui7e/cm5B4QuUwe9ERmaQFw8UNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by SA2PR11MB4812.namprd11.prod.outlook.com (2603:10b6:806:f8::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15; Mon, 23 May 2022 07:46:10 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54e1:e802:17c8:93f]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54e1:e802:17c8:93f%7]) with mapi id 15.20.5273.023; Mon, 23 May 2022 07:46:10 +0000 From: "Xia, Chenbo" To: "Pei, Andy" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Cao, Gang" , "Liu, Changpeng" , "Xu, Rosen" , "Xiao, QimaiX" Subject: RE: [PATCH v8 11/13] vdpa/ifc: add log for config space of virtio blk Thread-Topic: [PATCH v8 11/13] vdpa/ifc: add log for config space of virtio blk Thread-Index: AQHYards264NOxSQPkC4V2CKnoNC7a0sHJyQ Date: Mon, 23 May 2022 07:46:10 +0000 Message-ID: References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1652876035-70513-1-git-send-email-andy.pei@intel.com> <1652876035-70513-12-git-send-email-andy.pei@intel.com> In-Reply-To: <1652876035-70513-12-git-send-email-andy.pei@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 616e61a1-335c-4fc7-e217-08da3c904d9b x-ms-traffictypediagnostic: SA2PR11MB4812:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qIYXs2knNxuDcOzCRXS1Ayyys1VNnt7nl227uHYwl40WLxJ/OoTiXKAM4rGKdp7uPq+LpQhoEL5Oy82L8AwTfcpa2dWF5vmjGdm803sXx9lKPHCSzRATmiR3EftJsIfaepG15DRANzup4G85+FkS76oKk/7ri5HWXSlNmke7RAyVpVQSKmp33mN9ezsbA0lq5dj3QuIFCifMsu2keUwE/VADqoBvh6UxnE2uteLRIRGtxcannbsGAk5LPH7m8bDpjpPsFa/wgQ6n0fWG7JqUw7niBefvu+YJ29XZ26UENF1XuMgVYJVfexcK08HZ0cuEFMH2kOQfo8KuKUTuPvTvaL443v5c4tySJ72Nc28AhgGd+0Ted21hg0Bc/9k0tgJO/Q1ZYpdWCDsPF2LJ5VInTiy5NaR+ECkzVtZJN+4/YQQmMaJvLp/++lwQu8pXpIibEX7k9QGLgxvRP652SKG1QlQuRWS28E3unIo0gjN+gG+c3kZc8dgDtyb6A+CMO4t8FwY7ar7kUvDJy80prO3cR4VomtGhuGasDM7DKsV/XfsjmC91ivoleZRtHKRNcm31r6QlPCFTRbo7PPr4d+kOBELvjl5NxL+0LJG6xt3k15ZW1NoJMiDKS/MtcFO8ihhZb78rlcpmPn9xGEVp06UKwpmmTLjQ2hNKFevfHemh4p7lUJ3h40b5+4iPJlmi6e6IZEJGX6NMOekUNE+fyBGONg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(71200400001)(38100700002)(33656002)(83380400001)(26005)(508600001)(107886003)(2906002)(8936002)(9686003)(186003)(76116006)(110136005)(6506007)(66476007)(54906003)(52536014)(66946007)(86362001)(122000001)(7696005)(5660300002)(53546011)(4326008)(8676002)(316002)(66556008)(66446008)(64756008)(55016003)(38070700005)(82960400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?uI/4DNxPFK0o1MZpSU79r2VQvN84aPrqS0dqhOoNZR7502WBKPNDPCnxaBh6?= =?us-ascii?Q?8m03HepGAVnzyUy41EA1X2eUg7o3z0rc01XR/u6OhzuOXGsRMaZFD3W7Dvbk?= =?us-ascii?Q?Iu/JLxF7sp/jbEUvobHhWrMVk4Xfc/y/k3njAIFa2IY3IdPhMzISx5NkqSVV?= =?us-ascii?Q?VPMI5YjAlbjkD5/IKMw45LwrpfstLxJ2SfWClRo5/Bnx5LrJO8wKWgBvxR+V?= =?us-ascii?Q?otisHeMKfmdg35VKqmEAjcKjCS8eSO5AJZbovXz2av8EFLEWCi4pKye/Tq8C?= =?us-ascii?Q?3aH5wakMo2GVliirQpusHBp+NOgq9JdJlOgX+i2VjWOmswzKQT52r5UqYfsD?= =?us-ascii?Q?Y+BFYGHecPfOnKHGonF0N1eY3o3PhC1nW8xV/FR/L/D5VH5DHo/PIyymzAUV?= =?us-ascii?Q?XzTg13JKz8o+ieXrZjlzXY+oR/43dgaOjhldCxT9fAuYInQP15+5GNpMHJkT?= =?us-ascii?Q?EJZ7Pft0u5M/8zSykhhNSI5Npn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?QWutOvgDlq1wi9d+UGTfZFM7d8UXP2ZsEpNKdSePV1WFTBZ+iJHeQhZ+1OIh?= =?us-ascii?Q?GE6w/8kqYlrnlxWZWPhCnkgf6Jn9pytk+CAnaCoLOZyEOcxyI/eX1Yv6EhH3?= =?us-ascii?Q?zfi3DVATdzHW4kyTN3HGHXSFrSj6GEoQWFjl5PiIm2ffTCfq3hkcew6dXLHh?= =?us-ascii?Q?E9qfSPNwIYWokcpVdm4TbeQxaX7TNsXcrKCrlXW0EudSUKH5VSVzRI9esQiX?= =?us-ascii?Q?wvlpkUJvQnMzF+HYkwaTYkDOy9H4rwlVuMdiSfn6Bs9LKs1r7Xdi2JoiGBrb?= =?us-ascii?Q?yiOHqiqUn0Tt9XcC5oy6a0FQYjplOc2GGT7tIALhYxWkwgpknSzPye9NOuD3?= =?us-ascii?Q?WG1jVHSHuQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 616e61a1-335c-4fc7-e217-08da3c904d9b X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2022 07:46:10.0896 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6Yn9fdFtYp8d2B641f7vuCozb22tVLaExkbmrKDvrQzuxE9eKqE9Ys/mRvUY9pZ8iD44LRpBds7SISCmKnAZhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4812 X-OriginatorOrg: 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 > -----Original Message----- > From: Pei, Andy > Sent: Wednesday, May 18, 2022 8:14 PM > To: dev@dpdk.org > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; Cao, > Gang ; Liu, Changpeng ; Xu, > Rosen ; Xiao, QimaiX > Subject: [PATCH v8 11/13] vdpa/ifc: add log for config space of virtio bl= k >=20 > Add some log of virtio blk device config space information > at VDPA launch before qemu connects. >=20 > Signed-off-by: Andy Pei > --- > drivers/vdpa/ifc/ifcvf_vdpa.c | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) >=20 > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.= c > index 0acfa8c..376a1af 100644 > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > @@ -1382,6 +1382,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; >=20 > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) > return 0; > @@ -1448,6 +1451,37 @@ 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); > + } > + /* The capacity is number of sectors in 512-byte. > + * So right shift 1 bit we get in K, > + * another right shift 10 bits we get in M, > + * right shift 10 more bits, we get in G. > + * To show capacity in G, we right shift 21 bits in total. > + */ > + DRV_LOG(DEBUG, "capacity : %"PRIu64"G", capacity >> 21); > + > + DRV_LOG(DEBUG, "size_max : 0x%08x", > + internal->hw.blk_cfg->size_max); > + DRV_LOG(DEBUG, "seg_max : 0x%08x", > + internal->hw.blk_cfg->seg_max); > + DRV_LOG(DEBUG, "blk_size : 0x%08x", > + internal->hw.blk_cfg->blk_size); > + DRV_LOG(DEBUG, "geometry"); > + DRV_LOG(DEBUG, " cylinders: %u", > + internal->hw.blk_cfg->geometry.cylinders); > + DRV_LOG(DEBUG, " heads : %u", > + internal->hw.blk_cfg->geometry.heads); > + DRV_LOG(DEBUG, " sectors : %u", > + internal->hw.blk_cfg->geometry.sectors); > + DRV_LOG(DEBUG, "num_queues: 0x%08x", > + internal->hw.blk_cfg->num_queues); > } >=20 > list->internal =3D internal; > -- > 1.8.3.1 Reviewed-by: Chenbo Xia