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 78D1FA0032; Wed, 11 May 2022 15:56:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D38342819; Wed, 11 May 2022 15:56:49 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 3EEE3406B4 for ; Wed, 11 May 2022 15:56:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652277407; x=1683813407; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=Qnzx5hwZ79zJ7hNvMo6wC0kmQw+W0VY6EDzN0EJTwc4=; b=TgEq7o0tnlX+bsXHVxIP+Gg7fKmgEKX9JE8VQbKqvBi65N3v7X0pAVej scHab6HXT+glNSRUNl7J2ntKVbr6cRwuvEU+/4cc+Hinw/lWCjf+Cd61N NiISuygamQ6LHA6BidzFS2pm/nAye6Dxv5TUL1+6RI+kk4Om0YX5jBUlO akknuN6cbZjbvUBDZpSRR2IHyUQ+xdVZTnKsgCA2nQM1cOkbCTnetKvKi jU7Un87uEJEtU0StKfN7bASEcqrLwsU5rqvn7p0JykV6z11wTXaMQqJvH ukDde1C753K/qGKoOc3yNDwf42Vcm6fEltMizCYVAhA5JypUgcJqdBiM7 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="330302813" X-IronPort-AV: E=Sophos;i="5.91,217,1647327600"; d="scan'208";a="330302813" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 06:56:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,217,1647327600"; d="scan'208";a="623955473" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga008.fm.intel.com with ESMTP; 11 May 2022 06:56:45 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 11 May 2022 06:56:45 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 11 May 2022 06:56:45 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.174) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 11 May 2022 06:56:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VSN/pJoJwKUpLO4SR1McgkQ1HalhLgl3484C5KXPmgXVAzdCc3fL5k1iI5AMb+zW5d39a5h6h4nkt8HnVQgQd3RrQOskdwNSOID/Rrh63XWGwpSA1qfIRXQauo2cBxDNycUK8rC+f0wpxp+TdMaDNGmF6LKWa5jQFi4fT49XDes7DIDZjShrozZnWKeNhDXeSY4YBwyFxQM/C19VHxjOsy2MKYMDCaQble/iNVPIgt1/jscYISr6hZg6odoHMq/jpqTxwk2LFzxw9pd7B2ngnmny2MW4V+PiNeaGIPLBSU6ZsCNjflDXFiIFEnCEjvTXLwfEVcJwxw+i1KwzZ5D5FA== 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=sAx1bcl0nOtTttzpKAJdTcBwn/LJeZJA7NN7vY1z+lI=; b=a8PVomofiSaa5EWqSdrAAdQIk/MHdkCNfjgoHZ9Vw6s6pJL/gU/bZPtCiYdRHS9cbbZWy9Vjc/nyqCJiviB3JmdN+Pf4xuhWYFROa0z67EcePVghrgIVYuFlsuGkFximGbAodwn0VzdJjhNW7Y4wn4NmjAKrrbpNPJzDq4/cr+IvQIa64R3t77ces93RRWxGNXE55PszyVqkQKJ+HVqSetnJ9Jr05PGr9qJJzJ9SUSOoqKOAxKOKrfMTPdFTVcDmxL2xsqxoyFGCWQfC/oMca3pSyDED7/LKMk6SpwvPJCnDp7/z3k8wiMJmx5i0PpzZ3mIcrDsE8/6w/sX1828dtw== 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 BYAPR11MB3686.namprd11.prod.outlook.com (2603:10b6:a03:fc::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.22; Wed, 11 May 2022 13:56:43 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::2c8f:42df:ed85:99e5]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::2c8f:42df:ed85:99e5%4]) with mapi id 15.20.5227.023; Wed, 11 May 2022 13:56:43 +0000 From: "Xia, Chenbo" To: Maxime Coquelin , "dev@dpdk.org" , "david.marchand@redhat.com" , "i.maximets@ovn.org" Subject: RE: [PATCH 4/5] vhost: add statistics for IOTLB Thread-Topic: [PATCH 4/5] vhost: add statistics for IOTLB Thread-Index: AQHYZKsEVQagZCYQrUq19ig/roY2g60ZtIUA Date: Wed, 11 May 2022 13:56:43 +0000 Message-ID: References: <20220510201720.1262368-1-maxime.coquelin@redhat.com> <20220510201720.1262368-5-maxime.coquelin@redhat.com> In-Reply-To: <20220510201720.1262368-5-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: bb12bba0-95e9-4086-cb23-08da33561498 x-ms-traffictypediagnostic: BYAPR11MB3686: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: WXLfV5jyk3OQYmuUKasUE8G0qQcYEqWwq3fBU9mrS3czMtcnlAmW8LbpuMuopNQ75OXgOHuyohiXsy/r4Qf1BRSLaf2CyiNreccnuwM3qVEaDyRNdgwZipNMg6k52H4f2zokAer5MuIrxRapaets64W162hDk1uzO2rDVV9v1L4HWat5aaqWBCoLM07NstEeSDxIO6mFz/dTDZMAlNLdjN3XpIgveFkjLbCRt1FX121ozAhW3WUK4cL/aE4ssHh2liQngxudnfUjQzTICkk4BXjtXJKZEeoxFpWE3iKfwJC8J6ndMf+z/eDctQMPyBG4uXR2jdwGluR0RZ+KlJN5wCnFtPTo8+nfw6OR63dRZrXW1H5PqsdEqxj1keFeYv3WanbfJWJoSYpf74di2GxWufAPSNerO7XVlIDaJgiKYperFhvY+DOZZCaMi1ycBGP1HwWXCPxfS1Wj40mJIuAutVbwOoNeEX8VWPcpB3ssVWlVuv0IP4eZwDeX7Ilrq7Z4T0tSySwsxazAD1Vu5eSYzBS2FDeQCVSpJHivYM6NrfhbfpJnI1cAZPKw9hv/o073+pB9JoXfAqESRWtjfMcSE7q7YOdDpnN8G+oW/3FPKpjQz8sxyXVC5IZn0IfTruYNSM5H4kw0IQqICF0JNxQMrFsN66oq4R45G5l/8U5I1uQMCOnYBCE5nFNZFcmYYwrgGefVcSi9Nu9ceiG9b83hSw== 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)(55016003)(38100700002)(38070700005)(52536014)(86362001)(110136005)(8936002)(5660300002)(2906002)(7696005)(8676002)(82960400001)(316002)(71200400001)(76116006)(186003)(122000001)(6506007)(508600001)(64756008)(53546011)(66446008)(66556008)(66476007)(66946007)(9686003)(26005)(33656002)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?L8kgLpK5+5YE6s2QYNPbG6vk0ERVyQY8lhpATuSuqw9Ud0ZwuS8Ujl3eWBEs?= =?us-ascii?Q?wVSCF7IxRcHcUJwG5nghuE7EoZYx7/REf9ddzniMK+5KkMDG+OIxSO7NbmSM?= =?us-ascii?Q?CyEsgmOn0YIJoOzKKGdHwt0w/PxqTxFCNPxC8r+w5nm4F1H+ZapBJ/jOWz+e?= =?us-ascii?Q?sn9H7LKC0w189qNsqwwYxi9w3wZEiVODGdKR57JLQDY3mxlWOppOhCO88+5l?= =?us-ascii?Q?/Uu8z+TIMET5pNhgpFQjS4B40EWEfOSNvk8hJSZu0xYmybnMU7cFxHqvGz7p?= =?us-ascii?Q?C9Jg3a5/E88u1hrs4bRs51FExzOlgziIzsVwAJ8SH/m4lPUz/PRlBRMRVVlq?= =?us-ascii?Q?llgNo3/b338/pjdds+xPXh/pWFEn0RE1yoB/JasGmAfc/gAPtT0EmiRuGMOh?= =?us-ascii?Q?ZV3qiu8t0eymiby0rzUrDbiBYvUDpnMKsMg3aDCqjr7KfKekW0z5zFzeK94t?= =?us-ascii?Q?NTkNoUPQIYX1mBu9ChnojIZxsuCE9tYfJ7OonBg0GwU94zDUNTP2tA3JUJhy?= =?us-ascii?Q?D+csnv1FM3CyfQ73P4ftScPmRkw880KFtpGNLYCzsvz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F6xJb0yjsiqOhf4+ITPXrQDNX7vm/0aQK+Yl0eAom?= =?us-ascii?Q?1fvfyBCSQZ3iqJJY06/nvG3QiwVVnr3BDQw4SRJ3xKTUCJTKuqbAesfjaVM1?= =?us-ascii?Q?MDvVLQvS54CvgPPUg5fVk2AVg0Vje9ynjayU57Ug14+9uHuCXGcBcNNDuCUP?= =?us-ascii?Q?FkT7ZMfBuViXQXsR6spqlKpjn7PJGh3OTLOQktA6ZvlLR6PmA2/9ZxpQwBuA?= =?us-ascii?Q?jgDr6zanhJrT6xXP9j8VCeBKHi2/j+doauURiOX5kg41SvQqIh3omlwiNQY6?= =?us-ascii?Q?SDoTFeJn+w=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: bb12bba0-95e9-4086-cb23-08da33561498 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 May 2022 13:56:43.1795 (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: kMl5E8nFoAd9L/0AisfspFtvKH+6vIeM9DrUtD0aebtXLdTRvIUc9dQ5Wexql1lc2B3bhFSpQR/2Xdyao1Sc9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3686 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: Maxime Coquelin > Sent: Wednesday, May 11, 2022 4:17 AM > To: dev@dpdk.org; Xia, Chenbo ; > david.marchand@redhat.com; i.maximets@ovn.org > Cc: Maxime Coquelin > Subject: [PATCH 4/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 | 2 ++ > 2 files changed, 11 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c > index fa708c1f9c..721b3a3247 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..872675207e 100644 > --- a/lib/vhost/vhost.h > +++ b/lib/vhost/vhost.h > @@ -134,6 +134,8 @@ 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; > }; >=20 > /** > -- > 2.35.1 Reviewed-by: Chenbo Xia