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 DF188A0509; Wed, 4 May 2022 14:33:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1DCC40C35; Wed, 4 May 2022 14:33:09 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2058.outbound.protection.outlook.com [40.107.100.58]) by mails.dpdk.org (Postfix) with ESMTP id 44A5B4069F; Wed, 4 May 2022 14:33:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j7W0A3OnzftgaPmC9CkExnovHwGedoPtZkA/hP1jrw4v+vQLoDRchSbhN7QdCPxcsMQCfzK70AAJPSC+KVrJDuJBmWZmH0xDx2wxsyTMMTLxNaJEivvhOSNHu+E78XXIuNEL8j5WglpMeZvpcx4s2vY8aqJy8lPf6KJTGsmq3z7hYkyfEGidx8a3bqNepbaTBymudlnx60bRAm8G4/1hheTA4iaUz3t8rmAYC8o3iUk3NUh99rPDLwQbPuZku0M9EnaJIh5s6H0rQUPB8tEDppGVTMUOYGIZjaIILdEY7YZBbXF1S0V0oKyF8KrDovsdpn5tKBFBehxxCMs5IEx+mw== 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=UxLkDj6oZ9HBP1dn7s0qKcTuFrXch84FVryzGD3dDp4=; b=LG02puk4NvfN7k7p2fRHbwZMwMiNBuLk1ksSaTL3WNiYwCQGx3Clx0ibSm1z/s7NwqsmiDFvP0lxISOIv8msVydqq6Jh5QEH93eRQXJ+1AIbwSW9yLPpvDoKrdgNy6hA6+12nOe89qHLgTGHbyqs0AxxNa64htFpK73Mn4+OgTsrycmivXuqo40hwjCn9/N9BWMxlBM07aJWmZyiQQ/4xNtOtVmVJad+45aO1qpzmj0pX6UhyLM6hytlPVEJPOPOgvtn5NOItz76qxmWfpkUX4A4q7AGaxHMezkl35sOEC7F11KhaSsrWbD0MOKf/KEiJjp4FzwAB+44FmBzVZyHYQ== 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=UxLkDj6oZ9HBP1dn7s0qKcTuFrXch84FVryzGD3dDp4=; b=edZycf2cqe6fxFkeJnSppW2rB/8QmQhjECArYamt4kTQfMB8xuD8D3vsOogjbrCE6kwhe8sO8phsHlf7aa3VrLRK9QRDCUqA6zvvc379GQnReaERjZUIIpHMqvyqQ2NVh/BFweZCTipE87wZyWoMLk/r1Viaz//+KhW/U/ChRBY= Received: from DM6PR11CA0048.namprd11.prod.outlook.com (2603:10b6:5:14c::25) by DM6PR02MB5818.namprd02.prod.outlook.com (2603:10b6:5:17c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.18; Wed, 4 May 2022 12:33:06 +0000 Received: from DM3NAM02FT060.eop-nam02.prod.protection.outlook.com (2603:10b6:5:14c:cafe::4d) by DM6PR11CA0048.outlook.office365.com (2603:10b6:5:14c::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Wed, 4 May 2022 12:33:05 +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 DM3NAM02FT060.mail.protection.outlook.com (10.13.4.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Wed, 4 May 2022 12:33:05 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) 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; Wed, 4 May 2022 13:33:04 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Wed, 4 May 2022 13:33:04 +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.115] (port=40895) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nmEBk-0002IV-3R; Wed, 04 May 2022 13:33:04 +0100 Message-ID: <99a629d6-642e-db25-eeaa-a9eceec577cb@xilinx.com> Date: Wed, 4 May 2022 13:33:03 +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> 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: 0d6018ef-4d21-4053-ad6c-08da2dca3d25 X-MS-TrafficTypeDiagnostic: DM6PR02MB5818: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: ZCsqKB7s0ifD99ZxSXoR0Sm4jY6isuuSEtqsFNSjv17YsI1hxvBhX1x39NUi550K9P9EXXcL21pXXUvTi4tifv3lTzwQIjKWM1sx3UQVNDA8pjPJCAEigW0j6L11ekWBUZCiZd7BzHGNF9tW3YaPuT57GA+xEBkkWCXcj2g78vGpr/XkPng+TW7wNV5CsSVINAYSamnNS8WW0dVT2Kce7SR42UcCitmmflr1bGwwoG1vFrmC/2sd6W5EGjUw0MyedwmkaoTMWP/BX3HY32wDL8oI0/y0JykDlP0WszpRfQHeReenpA5pHNYHBpogwuiSz+vcUDcFTGUXL2jAUnm1WX9g8z5yU635tqoEpxhoXnwyHIQn9ExHsiPvY8vftROyJp5ZQKo5zYEJZgohi8osd2mX+j/mmMIg3KAnx4iOEuIWYZtlULkFcVm1WGt7szWACH+kYXhqRNm9bun2PKZjqCxfNQCIeOZGpVmRmozRLVsFoyhwRLzsrf6GDWln+A/QdUTL7h7ST5mZ5I5LHeah+rNRKKRjSSMGZT/vL7J4/V/3Maaf7GmIQcgzekTyjIj9KF/f4i6bfHK3rtU0Ttqc25cwWKSWSwwJxq9tdct0+SaMWhDz4RoMwq6rA0OBLnnhpBTwzvVtryNSLJZJYq0TxnkzWSQChKarXr2M+dlFxoLWJismzIZoiTIcrS5+fRul/DcXlZK/UAscMV3yXD3RhjXfS2xau7bBaVYUxZv4v9tZliRfSM2GvwCD9sSGeUlPwaFQSq7kL3X2yNdY77h5K2gqYycAnveQJ/qbUiTUG62i/Ay3Wh7wJ/xTeKy9xqIN 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)(36840700001)(40470700004)(46966006)(83380400001)(9786002)(70586007)(8676002)(70206006)(508600001)(8936002)(4326008)(53546011)(186003)(26005)(966005)(40460700003)(2616005)(44832011)(31696002)(5660300002)(426003)(47076005)(336012)(2906002)(82310400005)(356005)(31686004)(7636003)(316002)(36756003)(110136005)(36860700001)(54906003)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2022 12:33:05.6682 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d6018ef-4d21-4053-ad6c-08da2dca3d25 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: DM3NAM02FT060.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB5818 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 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? [1] https://git.dpdk.org/dpdk/tree/lib/ethdev/rte_ethdev.c?h=v22.03#n2518