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 33A4BA00BE; Mon, 25 Apr 2022 14:11:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0E2941109; Mon, 25 Apr 2022 14:10:59 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 26FBB40E78 for ; Mon, 25 Apr 2022 14:10:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650888658; x=1682424658; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=zTSA0Z614OUMlQrox2BNy0ba28xv9flXJ7rwxd4DucE=; b=Ermrx07fFZiF7b1PJeeOqvNyKA8WvkShQ8X3ySqnqWLpAjsvEQVBOUYU zW5srnvr9gth0tjoKAnNnZawcahkWNN3rD6Rirngn+Szbl4DmurXpLCha btpBP5Un+2qSeMfdVFz8NbCxYF00Y/KCK4Wji4ae4eebFLUQidQn2oEkB FIpE3vnTCbJ7NgAqpYgLUP6UjVRX1I8UseXxawKjmUFlr5688qlMRByKy EG7MyQrCJTyfLljfyCtLm7K8hMCfhVYgEzn6wrvGJZDkJ6cPCba1wP2/1 eYBWKZ6gGvh2mQzcoDQwOFqzRY1ZxJItqRRixl8wNxSg/45YKAP97Pxij g==; X-IronPort-AV: E=McAfee;i="6400,9594,10327"; a="245796190" X-IronPort-AV: E=Sophos;i="5.90,288,1643702400"; d="scan'208";a="245796190" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2022 05:10:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,288,1643702400"; d="scan'208";a="628021401" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga004.fm.intel.com with ESMTP; 25 Apr 2022 05:10:57 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 25 Apr 2022 05:10:57 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 25 Apr 2022 05:10:56 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) 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, 25 Apr 2022 05:10:56 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 25 Apr 2022 05:10:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kfRGf8kgrUD8fgRQ9GjkxOBLpsRBUPyCRtDRxvlEAQq3a5xiPBdM06uvlJ5HnLyYHyjuYYyYPiGKBkNU2Q8z7YULOulf5N/K/Vv0naLtbr7SYPwXeIzQ+YO3wncSDY3v8BOkjxlqXZNys7Uz8Qp45ygnrIp65Pjpq7zCr/IIWTwRHI9i260imkbVJFXtYwxyMZf8TyiYYfAMFoHt26Rn8dtcogDEORAkUgE5wVDpCPgg0BfNbV3gaBkA1jkmwcNJVIIsWK5dJKlL1uvEvSp0/t73O5XIF5ClMdFhVpblAIWEB01i79IfbdrHGCzHcygez0M5Z0+3+flsENVjy+lmow== 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=kfLAaURyXMA5+nqAJVm/DNZ3LG2Ir+7LyZUHHkRxd80=; b=D0TlDueHdXP4kqfwkKSTrhDoYtedvnX4KaQhdf8EU60xz+eOmWL08QT0trOQOK+mM39qtnqo8viSqYXaPVJxVnErgMP++9F8vrkvh/2HoQG29k9+nYd2rOEbQvARjx9EIIPC2LLq1/4ZKRL8TQ7pe5jnbF6mEcEUzHtsryEORAGZzKngdOyhJNi9v7kCnyTjpERcodfXumDCr1Y5j8W4VX4ekETiwUvNIsesc43g1vWiAm1wvm1BAXVZy/hUUF1j2nEoU7gmx8i+RhEWCQ5btlq9fRpG7AmMlWWD7ZkkLDq3gzvWn1hvLonKrPKXqSPM/gmpA2NEjV0hiz++RYuO3Q== 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 SA2PR11MB5145.namprd11.prod.outlook.com (2603:10b6:806:113::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Mon, 25 Apr 2022 12:10:55 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::4d1d:6453:f00c:cf8a]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::4d1d:6453:f00c:cf8a%6]) with mapi id 15.20.5186.020; Mon, 25 Apr 2022 12:10:55 +0000 From: "Xia, Chenbo" To: Maxime Coquelin , "dev@dpdk.org" , "david.marchand@redhat.com" , "i.maximets@ovn.org" Subject: RE: [PATCH v2 5/5] vhost: add statistics for IOTLB Thread-Topic: [PATCH v2 5/5] vhost: add statistics for IOTLB Thread-Index: AQHYP31EJ78ptzMGQk2eGHYYHfPixK0Au87g Date: Mon, 25 Apr 2022 12:10:54 +0000 Message-ID: References: <20220324124638.32672-1-maxime.coquelin@redhat.com> <20220324124638.32672-6-maxime.coquelin@redhat.com> In-Reply-To: <20220324124638.32672-6-maxime.coquelin@redhat.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: e478fe81-6838-400d-cc8b-08da26b4a631 x-ms-traffictypediagnostic: SA2PR11MB5145: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: SOYd8ghDBZtqERBDXvOCeHmLdGqBI8dPDjkqBNO+eJBco+cNsi2ede47xcDimo/LY4R8L/4seGAGG8SOqHtpzl1/GvA+nJ6bYYir/sYvFr/9edl//T3F0E+YLsJhRApXABC7Mz+aV+ilf83uAFq+9j43wLMAbpnqjb+6stSWIxNORO4dpL+1xNsUUXcGMkUvNnk1UDgNfe4nU1Zt5ajkSBWpimkSU0sl/CBRhVR7QYdgG+OtCwNFmeDSTqqmXR0+mYcxbXRkT1rbu10a9gYLVZg5NMqcZqC9o6z8WzaGzHp1pzeq6nv8PkXe4vU6dBFvd5wwkmLr8W5VrR31oKSfefdPJaJ/mp6682YFqiBKhhJPJnXQA8NqS/5sl1clf5hzdjgm4oXNxiuh/RB0K6xaYnQ/n8bXctYk0LHuoXPPFuXjsaFdYwv2cmzUXs/Qc3RbfYU3zLmXjsgltvdYldk0/sD0q9L+qHB+t7pe4hpNrGOEBSLHmLnj6tKc0nUPUswtnu5qW6B2uQyRhAO8UpB7wzdvuVtCNyuFhreKMGCbbz4/WDiHhS9aGUqidI4xDMVKdpFMBw92V7P9pJxt4trMSB00/u/+4bnKMMEk1rXRWunB0lU8f+VPsJgi1IOPsqyqJ3TZJfSs/Hm7ObjR3qII+Z99iCM/GilbmKlZn12hHwgUhliexgKkXQfuO+re/FtxVN+jqoXUiOHRIgbvR0epTA== 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)(64756008)(66946007)(66556008)(76116006)(9686003)(8676002)(82960400001)(7696005)(26005)(66446008)(6506007)(66476007)(316002)(71200400001)(110136005)(86362001)(122000001)(508600001)(53546011)(186003)(38070700005)(38100700002)(83380400001)(33656002)(2906002)(55016003)(52536014)(5660300002)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aKlfM9eHtw6NKnnsQ1j0cKCkkqe6IvOneSujrjp3C4fWSYEYYlXvOPykz3vK?= =?us-ascii?Q?8H7NgdItRLiPUEsIX/SsxoTJeZhxjPg/SnDhem0/mclwo8a77n3lvd9k1hZP?= =?us-ascii?Q?pIHAbJb/kRSKlfzo2Xh2DO584rdJ47ylBjlh6XYsBLXsi5smvk1MJzmGo9zQ?= =?us-ascii?Q?lzqT/PVhCGSrkgpGeddzCQI0wRCinSQY6CfVeEZxD/5a2OwuvKopjusqjZXe?= =?us-ascii?Q?Do3w/TPEuJjMwqhlQnRJEsKXVFmY+0slWPAUks9ntQ1MWtSoYTIWN5zDWWc7?= =?us-ascii?Q?ybnf2azq3PRXJEptEPss2pa6+2oCGI9rRkfQk6AVBnE1VgY2vLM4FG4b8MLy?= =?us-ascii?Q?hEoQxUJYqoctAd2xVHYlLCdVMy4chS1AwWv1GlXz3OUkOTplOXF0W/RizKYS?= =?us-ascii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JSxRW2MIf5IbaYjLZqok?= =?us-ascii?Q?qFiAiTXSATT2fZCHQPDpoFBPqCwTQAD6qN2pFWGKoGknAEwtyv8QXiRmxj6a?= =?us-ascii?Q?rAJs4V7DjNyx5ClmmDQCVsvQzhawDrewLrB6jOEV6qqrBlfuxDr4zUEEBOtP?= =?us-ascii?Q?V2/88MfdlIWFqFQq7qZ5t3aAE4ny0pzSCXPlUMazXqfCyZmCIRp1K1i+9kjC?= =?us-ascii?Q?l2UCAqxV486vYfdew9tQnNw2FCDLnTroVpyBP43uB/X02yyFd6i22XiOpnJg?= =?us-ascii?Q?349ZExetSZrR1CuumkQeRchTerGXQeCKD6SreyigMYTbO2BvqrXI8Scn7y3J?= =?us-ascii?Q?tu0oh7RdRsmp/47K06BZiREr7oDqbEOoJOhM7HymZoKExqs6Oa9PrGEBcSU0?= =?us-ascii?Q?V0LgsbKaavaMywBEoKUKvo5qKh3Ah15n4BxcxSr6Q35Lq+Wkkrsb+h16772e?= =?us-ascii?Q?x8b6KykTkg=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: e478fe81-6838-400d-cc8b-08da26b4a631 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2022 12:10:55.0128 (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: 4h39rJAejRcklmTEXs2n5nsMTyTNYnqZId2q0xO8VAYeI5JNhlXFOuy+VPFLN7NCdHbYHDZDUt0V5gH2NUeHEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5145 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 Hi Maxime, > -----Original Message----- > From: Maxime Coquelin > Sent: Thursday, March 24, 2022 8:47 PM > To: dev@dpdk.org; Xia, Chenbo ; > david.marchand@redhat.com; i.maximets@ovn.org > Cc: Maxime Coquelin > Subject: [PATCH v2 5/5] vhost: add statistics for IOTLB >=20 > This patch adds statistics for IOTLB hits and misses. >=20 > Signed-off-by: Maxime Coquelin > --- > lib/vhost/vhost.c | 10 +++++++++- > lib/vhost/vhost.h | 3 +++ > 2 files changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c > index 58b58fc40e..7f4fafdcb0 100644 > --- a/lib/vhost/vhost.c > +++ b/lib/vhost/vhost.c > @@ -43,6 +43,8 @@ static const struct vhost_vq_stats_name_off > vhost_vq_stat_strings[] =3D { > {"size_1024_1518_packets", offsetof(struct vhost_virtqueue, > stats.size_bins[6])}, > {"size_1519_max_packets", offsetof(struct vhost_virtqueue, > stats.size_bins[7])}, > {"guest_notifications", offsetof(struct vhost_virtqueue, > stats.guest_notifications)}, > + {"iotlb_hits", offsetof(struct vhost_virtqueue, > stats.iotlb_hits)}, > + {"iotlb_misses", offsetof(struct vhost_virtqueue, > stats.iotlb_misses)}, > }; >=20 > #define VHOST_NB_VQ_STATS RTE_DIM(vhost_vq_stat_strings) > @@ -60,8 +62,14 @@ __vhost_iova_to_vva(struct virtio_net *dev, struct > vhost_virtqueue *vq, > tmp_size =3D *size; >=20 > vva =3D vhost_user_iotlb_cache_find(vq, iova, &tmp_size, perm); > - if (tmp_size =3D=3D *size) > + if (tmp_size =3D=3D *size) { > + if (dev->flags & VIRTIO_DEV_STATS_ENABLED) > + vq->stats.iotlb_hits++; > return vva; > + } > + > + if (dev->flags & VIRTIO_DEV_STATS_ENABLED) > + vq->stats.iotlb_misses++; >=20 > iova +=3D tmp_size; >=20 > diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h > index 13c5c2266d..e876fc157b 100644 > --- a/lib/vhost/vhost.h > +++ b/lib/vhost/vhost.h > @@ -134,6 +134,9 @@ struct virtqueue_stats { > /* Size bins in array as RFC 2819, undersized [0], 64 [1], etc */ > uint64_t size_bins[8]; > uint64_t guest_notifications; > + uint64_t iotlb_hits; > + uint64_t iotlb_misses; > + uint64_t iotlb_errors; This seems defined but never used. Thanks, Chenbo > }; >=20 > /** > -- > 2.35.1