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 285C6A0543 for ; Thu, 7 Jul 2022 09:56:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23B06406B4; Thu, 7 Jul 2022 09:56:07 +0200 (CEST) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 9D6E8406B4 for ; Thu, 7 Jul 2022 09:56:05 +0200 (CEST) Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 68E0040A8D for ; Thu, 7 Jul 2022 07:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657180565; bh=M0w+16UKZXIYIUWK1qRWpmEp5DRNgyO/PhUOb3hWvk8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aF9aJwWuEtV/9i5SrBrqzxZYZ17Q2zUUfziV6XYwTjomvOvT/P0ISJSps1SOnza3R xjaOjufRQ9I/U2Paq03xqwnrqipx14Rky0B1zQQX2sOlCtDufPWaoYzLmcggzaTdFd 32o8z/03y028f5VToE0GzPxP6vT1/lqazyeb0VZXfpjpDKxFAnnt9NBmpUrgrgMe25 0CVEs6izWsPSByRQNXrk8qvmfMUd0w9JVg0EO4RVef8Xj8FV6wwpQjtWzGPQHwYVAz v0V7Y4vR74r4Uou+VrgMs21iJz9KD18sgIm0NdGc/vvEbAgZ6g/ENFPKcr2vaV45rs v+nYJk/Y4sapg== Received: by mail-ej1-f69.google.com with SMTP id sa13-20020a1709076d0d00b0072a8791298aso4406940ejc.7 for ; Thu, 07 Jul 2022 00:56:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M0w+16UKZXIYIUWK1qRWpmEp5DRNgyO/PhUOb3hWvk8=; b=EbIeyMgZ9IrABrYhKyunEStk9w8xlP+6Z2HnTR3yrqHCf4M5IPSusyaujJpqTVbvre mxpqdHVIgpnMtj41RNo8jk8lwBRYPCxXVgln93/9J29odeUJ4O2GZ5C1GEU5uJ/9kovf a9Jude4YAeQ+M382Vx3MZFbKN7Uk4Iw6BIHJqTvH9wOlXWg3eKLMjDSLmLWoivtg+oPq qa3HhkBETnjDZOm+Vxd8U+p3jZ7wbAgx0J4+y+2CBLHAfAAoKLp46HQF3IwkK1dhji8J 3+btstrK40NwoI61sEVt93EcQUuc0GHXmmiBeKYI7GRV4FaPht5HweJU115v6s1Or7WB 9FQQ== X-Gm-Message-State: AJIora8AEO9vAP5UrKrsG6fK1uFmHU+N8gmuKY6PC80nlhfmMUSMqFPc KGwpEC3TZVXHwYkWeskl6r2V3zM64SIfcpWdevX6eP4eESf6/UhL7Gw8W15sg65zznXpjY7hRlZ U0sxYlWtjlpJAjjHbIzakWcQ8 X-Received: by 2002:a05:6402:1d51:b0:41f:cf6c:35a5 with SMTP id dz17-20020a0564021d5100b0041fcf6c35a5mr61689992edb.25.1657180564269; Thu, 07 Jul 2022 00:56:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vbJgYopAGyRWhCgHQuohlbu0o7H0e/P+j66A60isaGf8IbUb+E9EcEht2m4TV7uAOE7EuHfA== X-Received: by 2002:a05:6402:1d51:b0:41f:cf6c:35a5 with SMTP id dz17-20020a0564021d5100b0041fcf6c35a5mr61689927edb.25.1657180563526; Thu, 07 Jul 2022 00:56:03 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2a02:6d40:3a4f:7b00:c19b:938e:7c97:afe2]) by smtp.gmail.com with ESMTPSA id er13-20020a056402448d00b0043a5bcf80a2sm8531080edb.60.2022.07.07.00.56.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 00:56:02 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Raja Zidane Cc: Matan Azrad , Akhil Goyal , dpdk stable Subject: patch 'examples/l2fwd-crypto: fix stats refresh rate' has been queued to stable release 19.11.13 Date: Thu, 7 Jul 2022 09:54:08 +0200 Message-Id: <20220707075522.194223-13-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220707075522.194223-1-christian.ehrhardt@canonical.com> References: <20220707075522.194223-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 19.11.13 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/09/22. 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. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/ea3fb95adc0304302497dd82dd5bb84343eeb9dc Thanks. Christian Ehrhardt --- >From ea3fb95adc0304302497dd82dd5bb84343eeb9dc Mon Sep 17 00:00:00 2001 From: Raja Zidane Date: Thu, 7 Apr 2022 14:42:49 +0300 Subject: [PATCH] examples/l2fwd-crypto: fix stats refresh rate [ upstream commit af676be9e6671b25c69af2aa5fc2d40d562137f6 ] TIMER_MILLISECOND is defined as the number of cpu cycles per millisecond, current definition is correct for cores with frequency of 2GHZ, for cores with different frequency, it caused different periods between refresh, (i.e. the definition is about 14ms on ARM cores). The devarg that stated the period between stats print was not used, instead, it was always defaulted to 10 seconds (on 2GHZ core). Use DPDK API to get CPU frequency, to define TIMER_MILLISECOND. Use the refresh period devarg instead of defaulting to 10s always. Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application") Signed-off-by: Raja Zidane Acked-by: Matan Azrad Acked-by: Akhil Goyal --- examples/l2fwd-crypto/main.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 5d41e6cb91..d7692464e4 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -252,11 +252,9 @@ struct l2fwd_port_statistics port_statistics[RTE_MAX_ETHPORTS]; struct l2fwd_crypto_statistics crypto_statistics[RTE_CRYPTO_MAX_DEVS]; /* A tsc-based timer responsible for triggering statistics printout */ -#define TIMER_MILLISECOND 2000000ULL /* around 1ms at 2 Ghz */ +#define TIMER_MILLISECOND (rte_get_tsc_hz() / 1000) #define MAX_TIMER_PERIOD 86400UL /* 1 day max */ - -/* default period is 10 seconds */ -static int64_t timer_period = 10 * TIMER_MILLISECOND * 1000; +#define DEFAULT_TIMER_PERIOD 10UL /* Print out statistics on packets dropped */ static void @@ -879,18 +877,17 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) } /* if timer is enabled */ - if (timer_period > 0) { + if (options->refresh_period > 0) { /* advance the timer */ timer_tsc += diff_tsc; /* if timer has reached its timeout */ if (unlikely(timer_tsc >= - (uint64_t)timer_period)) { + options->refresh_period)) { /* do this only on master core */ - if (lcore_id == rte_get_master_lcore() - && options->refresh_period) { + if (lcore_id == rte_get_master_lcore()) { print_stats(); timer_tsc = 0; } @@ -1451,7 +1448,8 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options) { options->portmask = 0xffffffff; options->nb_ports_per_lcore = 1; - options->refresh_period = 10000; + options->refresh_period = DEFAULT_TIMER_PERIOD * + TIMER_MILLISECOND * 1000; options->single_lcore = 0; options->sessionless = 0; -- 2.37.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-07 09:54:11.763087011 +0200 +++ 0013-examples-l2fwd-crypto-fix-stats-refresh-rate.patch 2022-07-07 09:54:10.805823629 +0200 @@ -1 +1 @@ -From af676be9e6671b25c69af2aa5fc2d40d562137f6 Mon Sep 17 00:00:00 2001 +From ea3fb95adc0304302497dd82dd5bb84343eeb9dc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit af676be9e6671b25c69af2aa5fc2d40d562137f6 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index bbdb263143..b1e2613ccf 100644 +index 5d41e6cb91..d7692464e4 100644 @@ -44 +45 @@ -@@ -894,18 +892,17 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) +@@ -879,18 +877,17 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) @@ -59,2 +60,2 @@ - /* do this only on main core */ -- if (lcore_id == rte_get_main_lcore() + /* do this only on master core */ +- if (lcore_id == rte_get_master_lcore() @@ -62 +63 @@ -+ if (lcore_id == rte_get_main_lcore()) { ++ if (lcore_id == rte_get_master_lcore()) { @@ -66 +67 @@ -@@ -1481,7 +1478,8 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options) +@@ -1451,7 +1448,8 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)