patch 'bitrate: fix calculation to match API description' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:34:07 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. 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/6cd9c8890bf7abd5cf0484b7d2d4f435ca988603

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 6cd9c8890bf7abd5cf0484b7d2d4f435ca988603 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

[ 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 b2d17c8e11..e7f5a9aee7 100644
--- a/lib/librte_bitratestats/rte_bitrate.c
+++ b/lib/librte_bitratestats/rte_bitrate.c
@@ -74,7 +74,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.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:08.572670246 +0100
+++ 0043-bitrate-fix-calculation-to-match-API-description.patch	2021-11-30 16:50:05.654872532 +0100
@@ -1 +1 @@
-From bdd478eede455611245593edd43dc49a1d821449 Mon Sep 17 00:00:00 2001
+From 6cd9c8890bf7abd5cf0484b7d2d4f435ca988603 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bdd478eede455611245593edd43dc49a1d821449 ]
+
@@ -18 +20 @@
- lib/bitratestats/rte_bitrate.c | 2 +-
+ lib/librte_bitratestats/rte_bitrate.c | 2 +-
@@ -21,5 +23,5 @@
-diff --git a/lib/bitratestats/rte_bitrate.c b/lib/bitratestats/rte_bitrate.c
-index e23e38bc94..1664e4863b 100644
---- a/lib/bitratestats/rte_bitrate.c
-+++ b/lib/bitratestats/rte_bitrate.c
-@@ -80,7 +80,7 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data,
+diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c
+index b2d17c8e11..e7f5a9aee7 100644
+--- a/lib/librte_bitratestats/rte_bitrate.c
++++ b/lib/librte_bitratestats/rte_bitrate.c
+@@ -74,7 +74,7 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data,


More information about the stable mailing list