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 482EDA050D for ; Tue, 26 Apr 2022 23:56:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 34FB041143; Tue, 26 Apr 2022 23:56:20 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2061.outbound.protection.outlook.com [40.107.220.61]) by mails.dpdk.org (Postfix) with ESMTP id D13A840691; Tue, 26 Apr 2022 23:56:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LVrsGUbdCB20Zprh5OZyfnT9TqULbIfZ3FNCY3VD/Cn9euR7cetJV/yYES8StBZT+mDr09tZwTwtbDpuh2q+NrVppAdh1/mANs2N4T676x9UQ4raKYDs/qGpknd86ITtmrZD3+doi5c1jPLv2Qe0HcmHKXaX6S97cDDl6RjZDfjKMJEXiAtuGZkBtU2udYmVI4T7qFHC24viW2z39ThtEqffYe5qqmow/jK84xeoLPAS/xxJa6Zk4glszfPnZhGT681yLyKpeHP+oexU9fGQMDUPWaE9uZpSw71VSctcnA/IK4OkcBuMngVKnLhG3FMHeRT48mMmOsMIqzmW4kZI7A== 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=XpvOhOFcEMDrPjGaXaLXdZj1Hr43/TlO8WEUiQZ1WOQ=; b=Ysj6+yaIFCSdNyXAUbheXi8meG7hAq0iIpPxdJLzOk5nBbtYYz5rZoBfcuBEI2nRksgm/mbcMHfcVzBYmcrrkNTUyi4ZWuNl/r8pf6kVmHiNFEckJdZ1TJVCb3t2X79xpaWhNDtoknVuT5r4UcG1/WbYyRyRzb3ZTopSl8h8/foGxUtSuxGJfI1SfA9cKBjtFuBCkwmio3R3Bx4qkSn1+pfMNY6OXs1wMMeSXrI48elNXRYKaLNB9tb+vM65ngwCVYbluefGf0vXQpMwrnTry4sIzgrjfUUlCxp7bNQGM3Zk8x7t7YKi+GovL39x6Alcx4rORG+Vd9dEm4w3/uQZEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=linuxonhyperv.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=XpvOhOFcEMDrPjGaXaLXdZj1Hr43/TlO8WEUiQZ1WOQ=; b=NCC69i5tOwBtheDSHhyUBlyDKlwyAPhTp9E88dMnYALzlmKz4cwdJ6eaE4rDJG5FVvP7gKcMLKaRoTRuB2aLFbhmQ9WSfwm9uw68F3FhECtHYSYaL3V6zagRfN1pRQk4BjP+KHdhz8pjU/PVqi9lSJcQYqJLyFe2uOycVw7zGaU= Received: from DS7PR05CA0103.namprd05.prod.outlook.com (2603:10b6:8:56::18) by DM6PR02MB5676.namprd02.prod.outlook.com (2603:10b6:5:34::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Tue, 26 Apr 2022 21:56:16 +0000 Received: from DM3NAM02FT040.eop-nam02.prod.protection.outlook.com (2603:10b6:8:56:cafe::3) by DS7PR05CA0103.outlook.office365.com (2603:10b6:8:56::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.6 via Frontend Transport; Tue, 26 Apr 2022 21:56:16 +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-pvapexch01.xlnx.xilinx.com; Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT040.mail.protection.outlook.com (10.13.5.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5186.14 via Frontend Transport; Tue, 26 Apr 2022 21:56:15 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 26 Apr 2022 22:56:14 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 26 Apr 2022 22:56:14 +0100 Envelope-to: longli@linuxonhyperv.com, dev@dpdk.org, sthemmin@microsoft.com, longli@microsoft.com, stable@dpdk.org Received: from [10.71.118.71] (port=52940) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1njTAM-000637-Bk; Tue, 26 Apr 2022 22:56:14 +0100 Message-ID: <7f51e773-6ded-b736-fb02-5e3b391353b9@xilinx.com> Date: Tue, 26 Apr 2022 22:56:14 +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: , , Stephen Hemminger CC: Long Li , References: <1648143948-17821-1-git-send-email-longli@linuxonhyperv.com> From: Ferruh Yigit In-Reply-To: <1648143948-17821-1-git-send-email-longli@linuxonhyperv.com> 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: 22b2ec26-bad3-46a8-0a96-08da27cf9672 X-MS-TrafficTypeDiagnostic: DM6PR02MB5676: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: GEYTchwt/uw9NHcqj6rV42dLRFjEIJEolxoi++cUPsi4om7T5uiZS+ANRoTtQRHBwlP1m4yOwfzQQiRpRn3WmWv82WIt4MXzgzXFUqrTlapI/qXSEmX+L51yHXr81m775hPtgIcfCOuFKR+Aoqfv2ocWjIphQp+5fWvRy8/Tv3afgBh43un5mDQefeiKpoHq2kHmN6NyWHTirsnC991Ok7JzwBOpA6Wu97fMbbjyclqLepjEP4z+VvguZaLeMDFTRTiY+qSgKtqHZVsodygUyoFjt0Uj26j6wvBdhPzqBeHkupf6xTPGwQomcEvNyVzp5+dgU/8DX0aXOGenADnmh6J37dBe/e0FBsXFrH/OnyHfABue0bPGKg50CxcTjg56KkR3I+DfVrYTrfcpzFZ9pKwsKHqed8ukwrR60sS2Ru08INAmGOBBzNKJwKDsUMbgbNuQiSpjMW7UqeLzYdNsBIX13k+EaXL6D2xlRpmRfA8Pgmw8LZzCEsC/BjDLYtZ4qlcJ8w5M65ILH/zkjt8XkOwrDr+7TWWWBPZB6Nfig0Qn6ujfaFsCpGG3oqEREt6k437Bunlnlr9Q/cgjHwOXjxJwK5BLuEYuyEqiVK8b/nIYunO4HYJbyZVq+AX8AKYXlyku8DmgLhpRDeAwbNe8icnLeElV9EyGokq5vc87AktvSuMIaxgdrTuX/vosoqsl8ILLZX6eHXHxoo6Hx2P0XBY/Q9oJ9mSl2cZp49CZj0Q= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(26005)(36860700001)(7636003)(356005)(83380400001)(31686004)(2616005)(336012)(186003)(426003)(47076005)(31696002)(44832011)(8936002)(9786002)(4326008)(40460700003)(8676002)(54906003)(2906002)(53546011)(5660300002)(36756003)(82310400005)(110136005)(45080400002)(508600001)(70586007)(70206006)(316002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2022 21:56:15.9928 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22b2ec26-bad3-46a8-0a96-08da27cf9672 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-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT040.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB5676 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 3/24/2022 5:45 PM, longli@linuxonhyperv.com wrote: > From: Long Li > > The netvsc should add to the values from the VF and report the sum. > Per port stats already accumulated, like: 'stats->opackets += txq->stats.packets;' > Fixes: 4e9c73e96e ("net/netvsc: add Hyper-V network device") > Cc: stable@dpdk.org > Signed-off-by: Long Li > --- > drivers/net/netvsc/hn_ethdev.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c > index 0a357d3645..a6202d898b 100644 > --- a/drivers/net/netvsc/hn_ethdev.c > +++ b/drivers/net/netvsc/hn_ethdev.c > @@ -804,8 +804,8 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev, > stats->oerrors += txq->stats.errors; > > 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. > } > } > > @@ -821,12 +821,12 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev, > stats->imissed += rxq->stats.ring_full; > > if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { > - stats->q_ipackets[i] = rxq->stats.packets; > - stats->q_ibytes[i] = rxq->stats.bytes; > + stats->q_ipackets[i] += rxq->stats.packets; > + stats->q_ibytes[i] += rxq->stats.bytes; > } > } > > - stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed; > + stats->rx_nombuf += dev->data->rx_mbuf_alloc_failed; Why '+='? Is 'dev->data->rx_mbuf_alloc_failed' reset somewhere between two consecutive stats get call? Anyway, above line has no affect, since the 'stats->rx_nombuf' is overwritten by 'rte_eth_stats_get()'. So above line can be removed. > return 0; > } >