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 357A7A0501 for ; Thu, 5 May 2022 18:28:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D13DE42829; Thu, 5 May 2022 18:28:53 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2082.outbound.protection.outlook.com [40.107.223.82]) by mails.dpdk.org (Postfix) with ESMTP id C2A374014F; Thu, 5 May 2022 18:28:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IVsWy36KgyS9fStzUapfTP/RMp9Ly+MoOuKlY8/8uJZvVozEnAHkJJcKnPNszkxJOUbCsBqhC3egIbycNdGzQUxZqTlXtdaZ7NtVhWOoX7+JaHZs/nG6TiaW9GLB+6pPkRPNNn+cAeNDbYud+XsEg1zuof7/cDu5vDAuTguN7s3VdX//WBb/M/liPG2X33vRDU3fiyJv1ZrRv/ZOD03/ipUwS3i3QMwCl2TfEGBc3NbBEXF7/EkYu9t3lsZ8jeGxxCV9YHdxa4KWsbsXTGtcKCd5Wt/Ngd4XHoj7094CQII67iaaAOnQJlQAl+zRAIVv/JnV4Es/z7MIFGSq4cSrzg== 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=L9bJbmUBYDs/h4KhvmLzw6iP+6/3HBEzEmUsajnQDQ8=; b=WmbEWAowM5sYiw2U1RjHXJzzS29EJzBI0KZnDddgldygDMgt5+7O7G/CB7pABkYp12LjHoZmk4YBjYcSwc5erMK9zY6A9l+uH1mm6Y38uJXa4GlUeVe3AAbsGRex79EJzC6kosX0K9JMgAbgeF2jxjGH1zgdezQj9SXcMcD0k1VlBTbjkhSYHgyrUQrleDsWd32b8qlRmIF+JSwfO2BZzu/AHRmpR5ie4wqilvhXJdJTE9PZa9dUDYkHMXzCMXfE5UjU3RBDVu+qIoQdx2G/JfIKYT45BgBoK2EE4JIeQUUZVDezkdH6vZh8smvw2VxyAcc3syT61rHpyS8sQNO2BA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=microsoft.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L9bJbmUBYDs/h4KhvmLzw6iP+6/3HBEzEmUsajnQDQ8=; b=WXcEZi9nxjAAOQxdL0oK3HMD7atFlNeQKgjPtKpITo8I7wLH0sJUWciRjn1bnfYh8fXJwoWmpLFMtvorvLpsJutJWBpuWoWAYXG2PZZpUdy/ZPfRjJlzZM6qnDVYaynKNIL8Z6lX6cxSead4rAOrlMrxYGHnPTb1HOYBPtkKu50= Received: from DS7PR07CA0006.namprd07.prod.outlook.com (2603:10b6:5:3af::16) by DM6PR02MB5419.namprd02.prod.outlook.com (2603:10b6:5:79::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Thu, 5 May 2022 16:28:41 +0000 Received: from DM3NAM02FT029.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3af:cafe::b0) by DS7PR07CA0006.outlook.office365.com (2603:10b6:5:3af::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13 via Frontend Transport; Thu, 5 May 2022 16:28:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch02.xlnx.xilinx.com; Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT029.mail.protection.outlook.com (10.13.4.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Thu, 5 May 2022 16:28:40 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 5 May 2022 17:28:39 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 5 May 2022 17:28:39 +0100 Envelope-to: longli@microsoft.com, stephen@networkplumber.org, longli@linuxonhyperv.com, dev@dpdk.org, sthemmin@microsoft.com, stable@dpdk.org Received: from [10.71.119.95] (port=39337) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nmeLH-0000Fr-7X; Thu, 05 May 2022 17:28:39 +0100 Message-ID: <7809f41b-c21b-5ebe-d830-91015edb0cb8@xilinx.com> Date: Thu, 5 May 2022 17:28:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [Patch v2] net/netvsc: report correct stats values Content-Language: en-US To: Long Li , Stephen Hemminger CC: "longli@linuxonhyperv.com" , "dev@dpdk.org" , Stephen Hemminger , "stable@dpdk.org" 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> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 00dcbe4f-3626-465f-3511-08da2eb450ba X-MS-TrafficTypeDiagnostic: DM6PR02MB5419: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: VXyQai1+kFNeDq9PDwQZHCk0JTRongxjZQRSjkEL/W4Evwym4BfJGMPuV2uD9ZpcqlMQlCMWMqeEKXcHXGHUA3dztpIO2lgy8XMkQrz2JxLVr2YNarxfZ5Q2BDQHOxgSwkw9UXHQ2pdDMyfE9oqb1uHm9BkpwgkFBJvVRKiDKtIPXBgtGdKvlb1hTyFIzpEIkvYKz5X79ZKgmLNKdRC7FOEOCu2D7bddmTdfM6USTVT6oUW/Ro/SCJ8MdYjfGISSkIXj1OTnHAXbKSluGfd42Nepw16xLOn5nUpPMKsPP28gqR6wlWZPOYBAXqpncrW6a5FLQFDmJgLTPUWfIeThnrm07T9Sc4FgGFeqhcJ3u9qPgnuWSXxJRJbKrWA6VgdnOJG6oUsoge5hUlekA7oLBqtEaHDsryRiWaTPN9nsbF3pbBmssp/Yilthb9arZG8w3HCj0OPk+8fkBmwKRNNgd5TsHtxgo+wDM737oMMoIxcRceBwPrwr90gYPzZOv8amdf168SoDmrmJsLPplzne0Jlj/fb9i4YzeAXjR8UDbSiPIhT/zPALY+dnue4GYI4F+L0MUVh0gEBHFbf7PuCf9Oqf07J8CNF1T+sd8oR1RYjT1Ih2wdK5izfniFiq08wuugAw1Xg70CSDoBuAPHwNWxNP5dHzPGlHix0OgKWy9huY1AyfQKpHvr8O0vDdA2thNa5fzv4Vk/EhcSj4+TV+eW1c9q9N3SCgHuQYpHQsiLA= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(31686004)(53546011)(47076005)(8676002)(26005)(336012)(426003)(82310400005)(70206006)(70586007)(4326008)(83380400001)(7636003)(356005)(31696002)(40460700003)(186003)(508600001)(36860700001)(36756003)(316002)(2906002)(966005)(8936002)(9786002)(110136005)(5660300002)(54906003)(2616005)(45080400002)(44832011)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2022 16:28:40.7374 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00dcbe4f-3626-465f-3511-08da2eb450ba X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT029.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB5419 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 On 5/4/2022 7:38 PM, Long Li wrote: >> Subject: Re: [Patch v2] net/netvsc: report correct stats values >> >> 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] = txq->stats.packets; >>>>>>>>>> - stats->q_obytes[i] = txq->stats.bytes; >>>>>>>>>> + stats->q_opackets[i] += txq->stats.packets; >>>>>>>>>> + stats->q_obytes[i] += 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 receive >> packets, even if it can't allocate a mbuf to receive a synthetic packet itself. 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. >> >> I am not referring to the "+=" 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. > But its own stat also will be overwritten (not in PMD function, but in ethdev layer). 'stats->rx_nombuf' assignment in the PMD seems has no effect and can be removed. I can't see how it is needed, can you please put a call stack to describe? >> >> [1] >> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.dpdk >> .org%2Fdpdk%2Ftree%2Flib%2Fethdev%2Frte_ethdev.c%3Fh%3Dv22.03%23n25 >> 18&data=05%7C01%7Clongli%40microsoft.com%7Cea473df2344c460d575 >> d08da2dca3e53%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63787 >> 2643902917430%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ >> IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sd >> ata=FZO%2B%2BnWtLGstHHIZ2aXsDUKNI%2Fi9tbj6jONhp174qKw%3D&res >> erved=0