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 74ADEA0032; Wed, 11 May 2022 15:57:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67D8840DDD; Wed, 11 May 2022 15:57:30 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6C6BA406B4 for ; Wed, 11 May 2022 15:57:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652277448; x=1683813448; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=PllyAdC4EPHJO/a7o1+baAnskNMrDuPAJPclgcazYCQ=; b=b6dMfR76JxPwmwFOHYc3gs5RPiaYaAJxcJZ1RfFvcXCeItL2nQeCWN0J ArAm91hnBlJoS4z39X9fOAhjwb9A55G+E4Cd+T0UgU+ZOx1m05fj/fL/S +WGZ7SidCYbNQLZP7t/RFcGVwzeARq4WIwnoOYV3+j8Q7C4G4rABM1aI8 oX1OJSzO1ArMDx7MtT+cH9zmQ14Hf4x7CtMYJqvCCtwNs0Aw5bOUwVw2E UtGwt6kOCmZaaenSURwICeDBesGZ2QaFMqsRCvd1FnSqoY22pyZjakZmP NYJueXBPOGgSibYqPY84ouq4UttOvwcvDU1+7tV1tk9Qg/kj4kjzPwKC1 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="257248905" X-IronPort-AV: E=Sophos;i="5.91,217,1647327600"; d="scan'208";a="257248905" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 06:57:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,217,1647327600"; d="scan'208";a="594142983" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga008.jf.intel.com with ESMTP; 11 May 2022 06:57:26 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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; Wed, 11 May 2022 06:57:25 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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:57:25 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.48) by edgegateway.intel.com (192.55.55.70) 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:57:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DHMTdK6lYIipBsTJCBNVRZLCE1bdjH+iQiHqZTdgKtjEPBWhVB9+OwZIamkjs6tjWH5yMTu7f5ftSIiElS9G/jC43TxD0ezZS4umcvtaAuemwZzgiwhKllYKEMltFFZTM1GPsaHPhTFgYtIrZbKj0qphiqQFsxkeiIse7R3jYh9mfHB1khsNQ3w4928oBQLoK7JFHnsEOeClH41tK+Yki5Ao5Lre84TBCEfTMi8qwAzsCC4yGtZilEmgreEqgFn9oTrzSL20lHMGFZjS7omdtY7qNWe6y3HnkkbUx7O2RaQzNFbzd4yzy6qTfi6krYLvbb8P/osBK7L6JVlT7s349Q== 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=9WTDwe6xzdVOzDYN7CyV989Eh3JXX9oI6+uI6WhkcGQ=; b=TKCLfdJPqN13HzHbH70+CUJnc+LI91Ni9KfNqhdXt+4k307cmD1Y6Cw6ytm5B8TSaekHlXJ0uZjyqm3SYzxlg6x7XhBMyxR5VIEH2HX0lGanbw9pRqiAZhiNUvjbQaXMeh/skT20DJduKs5iiLjJUPxPU6ix2IMY0WLXMz/ZJzFjy6iw2xrHzSJU9L7RVB4mMyWwWUODVPJJnclUyunGCOhvJrMJCdg7nYGUE7zNpXNApF8mDUwOFQ+LwE2r82cjdggHV4XCsDjcwpw0Xf75ygBqJyuHUqZ0svCdelFGhg4Ldt6RJPGNrrzb5Tj6KFGf7d0eHNlS3pKj6PF2TFz6SQ== 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 DM6PR11MB3369.namprd11.prod.outlook.com (2603:10b6:5:b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.21; Wed, 11 May 2022 13:57:23 +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:57:23 +0000 From: "Xia, Chenbo" To: Maxime Coquelin , "dev@dpdk.org" , "david.marchand@redhat.com" , "i.maximets@ovn.org" Subject: RE: [PATCH 5/5] vhost: add statistics for in-flight packets Thread-Topic: [PATCH 5/5] vhost: add statistics for in-flight packets Thread-Index: AQHYZKsLeotK1Pazs0mDbtO556+a9a0ZtLIw Date: Wed, 11 May 2022 13:57:23 +0000 Message-ID: References: <20220510201720.1262368-1-maxime.coquelin@redhat.com> <20220510201720.1262368-6-maxime.coquelin@redhat.com> In-Reply-To: <20220510201720.1262368-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: 9be50470-4cc8-485c-3679-08da33562c9d x-ms-traffictypediagnostic: DM6PR11MB3369: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: vq7oOSg9IZ/H7UB1iJCRJqLH2zagUHIbFRkm3TLQ28iHB7jHbNqIpz0Df1ZosG9qWP72Ec0X9LMSlGSLLQWAF0cwoG5Ry+7JWZfQYi6umLnfP72SCakFBqosWjULBrlr2rAM389znauesY7cOAHbAqjTgVuQtMFFAhMHIHD1pjmAgkIly0PqhutK/+d8O1IBhcIP7LMLWwvpOOofZaDJRcWvulMOjC9ik/6tQhktpX7/GG0KS8rF+J6Y78HYzy97FaAxg4K3AgdBunhkWerCRHhf/xW7SU+PvtHE9vvxxEblHkw6a9GWYN/CoDYaYEeuZXxIi1ozyggb53hlE3W+a6eK9QlOB8LOEgoZT3uViot6TimhIFYYHIBVwk7lRps64NH/LbBmq4FBww44Iccfv+cA8RP400Wh30++cyl7VwySBjO3LB4fimzy90La5hZUJyFnFLqU+Zee1ybBPX/QOb/Rep23nbsLdwZzy2X9TjWd4QDE+HYHiHuDIXKpt02qLL0NtuQdkHBdO4V9hqRGrIdxE+RzGoxS0aTfzZxXxE85meRfkr9dFv1Lv7zzRIZfGTdjot89cR+wlqT4bNO+pNq18YpI2qoZJ/+Uzqicu1Vj4zP1YdwQUVidi+JATFrnneLsBY3jwvSekoZ+09VgjSxkYH2Un64NrHO/iX0eqB8B58blKcIi3ctVsloBjC8b8SoHRXvvbn3tG9z6/ylzLw== 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)(66446008)(8676002)(53546011)(76116006)(5660300002)(66946007)(6506007)(64756008)(66556008)(83380400001)(26005)(9686003)(66476007)(7696005)(33656002)(2906002)(8936002)(186003)(52536014)(508600001)(55016003)(71200400001)(38070700005)(38100700002)(86362001)(316002)(122000001)(110136005)(82960400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dSTrM7vZnu2ygw5tlrjfdjf/aZS8hU0IVz2wXzD+8oB7Apif1n720IwpVQYw?= =?us-ascii?Q?h+9bDzV7DJLDLOLh1mhua4NI5UrVn5Qos/jLQsOJ27P6G1FkIoUOm7VJPi7S?= =?us-ascii?Q?9RDsiz3IPULtrz8Hes5RFH/iUUDyUQumMu+VB3IfiZfQijhd2JbK6WyT2XIF?= =?us-ascii?Q?gJZsie3rZ3rk11vwIwlcSXlmTDv7RAPgG6hDHLhoObmiibRjlz77TsAm14o2?= =?us-ascii?Q?ILr9oSeguzpi+3SaUMZS3rVjYq6gjCfgQGFiP82L8PBQt6PugbDlGfieaRlp?= =?us-ascii?Q?zQ5iPBbr4YL0RCJfoiqBdOr52nkjRtKUz21lqfbH9mY6Cd5/y3oKTWRmmQsw?= =?us-ascii?Q?tb3dqRlQ4Ei4OqLeMhvCaa6y5fv3iuzHh3vRvjPiKwxiOGHw7c1maGMj5qGk?= =?us-ascii?Q?4emfZUP/l2U2jnDw9KavYZnoy5YWWq8EjqJKK2a8fOExr4L9YlqAcDp/f0S7?= =?us-ascii?Q?dYksPxhne0LLCJNT9UpNXJE/9jPVnUInikCgk2ZlcYMUoimPQR107Cx1Bb8c?= =?us-ascii?Q?qgTVsX2yfncTl/FzWg0pVqQtiYnbQMU7tLU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1gYF7v+I1QcCN/rf+EiiG9ZvgKwnUbsbwkaEZOjqnqbQA2fw+Jj?= =?us-ascii?Q?jeJ59/L2hiMmfTkWTGG7cnYrBUi6VRWAB0bN9YiQu3Vqjb4UuWDuvbzBEzT7?= =?us-ascii?Q?sSBS+AQXl76idFYTr/B4LAqpSKXAS4gGYxvNS2Q+K2L8a09vJZwD8+Ct1X9u?= =?us-ascii?Q?kH4fhfpoFlfuho6VnEfKAKgxFSOsE0UTwLBNdn8lxGAopcolypuZENCgptSV?= =?us-ascii?Q?0+12VBKnZ5MWRAQ7B+grXGwmQgN1nuoHJ2/lMNZabsQfhaJAymHY8a4AeLIE?= =?us-ascii?Q?Vm9g4TyVSw=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: 9be50470-4cc8-485c-3679-08da33562c9d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 May 2022 13:57:23.4426 (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: /JCV22jq/JcJtHbvkTayz+tcs+e7kN8rb4KpqFQMRJ3Hy2gWsOwD9M7GCWd/QKFzaX7LnTpoKMPFSxZwxfmJlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3369 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 5/5] vhost: add statistics for in-flight packets >=20 > This patch adds statistics for packets in-flight submission > and completion, when Vhost async mode is used. >=20 > Signed-off-by: Maxime Coquelin > --- > lib/vhost/vhost.c | 2 ++ > lib/vhost/vhost.h | 2 ++ > lib/vhost/virtio_net.c | 6 ++++++ > 3 files changed, 10 insertions(+) >=20 > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c > index 721b3a3247..d9d31b2d03 100644 > --- a/lib/vhost/vhost.c > +++ b/lib/vhost/vhost.c > @@ -45,6 +45,8 @@ static const struct vhost_vq_stats_name_off > vhost_vq_stat_strings[] =3D { > {"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)}, > + {"inflight_submitted", offsetof(struct vhost_virtqueue, > stats.inflight_submitted)}, > + {"inflight_completed", offsetof(struct vhost_virtqueue, > stats.inflight_completed)}, > }; >=20 > #define VHOST_NB_VQ_STATS RTE_DIM(vhost_vq_stat_strings) > diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h > index 872675207e..1573d0afe9 100644 > --- a/lib/vhost/vhost.h > +++ b/lib/vhost/vhost.h > @@ -136,6 +136,8 @@ struct virtqueue_stats { > uint64_t guest_notifications; > uint64_t iotlb_hits; > uint64_t iotlb_misses; > + uint64_t inflight_submitted; > + uint64_t inflight_completed; > }; >=20 > /** > diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c > index b1ea9fa4a5..c8905c770a 100644 > --- a/lib/vhost/virtio_net.c > +++ b/lib/vhost/virtio_net.c > @@ -2115,6 +2115,7 @@ rte_vhost_poll_enqueue_completed(int vid, uint16_t > queue_id, > n_pkts_cpl =3D vhost_poll_enqueue_completed(dev, queue_id, pkts, count, > dma_id, vchan_id); >=20 > vhost_queue_stats_update(dev, vq, pkts, n_pkts_cpl); > + vq->stats.inflight_completed +=3D n_pkts_cpl; >=20 > out: > rte_spinlock_unlock(&vq->access_lock); > @@ -2158,6 +2159,9 @@ rte_vhost_clear_queue_thread_unsafe(int vid, > uint16_t queue_id, >=20 > n_pkts_cpl =3D vhost_poll_enqueue_completed(dev, queue_id, pkts, count, > dma_id, vchan_id); >=20 > + vhost_queue_stats_update(dev, vq, pkts, n_pkts_cpl); > + vq->stats.inflight_completed +=3D n_pkts_cpl; > + > return n_pkts_cpl; > } >=20 > @@ -2207,6 +2211,8 @@ virtio_dev_rx_async_submit(struct virtio_net *dev, > uint16_t queue_id, > nb_tx =3D virtio_dev_rx_async_submit_split(dev, vq, queue_id, > pkts, count, dma_id, vchan_id); >=20 > + vq->stats.inflight_submitted +=3D nb_tx; > + > out: > if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) > vhost_user_iotlb_rd_unlock(vq); > -- > 2.35.1 Reviewed-by: Chenbo Xia