[dpdk-stable] patch 'bitrate: fix calculation to match API description' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:29:28 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.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 11/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/45f9d14e11cc844015f00bbcf782f9caf6644d9a

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 45f9d14e11cc844015f00bbcf782f9caf6644d9a Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor at redhat.com>
Date: Fri, 9 Jul 2021 16:19:37 +0100
Subject: [PATCH] bitrate: fix calculation to match API description
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit bdd478eede455611245593edd43dc49a1d821449 ]

rte_stats_bitrate_calc() API states it returns 'Negative value on error'.

However, the implementation will return the error code from
rte_eth_stats_get() which may be non-zero on error.

Change the implementation of rte_stats_bitrate_calc() to match
the API description by always returning a negative value on error.

Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library")

Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
---
 lib/librte_bitratestats/rte_bitrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c
index e23e38bc94..1664e4863b 100644
--- a/lib/librte_bitratestats/rte_bitrate.c
+++ b/lib/librte_bitratestats/rte_bitrate.c
@@ -80,7 +80,7 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data,
 
 	ret_code = rte_eth_stats_get(port_id, &eth_stats);
 	if (ret_code != 0)
-		return ret_code;
+		return ret_code < 0 ? ret_code : -ret_code;
 
 	port_data = &bitrate_data->port_stats[port_id];
 
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:05.787203870 +0800
+++ 0084-bitrate-fix-calculation-to-match-API-description.patch	2021-11-10 14:17:01.844079642 +0800
@@ -1 +1 @@
-From bdd478eede455611245593edd43dc49a1d821449 Mon Sep 17 00:00:00 2001
+From 45f9d14e11cc844015f00bbcf782f9caf6644d9a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit bdd478eede455611245593edd43dc49a1d821449 ]
@@ -18 +21 @@
- lib/bitratestats/rte_bitrate.c | 2 +-
+ lib/librte_bitratestats/rte_bitrate.c | 2 +-
@@ -21 +24 @@
-diff --git a/lib/bitratestats/rte_bitrate.c b/lib/bitratestats/rte_bitrate.c
+diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c
@@ -23,2 +26,2 @@
---- a/lib/bitratestats/rte_bitrate.c
-+++ b/lib/bitratestats/rte_bitrate.c
+--- a/lib/librte_bitratestats/rte_bitrate.c
++++ b/lib/librte_bitratestats/rte_bitrate.c


More information about the stable mailing list