From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79867A04F3 for ; Thu, 19 Dec 2019 15:37:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 69643330; Thu, 19 Dec 2019 15:37:06 +0100 (CET) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id C42571BF8D for ; Thu, 19 Dec 2019 15:37:04 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id w15so6234059wru.4 for ; Thu, 19 Dec 2019 06:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4pD2INkn8BqKXdH89ANWKHfsCUNGLBlhOYA+Q9msGB0=; b=HkzlOxvWCFDNtzzum2CXDfPg+EWR9WRH0LbdkJPVnZWipqmTle15IzmHsdpO/9Mjdq zaUEeQXnjAHuTwCLLJA3F0hNOKNXJQX/BI0/cNMU1vtVH0vPyE+SWJKADsZ7q+m6/eyS mjJ7oyuWVKPyDPAZjK7FK+h3tjO6I7QGBpbBqreL4dWGYwKo3Izj/DuysxEfHg7lkv0a ub16UWlziiWdWDyappg5vL+cBlLINxQpNXH1aPHAkS1qzWBIJKavT10ez3JEGDN+ggAD THY3b4oHuc2yKAg4fYmMZ98scYkNc5B7BAPtn6XoJYO96sKCz8Zh4a808ju7oJC0bAdx V6HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4pD2INkn8BqKXdH89ANWKHfsCUNGLBlhOYA+Q9msGB0=; b=He/HvvStwpNCS69j+V/TqqDCz1fGLI33LD9H9O9c70usNZ8JHMqIHjCmCYKq04e9lw Jy43KQkUeJrGm6RVgq8Z2wDk3jyy3lz8btO28BTalVit6lLYAJGgdX6BSl33gei8eiCB dalXjK9sU7baGiRCFnBveDgh0H9AJs4gCqchHGtaRyd4CmQ1NVmWzqNB4SU1xJM6n53P KKUPcT0hGKuHnxDdPpkZica662phBCGmAz/wFQENV9lFK2CvdMA/uk1+EYXpUt6DJaUk hcLJj5O6Zz8xtaipAKJeQG0vMK0MJ3NYfS2C4kexhiV24k++GJstjw6mCF0dUM0BpOoO IxMw== X-Gm-Message-State: APjAAAVioTGNsMdZm5v1MUF79xGIEai0Zaeh+AFVM4GLSPYH8gKJ2A92 YiPHmTLZ3adIp6LKSfpTomk= X-Google-Smtp-Source: APXvYqw3nDGgqYsuxU9YAP0PLLuCYdnw71e1l962UUt1I58pFqC/WcNZ56jhvu/TSnRLQ40YTjlT7Q== X-Received: by 2002:adf:eb8e:: with SMTP id t14mr9752496wrn.384.1576766224523; Thu, 19 Dec 2019 06:37:04 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 5sm6901688wrh.5.2019.12.19.06.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:37:04 -0800 (PST) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: Harry van Haaren , dpdk stable Date: Thu, 19 Dec 2019 14:33:17 +0000 Message-Id: <20191219143447.21506-50-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'service: use log for error messages' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" 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 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 Signed-off-by: Harry van Haaren Acked-by: Harry van Haaren --- 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 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@dpdk.org Signed-off-by: Stephen Hemminger Signed-off-by: Harry van Haaren Acked-by: Harry van Haaren --- - 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; }