From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8DF4343C60 for ; Thu, 7 Mar 2024 02:32:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8872240272; Thu, 7 Mar 2024 02:32:29 +0100 (CET) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mails.dpdk.org (Postfix) with ESMTP id 5960540261 for ; Thu, 7 Mar 2024 02:32:28 +0100 (CET) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-33d28468666so139092f8f.0 for ; Wed, 06 Mar 2024 17:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775148; x=1710379948; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qtg15Lpy/Y7JPamHp+CGaaFZtsg7HyTDT2IgPG4LKyE=; b=WQdH1+07LxtKbfFfeEvAkSzzp16UayAwdmcf4x47s0Nhr6eODaWM2S019NDbsHlJrD FOiyP3OovJDLdWS6FqSOqdRrYgoRewflpwrXxG9P8qcqH/knKdqMOcugXX1RLlID9xIG kAJqzJOlWpPBG/VB6dNFOryfIYS1tfvj+zlxNLG44X9otdyRbAPCDGUx1YoILkrmvXTz 1pxIyo1N4zZeXGsNepuaPaRF7aJF9O0cQ/tznowlf2JsX9RtPYplLmasaw0FmbmDzHHx FUDd5IWKjYv9pBCPceRqH+Zk9KUXRt1r5ogkYn2NxulJda4wSpgIH0jtmd4PXfISlj8l zshQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775148; x=1710379948; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qtg15Lpy/Y7JPamHp+CGaaFZtsg7HyTDT2IgPG4LKyE=; b=QAwnqcjlCrPXc8Pe3BQ9ah6p2jcXTO+3Y6cLsFdTHLzTKhGFfyE77YdDZqLEv6Byn7 zVU+Ru2OX1SKgwlgdnjnRUwcoAMAZ7J9fDlsBTgch2/EnYveRWc5oYLPe9diQNg+OKSP cARPHcsoIix3Nvt3e+VM8s+cQUjXEmIJh0LS3xzLvJbaYZHscobN5n2UQus+68JJxGg3 M0Ngckb29yftd6jCYU0By1tg2wBBRvY1WCGhpV0xYDE+GpjAVV3/d3w4jkZJgdgOF6/W Wo1VgvFOcavWk/7geLhuwfev2YU+f7+OlSpc//MLF0sy8gqL7+pwJEZvKr/XFd34h0wh JPcw== X-Forwarded-Encrypted: i=1; AJvYcCWKC1sAeWJcJxUTarTeyL+vHi/50NCd/sVqGBLDLz/IH0kjLIf26Po7TSeQoMsqdvKoVxfCi2hsCIJXzj6CwAQ= X-Gm-Message-State: AOJu0Yx/gVHzn/U8ufVslSxIZi5E8+I0jTOLkhwTL4eJjtk/NC4Tcjs3 Ba6G5cv2l6bRqZNRJ9sGueWbshTtpAZNQ7IbeP4zxpFHPyKlufcV7lyQFZjW X-Google-Smtp-Source: AGHT+IHwZ3wUeO4anWVNWdoxQkA9ckURe70XUb8rGwUwYqfhIf7g58wquhDaE+GiElFzvs7B93FD0w== X-Received: by 2002:a5d:668f:0:b0:33d:c2cb:c18d with SMTP id l15-20020a5d668f000000b0033dc2cbc18dmr12877937wru.32.1709775147968; Wed, 06 Mar 2024 17:32:27 -0800 (PST) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id p3-20020a5d4583000000b0033b47ee01f1sm18787618wrq.49.2024.03.06.17.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:32:27 -0800 (PST) From: luca.boccassi@gmail.com To: David Marchand Cc: Stephen Hemminger , Tyler Retzlaff , Andrew Rybchenko , dpdk stable Subject: patch 'lib: use dedicated logtypes and macros' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:30:20 +0000 Message-Id: <20240307013159.1735343-3-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 22.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/09/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/88ba671592c0c0c91bd711de31a1f6dc4b9c5a6e Thanks. Luca Boccassi --- >From 88ba671592c0c0c91bd711de31a1f6dc4b9c5a6e Mon Sep 17 00:00:00 2001 From: David Marchand Date: Wed, 6 Dec 2023 13:51:57 +0100 Subject: [PATCH] lib: use dedicated logtypes and macros [ upstream commit c07da8e381ef860e972abd90400f134c64f3f77a ] No printf! When a dedicated log helper exists, use it. And no usurpation please: a library should log under its logtype (see the eventdev rx adapter update for example). Note: the RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET macro is renamed for consistency with the rest of eventdev (private) macros. Signed-off-by: David Marchand Reviewed-by: Stephen Hemminger Reviewed-by: Tyler Retzlaff Reviewed-by: Andrew Rybchenko --- lib/cryptodev/rte_cryptodev.c | 2 +- lib/ethdev/ethdev_driver.c | 4 ++-- lib/ethdev/ethdev_private.c | 2 +- lib/ethdev/rte_class_eth.c | 2 +- lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++++------ lib/eventdev/rte_eventdev.c | 6 +++--- lib/mempool/rte_mempool_ops.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 515d0df5ce..98d32d91a1 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2579,7 +2579,7 @@ rte_cryptodev_driver_id_get(const char *name) int driver_id = -1; if (name == NULL) { - RTE_LOG(DEBUG, CRYPTODEV, "name pointer NULL"); + CDEV_LOG_DEBUG("name pointer NULL"); return -1; } diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c index 0be1e8ca04..0387c7133d 100644 --- a/lib/ethdev/ethdev_driver.c +++ b/lib/ethdev/ethdev_driver.c @@ -465,7 +465,7 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da) pair = &args.pairs[i]; if (strcmp("representor", pair->key) == 0) { if (eth_da->type != RTE_ETH_REPRESENTOR_NONE) { - RTE_LOG(ERR, EAL, "duplicated representor key: %s\n", + RTE_ETHDEV_LOG(ERR, "duplicated representor key: %s\n", dargs); result = -1; goto parse_cleanup; @@ -691,7 +691,7 @@ rte_eth_representor_id_get(uint16_t port_id, if (info->ranges[i].controller != controller) continue; if (info->ranges[i].id_end < info->ranges[i].id_base) { - RTE_LOG(WARNING, EAL, "Port %hu invalid representor ID Range %u - %u, entry %d\n", + RTE_ETHDEV_LOG(WARNING, "Port %hu invalid representor ID Range %u - %u, entry %d\n", port_id, info->ranges[i].id_base, info->ranges[i].id_end, i); continue; diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 48090c879a..17f7933c99 100644 --- a/lib/ethdev/ethdev_private.c +++ b/lib/ethdev/ethdev_private.c @@ -184,7 +184,7 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data) RTE_DIM(eth_da->representor_ports)); done: if (str == NULL) - RTE_LOG(ERR, EAL, "wrong representor format: %s\n", str); + RTE_ETHDEV_LOG(ERR, "wrong representor format: %s\n", str); return str == NULL ? -1 : 0; } diff --git a/lib/ethdev/rte_class_eth.c b/lib/ethdev/rte_class_eth.c index b61dae849d..311beb17cb 100644 --- a/lib/ethdev/rte_class_eth.c +++ b/lib/ethdev/rte_class_eth.c @@ -165,7 +165,7 @@ eth_dev_iterate(const void *start, valid_keys = eth_params_keys; kvargs = rte_kvargs_parse(str, valid_keys); if (kvargs == NULL) { - RTE_LOG(ERR, EAL, "cannot parse argument list\n"); + RTE_ETHDEV_LOG(ERR, "cannot parse argument list\n"); rte_errno = EINVAL; return NULL; } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 6636128378..0be4777e2a 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -311,9 +311,9 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, } \ } while (0) -#define RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(port_id, retval) do { \ +#define RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(port_id, retval) do { \ if (!rte_eth_dev_is_valid_port(port_id)) { \ - RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \ + RTE_EDEV_LOG_ERR("Invalid port_id=%u", port_id); \ ret = retval; \ goto error; \ } \ @@ -3521,7 +3521,7 @@ handle_rxa_get_queue_conf(const char *cmd __rte_unused, /* Get device ID from parameter string */ eth_dev_id = strtoul(token, NULL, 10); - RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL); + RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL); token = strtok(NULL, ","); RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, -1); @@ -3593,7 +3593,7 @@ handle_rxa_get_queue_stats(const char *cmd __rte_unused, /* Get device ID from parameter string */ eth_dev_id = strtoul(token, NULL, 10); - RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL); + RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL); token = strtok(NULL, ","); RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, -1); @@ -3663,7 +3663,7 @@ handle_rxa_queue_stats_reset(const char *cmd __rte_unused, /* Get device ID from parameter string */ eth_dev_id = strtoul(token, NULL, 10); - RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL); + RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL); token = strtok(NULL, ","); RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, -1); @@ -3718,7 +3718,7 @@ handle_rxa_instance_get(const char *cmd __rte_unused, /* Get device ID from parameter string */ eth_dev_id = strtoul(token, NULL, 10); - RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL); + RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL); token = strtok(NULL, ","); RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, -1); diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index 04eeb76d4f..c7d5f62e13 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1263,8 +1263,8 @@ rte_event_vector_pool_create(const char *name, unsigned int n, int ret; if (!nb_elem) { - RTE_LOG(ERR, EVENTDEV, - "Invalid number of elements=%d requested\n", nb_elem); + RTE_EDEV_LOG_ERR("Invalid number of elements=%d requested", + nb_elem); rte_errno = EINVAL; return NULL; } @@ -1279,7 +1279,7 @@ rte_event_vector_pool_create(const char *name, unsigned int n, mp_ops_name = rte_mbuf_best_mempool_ops(); ret = rte_mempool_set_ops_byname(mp, mp_ops_name, NULL); if (ret != 0) { - RTE_LOG(ERR, EVENTDEV, "error setting mempool handler\n"); + RTE_EDEV_LOG_ERR("error setting mempool handler"); goto err; } diff --git a/lib/mempool/rte_mempool_ops.c b/lib/mempool/rte_mempool_ops.c index 3b43edc548..9db952150a 100644 --- a/lib/mempool/rte_mempool_ops.c +++ b/lib/mempool/rte_mempool_ops.c @@ -46,7 +46,7 @@ rte_mempool_register_ops(const struct rte_mempool_ops *h) if (strlen(h->name) >= sizeof(ops->name) - 1) { rte_spinlock_unlock(&rte_mempool_ops_table.sl); - RTE_LOG(DEBUG, EAL, "%s(): mempool_ops <%s>: name too long\n", + RTE_LOG(DEBUG, MEMPOOL, "%s(): mempool_ops <%s>: name too long\n", __func__, h->name); rte_errno = EEXIST; return -EEXIST; -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-07 01:05:35.361675402 +0000 +++ 0003-lib-use-dedicated-logtypes-and-macros.patch 2024-03-07 01:05:34.550934752 +0000 @@ -1 +1 @@ -From c07da8e381ef860e972abd90400f134c64f3f77a Mon Sep 17 00:00:00 2001 +From 88ba671592c0c0c91bd711de31a1f6dc4b9c5a6e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c07da8e381ef860e972abd90400f134c64f3f77a ] + @@ -14,2 +15,0 @@ -Cc: stable@dpdk.org - @@ -25 +24,0 @@ - lib/eventdev/rte_event_dma_adapter.c | 4 ++-- @@ -29 +28 @@ - 8 files changed, 17 insertions(+), 17 deletions(-) + 7 files changed, 15 insertions(+), 15 deletions(-) @@ -32 +31 @@ -index 25e3ec12d1..ead8c9a623 100644 +index 515d0df5ce..98d32d91a1 100644 @@ -35 +34 @@ -@@ -2684,7 +2684,7 @@ rte_cryptodev_driver_id_get(const char *name) +@@ -2579,7 +2579,7 @@ rte_cryptodev_driver_id_get(const char *name) @@ -45 +44 @@ -index fff4b7b4cd..55a9dcc565 100644 +index 0be1e8ca04..0387c7133d 100644 @@ -48 +47 @@ -@@ -487,7 +487,7 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da) +@@ -465,7 +465,7 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da) @@ -57 +56 @@ -@@ -713,7 +713,7 @@ rte_eth_representor_id_get(uint16_t port_id, +@@ -691,7 +691,7 @@ rte_eth_representor_id_get(uint16_t port_id, @@ -67 +66 @@ -index e98b7188b0..0e1c7b23c1 100644 +index 48090c879a..17f7933c99 100644 @@ -70 +69 @@ -@@ -182,7 +182,7 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data) +@@ -184,7 +184,7 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data) @@ -92,22 +90,0 @@ -diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c -index af4b5ad388..cbf9405438 100644 ---- a/lib/eventdev/rte_event_dma_adapter.c -+++ b/lib/eventdev/rte_event_dma_adapter.c -@@ -1046,7 +1046,7 @@ rte_event_dma_adapter_vchan_add(uint8_t id, int16_t dma_dev_id, uint16_t vchan, - sizeof(struct dma_vchan_info), - 0, adapter->socket_id); - if (dev_info->vchanq == NULL) { -- printf("Queue pair add not supported\n"); -+ RTE_EDEV_LOG_ERR("Queue pair add not supported"); - return -ENOMEM; - } - } -@@ -1057,7 +1057,7 @@ rte_event_dma_adapter_vchan_add(uint8_t id, int16_t dma_dev_id, uint16_t vchan, - sizeof(struct dma_vchan_info), - 0, adapter->socket_id); - if (dev_info->tqmap == NULL) { -- printf("tq pair add not supported\n"); -+ RTE_EDEV_LOG_ERR("tq pair add not supported"); - return -ENOMEM; - } - } @@ -115 +92 @@ -index 6db03adf04..82ae31712d 100644 +index 6636128378..0be4777e2a 100644 @@ -118 +95 @@ -@@ -314,9 +314,9 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, +@@ -311,9 +311,9 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, @@ -130 +107 @@ -@@ -3671,7 +3671,7 @@ handle_rxa_get_queue_conf(const char *cmd __rte_unused, +@@ -3521,7 +3521,7 @@ handle_rxa_get_queue_conf(const char *cmd __rte_unused, @@ -139 +116 @@ -@@ -3743,7 +3743,7 @@ handle_rxa_get_queue_stats(const char *cmd __rte_unused, +@@ -3593,7 +3593,7 @@ handle_rxa_get_queue_stats(const char *cmd __rte_unused, @@ -148 +125 @@ -@@ -3813,7 +3813,7 @@ handle_rxa_queue_stats_reset(const char *cmd __rte_unused, +@@ -3663,7 +3663,7 @@ handle_rxa_queue_stats_reset(const char *cmd __rte_unused, @@ -157 +134 @@ -@@ -3868,7 +3868,7 @@ handle_rxa_instance_get(const char *cmd __rte_unused, +@@ -3718,7 +3718,7 @@ handle_rxa_instance_get(const char *cmd __rte_unused, @@ -167 +144 @@ -index 0ca32d6721..ae50821a3f 100644 +index 04eeb76d4f..c7d5f62e13 100644 @@ -170 +147 @@ -@@ -1428,8 +1428,8 @@ rte_event_vector_pool_create(const char *name, unsigned int n, +@@ -1263,8 +1263,8 @@ rte_event_vector_pool_create(const char *name, unsigned int n, @@ -181 +158 @@ -@@ -1444,7 +1444,7 @@ rte_event_vector_pool_create(const char *name, unsigned int n, +@@ -1279,7 +1279,7 @@ rte_event_vector_pool_create(const char *name, unsigned int n, @@ -191 +168 @@ -index ae1d288f27..e871de9ec9 100644 +index 3b43edc548..9db952150a 100644