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

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:29:27 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/102d6df14d5608223a6d354896780e9056fafc34

Thanks.

Xueming Li <xuemingl at nvidia.com>

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

[ upstream commit 06ae9f0f92cf3bb85549f66dc3dfa11011d7db0f ]

rte_stats_bitrate_reg() API states it returns 'Zero on success'.

However, the implementation directly returns the return of
rte_metrics_reg_names() which may be zero or positive on success,
with a positive value also indicating the index.

The user of rte_stats_bitrate_reg() should not care about the
index as it is stored in the opaque rte_stats_bitrates struct.

Change the implementation of rte_stats_bitrate_reg() to match
the API description by always returning zero on success.

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

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

diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c
index 8fd9f47288..e23e38bc94 100644
--- a/lib/librte_bitratestats/rte_bitrate.c
+++ b/lib/librte_bitratestats/rte_bitrate.c
@@ -55,8 +55,10 @@ rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data)
 		return -EINVAL;
 
 	return_value = rte_metrics_reg_names(&names[0], RTE_DIM(names));
-	if (return_value >= 0)
+	if (return_value >= 0) {
 		bitrate_data->id_stats_set = return_value;
+		return 0;
+	}
 	return return_value;
 }
 
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:05.746374041 +0800
+++ 0083-bitrate-fix-registration-to-match-API-description.patch	2021-11-10 14:17:01.844079642 +0800
@@ -1 +1 @@
-From 06ae9f0f92cf3bb85549f66dc3dfa11011d7db0f Mon Sep 17 00:00:00 2001
+From 102d6df14d5608223a6d354896780e9056fafc34 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 06ae9f0f92cf3bb85549f66dc3dfa11011d7db0f ]
@@ -22 +25 @@
- lib/bitratestats/rte_bitrate.c | 4 +++-
+ lib/librte_bitratestats/rte_bitrate.c | 4 +++-
@@ -25 +28 @@
-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
@@ -27,2 +30,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