From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C9A8DA0518 for ; Fri, 24 Jul 2020 14:09:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C04D11C1FD; Fri, 24 Jul 2020 14:09:44 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id E65D61C1FD for ; Fri, 24 Jul 2020 14:09:43 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id z18so4530434wrm.12 for ; Fri, 24 Jul 2020 05:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uENL5iXyEsuiX5gKNycrVdhAm9pa+KCARkpUyup5ptg=; b=hugogG2ftGKv/fnLRgy5VWzvDoMMg2A5Eah9yreB/KcB1jIjZitSg+6Or+EXmjkbVr ZtwC72+dpl2VPFx74UEhOOR2wbATvWQdN1oBMPWELt4Os5nvEKZdxXNdsl7eauUNiDb+ YE4Tyx1mqx36f2fjvZo2KyYKQqYfp3lNMBB6+Eq27X/44NXBaacp+8+Ie8FX7Kd5ZWYm 7jNkRO22+3Z563a1cFZQZlRAtuM0NB80g3NiQLXCzcDHZEtzqAkgr9FBoAbL9hoQ5iCD PDL3qQ0dwYADJo9yxdCNErn00eTYtDx7x0GvXMiztqmTSgtHcQSbAvr+KoCWxlgAT5gf CoQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uENL5iXyEsuiX5gKNycrVdhAm9pa+KCARkpUyup5ptg=; b=MCj1GDeXOnuXvxwjGxwI7Q2ENflGi3XuxjhMZMhToumsr2KxJUE2bBtfpIMjTuh3Ep EWCIOWLgqCKF0qNh87ZLjIvY9D3oNUIlOv6ZGggtEFH7GD+c8n3UaeXhy6LqM1o5an0v XerMQ8rppVlsUQY9xD3+o1vZ9Lxy3bpPlMFowzyt3vAJ3acNo+MmV17Y+4aDP9fkk56s SyTi6mW1Q1CI/Fh+06GdgjlZYHDCMK5Gtm1J918y4zvOcNRE+HTHUgmFMl09oSKYUp87 wTRSs3xtTJwzBIABSYz51ZNSYoF9zmFSO11VGqfHlbum3hTI52bI0d7zKkKt73jABlDL 8P/w== X-Gm-Message-State: AOAM533fIqRO33ODr9oj0qNSklIep7iM91uweDiZ+XCfiZdFC5+zcRQJ 5g3P/xqo6OElTBC7hoSPcCE= X-Google-Smtp-Source: ABdhPJz6ju4X/hV0Eg2HmmWxquxHbBtasblVOlUOpVaLV2xO2f4SPvuJI35at/r0+DyFwi3bdB5wwA== X-Received: by 2002:a5d:558a:: with SMTP id i10mr7764338wrv.146.1595592583645; Fri, 24 Jul 2020 05:09:43 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id p8sm1213212wrq.9.2020.07.24.05.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:09:43 -0700 (PDT) From: luca.boccassi@gmail.com To: Phil Yang Cc: Ruifeng Wang , Honnappa Nagarahalli , Ferruh Yigit , dpdk stable Date: Fri, 24 Jul 2020 12:59:38 +0100 Message-Id: <20200724120030.1863487-140-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'app/testpmd: fix CPU cycles per packet stats on Tx modes' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From ffe4a7b9ac0cb5fabe3e2a178c73e813eba04a5e Mon Sep 17 00:00:00 2001 From: Phil Yang Date: Mon, 22 Jun 2020 17:04:42 +0800 Subject: [PATCH] app/testpmd: fix CPU cycles per packet stats on Tx modes [ upstream commit 3a164e002af00a6c1f2f06f4d86a6d383d1d08f7 ] In txonly and flowgen forwarding mode, calculating CPU per packets with total received packets is not accurate. Use total transmitted packets for these cases. The error output under txonly mode: testpmd> show fwd stats all ---------------------- Forward statistics for port 0 ------------------- RX-packets: 0 RX-dropped: 0 RX-total: 0 TX-packets: 3582891927 TX-dropped: 401965824 TX-total: 3984857751 TX-bursts : 86381636 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts] ------------------------------------------------------------------------- ---------------------- Forward statistics for port 1 ------------------- RX-packets: 1 RX-dropped: 394351696 RX-total: 394351697 TX-packets: 3582890632 TX-dropped: 401965568 TX-total: 3984856200 TX-bursts : 86381679 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts] ------------------------------------------------------------------------- +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++ RX-packets: 1 RX-dropped: 394351696 RX-total: 394351697 TX-packets: 7165782559 TX-dropped: 803931392 TX-total: 7969713951 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CPU cycles/packet=54984156291.00 \ (total cycles=54984156291 / total RX packets=1) at 200 MHz Clock Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand") Signed-off-by: Phil Yang Reviewed-by: Ruifeng Wang Reviewed-by: Honnappa Nagarahalli Tested-by: Ferruh Yigit --- app/test-pmd/testpmd.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 8ab6cfc6c..0ef7ecfe8 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1698,11 +1698,22 @@ fwd_stats_display(void) "%s\n", acc_stats_border, acc_stats_border); #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES - if (total_recv > 0) - printf("\n CPU cycles/packet=%u (total cycles=" - "%"PRIu64" / total RX packets=%"PRIu64")\n", - (unsigned int)(fwd_cycles / total_recv), - fwd_cycles, total_recv); +#define CYC_PER_MHZ 1E6 + if (total_recv > 0 || total_xmit > 0) { + uint64_t total_pkts = 0; + if (strcmp(cur_fwd_eng->fwd_mode_name, "txonly") == 0 || + strcmp(cur_fwd_eng->fwd_mode_name, "flowgen") == 0) + total_pkts = total_xmit; + else + total_pkts = total_recv; + + printf("\n CPU cycles/packet=%.2F (total cycles=" + "%"PRIu64" / total %s packets=%"PRIu64") at %"PRIu64 + " MHz Clock\n", + (double) fwd_cycles / total_pkts, + fwd_cycles, cur_fwd_eng->fwd_mode_name, total_pkts, + (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); + } #endif } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:53.957828946 +0100 +++ 0140-app-testpmd-fix-CPU-cycles-per-packet-stats-on-Tx-mo.patch 2020-07-24 12:53:48.475009962 +0100 @@ -1,8 +1,10 @@ -From 3a164e002af00a6c1f2f06f4d86a6d383d1d08f7 Mon Sep 17 00:00:00 2001 +From ffe4a7b9ac0cb5fabe3e2a178c73e813eba04a5e Mon Sep 17 00:00:00 2001 From: Phil Yang Date: Mon, 22 Jun 2020 17:04:42 +0800 Subject: [PATCH] app/testpmd: fix CPU cycles per packet stats on Tx modes +[ upstream commit 3a164e002af00a6c1f2f06f4d86a6d383d1d08f7 ] + In txonly and flowgen forwarding mode, calculating CPU per packets with total received packets is not accurate. Use total transmitted packets for these cases. @@ -31,25 +33,29 @@ (total cycles=54984156291 / total RX packets=1) at 200 MHz Clock Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand") -Cc: stable@dpdk.org Signed-off-by: Phil Yang Reviewed-by: Ruifeng Wang Reviewed-by: Honnappa Nagarahalli Tested-by: Ferruh Yigit --- - app/test-pmd/testpmd.c | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) + app/test-pmd/testpmd.c | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c -index e7516673b..92e00cf7a 100644 +index 8ab6cfc6c..0ef7ecfe8 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c -@@ -1956,13 +1956,21 @@ fwd_stats_display(void) +@@ -1698,11 +1698,22 @@ fwd_stats_display(void) + "%s\n", acc_stats_border, acc_stats_border); #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES - #define CYC_PER_MHZ 1E6 - if (total_recv > 0) +- printf("\n CPU cycles/packet=%u (total cycles=" +- "%"PRIu64" / total RX packets=%"PRIu64")\n", +- (unsigned int)(fwd_cycles / total_recv), +- fwd_cycles, total_recv); ++#define CYC_PER_MHZ 1E6 + if (total_recv > 0 || total_xmit > 0) { + uint64_t total_pkts = 0; + if (strcmp(cur_fwd_eng->fwd_mode_name, "txonly") == 0 || @@ -58,15 +64,12 @@ + else + total_pkts = total_recv; + - printf("\n CPU cycles/packet=%.2F (total cycles=" -- "%"PRIu64" / total RX packets=%"PRIu64") at %"PRIu64 ++ printf("\n CPU cycles/packet=%.2F (total cycles=" + "%"PRIu64" / total %s packets=%"PRIu64") at %"PRIu64 - " MHz Clock\n", -- (double) fwd_cycles / total_recv, -- fwd_cycles, total_recv, ++ " MHz Clock\n", + (double) fwd_cycles / total_pkts, + fwd_cycles, cur_fwd_eng->fwd_mode_name, total_pkts, - (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); ++ (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); + } #endif }