[dpdk-stable] patch 'service: use log for error messages' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:33:17 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/21/19. 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.

Thanks.

Luca Boccassi

---
>From 7dc1b212c7933c1c0381118cb5ceef4329d7faa3 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Wed, 21 Aug 2019 10:12:52 +0100
Subject: [PATCH] service: use log for error messages

[ upstream commit a8f8ae1cf9b68f6398b49019ca07a215a57bba41 ]

EAL should always use rte_log instead of putting errors to
stderr (which maybe redirected to /dev/null in a daemon).

Also checks for null before rte_free are unnecessary.
Minor code consistency improvements.

Fixes: 21698354c832 ("service: introduce service cores concept")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
Acked-by: Harry van Haaren <harry.van.haaren at intel.com>
---
 lib/librte_eal/common/rte_service.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 1f922940ab..71a07dd8cd 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -98,10 +98,12 @@ static struct rte_service_spec_impl *rte_services;
 static struct core_state *lcore_states;
 static uint32_t rte_service_library_initialized;
 
-int32_t rte_service_init(void)
+int32_t
+rte_service_init(void)
 {
 	if (rte_service_library_initialized) {
-		printf("service library init() called, init flag %d\n",
+		RTE_LOG(NOTICE, EAL,
+			"service library init() called, init flag %d\n",
 			rte_service_library_initialized);
 		return -EALREADY;
 	}
@@ -110,14 +112,14 @@ int32_t rte_service_init(void)
 			sizeof(struct rte_service_spec_impl),
 			RTE_CACHE_LINE_SIZE);
 	if (!rte_services) {
-		printf("error allocating rte services array\n");
+		RTE_LOG(ERR, EAL, "error allocating rte services array\n");
 		goto fail_mem;
 	}
 
 	lcore_states = rte_calloc("rte_service_core_states", RTE_MAX_LCORE,
 			sizeof(struct core_state), RTE_CACHE_LINE_SIZE);
 	if (!lcore_states) {
-		printf("error allocating core states array\n");
+		RTE_LOG(ERR, EAL, "error allocating core states array\n");
 		goto fail_mem;
 	}
 
@@ -136,10 +138,8 @@ int32_t rte_service_init(void)
 	rte_service_library_initialized = 1;
 	return 0;
 fail_mem:
-	if (rte_services)
-		rte_free(rte_services);
-	if (lcore_states)
-		rte_free(lcore_states);
+	rte_free(rte_services);
+	rte_free(lcore_states);
 	return -ENOMEM;
 }
 
@@ -384,8 +384,8 @@ service_run(uint32_t i, struct core_state *cs, uint64_t service_mask)
 	return 0;
 }
 
-int32_t rte_service_run_iter_on_app_lcore(uint32_t id,
-		uint32_t serialize_mt_unsafe)
+int32_t
+rte_service_run_iter_on_app_lcore(uint32_t id, uint32_t serialize_mt_unsafe)
 {
 	/* run service on calling core, using all-ones as the service mask */
 	if (!service_valid(id))
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:28.327124864 +0000
+++ 0050-service-use-log-for-error-messages.patch	2019-12-19 14:32:26.045296636 +0000
@@ -1,8 +1,10 @@
-From a8f8ae1cf9b68f6398b49019ca07a215a57bba41 Mon Sep 17 00:00:00 2001
+From 7dc1b212c7933c1c0381118cb5ceef4329d7faa3 Mon Sep 17 00:00:00 2001
 From: Stephen Hemminger <stephen at networkplumber.org>
 Date: Wed, 21 Aug 2019 10:12:52 +0100
 Subject: [PATCH] service: use log for error messages
 
+[ upstream commit a8f8ae1cf9b68f6398b49019ca07a215a57bba41 ]
+
 EAL should always use rte_log instead of putting errors to
 stderr (which maybe redirected to /dev/null in a daemon).
 
@@ -10,20 +12,19 @@
 Minor code consistency improvements.
 
 Fixes: 21698354c832 ("service: introduce service cores concept")
-Cc: stable at dpdk.org
 
 Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
 Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
 Acked-by: Harry van Haaren <harry.van.haaren at intel.com>
 ---
- lib/librte_eal/common/rte_service.c | 27 ++++++++++++---------------
- 1 file changed, 12 insertions(+), 15 deletions(-)
+ lib/librte_eal/common/rte_service.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
 
 diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
-index c3653ebae4..fe09077200 100644
+index 1f922940ab..71a07dd8cd 100644
 --- a/lib/librte_eal/common/rte_service.c
 +++ b/lib/librte_eal/common/rte_service.c
-@@ -70,10 +70,12 @@ static struct rte_service_spec_impl *rte_services;
+@@ -98,10 +98,12 @@ static struct rte_service_spec_impl *rte_services;
  static struct core_state *lcore_states;
  static uint32_t rte_service_library_initialized;
  
@@ -38,7 +39,7 @@
  			rte_service_library_initialized);
  		return -EALREADY;
  	}
-@@ -82,14 +84,14 @@ int32_t rte_service_init(void)
+@@ -110,14 +112,14 @@ int32_t rte_service_init(void)
  			sizeof(struct rte_service_spec_impl),
  			RTE_CACHE_LINE_SIZE);
  	if (!rte_services) {
@@ -55,7 +56,7 @@
  		goto fail_mem;
  	}
  
-@@ -108,10 +110,8 @@ int32_t rte_service_init(void)
+@@ -136,10 +138,8 @@ int32_t rte_service_init(void)
  	rte_service_library_initialized = 1;
  	return 0;
  fail_mem:
@@ -68,21 +69,7 @@
  	return -ENOMEM;
  }
  
-@@ -121,11 +121,8 @@ rte_service_finalize(void)
- 	if (!rte_service_library_initialized)
- 		return;
- 
--	if (rte_services)
--		rte_free(rte_services);
--
--	if (lcore_states)
--		rte_free(lcore_states);
-+	rte_free(rte_services);
-+	rte_free(lcore_states);
- 
- 	rte_service_library_initialized = 0;
- }
-@@ -397,8 +394,8 @@ rte_service_may_be_active(uint32_t id)
+@@ -384,8 +384,8 @@ service_run(uint32_t i, struct core_state *cs, uint64_t service_mask)
  	return 0;
  }
  


More information about the stable mailing list