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 7B270A00BE for ; Wed, 4 May 2022 20:38:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FE69427EF; Wed, 4 May 2022 20:38:50 +0200 (CEST) Received: from na01-obe.outbound.protection.outlook.com (unknown [52.101.57.27]) by mails.dpdk.org (Postfix) with ESMTP id 0C4344069F; Wed, 4 May 2022 20:38:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XzIxoQDvtu0FuQyN7LfN9/bEotq0CaKT3zoDUmTJihnDB9rOHyLefM1Kcp5UZCiyoDW8iLXTzSTa+xHrKkyfi/Xr5eNN8+uy+J76psmWKYzVEW3g444Jh1sIcMG4SG7/hPrlufsyGDnpDUQzH+O0N8wI2qxDvDRQwtwYoZmBYjgYedfqciUpgs0n+NAX84HPAtsq42hMU81Kri0hLmo09A/QzcfKCshxOcDQ+dXiE/Bu3U6PpUGJpdHB01yzX/5Wx4zk70MwuVg60YO5Y1rJZE96T6Pjw78RFdWNPw+iA8lVF1PV+0GtZI17ihj8NBw0vjCXYz2Ln6qLFrtqDiaLOg== 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=UEaLyrtIvxBD4SLmVwMz8ut/zMw1wwSb9FsX2VHZMfI=; b=M70pRjKiFgNgS0Hi49UThdEn+b95VfzrcivKabgRbcMXusDS8gxeqvkaUWd9pnqDdBlUZdcsTv7bTCxHSA4jJrmbVh8XqDzupT0hMB+oEZK6ceMqB0pKZ+8JtlcAe0i+NJhbV+zTl2WjDf+Aq51Rm4PHM6w6NDN5hDpYD1Zhs19BbzChS9vqHPT3vTlhaH7lW3DYR1U2p8V9AmlyTK9iww5rrugrEkJ6iTxbbPN5+5Gjiz3wQwRKn5Zy2M+CDGQghwvvpfOnRm+ppKM9Ttv7xFKuWbMuRzl7PkHliiq9G9IQXB+eCqQ15x9ltKhtfyYMegQcaMzeYTnnCxh68JuilA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UEaLyrtIvxBD4SLmVwMz8ut/zMw1wwSb9FsX2VHZMfI=; b=UzpgA8y8j/S7eharh040/atiEZzj75mW623VjmhCjeG8Rqi3lT07ldfndEIymEQvNS8DRQxk4OitbU4ImyW2oA5lKgiT1rrl0N5tWXcm7iBSqWeN6AEn1ChdqWFy31cgrsWAEL5uy7w1LUac6RUtWJgAql9C1N1vwARpFZ3HGjE= Received: from PH7PR21MB3263.namprd21.prod.outlook.com (2603:10b6:510:1db::16) by BL0PR2101MB1827.namprd21.prod.outlook.com (2603:10b6:207:33::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.8; Wed, 4 May 2022 18:38:45 +0000 Received: from PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::ddf3:2951:518d:34a5]) by PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::ddf3:2951:518d:34a5%7]) with mapi id 15.20.5250.004; Wed, 4 May 2022 18:38:45 +0000 From: Long Li To: Ferruh Yigit , Stephen Hemminger CC: "longli@linuxonhyperv.com" , "dev@dpdk.org" , Stephen Hemminger , "stable@dpdk.org" Subject: RE: [Patch v2] net/netvsc: report correct stats values Thread-Topic: [Patch v2] net/netvsc: report correct stats values Thread-Index: AQHYP6cEkQRXn4D8yUClXpvX3Nw0c60C8ZcAgAANvACACrUn4IAADUgAgAAB1WCAAAyYAIAADcyQgAEI6ICAAGTiIA== Date: Wed, 4 May 2022 18:38:45 +0000 Message-ID: References: <1648143948-17821-1-git-send-email-longli@linuxonhyperv.com> <7f51e773-6ded-b736-fb02-5e3b391353b9@xilinx.com> <20220426154524.49502217@hermes.local> <924d7398-6c78-6318-52f3-d671edfc8aad@xilinx.com> <04de7df6-3d4a-21e5-7be5-15f2ef88be16@xilinx.com> <99a629d6-642e-db25-eeaa-a9eceec577cb@xilinx.com> In-Reply-To: <99a629d6-642e-db25-eeaa-a9eceec577cb@xilinx.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=7243fa61-20b9-484d-8b04-71e3ba08ed9e; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-05-04T18:34:07Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 72c89094-ab4e-4ba5-9250-08da2dfd5228 x-ms-traffictypediagnostic: BL0PR2101MB1827: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: Q1efdY/PnQwoCddnI/aKI5qXBsn9sdPjaGcvUlI/O2+4b58sbv7sE4Z1L4NYGY0rH8b1WFXE9SU1wDjjOPBvS24cFCdRD18hjXvDSOsy8cevyAXfI6HYGTAhFoz3JrjvRPGWxAkYDprCoV7iygpY5pZ/b7+y4k7DCNYWuEiMABp5xbHBrstPPvWcfYIwHl4b3PCLe7E1FYb8xzMUHulWosDa5ZnFTL+XQ4sUhhNTDzFZG67mANkkx9nov+1azDrpEVZz6NROEAYEVDOd6GH/nALhjjScsZosAWXTqfJeZCk6hJMjeYhjbypG2vbrWefn9BNDvgfroDZCcbdZ958SMr1mabRvwHf3vOxmKYJhN4uHK/rYYEq+PxYAFkSrHwgtmz6AVh4EwaAVCkkYWTOnXcjof+KKvb+u+GKfLEe1FP+mI/Xg9sVdcARldCnnmFefg6RILWBOkJftznWgmbscFBQuixtKXr62fEB54wFi3MA3VCUyS/xISrMOYvg/9N9XglmI9Q8XmRw7XEOMtbphZpuwmHqQ1rQo3atndaCKQYYkB+Tld0qLaOpnoOSFOrtwh49RcaLzl3aJbFcnbanDF7dvVfHz2aV0vXnGY4JdScD+dUG04YClKuMAA8cARJ7c6JHOHQO3vqqHiJO7zHT9N6TsFihByQsBh8y8Aw1nrKJ4LokSPz4VnSatG4p0aih/dQ9qPp/ikNkBB4UJuftGINRZP02ix4irGOZGMcVqyeTMSCSl8gQW2+NmoGyhBYV5 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR21MB3263.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(451199009)(8990500004)(38100700002)(38070700005)(7696005)(86362001)(6506007)(110136005)(76116006)(26005)(9686003)(53546011)(82950400001)(10290500003)(82960400001)(8936002)(122000001)(5660300002)(52536014)(71200400001)(2906002)(186003)(316002)(54906003)(966005)(33656002)(83380400001)(55016003)(66446008)(64756008)(66556008)(66476007)(66946007)(4326008)(8676002)(508600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?erYOjIkSUduX/7aemuUed+XB40RSdH2jrm5RhEnGwqOtgbicfTcm6AHPvZBy?= =?us-ascii?Q?ulVCHfcGUwr74qI9TJ/rpKzi38a6IQOS8deHgQHpwpxsNaQQhuRLdcOxszl6?= =?us-ascii?Q?5gIBFKQajLyd/CCRhh2Y3GZHYuuqXPMQAy33TIJBuqGiqZ0q53F5FswvhOEh?= =?us-ascii?Q?1bmnDhp00u2cKktpE3pQICogCtrUynOqTL9PlINCAvP/3ZcLo3stL43y2Qtx?= =?us-ascii?Q?ptqRbo8RnY8FmKKICjilmUXjgzJzEHsMCRCo3FxTWfqg5EY6kz+I4NRZQABG?= =?us-ascii?Q?nRlgTSuFxekbvoXdeXffJJGlKvNbQE0UJgkri5jPz/mJ3ZflGobYQQnEF8N+?= =?us-ascii?Q?8utgZzc8RTvAgmA68uurVOalm0R8PO1XoqlLx/CDuQ2BQmIbUQI1cyaanjvI?= =?us-ascii?Q?7u+UjCzrKSj/Ow3w9rWy+YffxIRV2SAfkRr0wKmcC2CkkaqtHdMmfh01BVPj?= =?us-ascii?Q?xT3sdDpn8xct5pGJlaAlCqczbfCJNvEXrH6i2QdjtHVxBQkIGff67k2fjfzp?= =?us-ascii?Q?IuXKIAyTOvGdsjdNCpN4BsEqkrJZYuT2DxL7Sl+/787sGmi9kwPDF5Q6+n9i?= =?us-ascii?Q?tPrIIYjhsS6sNirPwXbCT704pnWBrRQstuZdTz4SP+2LSz5SB832emwBC7VW?= =?us-ascii?Q?1R4j/IrP7fO0f7IyCRnyREADmMFDMCvxxM0H8lsIPAH1jbGwQiUpkpTTVT6p?= =?us-ascii?Q?GtUPV3tp63cyHKeCeMycd+Xc9VHoDc8Z7iIH3UvBbR8BORHp10JH/zm8gZf1?= =?us-ascii?Q?XV1WYHI9iSWxIaFcxjw1OTLm01eRy6ZrzAXQtCmpqKr0WT9paiDiiRGUdIc+?= =?us-ascii?Q?W6U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vPtaJxPhGDdfuvm?= =?us-ascii?Q?1i1Z+7iGNg=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR21MB3263.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72c89094-ab4e-4ba5-9250-08da2dfd5228 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 May 2022 18:38:45.4612 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ak5K58+SmNsuYB6n42OITdyZ5tVs9mXVQJfu00JPTv3Fmw/suuLdF8fxM/5K3wvM9m9d/pEwRXDwO/W952u5aw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1827 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > Subject: Re: [Patch v2] net/netvsc: report correct stats values >=20 > On 5/3/2022 9:48 PM, Long Li wrote: > >> Subject: Re: [Patch v2] net/netvsc: report correct stats values > >> > >> On 5/3/2022 8:14 PM, Long Li wrote: > >>>> Subject: Re: [Patch v2] net/netvsc: report correct stats values > >>>> > >>>> On 5/3/2022 7:18 PM, Long Li wrote: > >>>>>> Subject: Re: [Patch v2] net/netvsc: report correct stats values > >>>>>> > >>>>>> On Tue, 26 Apr 2022 22:56:14 +0100 Ferruh Yigit > >>>>>> wrote: > >>>>>> > >>>>>>>> if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { > >>>>>>>> - stats->q_opackets[i] =3D txq->stats.packets; > >>>>>>>> - stats->q_obytes[i] =3D txq->stats.bytes; > >>>>>>>> + stats->q_opackets[i] +=3D txq->stats.packets; > >>>>>>>> + stats->q_obytes[i] +=3D txq->stats.bytes; > >>>>>>> > >>>>>>> This is per queue stats, 'stats->q_opackets[i]', in next > >>>>>>> iteration of the loop, 'i' will be increased and 'txq' will be > >>>>>>> updated, so as far as I can see the above change has no affect. > >>>>>> > >>>>>> Agree, that is why it was just assignment originally. > >>>>> > >>>>> The condition here is a little different. NETVSC is a master > >>>>> device with > >>>> another PMD running as a slave. When reporting stats values, it > >>>> needs to add the values from the slave PMD. The original code just > >>>> overwrites the values from its slave PMD. > >>>> > >>>> Where the initial values are coming from, 'hn_vf_stats_get()'? > >>>> > >>>> If 'hn_vf_stats_get()' fills the stats, what are the values kept in > >>>> 'txq- > >>> stats.*' > >>>> in above updated loop? > >>> > >>> Yes, hn_vf_stats_get() fills in the stats from the slave PMD. > >>> txq->stats > >> values are from the master PMD. Those values are different and > >> accounted separated from the values from the slave PMD. > >> > >> I see, since this is a little different than what most of the PMDs > >> do, can you please put a little more info to the commit log? Or > >> perhaps can add some comments to the code. > > > > Ok, will do. > > > >> > >> And still 'stats->rx_nombuf' change is not required right? If so can > >> you remove it in the next version? > > > > It is still needed. NETVSC unconditionally calls the slave PMD to recei= ve > packets, even if it can't allocate a mbuf to receive a synthetic packet i= tself. The > accounting of rx_nombuf is valid because the synthetic packets (to NETVSC= ) and > VF packets (to slave PMD) are routed separately from Hyper-V. >=20 > I am not referring to the "+=3D" update, my comment was because 'stats- > >rx_nombuf' is overwritten in 'rte_eth_stats_get()' [1]. > Is it still required? Yes, it is still needed. NETVSC calls the rte_eth_stats_get() on its slave = PMD first, and stats->rx_nombuf is updated (overwritten) for its slave PMD.= Afte that, it needs to add to its own dev->data->rx_mbuf_alloc_failed back= to stats->rx_nombuf. >=20 > [1] > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgit.d= pdk > .org%2Fdpdk%2Ftree%2Flib%2Fethdev%2Frte_ethdev.c%3Fh%3Dv22.03%23n25 > 18&data=3D05%7C01%7Clongli%40microsoft.com%7Cea473df2344c460d575 > d08da2dca3e53%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63787 > 2643902917430%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sd > ata=3DFZO%2B%2BnWtLGstHHIZ2aXsDUKNI%2Fi9tbj6jONhp174qKw%3D&res > erved=3D0