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 3157841B8F for ; Tue, 31 Jan 2023 12:56:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24845410F6; Tue, 31 Jan 2023 12:56:33 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2049.outbound.protection.outlook.com [40.107.223.49]) by mails.dpdk.org (Postfix) with ESMTP id 6BA574067B; Tue, 31 Jan 2023 12:56:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XqWLiy2cTmeplconJGYEqacKvFnWoCHjrsDoz9UKzk1vKRkU4Uw9J/qEZ2jh4f90hg6fNZYFc7YS8uOrzccH9ErAXg2HX3Tqjy5MNf0TZ3zAvGTYLazLLwLozEE/38ur02v6z/YLye9tuFVvB2YGPpMhgBhXLBdFFbb+hP3/1tf9MXiyZxfReg1gvHycXgVMouRWAsKzilHXKV49TVrrqxQjjDZIxlk45NZO7cM/th/Og3e2HIVan0lwi/rMwRWRCQ0P75Utz09JC6VRAml/mnTRuBfa4XcYF6vnC8I6mnROS/1FrnW5NVv1Hr3x97o5lHjOCYC+C/T4GQwhiaEU1Q== 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=DSIM22VzxoCyAAqRomyjoUB+4Uzi8OeyWrFAYLjRWIw=; b=JG4QQAwiEQqGWEQoMtdPeGmu++dqoddvm+syvAU5Ugm5oG5BN1EXF/lc77RQygEAQ8QZuEf5C4e3Zb3OqfW/XVqcsWuhY8yYj1nGt3zZ9PetE/E5jZJ+DfVS4mGe29M44CN4Bfd/un4Qfm32nBXpOVn98GdbokI16O+w5NohA/DNUeW+Jx3hFCt8sYycEBdSOKz+05Tk6OQF4gcPkkn4mHVJj6aS2u8t5U2IhTk893HHra42KIwl+2zOZ/8Qf8KDfWb7ZuE7dvmxQ5cOX3NIJWOxC8M1wpOaPA+Rlsde88mw+Qx6tahJ262FdzfQBqzx7ZTnk0cE+9wGGmJqSVBTBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DSIM22VzxoCyAAqRomyjoUB+4Uzi8OeyWrFAYLjRWIw=; b=mDVU4Jg42WWYjqTN9F18KHjirbnXYatg2UhE1i2YFItIrZS56CYgrMJlWHPLWzd3A4cV+VHtfz25lryuvCzl/zAwP0Xu+VZIDcmfXLZxz970xbXacY4ExZX7oqsu38D/UmlGNV4FWMCTxcGgrkSq9ReSh99idSyZ+JWU4j/0NsE= Received: from MW4PR03CA0174.namprd03.prod.outlook.com (2603:10b6:303:8d::29) by SJ0PR12MB7475.namprd12.prod.outlook.com (2603:10b6:a03:48d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 11:56:28 +0000 Received: from CO1NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8d:cafe::a4) by MW4PR03CA0174.outlook.office365.com (2603:10b6:303:8d::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Tue, 31 Jan 2023 11:56:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT057.mail.protection.outlook.com (10.13.174.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.21 via Frontend Transport; Tue, 31 Jan 2023 11:56:28 +0000 Received: from telcodpdk.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 31 Jan 2023 05:56:26 -0600 From: Ferruh Yigit To: Aman Singh , Yuying Zhang , David Marchand , Ferruh Yigit , Maxime Coquelin CC: , , Joshua Washington Subject: [PATCH] app/testpmd: fix forwarding stats for Tx dropped Date: Tue, 31 Jan 2023 11:56:03 +0000 Message-ID: <20230131115603.640254-1-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT057:EE_|SJ0PR12MB7475:EE_ X-MS-Office365-Filtering-Correlation-Id: ec7e34c1-959e-4fdd-ede9-08db03822fc1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WVinJ0MViC023r4POUPFCOfroNNt6CYX4jBgo0qyNbk/KIAa7cxpEE5XyyC1P7uXGNv8JUiri4xcXqZeMbn2HW7aH3W6C5K59ifwYfK4cuqoAJ6CXZyr5b45+EYiawiDiPf+eeVrnWRi5ndwzg/bviR/HC21PmjMIjUK1NlLQcIn6hiYcJ+IbWk+SHfThVa/ISqXuoDqwU20Z//84GyC7aaDRjyOxBw4zF2Ot2XO290upQ2vWUd9BT8bNpS3OK9hM2Si3ozTcAzpxF+6flloE7IpDnjXPOqv7Rbi8uXVNmiym6XoBjztSEnYQ2f8h1P2kii0KPQiRFquAfTRvYRV/62n0o1M8wwg8q1Zl3yncJJAA3CAiXMrIEVQLf+umflsGgJ7/WQZZwdznrrJI99hYxNqmrnaqepETCKhTg9PPt0D2UWzN+Wg3K0PVEjr7Cis3M5uTUgd/GL9jP+6Fajf/Gr8/Tpougn3hZjO+eThLmALQjyrz1O1r57Y9QbNhqOfs+Tdu5n6cjfPA1680GVo1QCG892nEiJ88dS+9tnopU3d+Qs8yDk15q7wPABQ5AoIek5aNGkPrLIQjGtYgklBjKktBOzDopmAlHcoflSItcj/DhamyW0dRnSronCfOQiyrEQWRt0/gqOFdOGwq9s3H5FQ4AOGJf0fCn7cd3eb0RZ5S4FcTjTir3Hqnd/RCELOyuJjHbgaJ12zfeVqJywaZOIEU/VZijA/LMaTtEp5cIO3zgzmkLpR1D5CS4TvuVn3VOCAmEOIxQI38OxfuWIc+A== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230025)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199018)(46966006)(40470700004)(36840700001)(86362001)(356005)(81166007)(82740400003)(36860700001)(36756003)(41300700001)(8936002)(70586007)(5660300002)(316002)(110136005)(54906003)(70206006)(4326008)(82310400005)(8676002)(2906002)(44832011)(40460700003)(40480700001)(83380400001)(336012)(426003)(2616005)(7696005)(47076005)(478600001)(186003)(16526019)(26005)(1076003)(966005)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 11:56:28.3208 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec7e34c1-959e-4fdd-ede9-08db03822fc1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7475 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 There is an inconsistency at displaying Tx dropped value for per port forwarding stats and accumulated forwarding stats. While displaying per port TX-dropped value, it only takes 'ports_stats[pt_id].tx_dropped' into account, but for accumulated TX-dropped results it takes both 'ports_stats[pt_id].tx_dropped' & 'stats.oerrors' into account. To fix, make both per port and accumulated stats display 'tx_dropped' and 'stats.oerrors' (ports_stats[pt_id].tx_dropped + stats.oerrors). Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand") Cc: stable@dpdk.org Reported-by: Joshua Washington Signed-off-by: Ferruh Yigit --- Cc: david.marchand@redhat.com Mail list reference: https://inbox.dpdk.org/dev/a440ab60-9624-f21e-396a-239bdf2aa1a1@amd.com/ --- app/test-pmd/testpmd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 60eb9579ded1..6f4749b8af0c 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2057,6 +2057,8 @@ fwd_stats_display(void) fwd_cycles += fs->core_cycles; } for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) { + uint64_t tx_dropped = 0; + pt_id = fwd_ports_ids[i]; port = &ports[pt_id]; @@ -2078,8 +2080,9 @@ fwd_stats_display(void) total_recv += stats.ipackets; total_xmit += stats.opackets; total_rx_dropped += stats.imissed; - total_tx_dropped += ports_stats[pt_id].tx_dropped; - total_tx_dropped += stats.oerrors; + tx_dropped += ports_stats[pt_id].tx_dropped; + tx_dropped += stats.oerrors; + total_tx_dropped += tx_dropped; total_rx_nombuf += stats.rx_nombuf; printf("\n %s Forward statistics for port %-2d %s\n", @@ -2106,8 +2109,8 @@ fwd_stats_display(void) printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64 "TX-total: %-"PRIu64"\n", - stats.opackets, ports_stats[pt_id].tx_dropped, - stats.opackets + ports_stats[pt_id].tx_dropped); + stats.opackets, tx_dropped, + stats.opackets + tx_dropped); if (record_burst_stats) { if (ports_stats[pt_id].rx_stream) -- 2.25.1