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 71176A04FF; Tue, 24 May 2022 05:06:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6428140A84; Tue, 24 May 2022 05:06:45 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 359D8400D6 for ; Tue, 24 May 2022 05:06:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653361604; x=1684897604; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=qTjxsuts6JXIivsSLhA35x6+kOg4qg9xevxdPCCLT0I=; b=V2HRUZSsEwcDADPmLd5IgHJYHX9zj5quRPXwCHVWWc18iIWwRdS2Ct5w /gullCITOrd+B+6Hg/gCAZ5UqnFRzkNYbKu2TLf17CXWmGsh0hjXNSX+g 2V2SS81qfZtHO5MzeC7JE9JpvLMUw0MqoM2rcwKoRaTj2VtPr2U7SYMbB WCbN3tNzl6vW5E0YU6nqhrpoY8FBz+sTcVKagCKgJKl+6Fwsff0vJR1Yh 3FqAPipvNulEYYL7n2QZr3P63s4j6vKawkj/gbBlskmzO8a+SPaFVlOi+ t3tVpg3qxPLBISi0YxNxfzUbb8JuA71pviK7gDCw7p+KimjZYy6EfIZsW A==; X-IronPort-AV: E=McAfee;i="6400,9594,10356"; a="255481804" X-IronPort-AV: E=Sophos;i="5.91,247,1647327600"; d="scan'208";a="255481804" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 20:06:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,247,1647327600"; d="scan'208";a="548280645" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga006.jf.intel.com with ESMTP; 23 May 2022 20:06:43 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX604.amr.corp.intel.com (10.22.229.17) 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 20:06:42 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX609.amr.corp.intel.com (10.22.229.22) 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 20:06:42 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) 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 20:06:42 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (134.134.137.103) 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 20:06:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WJwf+Ixhh4lPysNrg4d6RKvZhpDSErt3zE1w9Tsq+SKHjhNuM3fqYTOkWZXAjHMXsagQ87cpDu4vS1m4Lz+wL2uQaywb0Afy2rhkPDHkzU/xKQYsQRP10P63wkP0VndOUZZr80/UqyZbIDwPM0WTPGQBhC4rBBtOqNUaVeP4717ImVgKWIjxyZZ8stPnhGc9snOHRa7jvzIbSaf1mXBN67HVWlolIZh5T7uQrUkZotjw1kp88BhTlJuMsC1eIWW4XGbNIFNS9SL2MxRbhl1Gu9OJervWy8jhMehjaxJWmRZlg8YLwOkcUeKD+tRVAyrpJ8fGhZPY37IcHiwr/HhKgg== 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=w+mFMbHr9HU3MRdU+NlkmxBGHPUSPNdMgokndIZx/Bc=; b=GtsCip5Ryzw588TUni9N52DOykA5sWOEkgoi9C8MwSOEq0kIdAlXj2uBSHokZKxB7fGTKaYsiZcadCwfvoQmqhfmzkpptFRJEuJs4El8hmHTMFvdX89kiTQ7VqAYb//a4EcEL/8CviZyuleLxRHm0+65jNWDGAHH/eB1H9wtaeoX4G6AeU6oQxWqJApIjbK18UyUQEq+AeJpePFJipFfTMk4LI/L6TKj0s9LNS0MQujNXxBlMaaicEgJywGRNwcinEu2NPkjYlreKir5TInJO2CMwWDF5qeW/qmn7SPLjFGb0W1KlRkbMTT6nAph2uehC8ASysR+bvqnKPEyvUyJxA== 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 CH0PR11MB5267.namprd11.prod.outlook.com (2603:10b6:610:e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Tue, 24 May 2022 03:06:41 +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; Tue, 24 May 2022 03:06:41 +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 v9 11/13] vdpa/ifc: add log for config space of virtio blk Thread-Topic: [PATCH v9 11/13] vdpa/ifc: add log for config space of virtio blk Thread-Index: AQHYbo8ZFHY5PUGLVkumd5CfWEec860tWWog Date: Tue, 24 May 2022 03:06:41 +0000 Message-ID: References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1653298524-232138-1-git-send-email-andy.pei@intel.com> <1653298524-232138-12-git-send-email-andy.pei@intel.com> In-Reply-To: <1653298524-232138-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: ca699ca3-c839-466d-61c6-08da3d326cec x-ms-traffictypediagnostic: CH0PR11MB5267: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: 3YIX0Nqe0KSYSfVxQyAQpq4p/bxzxMXOINpTbz1pQT8wSHiCqmm7GjPFyUqa/Xq4uVkxDeM0iyb9xbaUHwuLXb+uaXoX7gObTA3AkcZhlao3my4fB2elDOJ++GDEVFBC7SI8Q3HaRjtq4w9VnDbHONf8bAAeLL0JIfxEz7hwn/2+uWUe0yYI0Sq7DJjS//ChkU2QQI0U+3iYFunb8is04+jSvhNv1boymU63XxpvkgyIXP+yoHjgSd41qWTaWU8vV/RdPorZJq4jzQlv2uJj1ENmo5C9C9KWGzSoy9NXpp0vzUL0M/QMcY+K3x0GSaHdVCgsTfDjdQx8d/wV2C/jRDbUl24cyf5VqsZmS31Kaq9tiNnLSoMVQf2ot6W8Dh9paRJfV3xYC1C/jFqhywkke3dEjFheSP/IV39bI5xcAuNzTpB1P82VTAnF+NMJn/GppMslt/T6lkUrWbDvokGiXHl9UogXLMAhr1I0lhLsqACD9/2Xshgl46jbP2IHmszlh57MJRTx7Em4vBhj9zlwLbLZqqlAygADTypj3JU+I+qo6O8CmhhzSQff0op+hAouHiTbbJCGG7N8RnOK47YfBeEmSohpxgp4v3Y316guv2tFOB3t4f/+RibQTtKpEZs5ZxH6Obvrxal/xelr7Tt8mt2/8rLqn6ZYvd+efP62Fz9+myBDXZjnuS/PAM8UURmb0kGGOwic1gTCZ0+E0PElWA== 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)(38070700005)(71200400001)(55016003)(122000001)(33656002)(82960400001)(52536014)(5660300002)(8936002)(83380400001)(86362001)(7696005)(9686003)(26005)(53546011)(6506007)(508600001)(2906002)(4326008)(186003)(54906003)(316002)(8676002)(76116006)(110136005)(66556008)(64756008)(66946007)(66446008)(66476007)(107886003)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BivZTyLFuwizLGTq0qsqIKnrruvn8Gy4rnrXGu/SEnMJILZd1SQ2go82XoPe?= =?us-ascii?Q?yf0jWzxTJ/6PONIyZrjo8e6ZJ7ks8R3QPHvfEG1+46llVUZW7F1fxye+AK2n?= =?us-ascii?Q?bPZ79InjkNrY8jHoLsPH+Uh7ffRDk1rzmr7/P8lPO3bRTfiLDq8Nbmj61k21?= =?us-ascii?Q?S4zr+S61tzJ53mml4/OzyHfOo+JaokqV7O1r5vd5gRDs3I3+T8MKPRcTzd/l?= =?us-ascii?Q?8ebWbNTXg1LYwCYMiAEn3FwK1/wBQbeiEvWXQr0cv8Z9p/8y8xs67Igid5xK?= =?us-ascii?Q?KVkwjiU5KKUEZQjT8AkGa28FJ37Pj/hWlAj5HEgeiVMyq3jwydizKGvmV0Qm?= =?us-ascii?Q?U45hiwuI0t4xlz84SI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ascii?Q?B9MixnGVZka+ajM9aYff7+1DDvzIjbYng2CZEOT5B9uk/Om/VqZYXNk8oS8u?= =?us-ascii?Q?4eCT7ApNXRe6mMYkJ5K5owHJXh48/Zpxc0A3aqJYwz6nBknp4/sHXXTzFYTM?= =?us-ascii?Q?BOALV0p8SkKrClhHmSXiX0qKvNVq/D9Z1CFo4HPrWU3vOrdguTHytMojrmgM?= =?us-ascii?Q?dM3f+pAzcyT8oX9yZHC7uOTVpc/g5aH8sPfW8l1RVRc0m714xm9Pxra2WBUh?= =?us-ascii?Q?82M7bLGYKJi8dbSPztrYCJosS92kmtI17U+T3s58VdUTXUN5svE2+ODAnEEl?= =?us-ascii?Q?JixEXO9RPdisQsjqKTU1eAv5txBzj8huUpM6JunfNh/3mIPwQ7fepr38h7W5?= =?us-ascii?Q?JSgyPYt72OgVqgRxqhkpJ4pKZTPce1Dh21cu1x6ycA9IE2gGMJAAqpejL+Xo?= =?us-ascii?Q?7kfaHmjyVhyeR84OvMSV02Na6JR4+w7TSVT1dY5fYubLqmu1OlW2YVp1eivo?= =?us-ascii?Q?wwp8EcQp3Q=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: ca699ca3-c839-466d-61c6-08da3d326cec X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 03:06:41.1123 (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: 61Aiyk4j5EICUuscFgcLbZHHglKsvux3gNfImrSG5U03fkGJVo1+reQJJ54bO2MB+S+pXcqAr1Urr4/WPRHCHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5267 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: Monday, May 23, 2022 5:35 PM > To: dev@dpdk.org > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; Cao, > Gang ; Liu, Changpeng ; Xu, > Rosen ; Xiao, QimaiX > Subject: [PATCH v9 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 1c5746a..80d6261 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