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 40765A0093 for ; Tue, 10 May 2022 14:31:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B6B04069D; Tue, 10 May 2022 14:31:09 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 2185E4282B for ; Tue, 10 May 2022 14:31:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652185867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cvntxk292wH6XQp5wO0X6xU9k7YGV9Gv3a2lbmTV674=; b=ia8/9uI7mz1WfzkIUZKAA/Wz7jTgKkEDs7Dw1LY7CKJUbUlS/xZQRmdSQvRhEHhebS1ive 1p8PC35e8IWQX8unMIHlA0BXlG29bujNm9sJZ4lO0jxuaqodVwEsY+PqkW8xpMpLVlMouW phJY1HATg9t2iJ31JEcreHGpEDv8d9s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-301-K70acE-DNJGxvWDu04-PCA-1; Tue, 10 May 2022 08:31:04 -0400 X-MC-Unique: K70acE-DNJGxvWDu04-PCA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51C6185A5A8; Tue, 10 May 2022 12:31:04 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 160F440CFD06; Tue, 10 May 2022 12:31:02 +0000 (UTC) From: Kevin Traynor 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 21.11.2 Date: Tue, 10 May 2022 13:30:10 +0100 Message-Id: <20220510123010.159523-33-ktraynor@redhat.com> In-Reply-To: <20220510123010.159523-1-ktraynor@redhat.com> References: <20220510123010.159523-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/15/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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/28ecf49a60347951323c3e7e2246b63bcc2320a8 Thanks. Kevin --- >From 28ecf49a60347951323c3e7e2246b63bcc2320a8 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 bbdb263143..b1e2613ccf 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -253,9 +253,7 @@ 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 */ @@ -895,5 +893,5 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) /* if timer is enabled */ - if (timer_period > 0) { + if (options->refresh_period > 0) { /* advance the timer */ @@ -902,9 +900,8 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options) /* if timer has reached its timeout */ if (unlikely(timer_tsc >= - (uint64_t)timer_period)) { + options->refresh_period)) { /* do this only on main core */ - if (lcore_id == rte_get_main_lcore() - && options->refresh_period) { + if (lcore_id == rte_get_main_lcore()) { print_stats(); timer_tsc = 0; @@ -1482,5 +1479,6 @@ 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.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-05-10 13:24:22.426246248 +0100 +++ 0033-examples-l2fwd-crypto-fix-stats-refresh-rate.patch 2022-05-10 13:24:21.632646397 +0100 @@ -1 +1 @@ -From af676be9e6671b25c69af2aa5fc2d40d562137f6 Mon Sep 17 00:00:00 2001 +From 28ecf49a60347951323c3e7e2246b63bcc2320a8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit af676be9e6671b25c69af2aa5fc2d40d562137f6 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org