* [RFC 1/3] lib: remove redundant newline from logs [not found] <20231117131824.1977792-1-david.marchand@redhat.com> @ 2023-11-17 13:18 ` David Marchand [not found] ` <20231208145950.2184940-1-david.marchand@redhat.com> ` (3 subsequent siblings) 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-11-17 13:18 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, stable, Kai Ji, Pablo de Lara, Nicolas Chautru, Cristian Dumitrescu, Fan Zhang, Ashish Gupta, Akhil Goyal, Mattias Rönnblom, Chengwen Feng, Kevin Laatz, Jerin Jacob, Abhinandan Gujjar, Amit Prakash Shukla, Naga Harish K S V, Erik Gabriel Carrillo, Srikanth Yalavarthi, Jasvinder Singh, Nithin Dabilpuram, Pavan Nikhilesh, Honnappa Nagarahalli Fix places where two newline characters may be logged. Also fix some direct calls to printf or RTE_LOG when a dedicated log helper for a library existed. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> --- drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 2 +- lib/bbdev/rte_bbdev.c | 6 +- lib/cfgfile/rte_cfgfile.c | 14 ++-- lib/compressdev/rte_compressdev_pmd.c | 4 +- lib/cryptodev/rte_cryptodev.c | 5 +- lib/dispatcher/rte_dispatcher.c | 12 +-- lib/dmadev/rte_dmadev.c | 2 +- lib/eventdev/eventdev_pmd.h | 6 +- lib/eventdev/rte_event_crypto_adapter.c | 12 +-- lib/eventdev/rte_event_dma_adapter.c | 18 ++--- lib/eventdev/rte_event_eth_rx_adapter.c | 30 +++---- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- lib/eventdev/rte_event_timer_adapter.c | 4 +- lib/eventdev/rte_eventdev.c | 10 +-- lib/metrics/rte_metrics_telemetry.c | 2 +- lib/mldev/rte_mldev.c | 102 ++++++++++++------------ lib/net/rte_net_crc.c | 6 +- lib/node/ethdev_rx.c | 4 +- lib/node/ip4_lookup.c | 2 +- lib/node/ip6_lookup.c | 2 +- lib/node/kernel_rx.c | 8 +- lib/node/kernel_tx.c | 4 +- lib/rcu/rte_rcu_qsbr.c | 4 +- lib/rcu/rte_rcu_qsbr.h | 8 +- lib/stack/rte_stack.c | 8 +- 25 files changed, 138 insertions(+), 139 deletions(-) diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c index 30f919cd40..2a5599b7d8 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c +++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c @@ -406,7 +406,7 @@ ipsec_mb_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer) resp_param->result = ipsec_mb_qp_release(dev, qp_id); break; default: - CDEV_LOG_ERR("invalid mp request type\n"); + CDEV_LOG_ERR("invalid mp request type"); } out: diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index cfebea09c7..e09bb97abb 100644 --- a/lib/bbdev/rte_bbdev.c +++ b/lib/bbdev/rte_bbdev.c @@ -1106,12 +1106,12 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, intr_handle = dev->intr_handle; if (intr_handle == NULL) { - rte_bbdev_log(ERR, "Device %u intr handle unset\n", dev_id); + rte_bbdev_log(ERR, "Device %u intr handle unset", dev_id); return -ENOTSUP; } if (queue_id >= RTE_MAX_RXTX_INTR_VEC_ID) { - rte_bbdev_log(ERR, "Device %u queue_id %u is too big\n", + rte_bbdev_log(ERR, "Device %u queue_id %u is too big", dev_id, queue_id); return -ENOTSUP; } @@ -1120,7 +1120,7 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, ret = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); if (ret && (ret != -EEXIST)) { rte_bbdev_log(ERR, - "dev %u q %u int ctl error op %d epfd %d vec %u\n", + "dev %u q %u int ctl error op %d epfd %d vec %u", dev_id, queue_id, op, epfd, vec); return ret; } diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c index eefba6e408..2f9cc0722a 100644 --- a/lib/cfgfile/rte_cfgfile.c +++ b/lib/cfgfile/rte_cfgfile.c @@ -137,7 +137,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) unsigned int i; if (!params) { - CFG_LOG(ERR, "missing cfgfile parameters\n"); + CFG_LOG(ERR, "missing cfgfile parameters"); return -EINVAL; } @@ -150,7 +150,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) } if (valid_comment == 0) { - CFG_LOG(ERR, "invalid comment characters %c\n", + CFG_LOG(ERR, "invalid comment characters %c", params->comment_character); return -ENOTSUP; } @@ -188,7 +188,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, lineno++; if ((len >= sizeof(buffer) - 1) && (buffer[len-1] != '\n')) { CFG_LOG(ERR, " line %d - no \\n found on string. " - "Check if line too long\n", lineno); + "Check if line too long", lineno); goto error1; } /* skip parsing if comment character found */ @@ -209,7 +209,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, char *end = memchr(buffer, ']', len); if (end == NULL) { CFG_LOG(ERR, - "line %d - no terminating ']' character found\n", + "line %d - no terminating ']' character found", lineno); goto error1; } @@ -225,7 +225,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, split[1] = memchr(buffer, '=', len); if (split[1] == NULL) { CFG_LOG(ERR, - "line %d - no '=' character found\n", + "line %d - no '=' character found", lineno); goto error1; } @@ -249,7 +249,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, if (!(flags & CFG_FLAG_EMPTY_VALUES) && (*split[1] == '\0')) { CFG_LOG(ERR, - "line %d - cannot use empty values\n", + "line %d - cannot use empty values", lineno); goto error1; } @@ -414,7 +414,7 @@ int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname, return 0; } - CFG_LOG(ERR, "entry name doesn't exist\n"); + CFG_LOG(ERR, "entry name doesn't exist"); return -EINVAL; } diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c index 156bccd972..762b44f03e 100644 --- a/lib/compressdev/rte_compressdev_pmd.c +++ b/lib/compressdev/rte_compressdev_pmd.c @@ -100,12 +100,12 @@ rte_compressdev_pmd_create(const char *name, struct rte_compressdev *compressdev; if (params->name[0] != '\0') { - COMPRESSDEV_LOG(INFO, "User specified device name = %s\n", + COMPRESSDEV_LOG(INFO, "User specified device name = %s", params->name); name = params->name; } - COMPRESSDEV_LOG(INFO, "Creating compressdev %s\n", name); + COMPRESSDEV_LOG(INFO, "Creating compressdev %s", name); COMPRESSDEV_LOG(INFO, "Init parameters - name: %s, socket id: %d", name, params->socket_id); diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index b258827734..16fb870d97 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -11,7 +11,6 @@ #include <stdint.h> #include <inttypes.h> -#include <rte_log.h> #include <rte_debug.h> #include <dev_driver.h> #include <rte_memory.h> @@ -2072,7 +2071,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id, } if (xforms == NULL) { - CDEV_LOG_ERR("Invalid xform\n"); + CDEV_LOG_ERR("Invalid xform"); rte_errno = EINVAL; return NULL; } @@ -2682,7 +2681,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/dispatcher/rte_dispatcher.c b/lib/dispatcher/rte_dispatcher.c index 10d02edde9..95dd41b818 100644 --- a/lib/dispatcher/rte_dispatcher.c +++ b/lib/dispatcher/rte_dispatcher.c @@ -246,7 +246,7 @@ evd_service_register(struct rte_dispatcher *dispatcher) rc = rte_service_component_register(&service, &dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Registration of dispatcher service " - "%s failed with error code %d\n", + "%s failed with error code %d", service.name, rc); return rc; @@ -260,7 +260,7 @@ evd_service_unregister(struct rte_dispatcher *dispatcher) rc = rte_service_component_unregister(dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Unregistration of dispatcher service " - "failed with error code %d\n", rc); + "failed with error code %d", rc); return rc; } @@ -279,7 +279,7 @@ rte_dispatcher_create(uint8_t event_dev_id) RTE_CACHE_LINE_SIZE, socket_id); if (dispatcher == NULL) { - RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher\n"); + RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher"); rte_errno = ENOMEM; return NULL; } @@ -483,7 +483,7 @@ evd_lcore_uninstall_handler(struct rte_dispatcher_lcore *lcore, unreg_handler = evd_lcore_get_handler_by_id(lcore, handler_id); if (unreg_handler == NULL) { - RTE_EDEV_LOG_ERR("Invalid handler id %d\n", handler_id); + RTE_EDEV_LOG_ERR("Invalid handler id %d", handler_id); return -EINVAL; } @@ -602,7 +602,7 @@ rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher, unreg_finalizer = evd_get_finalizer_by_id(dispatcher, finalizer_id); if (unreg_finalizer == NULL) { - RTE_EDEV_LOG_ERR("Invalid finalizer id %d\n", finalizer_id); + RTE_EDEV_LOG_ERR("Invalid finalizer id %d", finalizer_id); return -EINVAL; } @@ -636,7 +636,7 @@ evd_set_service_runstate(struct rte_dispatcher *dispatcher, int state) */ if (rc != 0) RTE_EDEV_LOG_ERR("Unexpected error %d occurred while setting " - "service component run state to %d\n", rc, + "service component run state to %d", rc, state); RTE_VERIFY(rc == 0); diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 4e5e420c82..009a21849a 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -726,7 +726,7 @@ rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status * return -EINVAL; if (vchan >= dev->data->dev_conf.nb_vchans) { - RTE_DMA_LOG(ERR, "Device %u vchan %u out of range\n", dev_id, vchan); + RTE_DMA_LOG(ERR, "Device %u vchan %u out of range", dev_id, vchan); return -EINVAL; } diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index 30bd90085c..2ec5aec0a8 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -49,14 +49,14 @@ extern "C" { /* Macros to check for valid device */ #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return retval; \ } \ } while (0) #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ rte_errno = errno; \ return retval; \ } \ @@ -64,7 +64,7 @@ extern "C" { #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return; \ } \ } while (0) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 1b435c9f0e..d46595d190 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -133,7 +133,7 @@ static struct event_crypto_adapter **event_crypto_adapter; /* Macros to check for valid adapter */ #define EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!eca_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -309,7 +309,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", dev_id); + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) return -EIO; @@ -319,7 +319,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -391,7 +391,7 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, sizeof(struct crypto_device_info), 0, socket_id); if (adapter->cdevs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices\n"); + RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices"); eca_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -1403,7 +1403,7 @@ rte_event_crypto_adapter_runtime_params_set(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1436,7 +1436,7 @@ rte_event_crypto_adapter_runtime_params_get(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c index af4b5ad388..4196164305 100644 --- a/lib/eventdev/rte_event_dma_adapter.c +++ b/lib/eventdev/rte_event_dma_adapter.c @@ -20,7 +20,7 @@ #define EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) \ do { \ if (!edma_adapter_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -313,7 +313,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_dev_configure(evdev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to configure event dev %u\n", evdev_id); + RTE_EDEV_LOG_ERR("Failed to configure event dev %u", evdev_id); if (started) { if (rte_event_dev_start(evdev_id)) return -EIO; @@ -323,7 +323,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_port_setup(evdev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("Failed to setup event port %u", port_id); return ret; } @@ -407,7 +407,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, num_dma_dev * sizeof(struct dma_device_info), 0, socket_id); if (adapter->dma_devs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices\n"); + RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -417,7 +417,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, for (i = 0; i < num_dma_dev; i++) { ret = rte_dma_info_get(i, &info); if (ret) { - RTE_EDEV_LOG_ERR("Failed to get dma device info\n"); + RTE_EDEV_LOG_ERR("Failed to get dma device info"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return ret; @@ -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; } } @@ -1297,7 +1297,7 @@ rte_event_dma_adapter_runtime_params_set(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1326,7 +1326,7 @@ rte_event_dma_adapter_runtime_params_get(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 6db03adf04..afd5f5ab33 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -293,14 +293,14 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ return retval; \ } \ } while (0) #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_GOTO_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ ret = retval; \ goto error; \ } \ @@ -308,7 +308,7 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, retval) do { \ if ((token) == NULL || strlen(token) == 0 || !isdigit(*token)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token\n"); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token"); \ ret = retval; \ goto error; \ } \ @@ -316,7 +316,7 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_ETH_VALID_PORTID_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_ETHDEV_LOG(ERR, "Invalid port_id=%u", port_id); \ ret = retval; \ goto error; \ } \ @@ -1540,7 +1540,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) @@ -1551,7 +1551,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -1628,7 +1628,7 @@ rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter) if (!err) return 0; - RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); error: rte_ring_free(rx_adapter->intr_ring); @@ -1644,12 +1644,12 @@ rxa_destroy_intr_thread(struct event_eth_rx_adapter *rx_adapter) err = pthread_cancel((pthread_t)rx_adapter->rx_intr_thread.opaque_id); if (err) - RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d\n", + RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d", err); err = rte_thread_join(rx_adapter->rx_intr_thread, NULL); if (err) - RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); rte_ring_free(rx_adapter->intr_ring); @@ -1915,7 +1915,7 @@ rxa_init_service(struct event_eth_rx_adapter *rx_adapter, uint8_t id) if (rte_mbuf_dyn_rx_timestamp_register( &event_eth_rx_timestamp_dynfield_offset, &event_eth_rx_timestamp_dynflag) != 0) { - RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf\n"); + RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf"); return -rte_errno; } @@ -2445,7 +2445,7 @@ rxa_create(uint8_t id, uint8_t dev_id, RTE_DIM(default_rss_key)); if (rx_adapter->eth_devices == NULL) { - RTE_EDEV_LOG_ERR("failed to get mem for eth devices\n"); + RTE_EDEV_LOG_ERR("failed to get mem for eth devices"); rte_free(rx_adapter); return -ENOMEM; } @@ -2497,12 +2497,12 @@ rxa_config_params_validate(struct rte_event_eth_rx_adapter_params *rxa_params, return 0; } else if (!rxa_params->use_queue_event_buf && rxa_params->event_buf_size == 0) { - RTE_EDEV_LOG_ERR("event buffer size can't be zero\n"); + RTE_EDEV_LOG_ERR("event buffer size can't be zero"); return -EINVAL; } else if (rxa_params->use_queue_event_buf && rxa_params->event_buf_size != 0) { RTE_EDEV_LOG_ERR("event buffer size needs to be configured " - "as part of queue add\n"); + "as part of queue add"); return -EINVAL; } @@ -3597,7 +3597,7 @@ handle_rxa_stats(const char *cmd __rte_unused, /* Get Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, &rx_adptr_stats)) { - RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats"); return -1; } @@ -3636,7 +3636,7 @@ handle_rxa_stats_reset(const char *cmd __rte_unused, /* Reset Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { - RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats"); return -1; } diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index 360d5caf6a..56435be991 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -334,7 +334,7 @@ txa_service_conf_cb(uint8_t __rte_unused id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, pc); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); if (started) { if (rte_event_dev_start(dev_id)) diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index 27466707bc..3f22e85173 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -106,7 +106,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to configure event dev %u\n", dev_id); + EVTIM_LOG_ERR("failed to configure event dev %u", dev_id); if (started) if (rte_event_dev_start(dev_id)) return -EIO; @@ -116,7 +116,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to setup event port %u on event dev %u\n", + EVTIM_LOG_ERR("failed to setup event port %u on event dev %u", port_id, dev_id); return ret; } diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index 0ca32d6721..157752868d 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1007,13 +1007,13 @@ rte_event_port_profile_links_set(uint8_t dev_id, uint8_t port_id, const uint8_t } if (*dev->dev_ops->port_link == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } if (profile_id && *dev->dev_ops->port_link_profile == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } @@ -1428,8 +1428,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; } @@ -1444,7 +1444,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/metrics/rte_metrics_telemetry.c b/lib/metrics/rte_metrics_telemetry.c index 5be21b2e86..1d133e1f8c 100644 --- a/lib/metrics/rte_metrics_telemetry.c +++ b/lib/metrics/rte_metrics_telemetry.c @@ -363,7 +363,7 @@ rte_metrics_tel_stat_names_to_ids(const char * const *stat_names, } } if (j == num_metrics) { - METRICS_LOG_WARN("Invalid stat name %s\n", + METRICS_LOG_WARN("Invalid stat name %s", stat_names[i]); free(names); return -EINVAL; diff --git a/lib/mldev/rte_mldev.c b/lib/mldev/rte_mldev.c index cc5f2e0cc6..196b1850e6 100644 --- a/lib/mldev/rte_mldev.c +++ b/lib/mldev/rte_mldev.c @@ -159,7 +159,7 @@ int rte_ml_dev_init(size_t dev_max) { if (dev_max == 0 || dev_max > INT16_MAX) { - RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)\n", dev_max, INT16_MAX); + RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)", dev_max, INT16_MAX); rte_errno = EINVAL; return -rte_errno; } @@ -217,7 +217,7 @@ rte_ml_dev_socket_id(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -232,7 +232,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -241,7 +241,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) return -ENOTSUP; if (dev_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL", dev_id); return -EINVAL; } memset(dev_info, 0, sizeof(struct rte_ml_dev_info)); @@ -257,7 +257,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -271,7 +271,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) } if (config == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL", dev_id); return -EINVAL; } @@ -280,7 +280,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) return ret; if (config->nb_queue_pairs > dev_info.max_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u\n", dev_id, + RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u", dev_id, config->nb_queue_pairs, dev_info.max_queue_pairs); return -EINVAL; } @@ -294,7 +294,7 @@ rte_ml_dev_close(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -318,7 +318,7 @@ rte_ml_dev_start(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -345,7 +345,7 @@ rte_ml_dev_stop(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -372,7 +372,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -386,7 +386,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, } if (qp_conf == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL", dev_id); return -EINVAL; } @@ -404,7 +404,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -413,7 +413,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) return -ENOTSUP; if (stats == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL", dev_id); return -EINVAL; } memset(stats, 0, sizeof(struct rte_ml_dev_stats)); @@ -427,7 +427,7 @@ rte_ml_dev_stats_reset(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return; } @@ -445,7 +445,7 @@ rte_ml_dev_xstats_names_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, in struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -462,7 +462,7 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -471,12 +471,12 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i return -ENOTSUP; if (name == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL", dev_id); return -EINVAL; } if (value == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL", dev_id); return -EINVAL; } @@ -490,7 +490,7 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -499,12 +499,12 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t return -ENOTSUP; if (stat_ids == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL", dev_id); return -EINVAL; } if (values == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL", dev_id); return -EINVAL; } @@ -518,7 +518,7 @@ rte_ml_dev_xstats_reset(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_ struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -535,7 +535,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -544,7 +544,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) return -ENOTSUP; if (fd == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL", dev_id); return -EINVAL; } @@ -557,7 +557,7 @@ rte_ml_dev_selftest(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -574,7 +574,7 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -583,12 +583,12 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * return -ENOTSUP; if (params == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL", dev_id); return -EINVAL; } if (model_id == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL", dev_id); return -EINVAL; } @@ -601,7 +601,7 @@ rte_ml_model_unload(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -618,7 +618,7 @@ rte_ml_model_start(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -635,7 +635,7 @@ rte_ml_model_stop(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -652,7 +652,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -661,7 +661,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf return -ENOTSUP; if (model_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL\n", dev_id, + RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL", dev_id, model_id); return -EINVAL; } @@ -675,7 +675,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -684,7 +684,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) return -ENOTSUP; if (buffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL", dev_id); return -EINVAL; } @@ -698,7 +698,7 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -707,12 +707,12 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d return -ENOTSUP; if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -726,7 +726,7 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -735,12 +735,12 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * return -ENOTSUP; if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -811,7 +811,7 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -823,13 +823,13 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -847,7 +847,7 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -859,13 +859,13 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -883,7 +883,7 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -892,12 +892,12 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error return -ENOTSUP; if (op == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL", dev_id); return -EINVAL; } if (error == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL", dev_id); return -EINVAL; } #else diff --git a/lib/net/rte_net_crc.c b/lib/net/rte_net_crc.c index a685f9e7bb..900d6de7f4 100644 --- a/lib/net/rte_net_crc.c +++ b/lib/net/rte_net_crc.c @@ -179,7 +179,7 @@ avx512_vpclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_512) return handlers_avx512; #endif - NET_LOG(INFO, "Requirements not met, can't use AVX512\n"); + NET_LOG(INFO, "Requirements not met, can't use AVX512"); return NULL; } @@ -205,7 +205,7 @@ sse42_pclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_sse42; #endif - NET_LOG(INFO, "Requirements not met, can't use SSE\n"); + NET_LOG(INFO, "Requirements not met, can't use SSE"); return NULL; } @@ -231,7 +231,7 @@ neon_pmull_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_neon; #endif - NET_LOG(INFO, "Requirements not met, can't use NEON\n"); + NET_LOG(INFO, "Requirements not met, can't use NEON"); return NULL; } diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c index 3e8fac1df4..475eff6abe 100644 --- a/lib/node/ethdev_rx.c +++ b/lib/node/ethdev_rx.c @@ -160,13 +160,13 @@ ethdev_ptype_setup(uint16_t port, uint16_t queue) if (!l3_ipv4 || !l3_ipv6) { node_info("ethdev_rx", - "Enabling ptype callback for required ptypes on port %u\n", + "Enabling ptype callback for required ptypes on port %u", port); if (!rte_eth_add_rx_callback(port, queue, eth_pkt_parse_cb, NULL)) { node_err("ethdev_rx", - "Failed to add rx ptype cb: port=%d, queue=%d\n", + "Failed to add rx ptype cb: port=%d, queue=%d", port, queue); return -EINVAL; } diff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c index 0dbfde64fe..18955971f6 100644 --- a/lib/node/ip4_lookup.c +++ b/lib/node/ip4_lookup.c @@ -143,7 +143,7 @@ rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop, ip, depth, val); if (ret < 0) { node_err("ip4_lookup", - "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d\n", + "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/ip6_lookup.c b/lib/node/ip6_lookup.c index 6f56eb5ec5..309964f60f 100644 --- a/lib/node/ip6_lookup.c +++ b/lib/node/ip6_lookup.c @@ -283,7 +283,7 @@ rte_node_ip6_route_add(const uint8_t *ip, uint8_t depth, uint16_t next_hop, if (ret < 0) { node_err("ip6_lookup", "Unable to add entry %s / %d nh (%x) to LPM " - "table on sock %d, rc=%d\n", + "table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/kernel_rx.c b/lib/node/kernel_rx.c index 2dba7c8cc7..6c20cdbb1e 100644 --- a/lib/node/kernel_rx.c +++ b/lib/node/kernel_rx.c @@ -134,7 +134,7 @@ kernel_rx_node_do(struct rte_graph *graph, struct rte_node *node, kernel_rx_node if (len == 0 || len == 0xFFFF) { rte_pktmbuf_free(m); if (rx->idx <= 0) - node_dbg("kernel_rx", "rx_mbuf array is empty\n"); + node_dbg("kernel_rx", "rx_mbuf array is empty"); rx->idx--; break; } @@ -207,20 +207,20 @@ kernel_rx_node_init(const struct rte_graph *graph, struct rte_node *node) RTE_VERIFY(elem != NULL); if (ctx->pktmbuf_pool == NULL) { - node_err("kernel_rx", "Invalid mbuf pool on graph %s\n", graph->name); + node_err("kernel_rx", "Invalid mbuf pool on graph %s", graph->name); return -EINVAL; } recv_info = rte_zmalloc_socket("kernel_rx_info", sizeof(kernel_rx_info_t), RTE_CACHE_LINE_SIZE, graph->socket); if (!recv_info) { - node_err("kernel_rx", "Kernel recv_info is NULL\n"); + node_err("kernel_rx", "Kernel recv_info is NULL"); return -ENOMEM; } sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (sock < 0) { - node_err("kernel_rx", "Unable to open RAW socket\n"); + node_err("kernel_rx", "Unable to open RAW socket"); return sock; } diff --git a/lib/node/kernel_tx.c b/lib/node/kernel_tx.c index 27d1808c71..3a96741622 100644 --- a/lib/node/kernel_tx.c +++ b/lib/node/kernel_tx.c @@ -36,7 +36,7 @@ kernel_tx_process_mbuf(struct rte_node *node, struct rte_mbuf **mbufs, uint16_t sin.sin_addr.s_addr = ip4->dst_addr; if (sendto(ctx->sock, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)) < 0) - node_err("kernel_tx", "Unable to send packets: %s\n", strerror(errno)); + node_err("kernel_tx", "Unable to send packets: %s", strerror(errno)); } } @@ -87,7 +87,7 @@ kernel_tx_node_init(const struct rte_graph *graph __rte_unused, struct rte_node ctx->sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (ctx->sock < 0) - node_err("kernel_tx", "Unable to open RAW socket\n"); + node_err("kernel_tx", "Unable to open RAW socket"); return 0; } diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c index a9f3d6cc98..41a44be4b9 100644 --- a/lib/rcu/rte_rcu_qsbr.c +++ b/lib/rcu/rte_rcu_qsbr.c @@ -92,7 +92,7 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; @@ -144,7 +144,7 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index 5979fb0efb..6b908e7ee0 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -299,7 +299,7 @@ rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Copy the current value of token. @@ -350,7 +350,7 @@ rte_rcu_qsbr_thread_offline(struct rte_rcu_qsbr *v, unsigned int thread_id) { RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* The reader can go offline only after the load of the @@ -427,7 +427,7 @@ rte_rcu_qsbr_unlock(__rte_unused struct rte_rcu_qsbr *v, 1, rte_memory_order_release); __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, WARNING, - "Lock counter %u. Nested locks?\n", + "Lock counter %u. Nested locks?", v->qsbr_cnt[thread_id].lock_cnt); #endif } @@ -481,7 +481,7 @@ rte_rcu_qsbr_quiescent(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Acquire the changes to the shared data structure released diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c index 1fabec2bfe..1dab6d6645 100644 --- a/lib/stack/rte_stack.c +++ b/lib/stack/rte_stack.c @@ -56,7 +56,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, int ret; if (flags & ~(RTE_STACK_F_LF)) { - STACK_LOG_ERR("Unsupported stack flags %#x\n", flags); + STACK_LOG_ERR("Unsupported stack flags %#x", flags); return NULL; } @@ -65,7 +65,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, #endif #if !defined(RTE_STACK_LF_SUPPORTED) if (flags & RTE_STACK_F_LF) { - STACK_LOG_ERR("Lock-free stack is not supported on your platform\n"); + STACK_LOG_ERR("Lock-free stack is not supported on your platform"); rte_errno = ENOTSUP; return NULL; } @@ -82,7 +82,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, te = rte_zmalloc("STACK_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { - STACK_LOG_ERR("Cannot reserve memory for tailq\n"); + STACK_LOG_ERR("Cannot reserve memory for tailq"); rte_errno = ENOMEM; return NULL; } @@ -92,7 +92,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, mz = rte_memzone_reserve_aligned(mz_name, sz, socket_id, 0, __alignof__(*s)); if (mz == NULL) { - STACK_LOG_ERR("Cannot reserve stack memzone!\n"); + STACK_LOG_ERR("Cannot reserve stack memzone!"); rte_mcfg_tailq_write_unlock(); rte_free(te); return NULL; -- 2.41.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
[parent not found: <20231208145950.2184940-1-david.marchand@redhat.com>]
* [RFC v2 01/14] hash: remove some dead code [not found] ` <20231208145950.2184940-1-david.marchand@redhat.com> @ 2023-12-08 14:59 ` David Marchand 2023-12-08 16:53 ` Stephen Hemminger 2023-12-08 20:46 ` Tyler Retzlaff 2023-12-08 14:59 ` [RFC v2 02/14] regexdev: fix logtype register David Marchand ` (3 subsequent siblings) 4 siblings, 2 replies; 39+ messages in thread From: David Marchand @ 2023-12-08 14:59 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Yipeng Wang, Sameh Gobriel, Vladimir Medvedkin, Ruifeng Wang, Ray Kinsella, Dharmik Thakkar This macro is not used. Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> --- lib/hash/rte_cuckoo_hash.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h index f7afc4dd79..8ea793c66e 100644 --- a/lib/hash/rte_cuckoo_hash.h +++ b/lib/hash/rte_cuckoo_hash.h @@ -29,17 +29,6 @@ #define RETURN_IF_TRUE(cond, retval) #endif -#if defined(RTE_LIBRTE_HASH_DEBUG) -#define ERR_IF_TRUE(cond, fmt, args...) do { \ - if (cond) { \ - RTE_LOG(ERR, HASH, fmt, ##args); \ - return; \ - } \ -} while (0) -#else -#define ERR_IF_TRUE(cond, fmt, args...) -#endif - #include <rte_hash_crc.h> #include <rte_jhash.h> -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 01/14] hash: remove some dead code 2023-12-08 14:59 ` [RFC v2 01/14] hash: remove some dead code David Marchand @ 2023-12-08 16:53 ` Stephen Hemminger 2023-12-08 20:46 ` Tyler Retzlaff 1 sibling, 0 replies; 39+ messages in thread From: Stephen Hemminger @ 2023-12-08 16:53 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, mb, stable, Yipeng Wang, Sameh Gobriel, Vladimir Medvedkin, Ruifeng Wang, Ray Kinsella, Dharmik Thakkar On Fri, 8 Dec 2023 15:59:35 +0100 David Marchand <david.marchand@redhat.com> wrote: > This macro is not used. > > Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 01/14] hash: remove some dead code 2023-12-08 14:59 ` [RFC v2 01/14] hash: remove some dead code David Marchand 2023-12-08 16:53 ` Stephen Hemminger @ 2023-12-08 20:46 ` Tyler Retzlaff 1 sibling, 0 replies; 39+ messages in thread From: Tyler Retzlaff @ 2023-12-08 20:46 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Yipeng Wang, Sameh Gobriel, Vladimir Medvedkin, Ruifeng Wang, Ray Kinsella, Dharmik Thakkar On Fri, Dec 08, 2023 at 03:59:35PM +0100, David Marchand wrote: > This macro is not used. > > Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > --- Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> ^ permalink raw reply [flat|nested] 39+ messages in thread
* [RFC v2 02/14] regexdev: fix logtype register [not found] ` <20231208145950.2184940-1-david.marchand@redhat.com> 2023-12-08 14:59 ` [RFC v2 01/14] hash: remove some dead code David Marchand @ 2023-12-08 14:59 ` David Marchand 2023-12-08 16:58 ` Stephen Hemminger ` (2 more replies) 2023-12-08 14:59 ` [RFC v2 03/14] lib: use dedicated logtypes David Marchand ` (2 subsequent siblings) 4 siblings, 3 replies; 39+ messages in thread From: David Marchand @ 2023-12-08 14:59 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Ori Kam, Parav Pandit, Guy Kaneti This library logtype was not initialized so its logs would end up under the 0 logtype, iow, RTE_LOGTYPE_EAL. Fixes: b25246beaefc ("regexdev: add core functions") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> --- lib/regexdev/rte_regexdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c index caec069182..d38a85eb0b 100644 --- a/lib/regexdev/rte_regexdev.c +++ b/lib/regexdev/rte_regexdev.c @@ -19,7 +19,7 @@ static struct { struct rte_regexdev_data data[RTE_MAX_REGEXDEV_DEVS]; } *rte_regexdev_shared_data; -int rte_regexdev_logtype; +RTE_LOG_REGISTER_DEFAULT(rte_regexdev_logtype, INFO); static uint16_t regexdev_find_free_dev(void) -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 02/14] regexdev: fix logtype register 2023-12-08 14:59 ` [RFC v2 02/14] regexdev: fix logtype register David Marchand @ 2023-12-08 16:58 ` Stephen Hemminger 2023-12-08 20:46 ` Tyler Retzlaff 2023-12-14 10:11 ` Ori Kam 2 siblings, 0 replies; 39+ messages in thread From: Stephen Hemminger @ 2023-12-08 16:58 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, mb, stable, Ori Kam, Parav Pandit, Guy Kaneti On Fri, 8 Dec 2023 15:59:36 +0100 David Marchand <david.marchand@redhat.com> wrote: > This library logtype was not initialized so its logs would end up under > the 0 logtype, iow, RTE_LOGTYPE_EAL. > > Fixes: b25246beaefc ("regexdev: add core functions") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 02/14] regexdev: fix logtype register 2023-12-08 14:59 ` [RFC v2 02/14] regexdev: fix logtype register David Marchand 2023-12-08 16:58 ` Stephen Hemminger @ 2023-12-08 20:46 ` Tyler Retzlaff 2023-12-14 10:11 ` Ori Kam 2 siblings, 0 replies; 39+ messages in thread From: Tyler Retzlaff @ 2023-12-08 20:46 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Ori Kam, Parav Pandit, Guy Kaneti On Fri, Dec 08, 2023 at 03:59:36PM +0100, David Marchand wrote: > This library logtype was not initialized so its logs would end up under > the 0 logtype, iow, RTE_LOGTYPE_EAL. > > Fixes: b25246beaefc ("regexdev: add core functions") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > --- Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> ^ permalink raw reply [flat|nested] 39+ messages in thread
* RE: [RFC v2 02/14] regexdev: fix logtype register 2023-12-08 14:59 ` [RFC v2 02/14] regexdev: fix logtype register David Marchand 2023-12-08 16:58 ` Stephen Hemminger 2023-12-08 20:46 ` Tyler Retzlaff @ 2023-12-14 10:11 ` Ori Kam 2 siblings, 0 replies; 39+ messages in thread From: Ori Kam @ 2023-12-14 10:11 UTC (permalink / raw) To: David Marchand, dev Cc: NBU-Contact-Thomas Monjalon (EXTERNAL), ferruh.yigit, bruce.richardson, stephen, mb, stable, Parav Pandit, Guy Kaneti > -----Original Message----- > From: David Marchand <david.marchand@redhat.com> > Sent: Friday, December 8, 2023 5:00 PM > > This library logtype was not initialized so its logs would end up under > the 0 logtype, iow, RTE_LOGTYPE_EAL. > > Fixes: b25246beaefc ("regexdev: add core functions") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > --- > lib/regexdev/rte_regexdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c > index caec069182..d38a85eb0b 100644 > --- a/lib/regexdev/rte_regexdev.c > +++ b/lib/regexdev/rte_regexdev.c > @@ -19,7 +19,7 @@ static struct { > struct rte_regexdev_data data[RTE_MAX_REGEXDEV_DEVS]; > } *rte_regexdev_shared_data; > > -int rte_regexdev_logtype; > +RTE_LOG_REGISTER_DEFAULT(rte_regexdev_logtype, INFO); > > static uint16_t > regexdev_find_free_dev(void) > -- > 2.43.0 Acked-by: Ori Kam <orika@nvidia.com> Best, Or ^ permalink raw reply [flat|nested] 39+ messages in thread
* [RFC v2 03/14] lib: use dedicated logtypes [not found] ` <20231208145950.2184940-1-david.marchand@redhat.com> 2023-12-08 14:59 ` [RFC v2 01/14] hash: remove some dead code David Marchand 2023-12-08 14:59 ` [RFC v2 02/14] regexdev: fix logtype register David Marchand @ 2023-12-08 14:59 ` David Marchand 2023-12-08 17:00 ` Stephen Hemminger ` (2 more replies) 2023-12-08 14:59 ` [RFC v2 04/14] lib: add newline in logs David Marchand 2023-12-08 14:59 ` [RFC v2 05/14] lib: remove redundant newline from logs David Marchand 4 siblings, 3 replies; 39+ messages in thread From: David Marchand @ 2023-12-08 14:59 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Akhil Goyal, Fan Zhang, Andrew Rybchenko, Amit Prakash Shukla, Jerin Jacob, Naga Harish K S V 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. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> --- 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_dma_adapter.c | 4 ++-- lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++++------ lib/eventdev/rte_eventdev.c | 6 +++--- lib/mempool/rte_mempool_ops.c | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index b258827734..d8769f0b8d 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2682,7 +2682,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 fff4b7b4cd..55a9dcc565 100644 --- a/lib/ethdev/ethdev_driver.c +++ b/lib/ethdev/ethdev_driver.c @@ -487,7 +487,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; @@ -713,7 +713,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 e98b7188b0..0e1c7b23c1 100644 --- a/lib/ethdev/ethdev_private.c +++ b/lib/ethdev/ethdev_private.c @@ -182,7 +182,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_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; } } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 6db03adf04..82ae31712d 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -314,9 +314,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; \ } \ @@ -3671,7 +3671,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); @@ -3743,7 +3743,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); @@ -3813,7 +3813,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); @@ -3868,7 +3868,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 0ca32d6721..ae50821a3f 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1428,8 +1428,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; } @@ -1444,7 +1444,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 ae1d288f27..e871de9ec9 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.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 03/14] lib: use dedicated logtypes 2023-12-08 14:59 ` [RFC v2 03/14] lib: use dedicated logtypes David Marchand @ 2023-12-08 17:00 ` Stephen Hemminger 2023-12-08 20:49 ` Tyler Retzlaff 2023-12-16 9:47 ` Andrew Rybchenko 2 siblings, 0 replies; 39+ messages in thread From: Stephen Hemminger @ 2023-12-08 17:00 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, mb, stable, Akhil Goyal, Fan Zhang, Andrew Rybchenko, Amit Prakash Shukla, Jerin Jacob, Naga Harish K S V On Fri, 8 Dec 2023 15:59:37 +0100 David Marchand <david.marchand@redhat.com> wrote: > 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. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 03/14] lib: use dedicated logtypes 2023-12-08 14:59 ` [RFC v2 03/14] lib: use dedicated logtypes David Marchand 2023-12-08 17:00 ` Stephen Hemminger @ 2023-12-08 20:49 ` Tyler Retzlaff 2023-12-16 9:47 ` Andrew Rybchenko 2 siblings, 0 replies; 39+ messages in thread From: Tyler Retzlaff @ 2023-12-08 20:49 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Akhil Goyal, Fan Zhang, Andrew Rybchenko, Amit Prakash Shukla, Jerin Jacob, Naga Harish K S V On Fri, Dec 08, 2023 at 03:59:37PM +0100, David Marchand wrote: > 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. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > --- Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 03/14] lib: use dedicated logtypes 2023-12-08 14:59 ` [RFC v2 03/14] lib: use dedicated logtypes David Marchand 2023-12-08 17:00 ` Stephen Hemminger 2023-12-08 20:49 ` Tyler Retzlaff @ 2023-12-16 9:47 ` Andrew Rybchenko 2 siblings, 0 replies; 39+ messages in thread From: Andrew Rybchenko @ 2023-12-16 9:47 UTC (permalink / raw) To: David Marchand, dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Akhil Goyal, Fan Zhang, Amit Prakash Shukla, Jerin Jacob, Naga Harish K S V On 12/8/23 17:59, David Marchand wrote: > 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. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> ^ permalink raw reply [flat|nested] 39+ messages in thread
* [RFC v2 04/14] lib: add newline in logs [not found] ` <20231208145950.2184940-1-david.marchand@redhat.com> ` (2 preceding siblings ...) 2023-12-08 14:59 ` [RFC v2 03/14] lib: use dedicated logtypes David Marchand @ 2023-12-08 14:59 ` David Marchand 2023-12-08 17:01 ` Stephen Hemminger ` (2 more replies) 2023-12-08 14:59 ` [RFC v2 05/14] lib: remove redundant newline from logs David Marchand 4 siblings, 3 replies; 39+ messages in thread From: David Marchand @ 2023-12-08 14:59 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Harman Kalra, Andrew Rybchenko, Vladimir Medvedkin, Anatoly Burakov, David Hunt, Sivaprasad Tummala Fix places leading to a log message not terminated with a newline. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> --- lib/eal/common/eal_common_options.c | 2 +- lib/eal/linux/eal_hugepage_info.c | 2 +- lib/eal/linux/eal_interrupts.c | 2 +- lib/ethdev/ethdev_pci.h | 2 +- lib/ethdev/rte_ethdev.c | 40 ++++++++++++++--------------- lib/lpm/rte_lpm6.c | 6 ++--- lib/power/guest_channel.c | 2 +- lib/power/rte_power_pmd_mgmt.c | 6 ++--- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index a6d21f1cba..e9ba01fb89 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -2141,7 +2141,7 @@ rte_vect_set_max_simd_bitwidth(uint16_t bitwidth) struct internal_config *internal_conf = eal_get_internal_configuration(); if (internal_conf->max_simd_bitwidth.forced) { - RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled"); + RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled\n"); return -EPERM; } diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c index 581d9dfc91..36a495fb1f 100644 --- a/lib/eal/linux/eal_hugepage_info.c +++ b/lib/eal/linux/eal_hugepage_info.c @@ -403,7 +403,7 @@ inspect_hugedir_cb(const struct walk_hugedir_data *whd) struct stat st; if (fstat(whd->file_fd, &st) < 0) - RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s", + RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s\n", __func__, whd->file_name, strerror(errno)); else (*total_size) += st.st_size; diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index d4919dff45..eabac24992 100644 --- a/lib/eal/linux/eal_interrupts.c +++ b/lib/eal/linux/eal_interrupts.c @@ -1542,7 +1542,7 @@ rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd) /* only check, initialization would be done in vdev driver.*/ if ((uint64_t)rte_intr_efd_counter_size_get(intr_handle) > sizeof(union rte_intr_read_buffer)) { - RTE_LOG(ERR, EAL, "the efd_counter_size is oversized"); + RTE_LOG(ERR, EAL, "the efd_counter_size is oversized\n"); return -EINVAL; } } else { diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h index 320e3e0093..ddb559aa95 100644 --- a/lib/ethdev/ethdev_pci.h +++ b/lib/ethdev/ethdev_pci.h @@ -31,7 +31,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev) { if ((eth_dev == NULL) || (pci_dev == NULL)) { - RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p", + RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p\n", (void *)eth_dev, (void *)pci_dev); return; } diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 3858983fcc..b9d99ece15 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -724,7 +724,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) uint16_t pid; if (name == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name"); + RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name\n"); return -EINVAL; } @@ -2394,41 +2394,41 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, nb_rx_desc = cap.max_nb_desc; if (nb_rx_desc > cap.max_nb_desc) { RTE_ETHDEV_LOG(ERR, - "Invalid value for nb_rx_desc(=%hu), should be: <= %hu", + "Invalid value for nb_rx_desc(=%hu), should be: <= %hu\n", nb_rx_desc, cap.max_nb_desc); return -EINVAL; } if (conf->peer_count > cap.max_rx_2_tx) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Rx queue(=%u), should be: <= %hu", + "Invalid value for number of peers for Rx queue(=%u), should be: <= %hu\n", conf->peer_count, cap.max_rx_2_tx); return -EINVAL; } if (conf->use_locked_device_memory && !cap.rx_cap.locked_device_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use locked device memory for Rx queue, which is not supported"); + "Attempt to use locked device memory for Rx queue, which is not supported\n"); return -EINVAL; } if (conf->use_rte_memory && !cap.rx_cap.rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use DPDK memory for Rx queue, which is not supported"); + "Attempt to use DPDK memory for Rx queue, which is not supported\n"); return -EINVAL; } if (conf->use_locked_device_memory && conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use mutually exclusive memory settings for Rx queue"); + "Attempt to use mutually exclusive memory settings for Rx queue\n"); return -EINVAL; } if (conf->force_memory && !conf->use_locked_device_memory && !conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to force Rx queue memory settings, but none is set"); + "Attempt to force Rx queue memory settings, but none is set\n"); return -EINVAL; } if (conf->peer_count == 0) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Rx queue(=%u), should be: > 0", + "Invalid value for number of peers for Rx queue(=%u), should be: > 0\n", conf->peer_count); return -EINVAL; } @@ -2438,7 +2438,7 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, count++; } if (count > cap.max_nb_queues) { - RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d", + RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d\n", cap.max_nb_queues); return -EINVAL; } @@ -2597,41 +2597,41 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, nb_tx_desc = cap.max_nb_desc; if (nb_tx_desc > cap.max_nb_desc) { RTE_ETHDEV_LOG(ERR, - "Invalid value for nb_tx_desc(=%hu), should be: <= %hu", + "Invalid value for nb_tx_desc(=%hu), should be: <= %hu\n", nb_tx_desc, cap.max_nb_desc); return -EINVAL; } if (conf->peer_count > cap.max_tx_2_rx) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Tx queue(=%u), should be: <= %hu", + "Invalid value for number of peers for Tx queue(=%u), should be: <= %hu\n", conf->peer_count, cap.max_tx_2_rx); return -EINVAL; } if (conf->use_locked_device_memory && !cap.tx_cap.locked_device_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use locked device memory for Tx queue, which is not supported"); + "Attempt to use locked device memory for Tx queue, which is not supported\n"); return -EINVAL; } if (conf->use_rte_memory && !cap.tx_cap.rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use DPDK memory for Tx queue, which is not supported"); + "Attempt to use DPDK memory for Tx queue, which is not supported\n"); return -EINVAL; } if (conf->use_locked_device_memory && conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use mutually exclusive memory settings for Tx queue"); + "Attempt to use mutually exclusive memory settings for Tx queue\n"); return -EINVAL; } if (conf->force_memory && !conf->use_locked_device_memory && !conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to force Tx queue memory settings, but none is set"); + "Attempt to force Tx queue memory settings, but none is set\n"); return -EINVAL; } if (conf->peer_count == 0) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Tx queue(=%u), should be: > 0", + "Invalid value for number of peers for Tx queue(=%u), should be: > 0\n", conf->peer_count); return -EINVAL; } @@ -2641,7 +2641,7 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, count++; } if (count > cap.max_nb_queues) { - RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d", + RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d\n", cap.max_nb_queues); return -EINVAL; } @@ -6716,7 +6716,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, } if (reassembly_capa == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL"); + RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL\n"); return -EINVAL; } @@ -6752,7 +6752,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, } if (conf == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL"); + RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL\n"); return -EINVAL; } @@ -6780,7 +6780,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (dev->data->dev_configured == 0) { RTE_ETHDEV_LOG(ERR, "Device with port_id=%u is not configured.\n" - "Cannot set IP reassembly configuration", + "Cannot set IP reassembly configuration\n", port_id); return -EINVAL; } diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c index 873cc8bc26..24ce7dd022 100644 --- a/lib/lpm/rte_lpm6.c +++ b/lib/lpm/rte_lpm6.c @@ -280,7 +280,7 @@ rte_lpm6_create(const char *name, int socket_id, rules_tbl = rte_hash_create(&rule_hash_tbl_params); if (rules_tbl == NULL) { - RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); goto fail_wo_unlock; } @@ -290,7 +290,7 @@ rte_lpm6_create(const char *name, int socket_id, sizeof(uint32_t) * config->number_tbl8s, RTE_CACHE_LINE_SIZE); if (tbl8_pool == NULL) { - RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); rte_errno = ENOMEM; goto fail_wo_unlock; @@ -301,7 +301,7 @@ rte_lpm6_create(const char *name, int socket_id, sizeof(struct rte_lpm_tbl8_hdr) * config->number_tbl8s, RTE_CACHE_LINE_SIZE); if (tbl8_hdrs == NULL) { - RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); rte_errno = ENOMEM; goto fail_wo_unlock; diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c index cc05347425..a6f2097d5b 100644 --- a/lib/power/guest_channel.c +++ b/lib/power/guest_channel.c @@ -90,7 +90,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id) flags |= O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) < 0) { RTE_LOG(ERR, GUEST_CHANNEL, "Failed on setting non-blocking mode for " - "file %s", fd_path); + "file %s\n", fd_path); goto error; } /* QEMU needs a delay after connection */ diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c index 38f8384085..6f18ed0adf 100644 --- a/lib/power/rte_power_pmd_mgmt.c +++ b/lib/power/rte_power_pmd_mgmt.c @@ -686,7 +686,7 @@ int rte_power_pmd_mgmt_set_pause_duration(unsigned int duration) { if (duration == 0) { - RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged"); + RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged\n"); return -EINVAL; } pause_duration = duration; @@ -709,7 +709,7 @@ rte_power_pmd_mgmt_set_scaling_freq_min(unsigned int lcore, unsigned int min) } if (min > scale_freq_max[lcore]) { - RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency"); + RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency\n"); return -EINVAL; } scale_freq_min[lcore] = min; @@ -729,7 +729,7 @@ rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max) if (max == 0) max = UINT32_MAX; if (max < scale_freq_min[lcore]) { - RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency"); + RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency\n"); return -EINVAL; } -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 04/14] lib: add newline in logs 2023-12-08 14:59 ` [RFC v2 04/14] lib: add newline in logs David Marchand @ 2023-12-08 17:01 ` Stephen Hemminger 2023-12-11 12:38 ` David Marchand 2023-12-08 20:50 ` Tyler Retzlaff 2023-12-16 9:43 ` Andrew Rybchenko 2 siblings, 1 reply; 39+ messages in thread From: Stephen Hemminger @ 2023-12-08 17:01 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, mb, stable, Harman Kalra, Andrew Rybchenko, Vladimir Medvedkin, Anatoly Burakov, David Hunt, Sivaprasad Tummala On Fri, 8 Dec 2023 15:59:38 +0100 David Marchand <david.marchand@redhat.com> wrote: > Fix places leading to a log message not terminated with a newline. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> Maybe a coccinelle fixup script would help in future. Acked-by: Stephen Hemminger <stephen@networkplumber.org> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 04/14] lib: add newline in logs 2023-12-08 17:01 ` Stephen Hemminger @ 2023-12-11 12:38 ` David Marchand 0 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-11 12:38 UTC (permalink / raw) To: Stephen Hemminger Cc: dev, thomas, ferruh.yigit, bruce.richardson, mb, stable, Harman Kalra, Andrew Rybchenko, Vladimir Medvedkin, Anatoly Burakov, David Hunt, Sivaprasad Tummala On Fri, Dec 8, 2023 at 6:02 PM Stephen Hemminger <stephen@networkplumber.org> wrote: > > On Fri, 8 Dec 2023 15:59:38 +0100 > David Marchand <david.marchand@redhat.com> wrote: > > > Fix places leading to a log message not terminated with a newline. > > > > Cc: stable@dpdk.org > > > > Signed-off-by: David Marchand <david.marchand@redhat.com> > > Maybe a coccinelle fixup script would help in future. Checkpatch will now complain for new users of RTE_LOG(). So hopefully, using RTE_LOG() will be an exception, rather than a normal occurence. -- David Marchand ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 04/14] lib: add newline in logs 2023-12-08 14:59 ` [RFC v2 04/14] lib: add newline in logs David Marchand 2023-12-08 17:01 ` Stephen Hemminger @ 2023-12-08 20:50 ` Tyler Retzlaff 2023-12-16 9:43 ` Andrew Rybchenko 2 siblings, 0 replies; 39+ messages in thread From: Tyler Retzlaff @ 2023-12-08 20:50 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Harman Kalra, Andrew Rybchenko, Vladimir Medvedkin, Anatoly Burakov, David Hunt, Sivaprasad Tummala On Fri, Dec 08, 2023 at 03:59:38PM +0100, David Marchand wrote: > Fix places leading to a log message not terminated with a newline. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > --- Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 04/14] lib: add newline in logs 2023-12-08 14:59 ` [RFC v2 04/14] lib: add newline in logs David Marchand 2023-12-08 17:01 ` Stephen Hemminger 2023-12-08 20:50 ` Tyler Retzlaff @ 2023-12-16 9:43 ` Andrew Rybchenko 2 siblings, 0 replies; 39+ messages in thread From: Andrew Rybchenko @ 2023-12-16 9:43 UTC (permalink / raw) To: David Marchand, dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Harman Kalra, Vladimir Medvedkin, Anatoly Burakov, David Hunt, Sivaprasad Tummala On 12/8/23 17:59, David Marchand wrote: > Fix places leading to a log message not terminated with a newline. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> For ethdev: Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> ^ permalink raw reply [flat|nested] 39+ messages in thread
* [RFC v2 05/14] lib: remove redundant newline from logs [not found] ` <20231208145950.2184940-1-david.marchand@redhat.com> ` (3 preceding siblings ...) 2023-12-08 14:59 ` [RFC v2 04/14] lib: add newline in logs David Marchand @ 2023-12-08 14:59 ` David Marchand 2023-12-08 17:02 ` Stephen Hemminger ` (2 more replies) 4 siblings, 3 replies; 39+ messages in thread From: David Marchand @ 2023-12-08 14:59 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Kai Ji, Pablo de Lara, Nicolas Chautru, Cristian Dumitrescu, Fan Zhang, Ashish Gupta, Akhil Goyal, Mattias Rönnblom, Chengwen Feng, Kevin Laatz, Dmitry Kozlyuk, Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam, Jerin Jacob, Abhinandan Gujjar, Amit Prakash Shukla, Naga Harish K S V, Erik Gabriel Carrillo, Srikanth Yalavarthi, Jasvinder Singh, Nithin Dabilpuram, Pavan Nikhilesh, Honnappa Nagarahalli, Maxime Coquelin, Chenbo Xia Fix places where two newline characters may be logged. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> --- Changes since RFC v1: - split fixes on direct calls to printf or RTE_LOG in a previous patch, --- drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 2 +- lib/bbdev/rte_bbdev.c | 6 +- lib/cfgfile/rte_cfgfile.c | 14 ++-- lib/compressdev/rte_compressdev_pmd.c | 4 +- lib/cryptodev/rte_cryptodev.c | 2 +- lib/dispatcher/rte_dispatcher.c | 12 +-- lib/dmadev/rte_dmadev.c | 2 +- lib/eal/windows/eal_memory.c | 2 +- lib/eventdev/eventdev_pmd.h | 6 +- lib/eventdev/rte_event_crypto_adapter.c | 12 +-- lib/eventdev/rte_event_dma_adapter.c | 14 ++-- lib/eventdev/rte_event_eth_rx_adapter.c | 28 +++---- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- lib/eventdev/rte_event_timer_adapter.c | 4 +- lib/eventdev/rte_eventdev.c | 4 +- lib/metrics/rte_metrics_telemetry.c | 2 +- lib/mldev/rte_mldev.c | 102 ++++++++++++------------ lib/net/rte_net_crc.c | 6 +- lib/node/ethdev_rx.c | 4 +- lib/node/ip4_lookup.c | 2 +- lib/node/ip6_lookup.c | 2 +- lib/node/kernel_rx.c | 8 +- lib/node/kernel_tx.c | 4 +- lib/rcu/rte_rcu_qsbr.c | 4 +- lib/rcu/rte_rcu_qsbr.h | 8 +- lib/stack/rte_stack.c | 8 +- lib/vhost/vhost_crypto.c | 6 +- 27 files changed, 135 insertions(+), 135 deletions(-) diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c index 52d6d010c7..f21f9cc5a0 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c +++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c @@ -407,7 +407,7 @@ ipsec_mb_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer) resp_param->result = ipsec_mb_qp_release(dev, qp_id); break; default: - CDEV_LOG_ERR("invalid mp request type\n"); + CDEV_LOG_ERR("invalid mp request type"); } out: diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index cfebea09c7..e09bb97abb 100644 --- a/lib/bbdev/rte_bbdev.c +++ b/lib/bbdev/rte_bbdev.c @@ -1106,12 +1106,12 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, intr_handle = dev->intr_handle; if (intr_handle == NULL) { - rte_bbdev_log(ERR, "Device %u intr handle unset\n", dev_id); + rte_bbdev_log(ERR, "Device %u intr handle unset", dev_id); return -ENOTSUP; } if (queue_id >= RTE_MAX_RXTX_INTR_VEC_ID) { - rte_bbdev_log(ERR, "Device %u queue_id %u is too big\n", + rte_bbdev_log(ERR, "Device %u queue_id %u is too big", dev_id, queue_id); return -ENOTSUP; } @@ -1120,7 +1120,7 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, ret = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); if (ret && (ret != -EEXIST)) { rte_bbdev_log(ERR, - "dev %u q %u int ctl error op %d epfd %d vec %u\n", + "dev %u q %u int ctl error op %d epfd %d vec %u", dev_id, queue_id, op, epfd, vec); return ret; } diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c index eefba6e408..2f9cc0722a 100644 --- a/lib/cfgfile/rte_cfgfile.c +++ b/lib/cfgfile/rte_cfgfile.c @@ -137,7 +137,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) unsigned int i; if (!params) { - CFG_LOG(ERR, "missing cfgfile parameters\n"); + CFG_LOG(ERR, "missing cfgfile parameters"); return -EINVAL; } @@ -150,7 +150,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) } if (valid_comment == 0) { - CFG_LOG(ERR, "invalid comment characters %c\n", + CFG_LOG(ERR, "invalid comment characters %c", params->comment_character); return -ENOTSUP; } @@ -188,7 +188,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, lineno++; if ((len >= sizeof(buffer) - 1) && (buffer[len-1] != '\n')) { CFG_LOG(ERR, " line %d - no \\n found on string. " - "Check if line too long\n", lineno); + "Check if line too long", lineno); goto error1; } /* skip parsing if comment character found */ @@ -209,7 +209,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, char *end = memchr(buffer, ']', len); if (end == NULL) { CFG_LOG(ERR, - "line %d - no terminating ']' character found\n", + "line %d - no terminating ']' character found", lineno); goto error1; } @@ -225,7 +225,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, split[1] = memchr(buffer, '=', len); if (split[1] == NULL) { CFG_LOG(ERR, - "line %d - no '=' character found\n", + "line %d - no '=' character found", lineno); goto error1; } @@ -249,7 +249,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, if (!(flags & CFG_FLAG_EMPTY_VALUES) && (*split[1] == '\0')) { CFG_LOG(ERR, - "line %d - cannot use empty values\n", + "line %d - cannot use empty values", lineno); goto error1; } @@ -414,7 +414,7 @@ int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname, return 0; } - CFG_LOG(ERR, "entry name doesn't exist\n"); + CFG_LOG(ERR, "entry name doesn't exist"); return -EINVAL; } diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c index 156bccd972..762b44f03e 100644 --- a/lib/compressdev/rte_compressdev_pmd.c +++ b/lib/compressdev/rte_compressdev_pmd.c @@ -100,12 +100,12 @@ rte_compressdev_pmd_create(const char *name, struct rte_compressdev *compressdev; if (params->name[0] != '\0') { - COMPRESSDEV_LOG(INFO, "User specified device name = %s\n", + COMPRESSDEV_LOG(INFO, "User specified device name = %s", params->name); name = params->name; } - COMPRESSDEV_LOG(INFO, "Creating compressdev %s\n", name); + COMPRESSDEV_LOG(INFO, "Creating compressdev %s", name); COMPRESSDEV_LOG(INFO, "Init parameters - name: %s, socket id: %d", name, params->socket_id); diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index d8769f0b8d..a3a8fc9c07 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2072,7 +2072,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id, } if (xforms == NULL) { - CDEV_LOG_ERR("Invalid xform\n"); + CDEV_LOG_ERR("Invalid xform"); rte_errno = EINVAL; return NULL; } diff --git a/lib/dispatcher/rte_dispatcher.c b/lib/dispatcher/rte_dispatcher.c index 10d02edde9..95dd41b818 100644 --- a/lib/dispatcher/rte_dispatcher.c +++ b/lib/dispatcher/rte_dispatcher.c @@ -246,7 +246,7 @@ evd_service_register(struct rte_dispatcher *dispatcher) rc = rte_service_component_register(&service, &dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Registration of dispatcher service " - "%s failed with error code %d\n", + "%s failed with error code %d", service.name, rc); return rc; @@ -260,7 +260,7 @@ evd_service_unregister(struct rte_dispatcher *dispatcher) rc = rte_service_component_unregister(dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Unregistration of dispatcher service " - "failed with error code %d\n", rc); + "failed with error code %d", rc); return rc; } @@ -279,7 +279,7 @@ rte_dispatcher_create(uint8_t event_dev_id) RTE_CACHE_LINE_SIZE, socket_id); if (dispatcher == NULL) { - RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher\n"); + RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher"); rte_errno = ENOMEM; return NULL; } @@ -483,7 +483,7 @@ evd_lcore_uninstall_handler(struct rte_dispatcher_lcore *lcore, unreg_handler = evd_lcore_get_handler_by_id(lcore, handler_id); if (unreg_handler == NULL) { - RTE_EDEV_LOG_ERR("Invalid handler id %d\n", handler_id); + RTE_EDEV_LOG_ERR("Invalid handler id %d", handler_id); return -EINVAL; } @@ -602,7 +602,7 @@ rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher, unreg_finalizer = evd_get_finalizer_by_id(dispatcher, finalizer_id); if (unreg_finalizer == NULL) { - RTE_EDEV_LOG_ERR("Invalid finalizer id %d\n", finalizer_id); + RTE_EDEV_LOG_ERR("Invalid finalizer id %d", finalizer_id); return -EINVAL; } @@ -636,7 +636,7 @@ evd_set_service_runstate(struct rte_dispatcher *dispatcher, int state) */ if (rc != 0) RTE_EDEV_LOG_ERR("Unexpected error %d occurred while setting " - "service component run state to %d\n", rc, + "service component run state to %d", rc, state); RTE_VERIFY(rc == 0); diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 4e5e420c82..009a21849a 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -726,7 +726,7 @@ rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status * return -EINVAL; if (vchan >= dev->data->dev_conf.nb_vchans) { - RTE_DMA_LOG(ERR, "Device %u vchan %u out of range\n", dev_id, vchan); + RTE_DMA_LOG(ERR, "Device %u vchan %u out of range", dev_id, vchan); return -EINVAL; } diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c index 31410a41fd..fd39155163 100644 --- a/lib/eal/windows/eal_memory.c +++ b/lib/eal/windows/eal_memory.c @@ -110,7 +110,7 @@ eal_mem_win32api_init(void) VirtualAlloc2_ptr = (VirtualAlloc2_type)( (void *)GetProcAddress(library, function)); if (VirtualAlloc2_ptr == NULL) { - RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")\n", + RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")", library_name, function); /* Contrary to the docs, Server 2016 is not supported. */ diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index 30bd90085c..2ec5aec0a8 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -49,14 +49,14 @@ extern "C" { /* Macros to check for valid device */ #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return retval; \ } \ } while (0) #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ rte_errno = errno; \ return retval; \ } \ @@ -64,7 +64,7 @@ extern "C" { #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return; \ } \ } while (0) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 1b435c9f0e..d46595d190 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -133,7 +133,7 @@ static struct event_crypto_adapter **event_crypto_adapter; /* Macros to check for valid adapter */ #define EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!eca_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -309,7 +309,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", dev_id); + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) return -EIO; @@ -319,7 +319,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -391,7 +391,7 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, sizeof(struct crypto_device_info), 0, socket_id); if (adapter->cdevs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices\n"); + RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices"); eca_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -1403,7 +1403,7 @@ rte_event_crypto_adapter_runtime_params_set(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1436,7 +1436,7 @@ rte_event_crypto_adapter_runtime_params_get(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c index cbf9405438..4196164305 100644 --- a/lib/eventdev/rte_event_dma_adapter.c +++ b/lib/eventdev/rte_event_dma_adapter.c @@ -20,7 +20,7 @@ #define EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) \ do { \ if (!edma_adapter_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -313,7 +313,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_dev_configure(evdev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to configure event dev %u\n", evdev_id); + RTE_EDEV_LOG_ERR("Failed to configure event dev %u", evdev_id); if (started) { if (rte_event_dev_start(evdev_id)) return -EIO; @@ -323,7 +323,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_port_setup(evdev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("Failed to setup event port %u", port_id); return ret; } @@ -407,7 +407,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, num_dma_dev * sizeof(struct dma_device_info), 0, socket_id); if (adapter->dma_devs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices\n"); + RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -417,7 +417,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, for (i = 0; i < num_dma_dev; i++) { ret = rte_dma_info_get(i, &info); if (ret) { - RTE_EDEV_LOG_ERR("Failed to get dma device info\n"); + RTE_EDEV_LOG_ERR("Failed to get dma device info"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return ret; @@ -1297,7 +1297,7 @@ rte_event_dma_adapter_runtime_params_set(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1326,7 +1326,7 @@ rte_event_dma_adapter_runtime_params_get(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 82ae31712d..1b83a55b5c 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -293,14 +293,14 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ return retval; \ } \ } while (0) #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_GOTO_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ ret = retval; \ goto error; \ } \ @@ -308,7 +308,7 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, retval) do { \ if ((token) == NULL || strlen(token) == 0 || !isdigit(*token)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token\n"); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token"); \ ret = retval; \ goto error; \ } \ @@ -1540,7 +1540,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) @@ -1551,7 +1551,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -1628,7 +1628,7 @@ rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter) if (!err) return 0; - RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); error: rte_ring_free(rx_adapter->intr_ring); @@ -1644,12 +1644,12 @@ rxa_destroy_intr_thread(struct event_eth_rx_adapter *rx_adapter) err = pthread_cancel((pthread_t)rx_adapter->rx_intr_thread.opaque_id); if (err) - RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d\n", + RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d", err); err = rte_thread_join(rx_adapter->rx_intr_thread, NULL); if (err) - RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); rte_ring_free(rx_adapter->intr_ring); @@ -1915,7 +1915,7 @@ rxa_init_service(struct event_eth_rx_adapter *rx_adapter, uint8_t id) if (rte_mbuf_dyn_rx_timestamp_register( &event_eth_rx_timestamp_dynfield_offset, &event_eth_rx_timestamp_dynflag) != 0) { - RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf\n"); + RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf"); return -rte_errno; } @@ -2445,7 +2445,7 @@ rxa_create(uint8_t id, uint8_t dev_id, RTE_DIM(default_rss_key)); if (rx_adapter->eth_devices == NULL) { - RTE_EDEV_LOG_ERR("failed to get mem for eth devices\n"); + RTE_EDEV_LOG_ERR("failed to get mem for eth devices"); rte_free(rx_adapter); return -ENOMEM; } @@ -2497,12 +2497,12 @@ rxa_config_params_validate(struct rte_event_eth_rx_adapter_params *rxa_params, return 0; } else if (!rxa_params->use_queue_event_buf && rxa_params->event_buf_size == 0) { - RTE_EDEV_LOG_ERR("event buffer size can't be zero\n"); + RTE_EDEV_LOG_ERR("event buffer size can't be zero"); return -EINVAL; } else if (rxa_params->use_queue_event_buf && rxa_params->event_buf_size != 0) { RTE_EDEV_LOG_ERR("event buffer size needs to be configured " - "as part of queue add\n"); + "as part of queue add"); return -EINVAL; } @@ -3597,7 +3597,7 @@ handle_rxa_stats(const char *cmd __rte_unused, /* Get Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, &rx_adptr_stats)) { - RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats"); return -1; } @@ -3636,7 +3636,7 @@ handle_rxa_stats_reset(const char *cmd __rte_unused, /* Reset Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { - RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats"); return -1; } diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index 360d5caf6a..56435be991 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -334,7 +334,7 @@ txa_service_conf_cb(uint8_t __rte_unused id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, pc); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); if (started) { if (rte_event_dev_start(dev_id)) diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index 27466707bc..3f22e85173 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -106,7 +106,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to configure event dev %u\n", dev_id); + EVTIM_LOG_ERR("failed to configure event dev %u", dev_id); if (started) if (rte_event_dev_start(dev_id)) return -EIO; @@ -116,7 +116,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to setup event port %u on event dev %u\n", + EVTIM_LOG_ERR("failed to setup event port %u on event dev %u", port_id, dev_id); return ret; } diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index ae50821a3f..157752868d 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1007,13 +1007,13 @@ rte_event_port_profile_links_set(uint8_t dev_id, uint8_t port_id, const uint8_t } if (*dev->dev_ops->port_link == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } if (profile_id && *dev->dev_ops->port_link_profile == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } diff --git a/lib/metrics/rte_metrics_telemetry.c b/lib/metrics/rte_metrics_telemetry.c index 5be21b2e86..1d133e1f8c 100644 --- a/lib/metrics/rte_metrics_telemetry.c +++ b/lib/metrics/rte_metrics_telemetry.c @@ -363,7 +363,7 @@ rte_metrics_tel_stat_names_to_ids(const char * const *stat_names, } } if (j == num_metrics) { - METRICS_LOG_WARN("Invalid stat name %s\n", + METRICS_LOG_WARN("Invalid stat name %s", stat_names[i]); free(names); return -EINVAL; diff --git a/lib/mldev/rte_mldev.c b/lib/mldev/rte_mldev.c index cc5f2e0cc6..196b1850e6 100644 --- a/lib/mldev/rte_mldev.c +++ b/lib/mldev/rte_mldev.c @@ -159,7 +159,7 @@ int rte_ml_dev_init(size_t dev_max) { if (dev_max == 0 || dev_max > INT16_MAX) { - RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)\n", dev_max, INT16_MAX); + RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)", dev_max, INT16_MAX); rte_errno = EINVAL; return -rte_errno; } @@ -217,7 +217,7 @@ rte_ml_dev_socket_id(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -232,7 +232,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -241,7 +241,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) return -ENOTSUP; if (dev_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL", dev_id); return -EINVAL; } memset(dev_info, 0, sizeof(struct rte_ml_dev_info)); @@ -257,7 +257,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -271,7 +271,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) } if (config == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL", dev_id); return -EINVAL; } @@ -280,7 +280,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) return ret; if (config->nb_queue_pairs > dev_info.max_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u\n", dev_id, + RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u", dev_id, config->nb_queue_pairs, dev_info.max_queue_pairs); return -EINVAL; } @@ -294,7 +294,7 @@ rte_ml_dev_close(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -318,7 +318,7 @@ rte_ml_dev_start(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -345,7 +345,7 @@ rte_ml_dev_stop(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -372,7 +372,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -386,7 +386,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, } if (qp_conf == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL", dev_id); return -EINVAL; } @@ -404,7 +404,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -413,7 +413,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) return -ENOTSUP; if (stats == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL", dev_id); return -EINVAL; } memset(stats, 0, sizeof(struct rte_ml_dev_stats)); @@ -427,7 +427,7 @@ rte_ml_dev_stats_reset(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return; } @@ -445,7 +445,7 @@ rte_ml_dev_xstats_names_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, in struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -462,7 +462,7 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -471,12 +471,12 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i return -ENOTSUP; if (name == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL", dev_id); return -EINVAL; } if (value == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL", dev_id); return -EINVAL; } @@ -490,7 +490,7 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -499,12 +499,12 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t return -ENOTSUP; if (stat_ids == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL", dev_id); return -EINVAL; } if (values == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL", dev_id); return -EINVAL; } @@ -518,7 +518,7 @@ rte_ml_dev_xstats_reset(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_ struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -535,7 +535,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -544,7 +544,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) return -ENOTSUP; if (fd == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL", dev_id); return -EINVAL; } @@ -557,7 +557,7 @@ rte_ml_dev_selftest(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -574,7 +574,7 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -583,12 +583,12 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * return -ENOTSUP; if (params == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL", dev_id); return -EINVAL; } if (model_id == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL", dev_id); return -EINVAL; } @@ -601,7 +601,7 @@ rte_ml_model_unload(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -618,7 +618,7 @@ rte_ml_model_start(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -635,7 +635,7 @@ rte_ml_model_stop(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -652,7 +652,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -661,7 +661,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf return -ENOTSUP; if (model_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL\n", dev_id, + RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL", dev_id, model_id); return -EINVAL; } @@ -675,7 +675,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -684,7 +684,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) return -ENOTSUP; if (buffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL", dev_id); return -EINVAL; } @@ -698,7 +698,7 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -707,12 +707,12 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d return -ENOTSUP; if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -726,7 +726,7 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -735,12 +735,12 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * return -ENOTSUP; if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -811,7 +811,7 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -823,13 +823,13 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -847,7 +847,7 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -859,13 +859,13 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -883,7 +883,7 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -892,12 +892,12 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error return -ENOTSUP; if (op == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL", dev_id); return -EINVAL; } if (error == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL", dev_id); return -EINVAL; } #else diff --git a/lib/net/rte_net_crc.c b/lib/net/rte_net_crc.c index a685f9e7bb..900d6de7f4 100644 --- a/lib/net/rte_net_crc.c +++ b/lib/net/rte_net_crc.c @@ -179,7 +179,7 @@ avx512_vpclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_512) return handlers_avx512; #endif - NET_LOG(INFO, "Requirements not met, can't use AVX512\n"); + NET_LOG(INFO, "Requirements not met, can't use AVX512"); return NULL; } @@ -205,7 +205,7 @@ sse42_pclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_sse42; #endif - NET_LOG(INFO, "Requirements not met, can't use SSE\n"); + NET_LOG(INFO, "Requirements not met, can't use SSE"); return NULL; } @@ -231,7 +231,7 @@ neon_pmull_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_neon; #endif - NET_LOG(INFO, "Requirements not met, can't use NEON\n"); + NET_LOG(INFO, "Requirements not met, can't use NEON"); return NULL; } diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c index 3e8fac1df4..475eff6abe 100644 --- a/lib/node/ethdev_rx.c +++ b/lib/node/ethdev_rx.c @@ -160,13 +160,13 @@ ethdev_ptype_setup(uint16_t port, uint16_t queue) if (!l3_ipv4 || !l3_ipv6) { node_info("ethdev_rx", - "Enabling ptype callback for required ptypes on port %u\n", + "Enabling ptype callback for required ptypes on port %u", port); if (!rte_eth_add_rx_callback(port, queue, eth_pkt_parse_cb, NULL)) { node_err("ethdev_rx", - "Failed to add rx ptype cb: port=%d, queue=%d\n", + "Failed to add rx ptype cb: port=%d, queue=%d", port, queue); return -EINVAL; } diff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c index 0dbfde64fe..18955971f6 100644 --- a/lib/node/ip4_lookup.c +++ b/lib/node/ip4_lookup.c @@ -143,7 +143,7 @@ rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop, ip, depth, val); if (ret < 0) { node_err("ip4_lookup", - "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d\n", + "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/ip6_lookup.c b/lib/node/ip6_lookup.c index 6f56eb5ec5..309964f60f 100644 --- a/lib/node/ip6_lookup.c +++ b/lib/node/ip6_lookup.c @@ -283,7 +283,7 @@ rte_node_ip6_route_add(const uint8_t *ip, uint8_t depth, uint16_t next_hop, if (ret < 0) { node_err("ip6_lookup", "Unable to add entry %s / %d nh (%x) to LPM " - "table on sock %d, rc=%d\n", + "table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/kernel_rx.c b/lib/node/kernel_rx.c index 2dba7c8cc7..6c20cdbb1e 100644 --- a/lib/node/kernel_rx.c +++ b/lib/node/kernel_rx.c @@ -134,7 +134,7 @@ kernel_rx_node_do(struct rte_graph *graph, struct rte_node *node, kernel_rx_node if (len == 0 || len == 0xFFFF) { rte_pktmbuf_free(m); if (rx->idx <= 0) - node_dbg("kernel_rx", "rx_mbuf array is empty\n"); + node_dbg("kernel_rx", "rx_mbuf array is empty"); rx->idx--; break; } @@ -207,20 +207,20 @@ kernel_rx_node_init(const struct rte_graph *graph, struct rte_node *node) RTE_VERIFY(elem != NULL); if (ctx->pktmbuf_pool == NULL) { - node_err("kernel_rx", "Invalid mbuf pool on graph %s\n", graph->name); + node_err("kernel_rx", "Invalid mbuf pool on graph %s", graph->name); return -EINVAL; } recv_info = rte_zmalloc_socket("kernel_rx_info", sizeof(kernel_rx_info_t), RTE_CACHE_LINE_SIZE, graph->socket); if (!recv_info) { - node_err("kernel_rx", "Kernel recv_info is NULL\n"); + node_err("kernel_rx", "Kernel recv_info is NULL"); return -ENOMEM; } sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (sock < 0) { - node_err("kernel_rx", "Unable to open RAW socket\n"); + node_err("kernel_rx", "Unable to open RAW socket"); return sock; } diff --git a/lib/node/kernel_tx.c b/lib/node/kernel_tx.c index 27d1808c71..3a96741622 100644 --- a/lib/node/kernel_tx.c +++ b/lib/node/kernel_tx.c @@ -36,7 +36,7 @@ kernel_tx_process_mbuf(struct rte_node *node, struct rte_mbuf **mbufs, uint16_t sin.sin_addr.s_addr = ip4->dst_addr; if (sendto(ctx->sock, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)) < 0) - node_err("kernel_tx", "Unable to send packets: %s\n", strerror(errno)); + node_err("kernel_tx", "Unable to send packets: %s", strerror(errno)); } } @@ -87,7 +87,7 @@ kernel_tx_node_init(const struct rte_graph *graph __rte_unused, struct rte_node ctx->sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (ctx->sock < 0) - node_err("kernel_tx", "Unable to open RAW socket\n"); + node_err("kernel_tx", "Unable to open RAW socket"); return 0; } diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c index a9f3d6cc98..41a44be4b9 100644 --- a/lib/rcu/rte_rcu_qsbr.c +++ b/lib/rcu/rte_rcu_qsbr.c @@ -92,7 +92,7 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; @@ -144,7 +144,7 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index 5979fb0efb..6b908e7ee0 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -299,7 +299,7 @@ rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Copy the current value of token. @@ -350,7 +350,7 @@ rte_rcu_qsbr_thread_offline(struct rte_rcu_qsbr *v, unsigned int thread_id) { RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* The reader can go offline only after the load of the @@ -427,7 +427,7 @@ rte_rcu_qsbr_unlock(__rte_unused struct rte_rcu_qsbr *v, 1, rte_memory_order_release); __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, WARNING, - "Lock counter %u. Nested locks?\n", + "Lock counter %u. Nested locks?", v->qsbr_cnt[thread_id].lock_cnt); #endif } @@ -481,7 +481,7 @@ rte_rcu_qsbr_quiescent(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Acquire the changes to the shared data structure released diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c index 1fabec2bfe..1dab6d6645 100644 --- a/lib/stack/rte_stack.c +++ b/lib/stack/rte_stack.c @@ -56,7 +56,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, int ret; if (flags & ~(RTE_STACK_F_LF)) { - STACK_LOG_ERR("Unsupported stack flags %#x\n", flags); + STACK_LOG_ERR("Unsupported stack flags %#x", flags); return NULL; } @@ -65,7 +65,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, #endif #if !defined(RTE_STACK_LF_SUPPORTED) if (flags & RTE_STACK_F_LF) { - STACK_LOG_ERR("Lock-free stack is not supported on your platform\n"); + STACK_LOG_ERR("Lock-free stack is not supported on your platform"); rte_errno = ENOTSUP; return NULL; } @@ -82,7 +82,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, te = rte_zmalloc("STACK_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { - STACK_LOG_ERR("Cannot reserve memory for tailq\n"); + STACK_LOG_ERR("Cannot reserve memory for tailq"); rte_errno = ENOMEM; return NULL; } @@ -92,7 +92,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, mz = rte_memzone_reserve_aligned(mz_name, sz, socket_id, 0, __alignof__(*s)); if (mz == NULL) { - STACK_LOG_ERR("Cannot reserve stack memzone!\n"); + STACK_LOG_ERR("Cannot reserve stack memzone!"); rte_mcfg_tailq_write_unlock(); rte_free(te); return NULL; diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c index 3e1ef1ac25..6e5443e5f8 100644 --- a/lib/vhost/vhost_crypto.c +++ b/lib/vhost/vhost_crypto.c @@ -245,7 +245,7 @@ transform_cipher_param(struct rte_crypto_sym_xform *xform, return ret; if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) { - VC_LOG_DBG("Invalid cipher key length\n"); + VC_LOG_DBG("Invalid cipher key length"); return -VIRTIO_CRYPTO_BADMSG; } @@ -301,7 +301,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms, return ret; if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) { - VC_LOG_DBG("Invalid cipher key length\n"); + VC_LOG_DBG("Invalid cipher key length"); return -VIRTIO_CRYPTO_BADMSG; } @@ -321,7 +321,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms, return ret; if (param->auth_key_len > VHOST_USER_CRYPTO_MAX_HMAC_KEY_LENGTH) { - VC_LOG_DBG("Invalid auth key length\n"); + VC_LOG_DBG("Invalid auth key length"); return -VIRTIO_CRYPTO_BADMSG; } -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 05/14] lib: remove redundant newline from logs 2023-12-08 14:59 ` [RFC v2 05/14] lib: remove redundant newline from logs David Marchand @ 2023-12-08 17:02 ` Stephen Hemminger 2023-12-09 7:15 ` fengchengwen 2023-12-11 8:48 ` Mattias Rönnblom 2 siblings, 0 replies; 39+ messages in thread From: Stephen Hemminger @ 2023-12-08 17:02 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, mb, stable, Kai Ji, Pablo de Lara, Nicolas Chautru, Cristian Dumitrescu, Fan Zhang, Ashish Gupta, Akhil Goyal, Mattias Rönnblom, Chengwen Feng, Kevin Laatz, Dmitry Kozlyuk, Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam, Jerin Jacob, Abhinandan Gujjar, Amit Prakash Shukla, Naga Harish K S V, Erik Gabriel Carrillo, Srikanth Yalavarthi, Jasvinder Singh, Nithin Dabilpuram, Pavan Nikhilesh, Honnappa Nagarahalli, Maxime Coquelin, Chenbo Xia On Fri, 8 Dec 2023 15:59:39 +0100 David Marchand <david.marchand@redhat.com> wrote: > Fix places where two newline characters may be logged. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > --- > Changes since RFC v1: > - split fixes on direct calls to printf or RTE_LOG in a previous patch, > > --- > drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 2 +- > lib/bbdev/rte_bbdev.c | 6 +- > lib/cfgfile/rte_cfgfile.c | 14 ++-- > lib/compressdev/rte_compressdev_pmd.c | 4 +- > lib/cryptodev/rte_cryptodev.c | 2 +- > lib/dispatcher/rte_dispatcher.c | 12 +-- > lib/dmadev/rte_dmadev.c | 2 +- > lib/eal/windows/eal_memory.c | 2 +- > lib/eventdev/eventdev_pmd.h | 6 +- > lib/eventdev/rte_event_crypto_adapter.c | 12 +-- > lib/eventdev/rte_event_dma_adapter.c | 14 ++-- > lib/eventdev/rte_event_eth_rx_adapter.c | 28 +++---- > lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- > lib/eventdev/rte_event_timer_adapter.c | 4 +- > lib/eventdev/rte_eventdev.c | 4 +- > lib/metrics/rte_metrics_telemetry.c | 2 +- > lib/mldev/rte_mldev.c | 102 ++++++++++++------------ > lib/net/rte_net_crc.c | 6 +- > lib/node/ethdev_rx.c | 4 +- > lib/node/ip4_lookup.c | 2 +- > lib/node/ip6_lookup.c | 2 +- > lib/node/kernel_rx.c | 8 +- > lib/node/kernel_tx.c | 4 +- > lib/rcu/rte_rcu_qsbr.c | 4 +- > lib/rcu/rte_rcu_qsbr.h | 8 +- > lib/stack/rte_stack.c | 8 +- > lib/vhost/vhost_crypto.c | 6 +- > 27 files changed, 135 insertions(+), 135 deletions(-) Acked-by: Stephen Hemminger <stephen@networkplumber.org> ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 05/14] lib: remove redundant newline from logs 2023-12-08 14:59 ` [RFC v2 05/14] lib: remove redundant newline from logs David Marchand 2023-12-08 17:02 ` Stephen Hemminger @ 2023-12-09 7:15 ` fengchengwen 2023-12-11 8:48 ` Mattias Rönnblom 2 siblings, 0 replies; 39+ messages in thread From: fengchengwen @ 2023-12-09 7:15 UTC (permalink / raw) To: David Marchand, dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Kai Ji, Pablo de Lara, Nicolas Chautru, Cristian Dumitrescu, Fan Zhang, Ashish Gupta, Akhil Goyal, Mattias Rönnblom, Kevin Laatz, Dmitry Kozlyuk, Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam, Jerin Jacob, Abhinandan Gujjar, Amit Prakash Shukla, Naga Harish K S V, Erik Gabriel Carrillo, Srikanth Yalavarthi, Jasvinder Singh, Nithin Dabilpuram, Pavan Nikhilesh, Honnappa Nagarahalli, Maxime Coquelin, Chenbo Xia For lib/dmadev part Reviewed-by: Chengwen Feng <fengchengwen@huawei.com> On 2023/12/8 22:59, David Marchand wrote: > Fix places where two newline characters may be logged. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > --- > Changes since RFC v1: > - split fixes on direct calls to printf or RTE_LOG in a previous patch, > > --- > drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 2 +- > lib/bbdev/rte_bbdev.c | 6 +- > lib/cfgfile/rte_cfgfile.c | 14 ++-- > lib/compressdev/rte_compressdev_pmd.c | 4 +- > lib/cryptodev/rte_cryptodev.c | 2 +- > lib/dispatcher/rte_dispatcher.c | 12 +-- > lib/dmadev/rte_dmadev.c | 2 +- > lib/eal/windows/eal_memory.c | 2 +- > lib/eventdev/eventdev_pmd.h | 6 +- > lib/eventdev/rte_event_crypto_adapter.c | 12 +-- > lib/eventdev/rte_event_dma_adapter.c | 14 ++-- > lib/eventdev/rte_event_eth_rx_adapter.c | 28 +++---- > lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- > lib/eventdev/rte_event_timer_adapter.c | 4 +- > lib/eventdev/rte_eventdev.c | 4 +- > lib/metrics/rte_metrics_telemetry.c | 2 +- > lib/mldev/rte_mldev.c | 102 ++++++++++++------------ > lib/net/rte_net_crc.c | 6 +- > lib/node/ethdev_rx.c | 4 +- > lib/node/ip4_lookup.c | 2 +- > lib/node/ip6_lookup.c | 2 +- > lib/node/kernel_rx.c | 8 +- > lib/node/kernel_tx.c | 4 +- > lib/rcu/rte_rcu_qsbr.c | 4 +- > lib/rcu/rte_rcu_qsbr.h | 8 +- > lib/stack/rte_stack.c | 8 +- > lib/vhost/vhost_crypto.c | 6 +- > 27 files changed, 135 insertions(+), 135 deletions(-) > ... ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [RFC v2 05/14] lib: remove redundant newline from logs 2023-12-08 14:59 ` [RFC v2 05/14] lib: remove redundant newline from logs David Marchand 2023-12-08 17:02 ` Stephen Hemminger 2023-12-09 7:15 ` fengchengwen @ 2023-12-11 8:48 ` Mattias Rönnblom 2 siblings, 0 replies; 39+ messages in thread From: Mattias Rönnblom @ 2023-12-11 8:48 UTC (permalink / raw) To: David Marchand, dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Kai Ji, Pablo de Lara, Nicolas Chautru, Cristian Dumitrescu, Fan Zhang, Ashish Gupta, Akhil Goyal, Mattias Rönnblom, Chengwen Feng, Kevin Laatz, Dmitry Kozlyuk, Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam, Jerin Jacob, Abhinandan Gujjar, Amit Prakash Shukla, Naga Harish K S V, Erik Gabriel Carrillo, Srikanth Yalavarthi, Jasvinder Singh, Nithin Dabilpuram, Pavan Nikhilesh, Honnappa Nagarahalli, Maxime Coquelin, Chenbo Xia On 2023-12-08 15:59, David Marchand wrote: > Fix places where two newline characters may be logged. > > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > --- > Changes since RFC v1: > - split fixes on direct calls to printf or RTE_LOG in a previous patch, > > --- > drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 2 +- > lib/bbdev/rte_bbdev.c | 6 +- > lib/cfgfile/rte_cfgfile.c | 14 ++-- > lib/compressdev/rte_compressdev_pmd.c | 4 +- > lib/cryptodev/rte_cryptodev.c | 2 +- > lib/dispatcher/rte_dispatcher.c | 12 +-- > lib/dmadev/rte_dmadev.c | 2 +- > lib/eal/windows/eal_memory.c | 2 +- > lib/eventdev/eventdev_pmd.h | 6 +- > lib/eventdev/rte_event_crypto_adapter.c | 12 +-- > lib/eventdev/rte_event_dma_adapter.c | 14 ++-- > lib/eventdev/rte_event_eth_rx_adapter.c | 28 +++---- > lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- > lib/eventdev/rte_event_timer_adapter.c | 4 +- > lib/eventdev/rte_eventdev.c | 4 +- > lib/metrics/rte_metrics_telemetry.c | 2 +- > lib/mldev/rte_mldev.c | 102 ++++++++++++------------ > lib/net/rte_net_crc.c | 6 +- > lib/node/ethdev_rx.c | 4 +- > lib/node/ip4_lookup.c | 2 +- > lib/node/ip6_lookup.c | 2 +- > lib/node/kernel_rx.c | 8 +- > lib/node/kernel_tx.c | 4 +- > lib/rcu/rte_rcu_qsbr.c | 4 +- > lib/rcu/rte_rcu_qsbr.h | 8 +- > lib/stack/rte_stack.c | 8 +- > lib/vhost/vhost_crypto.c | 6 +- > 27 files changed, 135 insertions(+), 135 deletions(-) > Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> ^ permalink raw reply [flat|nested] 39+ messages in thread
[parent not found: <20231218092738.749604-1-david.marchand@redhat.com>]
* [PATCH v3 01/14] hash: remove some dead code [not found] ` <20231218092738.749604-1-david.marchand@redhat.com> @ 2023-12-18 9:27 ` David Marchand 2023-12-18 9:27 ` [PATCH v3 02/14] regexdev: fix logtype register David Marchand ` (3 subsequent siblings) 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-18 9:27 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Yipeng Wang, Sameh Gobriel, Vladimir Medvedkin, Ray Kinsella, Dharmik Thakkar, Ruifeng Wang This macro is not used. Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> --- lib/hash/rte_cuckoo_hash.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h index f7afc4dd79..8ea793c66e 100644 --- a/lib/hash/rte_cuckoo_hash.h +++ b/lib/hash/rte_cuckoo_hash.h @@ -29,17 +29,6 @@ #define RETURN_IF_TRUE(cond, retval) #endif -#if defined(RTE_LIBRTE_HASH_DEBUG) -#define ERR_IF_TRUE(cond, fmt, args...) do { \ - if (cond) { \ - RTE_LOG(ERR, HASH, fmt, ##args); \ - return; \ - } \ -} while (0) -#else -#define ERR_IF_TRUE(cond, fmt, args...) -#endif - #include <rte_hash_crc.h> #include <rte_jhash.h> -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v3 02/14] regexdev: fix logtype register [not found] ` <20231218092738.749604-1-david.marchand@redhat.com> 2023-12-18 9:27 ` [PATCH v3 01/14] hash: remove some dead code David Marchand @ 2023-12-18 9:27 ` David Marchand 2023-12-18 9:27 ` [PATCH v3 03/14] lib: use dedicated logtypes and macros David Marchand ` (2 subsequent siblings) 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-18 9:27 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Ori Kam, Parav Pandit, Guy Kaneti This library logtype was not initialized so its logs would end up under the 0 logtype, iow, RTE_LOGTYPE_EAL. Fixes: b25246beaefc ("regexdev: add core functions") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Ori Kam <orika@nvidia.com> --- lib/regexdev/rte_regexdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c index caec069182..d38a85eb0b 100644 --- a/lib/regexdev/rte_regexdev.c +++ b/lib/regexdev/rte_regexdev.c @@ -19,7 +19,7 @@ static struct { struct rte_regexdev_data data[RTE_MAX_REGEXDEV_DEVS]; } *rte_regexdev_shared_data; -int rte_regexdev_logtype; +RTE_LOG_REGISTER_DEFAULT(rte_regexdev_logtype, INFO); static uint16_t regexdev_find_free_dev(void) -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v3 03/14] lib: use dedicated logtypes and macros [not found] ` <20231218092738.749604-1-david.marchand@redhat.com> 2023-12-18 9:27 ` [PATCH v3 01/14] hash: remove some dead code David Marchand 2023-12-18 9:27 ` [PATCH v3 02/14] regexdev: fix logtype register David Marchand @ 2023-12-18 9:27 ` David Marchand 2023-12-18 9:27 ` [PATCH v3 04/14] lib: add newline in logs David Marchand 2023-12-18 9:27 ` [PATCH v3 05/14] lib: remove redundant newline from logs David Marchand 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-18 9:27 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Andrew Rybchenko, Akhil Goyal, Fan Zhang, Amit Prakash Shukla, Jerin Jacob, Naga Harish K S V 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. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> --- 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_dma_adapter.c | 4 ++-- lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++++------ lib/eventdev/rte_eventdev.c | 6 +++--- lib/mempool/rte_mempool_ops.c | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 25e3ec12d1..ead8c9a623 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2684,7 +2684,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 fff4b7b4cd..55a9dcc565 100644 --- a/lib/ethdev/ethdev_driver.c +++ b/lib/ethdev/ethdev_driver.c @@ -487,7 +487,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; @@ -713,7 +713,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 e98b7188b0..0e1c7b23c1 100644 --- a/lib/ethdev/ethdev_private.c +++ b/lib/ethdev/ethdev_private.c @@ -182,7 +182,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_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; } } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 6db03adf04..82ae31712d 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -314,9 +314,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; \ } \ @@ -3671,7 +3671,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); @@ -3743,7 +3743,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); @@ -3813,7 +3813,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); @@ -3868,7 +3868,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 0ca32d6721..ae50821a3f 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1428,8 +1428,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; } @@ -1444,7 +1444,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 ae1d288f27..e871de9ec9 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.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v3 04/14] lib: add newline in logs [not found] ` <20231218092738.749604-1-david.marchand@redhat.com> ` (2 preceding siblings ...) 2023-12-18 9:27 ` [PATCH v3 03/14] lib: use dedicated logtypes and macros David Marchand @ 2023-12-18 9:27 ` David Marchand 2023-12-18 9:27 ` [PATCH v3 05/14] lib: remove redundant newline from logs David Marchand 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-18 9:27 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Andrew Rybchenko, Harman Kalra, Vladimir Medvedkin, Anatoly Burakov, David Hunt, Sivaprasad Tummala Fix places leading to a log message not terminated with a newline. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> --- lib/eal/common/eal_common_options.c | 2 +- lib/eal/linux/eal_hugepage_info.c | 2 +- lib/eal/linux/eal_interrupts.c | 2 +- lib/ethdev/ethdev_pci.h | 2 +- lib/ethdev/rte_ethdev.c | 40 ++++++++++++++--------------- lib/lpm/rte_lpm6.c | 6 ++--- lib/power/guest_channel.c | 2 +- lib/power/rte_power_pmd_mgmt.c | 6 ++--- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index a6d21f1cba..e9ba01fb89 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -2141,7 +2141,7 @@ rte_vect_set_max_simd_bitwidth(uint16_t bitwidth) struct internal_config *internal_conf = eal_get_internal_configuration(); if (internal_conf->max_simd_bitwidth.forced) { - RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled"); + RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled\n"); return -EPERM; } diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c index 581d9dfc91..36a495fb1f 100644 --- a/lib/eal/linux/eal_hugepage_info.c +++ b/lib/eal/linux/eal_hugepage_info.c @@ -403,7 +403,7 @@ inspect_hugedir_cb(const struct walk_hugedir_data *whd) struct stat st; if (fstat(whd->file_fd, &st) < 0) - RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s", + RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s\n", __func__, whd->file_name, strerror(errno)); else (*total_size) += st.st_size; diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index d4919dff45..eabac24992 100644 --- a/lib/eal/linux/eal_interrupts.c +++ b/lib/eal/linux/eal_interrupts.c @@ -1542,7 +1542,7 @@ rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd) /* only check, initialization would be done in vdev driver.*/ if ((uint64_t)rte_intr_efd_counter_size_get(intr_handle) > sizeof(union rte_intr_read_buffer)) { - RTE_LOG(ERR, EAL, "the efd_counter_size is oversized"); + RTE_LOG(ERR, EAL, "the efd_counter_size is oversized\n"); return -EINVAL; } } else { diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h index 320e3e0093..ddb559aa95 100644 --- a/lib/ethdev/ethdev_pci.h +++ b/lib/ethdev/ethdev_pci.h @@ -31,7 +31,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev) { if ((eth_dev == NULL) || (pci_dev == NULL)) { - RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p", + RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p\n", (void *)eth_dev, (void *)pci_dev); return; } diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 3858983fcc..b9d99ece15 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -724,7 +724,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) uint16_t pid; if (name == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name"); + RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name\n"); return -EINVAL; } @@ -2394,41 +2394,41 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, nb_rx_desc = cap.max_nb_desc; if (nb_rx_desc > cap.max_nb_desc) { RTE_ETHDEV_LOG(ERR, - "Invalid value for nb_rx_desc(=%hu), should be: <= %hu", + "Invalid value for nb_rx_desc(=%hu), should be: <= %hu\n", nb_rx_desc, cap.max_nb_desc); return -EINVAL; } if (conf->peer_count > cap.max_rx_2_tx) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Rx queue(=%u), should be: <= %hu", + "Invalid value for number of peers for Rx queue(=%u), should be: <= %hu\n", conf->peer_count, cap.max_rx_2_tx); return -EINVAL; } if (conf->use_locked_device_memory && !cap.rx_cap.locked_device_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use locked device memory for Rx queue, which is not supported"); + "Attempt to use locked device memory for Rx queue, which is not supported\n"); return -EINVAL; } if (conf->use_rte_memory && !cap.rx_cap.rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use DPDK memory for Rx queue, which is not supported"); + "Attempt to use DPDK memory for Rx queue, which is not supported\n"); return -EINVAL; } if (conf->use_locked_device_memory && conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use mutually exclusive memory settings for Rx queue"); + "Attempt to use mutually exclusive memory settings for Rx queue\n"); return -EINVAL; } if (conf->force_memory && !conf->use_locked_device_memory && !conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to force Rx queue memory settings, but none is set"); + "Attempt to force Rx queue memory settings, but none is set\n"); return -EINVAL; } if (conf->peer_count == 0) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Rx queue(=%u), should be: > 0", + "Invalid value for number of peers for Rx queue(=%u), should be: > 0\n", conf->peer_count); return -EINVAL; } @@ -2438,7 +2438,7 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, count++; } if (count > cap.max_nb_queues) { - RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d", + RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d\n", cap.max_nb_queues); return -EINVAL; } @@ -2597,41 +2597,41 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, nb_tx_desc = cap.max_nb_desc; if (nb_tx_desc > cap.max_nb_desc) { RTE_ETHDEV_LOG(ERR, - "Invalid value for nb_tx_desc(=%hu), should be: <= %hu", + "Invalid value for nb_tx_desc(=%hu), should be: <= %hu\n", nb_tx_desc, cap.max_nb_desc); return -EINVAL; } if (conf->peer_count > cap.max_tx_2_rx) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Tx queue(=%u), should be: <= %hu", + "Invalid value for number of peers for Tx queue(=%u), should be: <= %hu\n", conf->peer_count, cap.max_tx_2_rx); return -EINVAL; } if (conf->use_locked_device_memory && !cap.tx_cap.locked_device_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use locked device memory for Tx queue, which is not supported"); + "Attempt to use locked device memory for Tx queue, which is not supported\n"); return -EINVAL; } if (conf->use_rte_memory && !cap.tx_cap.rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use DPDK memory for Tx queue, which is not supported"); + "Attempt to use DPDK memory for Tx queue, which is not supported\n"); return -EINVAL; } if (conf->use_locked_device_memory && conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use mutually exclusive memory settings for Tx queue"); + "Attempt to use mutually exclusive memory settings for Tx queue\n"); return -EINVAL; } if (conf->force_memory && !conf->use_locked_device_memory && !conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to force Tx queue memory settings, but none is set"); + "Attempt to force Tx queue memory settings, but none is set\n"); return -EINVAL; } if (conf->peer_count == 0) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Tx queue(=%u), should be: > 0", + "Invalid value for number of peers for Tx queue(=%u), should be: > 0\n", conf->peer_count); return -EINVAL; } @@ -2641,7 +2641,7 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, count++; } if (count > cap.max_nb_queues) { - RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d", + RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d\n", cap.max_nb_queues); return -EINVAL; } @@ -6716,7 +6716,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, } if (reassembly_capa == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL"); + RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL\n"); return -EINVAL; } @@ -6752,7 +6752,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, } if (conf == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL"); + RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL\n"); return -EINVAL; } @@ -6780,7 +6780,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (dev->data->dev_configured == 0) { RTE_ETHDEV_LOG(ERR, "Device with port_id=%u is not configured.\n" - "Cannot set IP reassembly configuration", + "Cannot set IP reassembly configuration\n", port_id); return -EINVAL; } diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c index 873cc8bc26..24ce7dd022 100644 --- a/lib/lpm/rte_lpm6.c +++ b/lib/lpm/rte_lpm6.c @@ -280,7 +280,7 @@ rte_lpm6_create(const char *name, int socket_id, rules_tbl = rte_hash_create(&rule_hash_tbl_params); if (rules_tbl == NULL) { - RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); goto fail_wo_unlock; } @@ -290,7 +290,7 @@ rte_lpm6_create(const char *name, int socket_id, sizeof(uint32_t) * config->number_tbl8s, RTE_CACHE_LINE_SIZE); if (tbl8_pool == NULL) { - RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); rte_errno = ENOMEM; goto fail_wo_unlock; @@ -301,7 +301,7 @@ rte_lpm6_create(const char *name, int socket_id, sizeof(struct rte_lpm_tbl8_hdr) * config->number_tbl8s, RTE_CACHE_LINE_SIZE); if (tbl8_hdrs == NULL) { - RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); rte_errno = ENOMEM; goto fail_wo_unlock; diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c index cc05347425..a6f2097d5b 100644 --- a/lib/power/guest_channel.c +++ b/lib/power/guest_channel.c @@ -90,7 +90,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id) flags |= O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) < 0) { RTE_LOG(ERR, GUEST_CHANNEL, "Failed on setting non-blocking mode for " - "file %s", fd_path); + "file %s\n", fd_path); goto error; } /* QEMU needs a delay after connection */ diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c index 38f8384085..6f18ed0adf 100644 --- a/lib/power/rte_power_pmd_mgmt.c +++ b/lib/power/rte_power_pmd_mgmt.c @@ -686,7 +686,7 @@ int rte_power_pmd_mgmt_set_pause_duration(unsigned int duration) { if (duration == 0) { - RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged"); + RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged\n"); return -EINVAL; } pause_duration = duration; @@ -709,7 +709,7 @@ rte_power_pmd_mgmt_set_scaling_freq_min(unsigned int lcore, unsigned int min) } if (min > scale_freq_max[lcore]) { - RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency"); + RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency\n"); return -EINVAL; } scale_freq_min[lcore] = min; @@ -729,7 +729,7 @@ rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max) if (max == 0) max = UINT32_MAX; if (max < scale_freq_min[lcore]) { - RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency"); + RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency\n"); return -EINVAL; } -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v3 05/14] lib: remove redundant newline from logs [not found] ` <20231218092738.749604-1-david.marchand@redhat.com> ` (3 preceding siblings ...) 2023-12-18 9:27 ` [PATCH v3 04/14] lib: add newline in logs David Marchand @ 2023-12-18 9:27 ` David Marchand 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-18 9:27 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Chengwen Feng, Mattias Rönnblom, Kai Ji, Pablo de Lara, Nicolas Chautru, Cristian Dumitrescu, Fan Zhang, Ashish Gupta, Akhil Goyal, Kevin Laatz, Dmitry Kozlyuk, Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam, Jerin Jacob, Abhinandan Gujjar, Amit Prakash Shukla, Naga Harish K S V, Erik Gabriel Carrillo, Srikanth Yalavarthi, Jasvinder Singh, Nithin Dabilpuram, Pavan Nikhilesh, Honnappa Nagarahalli, Maxime Coquelin, Chenbo Xia Fix places where two newline characters may be logged. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> --- Changes since RFC v1: - split fixes on direct calls to printf or RTE_LOG in a previous patch, --- drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 2 +- lib/bbdev/rte_bbdev.c | 6 +- lib/cfgfile/rte_cfgfile.c | 14 ++-- lib/compressdev/rte_compressdev_pmd.c | 4 +- lib/cryptodev/rte_cryptodev.c | 2 +- lib/dispatcher/rte_dispatcher.c | 12 +-- lib/dmadev/rte_dmadev.c | 2 +- lib/eal/windows/eal_memory.c | 2 +- lib/eventdev/eventdev_pmd.h | 6 +- lib/eventdev/rte_event_crypto_adapter.c | 12 +-- lib/eventdev/rte_event_dma_adapter.c | 14 ++-- lib/eventdev/rte_event_eth_rx_adapter.c | 28 +++---- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- lib/eventdev/rte_event_timer_adapter.c | 4 +- lib/eventdev/rte_eventdev.c | 4 +- lib/metrics/rte_metrics_telemetry.c | 2 +- lib/mldev/rte_mldev.c | 102 ++++++++++++------------ lib/net/rte_net_crc.c | 6 +- lib/node/ethdev_rx.c | 4 +- lib/node/ip4_lookup.c | 2 +- lib/node/ip6_lookup.c | 2 +- lib/node/kernel_rx.c | 8 +- lib/node/kernel_tx.c | 4 +- lib/rcu/rte_rcu_qsbr.c | 4 +- lib/rcu/rte_rcu_qsbr.h | 8 +- lib/stack/rte_stack.c | 8 +- lib/vhost/vhost_crypto.c | 6 +- 27 files changed, 135 insertions(+), 135 deletions(-) diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c index 52d6d010c7..f21f9cc5a0 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c +++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c @@ -407,7 +407,7 @@ ipsec_mb_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer) resp_param->result = ipsec_mb_qp_release(dev, qp_id); break; default: - CDEV_LOG_ERR("invalid mp request type\n"); + CDEV_LOG_ERR("invalid mp request type"); } out: diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index cfebea09c7..e09bb97abb 100644 --- a/lib/bbdev/rte_bbdev.c +++ b/lib/bbdev/rte_bbdev.c @@ -1106,12 +1106,12 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, intr_handle = dev->intr_handle; if (intr_handle == NULL) { - rte_bbdev_log(ERR, "Device %u intr handle unset\n", dev_id); + rte_bbdev_log(ERR, "Device %u intr handle unset", dev_id); return -ENOTSUP; } if (queue_id >= RTE_MAX_RXTX_INTR_VEC_ID) { - rte_bbdev_log(ERR, "Device %u queue_id %u is too big\n", + rte_bbdev_log(ERR, "Device %u queue_id %u is too big", dev_id, queue_id); return -ENOTSUP; } @@ -1120,7 +1120,7 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, ret = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); if (ret && (ret != -EEXIST)) { rte_bbdev_log(ERR, - "dev %u q %u int ctl error op %d epfd %d vec %u\n", + "dev %u q %u int ctl error op %d epfd %d vec %u", dev_id, queue_id, op, epfd, vec); return ret; } diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c index eefba6e408..2f9cc0722a 100644 --- a/lib/cfgfile/rte_cfgfile.c +++ b/lib/cfgfile/rte_cfgfile.c @@ -137,7 +137,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) unsigned int i; if (!params) { - CFG_LOG(ERR, "missing cfgfile parameters\n"); + CFG_LOG(ERR, "missing cfgfile parameters"); return -EINVAL; } @@ -150,7 +150,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) } if (valid_comment == 0) { - CFG_LOG(ERR, "invalid comment characters %c\n", + CFG_LOG(ERR, "invalid comment characters %c", params->comment_character); return -ENOTSUP; } @@ -188,7 +188,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, lineno++; if ((len >= sizeof(buffer) - 1) && (buffer[len-1] != '\n')) { CFG_LOG(ERR, " line %d - no \\n found on string. " - "Check if line too long\n", lineno); + "Check if line too long", lineno); goto error1; } /* skip parsing if comment character found */ @@ -209,7 +209,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, char *end = memchr(buffer, ']', len); if (end == NULL) { CFG_LOG(ERR, - "line %d - no terminating ']' character found\n", + "line %d - no terminating ']' character found", lineno); goto error1; } @@ -225,7 +225,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, split[1] = memchr(buffer, '=', len); if (split[1] == NULL) { CFG_LOG(ERR, - "line %d - no '=' character found\n", + "line %d - no '=' character found", lineno); goto error1; } @@ -249,7 +249,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, if (!(flags & CFG_FLAG_EMPTY_VALUES) && (*split[1] == '\0')) { CFG_LOG(ERR, - "line %d - cannot use empty values\n", + "line %d - cannot use empty values", lineno); goto error1; } @@ -414,7 +414,7 @@ int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname, return 0; } - CFG_LOG(ERR, "entry name doesn't exist\n"); + CFG_LOG(ERR, "entry name doesn't exist"); return -EINVAL; } diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c index 156bccd972..762b44f03e 100644 --- a/lib/compressdev/rte_compressdev_pmd.c +++ b/lib/compressdev/rte_compressdev_pmd.c @@ -100,12 +100,12 @@ rte_compressdev_pmd_create(const char *name, struct rte_compressdev *compressdev; if (params->name[0] != '\0') { - COMPRESSDEV_LOG(INFO, "User specified device name = %s\n", + COMPRESSDEV_LOG(INFO, "User specified device name = %s", params->name); name = params->name; } - COMPRESSDEV_LOG(INFO, "Creating compressdev %s\n", name); + COMPRESSDEV_LOG(INFO, "Creating compressdev %s", name); COMPRESSDEV_LOG(INFO, "Init parameters - name: %s, socket id: %d", name, params->socket_id); diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index ead8c9a623..b233c0ecd7 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2074,7 +2074,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id, } if (xforms == NULL) { - CDEV_LOG_ERR("Invalid xform\n"); + CDEV_LOG_ERR("Invalid xform"); rte_errno = EINVAL; return NULL; } diff --git a/lib/dispatcher/rte_dispatcher.c b/lib/dispatcher/rte_dispatcher.c index 10d02edde9..95dd41b818 100644 --- a/lib/dispatcher/rte_dispatcher.c +++ b/lib/dispatcher/rte_dispatcher.c @@ -246,7 +246,7 @@ evd_service_register(struct rte_dispatcher *dispatcher) rc = rte_service_component_register(&service, &dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Registration of dispatcher service " - "%s failed with error code %d\n", + "%s failed with error code %d", service.name, rc); return rc; @@ -260,7 +260,7 @@ evd_service_unregister(struct rte_dispatcher *dispatcher) rc = rte_service_component_unregister(dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Unregistration of dispatcher service " - "failed with error code %d\n", rc); + "failed with error code %d", rc); return rc; } @@ -279,7 +279,7 @@ rte_dispatcher_create(uint8_t event_dev_id) RTE_CACHE_LINE_SIZE, socket_id); if (dispatcher == NULL) { - RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher\n"); + RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher"); rte_errno = ENOMEM; return NULL; } @@ -483,7 +483,7 @@ evd_lcore_uninstall_handler(struct rte_dispatcher_lcore *lcore, unreg_handler = evd_lcore_get_handler_by_id(lcore, handler_id); if (unreg_handler == NULL) { - RTE_EDEV_LOG_ERR("Invalid handler id %d\n", handler_id); + RTE_EDEV_LOG_ERR("Invalid handler id %d", handler_id); return -EINVAL; } @@ -602,7 +602,7 @@ rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher, unreg_finalizer = evd_get_finalizer_by_id(dispatcher, finalizer_id); if (unreg_finalizer == NULL) { - RTE_EDEV_LOG_ERR("Invalid finalizer id %d\n", finalizer_id); + RTE_EDEV_LOG_ERR("Invalid finalizer id %d", finalizer_id); return -EINVAL; } @@ -636,7 +636,7 @@ evd_set_service_runstate(struct rte_dispatcher *dispatcher, int state) */ if (rc != 0) RTE_EDEV_LOG_ERR("Unexpected error %d occurred while setting " - "service component run state to %d\n", rc, + "service component run state to %d", rc, state); RTE_VERIFY(rc == 0); diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 4e5e420c82..009a21849a 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -726,7 +726,7 @@ rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status * return -EINVAL; if (vchan >= dev->data->dev_conf.nb_vchans) { - RTE_DMA_LOG(ERR, "Device %u vchan %u out of range\n", dev_id, vchan); + RTE_DMA_LOG(ERR, "Device %u vchan %u out of range", dev_id, vchan); return -EINVAL; } diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c index 31410a41fd..fd39155163 100644 --- a/lib/eal/windows/eal_memory.c +++ b/lib/eal/windows/eal_memory.c @@ -110,7 +110,7 @@ eal_mem_win32api_init(void) VirtualAlloc2_ptr = (VirtualAlloc2_type)( (void *)GetProcAddress(library, function)); if (VirtualAlloc2_ptr == NULL) { - RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")\n", + RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")", library_name, function); /* Contrary to the docs, Server 2016 is not supported. */ diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index 30bd90085c..2ec5aec0a8 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -49,14 +49,14 @@ extern "C" { /* Macros to check for valid device */ #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return retval; \ } \ } while (0) #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ rte_errno = errno; \ return retval; \ } \ @@ -64,7 +64,7 @@ extern "C" { #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return; \ } \ } while (0) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 1b435c9f0e..d46595d190 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -133,7 +133,7 @@ static struct event_crypto_adapter **event_crypto_adapter; /* Macros to check for valid adapter */ #define EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!eca_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -309,7 +309,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", dev_id); + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) return -EIO; @@ -319,7 +319,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -391,7 +391,7 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, sizeof(struct crypto_device_info), 0, socket_id); if (adapter->cdevs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices\n"); + RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices"); eca_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -1403,7 +1403,7 @@ rte_event_crypto_adapter_runtime_params_set(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1436,7 +1436,7 @@ rte_event_crypto_adapter_runtime_params_get(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c index cbf9405438..4196164305 100644 --- a/lib/eventdev/rte_event_dma_adapter.c +++ b/lib/eventdev/rte_event_dma_adapter.c @@ -20,7 +20,7 @@ #define EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) \ do { \ if (!edma_adapter_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -313,7 +313,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_dev_configure(evdev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to configure event dev %u\n", evdev_id); + RTE_EDEV_LOG_ERR("Failed to configure event dev %u", evdev_id); if (started) { if (rte_event_dev_start(evdev_id)) return -EIO; @@ -323,7 +323,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_port_setup(evdev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("Failed to setup event port %u", port_id); return ret; } @@ -407,7 +407,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, num_dma_dev * sizeof(struct dma_device_info), 0, socket_id); if (adapter->dma_devs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices\n"); + RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -417,7 +417,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, for (i = 0; i < num_dma_dev; i++) { ret = rte_dma_info_get(i, &info); if (ret) { - RTE_EDEV_LOG_ERR("Failed to get dma device info\n"); + RTE_EDEV_LOG_ERR("Failed to get dma device info"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return ret; @@ -1297,7 +1297,7 @@ rte_event_dma_adapter_runtime_params_set(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1326,7 +1326,7 @@ rte_event_dma_adapter_runtime_params_get(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 82ae31712d..1b83a55b5c 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -293,14 +293,14 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ return retval; \ } \ } while (0) #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_GOTO_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ ret = retval; \ goto error; \ } \ @@ -308,7 +308,7 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, retval) do { \ if ((token) == NULL || strlen(token) == 0 || !isdigit(*token)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token\n"); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token"); \ ret = retval; \ goto error; \ } \ @@ -1540,7 +1540,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) @@ -1551,7 +1551,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -1628,7 +1628,7 @@ rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter) if (!err) return 0; - RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); error: rte_ring_free(rx_adapter->intr_ring); @@ -1644,12 +1644,12 @@ rxa_destroy_intr_thread(struct event_eth_rx_adapter *rx_adapter) err = pthread_cancel((pthread_t)rx_adapter->rx_intr_thread.opaque_id); if (err) - RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d\n", + RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d", err); err = rte_thread_join(rx_adapter->rx_intr_thread, NULL); if (err) - RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); rte_ring_free(rx_adapter->intr_ring); @@ -1915,7 +1915,7 @@ rxa_init_service(struct event_eth_rx_adapter *rx_adapter, uint8_t id) if (rte_mbuf_dyn_rx_timestamp_register( &event_eth_rx_timestamp_dynfield_offset, &event_eth_rx_timestamp_dynflag) != 0) { - RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf\n"); + RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf"); return -rte_errno; } @@ -2445,7 +2445,7 @@ rxa_create(uint8_t id, uint8_t dev_id, RTE_DIM(default_rss_key)); if (rx_adapter->eth_devices == NULL) { - RTE_EDEV_LOG_ERR("failed to get mem for eth devices\n"); + RTE_EDEV_LOG_ERR("failed to get mem for eth devices"); rte_free(rx_adapter); return -ENOMEM; } @@ -2497,12 +2497,12 @@ rxa_config_params_validate(struct rte_event_eth_rx_adapter_params *rxa_params, return 0; } else if (!rxa_params->use_queue_event_buf && rxa_params->event_buf_size == 0) { - RTE_EDEV_LOG_ERR("event buffer size can't be zero\n"); + RTE_EDEV_LOG_ERR("event buffer size can't be zero"); return -EINVAL; } else if (rxa_params->use_queue_event_buf && rxa_params->event_buf_size != 0) { RTE_EDEV_LOG_ERR("event buffer size needs to be configured " - "as part of queue add\n"); + "as part of queue add"); return -EINVAL; } @@ -3597,7 +3597,7 @@ handle_rxa_stats(const char *cmd __rte_unused, /* Get Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, &rx_adptr_stats)) { - RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats"); return -1; } @@ -3636,7 +3636,7 @@ handle_rxa_stats_reset(const char *cmd __rte_unused, /* Reset Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { - RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats"); return -1; } diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index 360d5caf6a..56435be991 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -334,7 +334,7 @@ txa_service_conf_cb(uint8_t __rte_unused id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, pc); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); if (started) { if (rte_event_dev_start(dev_id)) diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index 27466707bc..3f22e85173 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -106,7 +106,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to configure event dev %u\n", dev_id); + EVTIM_LOG_ERR("failed to configure event dev %u", dev_id); if (started) if (rte_event_dev_start(dev_id)) return -EIO; @@ -116,7 +116,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to setup event port %u on event dev %u\n", + EVTIM_LOG_ERR("failed to setup event port %u on event dev %u", port_id, dev_id); return ret; } diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index ae50821a3f..157752868d 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1007,13 +1007,13 @@ rte_event_port_profile_links_set(uint8_t dev_id, uint8_t port_id, const uint8_t } if (*dev->dev_ops->port_link == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } if (profile_id && *dev->dev_ops->port_link_profile == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } diff --git a/lib/metrics/rte_metrics_telemetry.c b/lib/metrics/rte_metrics_telemetry.c index 5be21b2e86..1d133e1f8c 100644 --- a/lib/metrics/rte_metrics_telemetry.c +++ b/lib/metrics/rte_metrics_telemetry.c @@ -363,7 +363,7 @@ rte_metrics_tel_stat_names_to_ids(const char * const *stat_names, } } if (j == num_metrics) { - METRICS_LOG_WARN("Invalid stat name %s\n", + METRICS_LOG_WARN("Invalid stat name %s", stat_names[i]); free(names); return -EINVAL; diff --git a/lib/mldev/rte_mldev.c b/lib/mldev/rte_mldev.c index cc5f2e0cc6..196b1850e6 100644 --- a/lib/mldev/rte_mldev.c +++ b/lib/mldev/rte_mldev.c @@ -159,7 +159,7 @@ int rte_ml_dev_init(size_t dev_max) { if (dev_max == 0 || dev_max > INT16_MAX) { - RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)\n", dev_max, INT16_MAX); + RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)", dev_max, INT16_MAX); rte_errno = EINVAL; return -rte_errno; } @@ -217,7 +217,7 @@ rte_ml_dev_socket_id(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -232,7 +232,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -241,7 +241,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) return -ENOTSUP; if (dev_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL", dev_id); return -EINVAL; } memset(dev_info, 0, sizeof(struct rte_ml_dev_info)); @@ -257,7 +257,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -271,7 +271,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) } if (config == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL", dev_id); return -EINVAL; } @@ -280,7 +280,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) return ret; if (config->nb_queue_pairs > dev_info.max_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u\n", dev_id, + RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u", dev_id, config->nb_queue_pairs, dev_info.max_queue_pairs); return -EINVAL; } @@ -294,7 +294,7 @@ rte_ml_dev_close(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -318,7 +318,7 @@ rte_ml_dev_start(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -345,7 +345,7 @@ rte_ml_dev_stop(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -372,7 +372,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -386,7 +386,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, } if (qp_conf == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL", dev_id); return -EINVAL; } @@ -404,7 +404,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -413,7 +413,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) return -ENOTSUP; if (stats == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL", dev_id); return -EINVAL; } memset(stats, 0, sizeof(struct rte_ml_dev_stats)); @@ -427,7 +427,7 @@ rte_ml_dev_stats_reset(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return; } @@ -445,7 +445,7 @@ rte_ml_dev_xstats_names_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, in struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -462,7 +462,7 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -471,12 +471,12 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i return -ENOTSUP; if (name == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL", dev_id); return -EINVAL; } if (value == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL", dev_id); return -EINVAL; } @@ -490,7 +490,7 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -499,12 +499,12 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t return -ENOTSUP; if (stat_ids == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL", dev_id); return -EINVAL; } if (values == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL", dev_id); return -EINVAL; } @@ -518,7 +518,7 @@ rte_ml_dev_xstats_reset(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_ struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -535,7 +535,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -544,7 +544,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) return -ENOTSUP; if (fd == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL", dev_id); return -EINVAL; } @@ -557,7 +557,7 @@ rte_ml_dev_selftest(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -574,7 +574,7 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -583,12 +583,12 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * return -ENOTSUP; if (params == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL", dev_id); return -EINVAL; } if (model_id == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL", dev_id); return -EINVAL; } @@ -601,7 +601,7 @@ rte_ml_model_unload(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -618,7 +618,7 @@ rte_ml_model_start(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -635,7 +635,7 @@ rte_ml_model_stop(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -652,7 +652,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -661,7 +661,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf return -ENOTSUP; if (model_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL\n", dev_id, + RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL", dev_id, model_id); return -EINVAL; } @@ -675,7 +675,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -684,7 +684,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) return -ENOTSUP; if (buffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL", dev_id); return -EINVAL; } @@ -698,7 +698,7 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -707,12 +707,12 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d return -ENOTSUP; if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -726,7 +726,7 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -735,12 +735,12 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * return -ENOTSUP; if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -811,7 +811,7 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -823,13 +823,13 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -847,7 +847,7 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -859,13 +859,13 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -883,7 +883,7 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -892,12 +892,12 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error return -ENOTSUP; if (op == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL", dev_id); return -EINVAL; } if (error == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL", dev_id); return -EINVAL; } #else diff --git a/lib/net/rte_net_crc.c b/lib/net/rte_net_crc.c index a685f9e7bb..900d6de7f4 100644 --- a/lib/net/rte_net_crc.c +++ b/lib/net/rte_net_crc.c @@ -179,7 +179,7 @@ avx512_vpclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_512) return handlers_avx512; #endif - NET_LOG(INFO, "Requirements not met, can't use AVX512\n"); + NET_LOG(INFO, "Requirements not met, can't use AVX512"); return NULL; } @@ -205,7 +205,7 @@ sse42_pclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_sse42; #endif - NET_LOG(INFO, "Requirements not met, can't use SSE\n"); + NET_LOG(INFO, "Requirements not met, can't use SSE"); return NULL; } @@ -231,7 +231,7 @@ neon_pmull_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_neon; #endif - NET_LOG(INFO, "Requirements not met, can't use NEON\n"); + NET_LOG(INFO, "Requirements not met, can't use NEON"); return NULL; } diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c index 3e8fac1df4..475eff6abe 100644 --- a/lib/node/ethdev_rx.c +++ b/lib/node/ethdev_rx.c @@ -160,13 +160,13 @@ ethdev_ptype_setup(uint16_t port, uint16_t queue) if (!l3_ipv4 || !l3_ipv6) { node_info("ethdev_rx", - "Enabling ptype callback for required ptypes on port %u\n", + "Enabling ptype callback for required ptypes on port %u", port); if (!rte_eth_add_rx_callback(port, queue, eth_pkt_parse_cb, NULL)) { node_err("ethdev_rx", - "Failed to add rx ptype cb: port=%d, queue=%d\n", + "Failed to add rx ptype cb: port=%d, queue=%d", port, queue); return -EINVAL; } diff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c index 0dbfde64fe..18955971f6 100644 --- a/lib/node/ip4_lookup.c +++ b/lib/node/ip4_lookup.c @@ -143,7 +143,7 @@ rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop, ip, depth, val); if (ret < 0) { node_err("ip4_lookup", - "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d\n", + "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/ip6_lookup.c b/lib/node/ip6_lookup.c index 6f56eb5ec5..309964f60f 100644 --- a/lib/node/ip6_lookup.c +++ b/lib/node/ip6_lookup.c @@ -283,7 +283,7 @@ rte_node_ip6_route_add(const uint8_t *ip, uint8_t depth, uint16_t next_hop, if (ret < 0) { node_err("ip6_lookup", "Unable to add entry %s / %d nh (%x) to LPM " - "table on sock %d, rc=%d\n", + "table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/kernel_rx.c b/lib/node/kernel_rx.c index 2dba7c8cc7..6c20cdbb1e 100644 --- a/lib/node/kernel_rx.c +++ b/lib/node/kernel_rx.c @@ -134,7 +134,7 @@ kernel_rx_node_do(struct rte_graph *graph, struct rte_node *node, kernel_rx_node if (len == 0 || len == 0xFFFF) { rte_pktmbuf_free(m); if (rx->idx <= 0) - node_dbg("kernel_rx", "rx_mbuf array is empty\n"); + node_dbg("kernel_rx", "rx_mbuf array is empty"); rx->idx--; break; } @@ -207,20 +207,20 @@ kernel_rx_node_init(const struct rte_graph *graph, struct rte_node *node) RTE_VERIFY(elem != NULL); if (ctx->pktmbuf_pool == NULL) { - node_err("kernel_rx", "Invalid mbuf pool on graph %s\n", graph->name); + node_err("kernel_rx", "Invalid mbuf pool on graph %s", graph->name); return -EINVAL; } recv_info = rte_zmalloc_socket("kernel_rx_info", sizeof(kernel_rx_info_t), RTE_CACHE_LINE_SIZE, graph->socket); if (!recv_info) { - node_err("kernel_rx", "Kernel recv_info is NULL\n"); + node_err("kernel_rx", "Kernel recv_info is NULL"); return -ENOMEM; } sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (sock < 0) { - node_err("kernel_rx", "Unable to open RAW socket\n"); + node_err("kernel_rx", "Unable to open RAW socket"); return sock; } diff --git a/lib/node/kernel_tx.c b/lib/node/kernel_tx.c index 27d1808c71..3a96741622 100644 --- a/lib/node/kernel_tx.c +++ b/lib/node/kernel_tx.c @@ -36,7 +36,7 @@ kernel_tx_process_mbuf(struct rte_node *node, struct rte_mbuf **mbufs, uint16_t sin.sin_addr.s_addr = ip4->dst_addr; if (sendto(ctx->sock, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)) < 0) - node_err("kernel_tx", "Unable to send packets: %s\n", strerror(errno)); + node_err("kernel_tx", "Unable to send packets: %s", strerror(errno)); } } @@ -87,7 +87,7 @@ kernel_tx_node_init(const struct rte_graph *graph __rte_unused, struct rte_node ctx->sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (ctx->sock < 0) - node_err("kernel_tx", "Unable to open RAW socket\n"); + node_err("kernel_tx", "Unable to open RAW socket"); return 0; } diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c index a9f3d6cc98..41a44be4b9 100644 --- a/lib/rcu/rte_rcu_qsbr.c +++ b/lib/rcu/rte_rcu_qsbr.c @@ -92,7 +92,7 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; @@ -144,7 +144,7 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index 5979fb0efb..6b908e7ee0 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -299,7 +299,7 @@ rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Copy the current value of token. @@ -350,7 +350,7 @@ rte_rcu_qsbr_thread_offline(struct rte_rcu_qsbr *v, unsigned int thread_id) { RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* The reader can go offline only after the load of the @@ -427,7 +427,7 @@ rte_rcu_qsbr_unlock(__rte_unused struct rte_rcu_qsbr *v, 1, rte_memory_order_release); __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, WARNING, - "Lock counter %u. Nested locks?\n", + "Lock counter %u. Nested locks?", v->qsbr_cnt[thread_id].lock_cnt); #endif } @@ -481,7 +481,7 @@ rte_rcu_qsbr_quiescent(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Acquire the changes to the shared data structure released diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c index 1fabec2bfe..1dab6d6645 100644 --- a/lib/stack/rte_stack.c +++ b/lib/stack/rte_stack.c @@ -56,7 +56,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, int ret; if (flags & ~(RTE_STACK_F_LF)) { - STACK_LOG_ERR("Unsupported stack flags %#x\n", flags); + STACK_LOG_ERR("Unsupported stack flags %#x", flags); return NULL; } @@ -65,7 +65,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, #endif #if !defined(RTE_STACK_LF_SUPPORTED) if (flags & RTE_STACK_F_LF) { - STACK_LOG_ERR("Lock-free stack is not supported on your platform\n"); + STACK_LOG_ERR("Lock-free stack is not supported on your platform"); rte_errno = ENOTSUP; return NULL; } @@ -82,7 +82,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, te = rte_zmalloc("STACK_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { - STACK_LOG_ERR("Cannot reserve memory for tailq\n"); + STACK_LOG_ERR("Cannot reserve memory for tailq"); rte_errno = ENOMEM; return NULL; } @@ -92,7 +92,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, mz = rte_memzone_reserve_aligned(mz_name, sz, socket_id, 0, __alignof__(*s)); if (mz == NULL) { - STACK_LOG_ERR("Cannot reserve stack memzone!\n"); + STACK_LOG_ERR("Cannot reserve stack memzone!"); rte_mcfg_tailq_write_unlock(); rte_free(te); return NULL; diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c index 3e1ef1ac25..6e5443e5f8 100644 --- a/lib/vhost/vhost_crypto.c +++ b/lib/vhost/vhost_crypto.c @@ -245,7 +245,7 @@ transform_cipher_param(struct rte_crypto_sym_xform *xform, return ret; if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) { - VC_LOG_DBG("Invalid cipher key length\n"); + VC_LOG_DBG("Invalid cipher key length"); return -VIRTIO_CRYPTO_BADMSG; } @@ -301,7 +301,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms, return ret; if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) { - VC_LOG_DBG("Invalid cipher key length\n"); + VC_LOG_DBG("Invalid cipher key length"); return -VIRTIO_CRYPTO_BADMSG; } @@ -321,7 +321,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms, return ret; if (param->auth_key_len > VHOST_USER_CRYPTO_MAX_HMAC_KEY_LENGTH) { - VC_LOG_DBG("Invalid auth key length\n"); + VC_LOG_DBG("Invalid auth key length"); return -VIRTIO_CRYPTO_BADMSG; } -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
[parent not found: <20231218143805.1500121-1-david.marchand@redhat.com>]
* [PATCH v4 01/14] hash: remove some dead code [not found] ` <20231218143805.1500121-1-david.marchand@redhat.com> @ 2023-12-18 14:37 ` David Marchand 2023-12-18 14:37 ` [PATCH v4 02/14] regexdev: fix logtype register David Marchand ` (3 subsequent siblings) 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-18 14:37 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Yipeng Wang, Sameh Gobriel, Vladimir Medvedkin, Ruifeng Wang, Ray Kinsella, Dharmik Thakkar This macro is not used. Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> --- lib/hash/rte_cuckoo_hash.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h index f7afc4dd79..8ea793c66e 100644 --- a/lib/hash/rte_cuckoo_hash.h +++ b/lib/hash/rte_cuckoo_hash.h @@ -29,17 +29,6 @@ #define RETURN_IF_TRUE(cond, retval) #endif -#if defined(RTE_LIBRTE_HASH_DEBUG) -#define ERR_IF_TRUE(cond, fmt, args...) do { \ - if (cond) { \ - RTE_LOG(ERR, HASH, fmt, ##args); \ - return; \ - } \ -} while (0) -#else -#define ERR_IF_TRUE(cond, fmt, args...) -#endif - #include <rte_hash_crc.h> #include <rte_jhash.h> -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v4 02/14] regexdev: fix logtype register [not found] ` <20231218143805.1500121-1-david.marchand@redhat.com> 2023-12-18 14:37 ` [PATCH v4 01/14] hash: remove some dead code David Marchand @ 2023-12-18 14:37 ` David Marchand 2023-12-18 16:46 ` Stephen Hemminger 2023-12-18 14:37 ` [PATCH v4 03/14] lib: use dedicated logtypes and macros David Marchand ` (2 subsequent siblings) 4 siblings, 1 reply; 39+ messages in thread From: David Marchand @ 2023-12-18 14:37 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Ori Kam, Guy Kaneti, Parav Pandit This library logtype was not initialized so its logs would end up under the 0 logtype, iow, RTE_LOGTYPE_EAL. Fixes: b25246beaefc ("regexdev: add core functions") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Ori Kam <orika@nvidia.com> --- lib/regexdev/rte_regexdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c index caec069182..d38a85eb0b 100644 --- a/lib/regexdev/rte_regexdev.c +++ b/lib/regexdev/rte_regexdev.c @@ -19,7 +19,7 @@ static struct { struct rte_regexdev_data data[RTE_MAX_REGEXDEV_DEVS]; } *rte_regexdev_shared_data; -int rte_regexdev_logtype; +RTE_LOG_REGISTER_DEFAULT(rte_regexdev_logtype, INFO); static uint16_t regexdev_find_free_dev(void) -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v4 02/14] regexdev: fix logtype register 2023-12-18 14:37 ` [PATCH v4 02/14] regexdev: fix logtype register David Marchand @ 2023-12-18 16:46 ` Stephen Hemminger 0 siblings, 0 replies; 39+ messages in thread From: Stephen Hemminger @ 2023-12-18 16:46 UTC (permalink / raw) To: David Marchand Cc: dev, thomas, ferruh.yigit, bruce.richardson, mb, stable, Tyler Retzlaff, Ori Kam, Guy Kaneti, Parav Pandit On Mon, 18 Dec 2023 15:37:51 +0100 David Marchand <david.marchand@redhat.com> wrote: > This library logtype was not initialized so its logs would end up under > the 0 logtype, iow, RTE_LOGTYPE_EAL. > > Fixes: b25246beaefc ("regexdev: add core functions") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> > Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> > Acked-by: Ori Kam <orika@nvidia.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v4 03/14] lib: use dedicated logtypes and macros [not found] ` <20231218143805.1500121-1-david.marchand@redhat.com> 2023-12-18 14:37 ` [PATCH v4 01/14] hash: remove some dead code David Marchand 2023-12-18 14:37 ` [PATCH v4 02/14] regexdev: fix logtype register David Marchand @ 2023-12-18 14:37 ` David Marchand 2023-12-18 14:37 ` [PATCH v4 04/14] lib: add newline in logs David Marchand 2023-12-18 14:37 ` [PATCH v4 05/14] lib: remove redundant newline from logs David Marchand 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-18 14:37 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Andrew Rybchenko, Akhil Goyal, Fan Zhang, Amit Prakash Shukla, Jerin Jacob, Naga Harish K S V 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. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> --- 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_dma_adapter.c | 4 ++-- lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++++------ lib/eventdev/rte_eventdev.c | 6 +++--- lib/mempool/rte_mempool_ops.c | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 25e3ec12d1..ead8c9a623 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2684,7 +2684,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 fff4b7b4cd..55a9dcc565 100644 --- a/lib/ethdev/ethdev_driver.c +++ b/lib/ethdev/ethdev_driver.c @@ -487,7 +487,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; @@ -713,7 +713,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 e98b7188b0..0e1c7b23c1 100644 --- a/lib/ethdev/ethdev_private.c +++ b/lib/ethdev/ethdev_private.c @@ -182,7 +182,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_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; } } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 6db03adf04..82ae31712d 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -314,9 +314,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; \ } \ @@ -3671,7 +3671,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); @@ -3743,7 +3743,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); @@ -3813,7 +3813,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); @@ -3868,7 +3868,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 0ca32d6721..ae50821a3f 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1428,8 +1428,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; } @@ -1444,7 +1444,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 ae1d288f27..e871de9ec9 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.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v4 04/14] lib: add newline in logs [not found] ` <20231218143805.1500121-1-david.marchand@redhat.com> ` (2 preceding siblings ...) 2023-12-18 14:37 ` [PATCH v4 03/14] lib: use dedicated logtypes and macros David Marchand @ 2023-12-18 14:37 ` David Marchand 2023-12-18 14:37 ` [PATCH v4 05/14] lib: remove redundant newline from logs David Marchand 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-18 14:37 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Andrew Rybchenko, Harman Kalra, Vladimir Medvedkin, Anatoly Burakov, David Hunt, Sivaprasad Tummala Fix places leading to a log message not terminated with a newline. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> --- lib/eal/common/eal_common_options.c | 2 +- lib/eal/linux/eal_hugepage_info.c | 2 +- lib/eal/linux/eal_interrupts.c | 2 +- lib/ethdev/ethdev_pci.h | 2 +- lib/ethdev/rte_ethdev.c | 40 ++++++++++++++--------------- lib/lpm/rte_lpm6.c | 6 ++--- lib/power/guest_channel.c | 2 +- lib/power/rte_power_pmd_mgmt.c | 6 ++--- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index a6d21f1cba..e9ba01fb89 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -2141,7 +2141,7 @@ rte_vect_set_max_simd_bitwidth(uint16_t bitwidth) struct internal_config *internal_conf = eal_get_internal_configuration(); if (internal_conf->max_simd_bitwidth.forced) { - RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled"); + RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled\n"); return -EPERM; } diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c index 581d9dfc91..36a495fb1f 100644 --- a/lib/eal/linux/eal_hugepage_info.c +++ b/lib/eal/linux/eal_hugepage_info.c @@ -403,7 +403,7 @@ inspect_hugedir_cb(const struct walk_hugedir_data *whd) struct stat st; if (fstat(whd->file_fd, &st) < 0) - RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s", + RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s\n", __func__, whd->file_name, strerror(errno)); else (*total_size) += st.st_size; diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index d4919dff45..eabac24992 100644 --- a/lib/eal/linux/eal_interrupts.c +++ b/lib/eal/linux/eal_interrupts.c @@ -1542,7 +1542,7 @@ rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd) /* only check, initialization would be done in vdev driver.*/ if ((uint64_t)rte_intr_efd_counter_size_get(intr_handle) > sizeof(union rte_intr_read_buffer)) { - RTE_LOG(ERR, EAL, "the efd_counter_size is oversized"); + RTE_LOG(ERR, EAL, "the efd_counter_size is oversized\n"); return -EINVAL; } } else { diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h index 320e3e0093..ddb559aa95 100644 --- a/lib/ethdev/ethdev_pci.h +++ b/lib/ethdev/ethdev_pci.h @@ -31,7 +31,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev) { if ((eth_dev == NULL) || (pci_dev == NULL)) { - RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p", + RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p\n", (void *)eth_dev, (void *)pci_dev); return; } diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 3858983fcc..b9d99ece15 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -724,7 +724,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) uint16_t pid; if (name == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name"); + RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name\n"); return -EINVAL; } @@ -2394,41 +2394,41 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, nb_rx_desc = cap.max_nb_desc; if (nb_rx_desc > cap.max_nb_desc) { RTE_ETHDEV_LOG(ERR, - "Invalid value for nb_rx_desc(=%hu), should be: <= %hu", + "Invalid value for nb_rx_desc(=%hu), should be: <= %hu\n", nb_rx_desc, cap.max_nb_desc); return -EINVAL; } if (conf->peer_count > cap.max_rx_2_tx) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Rx queue(=%u), should be: <= %hu", + "Invalid value for number of peers for Rx queue(=%u), should be: <= %hu\n", conf->peer_count, cap.max_rx_2_tx); return -EINVAL; } if (conf->use_locked_device_memory && !cap.rx_cap.locked_device_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use locked device memory for Rx queue, which is not supported"); + "Attempt to use locked device memory for Rx queue, which is not supported\n"); return -EINVAL; } if (conf->use_rte_memory && !cap.rx_cap.rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use DPDK memory for Rx queue, which is not supported"); + "Attempt to use DPDK memory for Rx queue, which is not supported\n"); return -EINVAL; } if (conf->use_locked_device_memory && conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use mutually exclusive memory settings for Rx queue"); + "Attempt to use mutually exclusive memory settings for Rx queue\n"); return -EINVAL; } if (conf->force_memory && !conf->use_locked_device_memory && !conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to force Rx queue memory settings, but none is set"); + "Attempt to force Rx queue memory settings, but none is set\n"); return -EINVAL; } if (conf->peer_count == 0) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Rx queue(=%u), should be: > 0", + "Invalid value for number of peers for Rx queue(=%u), should be: > 0\n", conf->peer_count); return -EINVAL; } @@ -2438,7 +2438,7 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, count++; } if (count > cap.max_nb_queues) { - RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d", + RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d\n", cap.max_nb_queues); return -EINVAL; } @@ -2597,41 +2597,41 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, nb_tx_desc = cap.max_nb_desc; if (nb_tx_desc > cap.max_nb_desc) { RTE_ETHDEV_LOG(ERR, - "Invalid value for nb_tx_desc(=%hu), should be: <= %hu", + "Invalid value for nb_tx_desc(=%hu), should be: <= %hu\n", nb_tx_desc, cap.max_nb_desc); return -EINVAL; } if (conf->peer_count > cap.max_tx_2_rx) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Tx queue(=%u), should be: <= %hu", + "Invalid value for number of peers for Tx queue(=%u), should be: <= %hu\n", conf->peer_count, cap.max_tx_2_rx); return -EINVAL; } if (conf->use_locked_device_memory && !cap.tx_cap.locked_device_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use locked device memory for Tx queue, which is not supported"); + "Attempt to use locked device memory for Tx queue, which is not supported\n"); return -EINVAL; } if (conf->use_rte_memory && !cap.tx_cap.rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use DPDK memory for Tx queue, which is not supported"); + "Attempt to use DPDK memory for Tx queue, which is not supported\n"); return -EINVAL; } if (conf->use_locked_device_memory && conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use mutually exclusive memory settings for Tx queue"); + "Attempt to use mutually exclusive memory settings for Tx queue\n"); return -EINVAL; } if (conf->force_memory && !conf->use_locked_device_memory && !conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to force Tx queue memory settings, but none is set"); + "Attempt to force Tx queue memory settings, but none is set\n"); return -EINVAL; } if (conf->peer_count == 0) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Tx queue(=%u), should be: > 0", + "Invalid value for number of peers for Tx queue(=%u), should be: > 0\n", conf->peer_count); return -EINVAL; } @@ -2641,7 +2641,7 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, count++; } if (count > cap.max_nb_queues) { - RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d", + RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d\n", cap.max_nb_queues); return -EINVAL; } @@ -6716,7 +6716,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, } if (reassembly_capa == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL"); + RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL\n"); return -EINVAL; } @@ -6752,7 +6752,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, } if (conf == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL"); + RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL\n"); return -EINVAL; } @@ -6780,7 +6780,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (dev->data->dev_configured == 0) { RTE_ETHDEV_LOG(ERR, "Device with port_id=%u is not configured.\n" - "Cannot set IP reassembly configuration", + "Cannot set IP reassembly configuration\n", port_id); return -EINVAL; } diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c index 873cc8bc26..24ce7dd022 100644 --- a/lib/lpm/rte_lpm6.c +++ b/lib/lpm/rte_lpm6.c @@ -280,7 +280,7 @@ rte_lpm6_create(const char *name, int socket_id, rules_tbl = rte_hash_create(&rule_hash_tbl_params); if (rules_tbl == NULL) { - RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); goto fail_wo_unlock; } @@ -290,7 +290,7 @@ rte_lpm6_create(const char *name, int socket_id, sizeof(uint32_t) * config->number_tbl8s, RTE_CACHE_LINE_SIZE); if (tbl8_pool == NULL) { - RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); rte_errno = ENOMEM; goto fail_wo_unlock; @@ -301,7 +301,7 @@ rte_lpm6_create(const char *name, int socket_id, sizeof(struct rte_lpm_tbl8_hdr) * config->number_tbl8s, RTE_CACHE_LINE_SIZE); if (tbl8_hdrs == NULL) { - RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); rte_errno = ENOMEM; goto fail_wo_unlock; diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c index cc05347425..a6f2097d5b 100644 --- a/lib/power/guest_channel.c +++ b/lib/power/guest_channel.c @@ -90,7 +90,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id) flags |= O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) < 0) { RTE_LOG(ERR, GUEST_CHANNEL, "Failed on setting non-blocking mode for " - "file %s", fd_path); + "file %s\n", fd_path); goto error; } /* QEMU needs a delay after connection */ diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c index 38f8384085..6f18ed0adf 100644 --- a/lib/power/rte_power_pmd_mgmt.c +++ b/lib/power/rte_power_pmd_mgmt.c @@ -686,7 +686,7 @@ int rte_power_pmd_mgmt_set_pause_duration(unsigned int duration) { if (duration == 0) { - RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged"); + RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged\n"); return -EINVAL; } pause_duration = duration; @@ -709,7 +709,7 @@ rte_power_pmd_mgmt_set_scaling_freq_min(unsigned int lcore, unsigned int min) } if (min > scale_freq_max[lcore]) { - RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency"); + RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency\n"); return -EINVAL; } scale_freq_min[lcore] = min; @@ -729,7 +729,7 @@ rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max) if (max == 0) max = UINT32_MAX; if (max < scale_freq_min[lcore]) { - RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency"); + RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency\n"); return -EINVAL; } -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v4 05/14] lib: remove redundant newline from logs [not found] ` <20231218143805.1500121-1-david.marchand@redhat.com> ` (3 preceding siblings ...) 2023-12-18 14:37 ` [PATCH v4 04/14] lib: add newline in logs David Marchand @ 2023-12-18 14:37 ` David Marchand 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-18 14:37 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Chengwen Feng, Mattias Rönnblom, Kai Ji, Pablo de Lara, Nicolas Chautru, Cristian Dumitrescu, Fan Zhang, Ashish Gupta, Akhil Goyal, Kevin Laatz, Dmitry Kozlyuk, Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam, Jerin Jacob, Abhinandan Gujjar, Amit Prakash Shukla, Naga Harish K S V, Erik Gabriel Carrillo, Srikanth Yalavarthi, Jasvinder Singh, Nithin Dabilpuram, Pavan Nikhilesh, Honnappa Nagarahalli, Maxime Coquelin, Chenbo Xia Fix places where two newline characters may be logged. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> --- Changes since RFC v1: - split fixes on direct calls to printf or RTE_LOG in a previous patch, --- drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 2 +- lib/bbdev/rte_bbdev.c | 6 +- lib/cfgfile/rte_cfgfile.c | 14 ++-- lib/compressdev/rte_compressdev_pmd.c | 4 +- lib/cryptodev/rte_cryptodev.c | 2 +- lib/dispatcher/rte_dispatcher.c | 12 +-- lib/dmadev/rte_dmadev.c | 2 +- lib/eal/windows/eal_memory.c | 2 +- lib/eventdev/eventdev_pmd.h | 6 +- lib/eventdev/rte_event_crypto_adapter.c | 12 +-- lib/eventdev/rte_event_dma_adapter.c | 14 ++-- lib/eventdev/rte_event_eth_rx_adapter.c | 28 +++---- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- lib/eventdev/rte_event_timer_adapter.c | 4 +- lib/eventdev/rte_eventdev.c | 4 +- lib/metrics/rte_metrics_telemetry.c | 2 +- lib/mldev/rte_mldev.c | 102 ++++++++++++------------ lib/net/rte_net_crc.c | 6 +- lib/node/ethdev_rx.c | 4 +- lib/node/ip4_lookup.c | 2 +- lib/node/ip6_lookup.c | 2 +- lib/node/kernel_rx.c | 8 +- lib/node/kernel_tx.c | 4 +- lib/rcu/rte_rcu_qsbr.c | 4 +- lib/rcu/rte_rcu_qsbr.h | 8 +- lib/stack/rte_stack.c | 8 +- lib/vhost/vhost_crypto.c | 6 +- 27 files changed, 135 insertions(+), 135 deletions(-) diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c index 52d6d010c7..f21f9cc5a0 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c +++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c @@ -407,7 +407,7 @@ ipsec_mb_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer) resp_param->result = ipsec_mb_qp_release(dev, qp_id); break; default: - CDEV_LOG_ERR("invalid mp request type\n"); + CDEV_LOG_ERR("invalid mp request type"); } out: diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index cfebea09c7..e09bb97abb 100644 --- a/lib/bbdev/rte_bbdev.c +++ b/lib/bbdev/rte_bbdev.c @@ -1106,12 +1106,12 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, intr_handle = dev->intr_handle; if (intr_handle == NULL) { - rte_bbdev_log(ERR, "Device %u intr handle unset\n", dev_id); + rte_bbdev_log(ERR, "Device %u intr handle unset", dev_id); return -ENOTSUP; } if (queue_id >= RTE_MAX_RXTX_INTR_VEC_ID) { - rte_bbdev_log(ERR, "Device %u queue_id %u is too big\n", + rte_bbdev_log(ERR, "Device %u queue_id %u is too big", dev_id, queue_id); return -ENOTSUP; } @@ -1120,7 +1120,7 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, ret = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); if (ret && (ret != -EEXIST)) { rte_bbdev_log(ERR, - "dev %u q %u int ctl error op %d epfd %d vec %u\n", + "dev %u q %u int ctl error op %d epfd %d vec %u", dev_id, queue_id, op, epfd, vec); return ret; } diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c index eefba6e408..2f9cc0722a 100644 --- a/lib/cfgfile/rte_cfgfile.c +++ b/lib/cfgfile/rte_cfgfile.c @@ -137,7 +137,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) unsigned int i; if (!params) { - CFG_LOG(ERR, "missing cfgfile parameters\n"); + CFG_LOG(ERR, "missing cfgfile parameters"); return -EINVAL; } @@ -150,7 +150,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) } if (valid_comment == 0) { - CFG_LOG(ERR, "invalid comment characters %c\n", + CFG_LOG(ERR, "invalid comment characters %c", params->comment_character); return -ENOTSUP; } @@ -188,7 +188,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, lineno++; if ((len >= sizeof(buffer) - 1) && (buffer[len-1] != '\n')) { CFG_LOG(ERR, " line %d - no \\n found on string. " - "Check if line too long\n", lineno); + "Check if line too long", lineno); goto error1; } /* skip parsing if comment character found */ @@ -209,7 +209,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, char *end = memchr(buffer, ']', len); if (end == NULL) { CFG_LOG(ERR, - "line %d - no terminating ']' character found\n", + "line %d - no terminating ']' character found", lineno); goto error1; } @@ -225,7 +225,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, split[1] = memchr(buffer, '=', len); if (split[1] == NULL) { CFG_LOG(ERR, - "line %d - no '=' character found\n", + "line %d - no '=' character found", lineno); goto error1; } @@ -249,7 +249,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, if (!(flags & CFG_FLAG_EMPTY_VALUES) && (*split[1] == '\0')) { CFG_LOG(ERR, - "line %d - cannot use empty values\n", + "line %d - cannot use empty values", lineno); goto error1; } @@ -414,7 +414,7 @@ int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname, return 0; } - CFG_LOG(ERR, "entry name doesn't exist\n"); + CFG_LOG(ERR, "entry name doesn't exist"); return -EINVAL; } diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c index 156bccd972..762b44f03e 100644 --- a/lib/compressdev/rte_compressdev_pmd.c +++ b/lib/compressdev/rte_compressdev_pmd.c @@ -100,12 +100,12 @@ rte_compressdev_pmd_create(const char *name, struct rte_compressdev *compressdev; if (params->name[0] != '\0') { - COMPRESSDEV_LOG(INFO, "User specified device name = %s\n", + COMPRESSDEV_LOG(INFO, "User specified device name = %s", params->name); name = params->name; } - COMPRESSDEV_LOG(INFO, "Creating compressdev %s\n", name); + COMPRESSDEV_LOG(INFO, "Creating compressdev %s", name); COMPRESSDEV_LOG(INFO, "Init parameters - name: %s, socket id: %d", name, params->socket_id); diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index ead8c9a623..b233c0ecd7 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2074,7 +2074,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id, } if (xforms == NULL) { - CDEV_LOG_ERR("Invalid xform\n"); + CDEV_LOG_ERR("Invalid xform"); rte_errno = EINVAL; return NULL; } diff --git a/lib/dispatcher/rte_dispatcher.c b/lib/dispatcher/rte_dispatcher.c index 10d02edde9..95dd41b818 100644 --- a/lib/dispatcher/rte_dispatcher.c +++ b/lib/dispatcher/rte_dispatcher.c @@ -246,7 +246,7 @@ evd_service_register(struct rte_dispatcher *dispatcher) rc = rte_service_component_register(&service, &dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Registration of dispatcher service " - "%s failed with error code %d\n", + "%s failed with error code %d", service.name, rc); return rc; @@ -260,7 +260,7 @@ evd_service_unregister(struct rte_dispatcher *dispatcher) rc = rte_service_component_unregister(dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Unregistration of dispatcher service " - "failed with error code %d\n", rc); + "failed with error code %d", rc); return rc; } @@ -279,7 +279,7 @@ rte_dispatcher_create(uint8_t event_dev_id) RTE_CACHE_LINE_SIZE, socket_id); if (dispatcher == NULL) { - RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher\n"); + RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher"); rte_errno = ENOMEM; return NULL; } @@ -483,7 +483,7 @@ evd_lcore_uninstall_handler(struct rte_dispatcher_lcore *lcore, unreg_handler = evd_lcore_get_handler_by_id(lcore, handler_id); if (unreg_handler == NULL) { - RTE_EDEV_LOG_ERR("Invalid handler id %d\n", handler_id); + RTE_EDEV_LOG_ERR("Invalid handler id %d", handler_id); return -EINVAL; } @@ -602,7 +602,7 @@ rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher, unreg_finalizer = evd_get_finalizer_by_id(dispatcher, finalizer_id); if (unreg_finalizer == NULL) { - RTE_EDEV_LOG_ERR("Invalid finalizer id %d\n", finalizer_id); + RTE_EDEV_LOG_ERR("Invalid finalizer id %d", finalizer_id); return -EINVAL; } @@ -636,7 +636,7 @@ evd_set_service_runstate(struct rte_dispatcher *dispatcher, int state) */ if (rc != 0) RTE_EDEV_LOG_ERR("Unexpected error %d occurred while setting " - "service component run state to %d\n", rc, + "service component run state to %d", rc, state); RTE_VERIFY(rc == 0); diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 4e5e420c82..009a21849a 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -726,7 +726,7 @@ rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status * return -EINVAL; if (vchan >= dev->data->dev_conf.nb_vchans) { - RTE_DMA_LOG(ERR, "Device %u vchan %u out of range\n", dev_id, vchan); + RTE_DMA_LOG(ERR, "Device %u vchan %u out of range", dev_id, vchan); return -EINVAL; } diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c index 31410a41fd..fd39155163 100644 --- a/lib/eal/windows/eal_memory.c +++ b/lib/eal/windows/eal_memory.c @@ -110,7 +110,7 @@ eal_mem_win32api_init(void) VirtualAlloc2_ptr = (VirtualAlloc2_type)( (void *)GetProcAddress(library, function)); if (VirtualAlloc2_ptr == NULL) { - RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")\n", + RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")", library_name, function); /* Contrary to the docs, Server 2016 is not supported. */ diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index 30bd90085c..2ec5aec0a8 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -49,14 +49,14 @@ extern "C" { /* Macros to check for valid device */ #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return retval; \ } \ } while (0) #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ rte_errno = errno; \ return retval; \ } \ @@ -64,7 +64,7 @@ extern "C" { #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return; \ } \ } while (0) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 1b435c9f0e..d46595d190 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -133,7 +133,7 @@ static struct event_crypto_adapter **event_crypto_adapter; /* Macros to check for valid adapter */ #define EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!eca_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -309,7 +309,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", dev_id); + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) return -EIO; @@ -319,7 +319,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -391,7 +391,7 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, sizeof(struct crypto_device_info), 0, socket_id); if (adapter->cdevs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices\n"); + RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices"); eca_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -1403,7 +1403,7 @@ rte_event_crypto_adapter_runtime_params_set(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1436,7 +1436,7 @@ rte_event_crypto_adapter_runtime_params_get(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c index cbf9405438..4196164305 100644 --- a/lib/eventdev/rte_event_dma_adapter.c +++ b/lib/eventdev/rte_event_dma_adapter.c @@ -20,7 +20,7 @@ #define EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) \ do { \ if (!edma_adapter_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -313,7 +313,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_dev_configure(evdev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to configure event dev %u\n", evdev_id); + RTE_EDEV_LOG_ERR("Failed to configure event dev %u", evdev_id); if (started) { if (rte_event_dev_start(evdev_id)) return -EIO; @@ -323,7 +323,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_port_setup(evdev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("Failed to setup event port %u", port_id); return ret; } @@ -407,7 +407,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, num_dma_dev * sizeof(struct dma_device_info), 0, socket_id); if (adapter->dma_devs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices\n"); + RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -417,7 +417,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, for (i = 0; i < num_dma_dev; i++) { ret = rte_dma_info_get(i, &info); if (ret) { - RTE_EDEV_LOG_ERR("Failed to get dma device info\n"); + RTE_EDEV_LOG_ERR("Failed to get dma device info"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return ret; @@ -1297,7 +1297,7 @@ rte_event_dma_adapter_runtime_params_set(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1326,7 +1326,7 @@ rte_event_dma_adapter_runtime_params_get(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 82ae31712d..1b83a55b5c 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -293,14 +293,14 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ return retval; \ } \ } while (0) #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_GOTO_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ ret = retval; \ goto error; \ } \ @@ -308,7 +308,7 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, retval) do { \ if ((token) == NULL || strlen(token) == 0 || !isdigit(*token)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token\n"); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token"); \ ret = retval; \ goto error; \ } \ @@ -1540,7 +1540,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) @@ -1551,7 +1551,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -1628,7 +1628,7 @@ rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter) if (!err) return 0; - RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); error: rte_ring_free(rx_adapter->intr_ring); @@ -1644,12 +1644,12 @@ rxa_destroy_intr_thread(struct event_eth_rx_adapter *rx_adapter) err = pthread_cancel((pthread_t)rx_adapter->rx_intr_thread.opaque_id); if (err) - RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d\n", + RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d", err); err = rte_thread_join(rx_adapter->rx_intr_thread, NULL); if (err) - RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); rte_ring_free(rx_adapter->intr_ring); @@ -1915,7 +1915,7 @@ rxa_init_service(struct event_eth_rx_adapter *rx_adapter, uint8_t id) if (rte_mbuf_dyn_rx_timestamp_register( &event_eth_rx_timestamp_dynfield_offset, &event_eth_rx_timestamp_dynflag) != 0) { - RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf\n"); + RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf"); return -rte_errno; } @@ -2445,7 +2445,7 @@ rxa_create(uint8_t id, uint8_t dev_id, RTE_DIM(default_rss_key)); if (rx_adapter->eth_devices == NULL) { - RTE_EDEV_LOG_ERR("failed to get mem for eth devices\n"); + RTE_EDEV_LOG_ERR("failed to get mem for eth devices"); rte_free(rx_adapter); return -ENOMEM; } @@ -2497,12 +2497,12 @@ rxa_config_params_validate(struct rte_event_eth_rx_adapter_params *rxa_params, return 0; } else if (!rxa_params->use_queue_event_buf && rxa_params->event_buf_size == 0) { - RTE_EDEV_LOG_ERR("event buffer size can't be zero\n"); + RTE_EDEV_LOG_ERR("event buffer size can't be zero"); return -EINVAL; } else if (rxa_params->use_queue_event_buf && rxa_params->event_buf_size != 0) { RTE_EDEV_LOG_ERR("event buffer size needs to be configured " - "as part of queue add\n"); + "as part of queue add"); return -EINVAL; } @@ -3597,7 +3597,7 @@ handle_rxa_stats(const char *cmd __rte_unused, /* Get Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, &rx_adptr_stats)) { - RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats"); return -1; } @@ -3636,7 +3636,7 @@ handle_rxa_stats_reset(const char *cmd __rte_unused, /* Reset Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { - RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats"); return -1; } diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index 360d5caf6a..56435be991 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -334,7 +334,7 @@ txa_service_conf_cb(uint8_t __rte_unused id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, pc); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); if (started) { if (rte_event_dev_start(dev_id)) diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index 27466707bc..3f22e85173 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -106,7 +106,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to configure event dev %u\n", dev_id); + EVTIM_LOG_ERR("failed to configure event dev %u", dev_id); if (started) if (rte_event_dev_start(dev_id)) return -EIO; @@ -116,7 +116,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to setup event port %u on event dev %u\n", + EVTIM_LOG_ERR("failed to setup event port %u on event dev %u", port_id, dev_id); return ret; } diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index ae50821a3f..157752868d 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1007,13 +1007,13 @@ rte_event_port_profile_links_set(uint8_t dev_id, uint8_t port_id, const uint8_t } if (*dev->dev_ops->port_link == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } if (profile_id && *dev->dev_ops->port_link_profile == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } diff --git a/lib/metrics/rte_metrics_telemetry.c b/lib/metrics/rte_metrics_telemetry.c index 5be21b2e86..1d133e1f8c 100644 --- a/lib/metrics/rte_metrics_telemetry.c +++ b/lib/metrics/rte_metrics_telemetry.c @@ -363,7 +363,7 @@ rte_metrics_tel_stat_names_to_ids(const char * const *stat_names, } } if (j == num_metrics) { - METRICS_LOG_WARN("Invalid stat name %s\n", + METRICS_LOG_WARN("Invalid stat name %s", stat_names[i]); free(names); return -EINVAL; diff --git a/lib/mldev/rte_mldev.c b/lib/mldev/rte_mldev.c index cc5f2e0cc6..196b1850e6 100644 --- a/lib/mldev/rte_mldev.c +++ b/lib/mldev/rte_mldev.c @@ -159,7 +159,7 @@ int rte_ml_dev_init(size_t dev_max) { if (dev_max == 0 || dev_max > INT16_MAX) { - RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)\n", dev_max, INT16_MAX); + RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)", dev_max, INT16_MAX); rte_errno = EINVAL; return -rte_errno; } @@ -217,7 +217,7 @@ rte_ml_dev_socket_id(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -232,7 +232,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -241,7 +241,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) return -ENOTSUP; if (dev_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL", dev_id); return -EINVAL; } memset(dev_info, 0, sizeof(struct rte_ml_dev_info)); @@ -257,7 +257,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -271,7 +271,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) } if (config == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL", dev_id); return -EINVAL; } @@ -280,7 +280,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) return ret; if (config->nb_queue_pairs > dev_info.max_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u\n", dev_id, + RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u", dev_id, config->nb_queue_pairs, dev_info.max_queue_pairs); return -EINVAL; } @@ -294,7 +294,7 @@ rte_ml_dev_close(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -318,7 +318,7 @@ rte_ml_dev_start(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -345,7 +345,7 @@ rte_ml_dev_stop(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -372,7 +372,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -386,7 +386,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, } if (qp_conf == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL", dev_id); return -EINVAL; } @@ -404,7 +404,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -413,7 +413,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) return -ENOTSUP; if (stats == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL", dev_id); return -EINVAL; } memset(stats, 0, sizeof(struct rte_ml_dev_stats)); @@ -427,7 +427,7 @@ rte_ml_dev_stats_reset(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return; } @@ -445,7 +445,7 @@ rte_ml_dev_xstats_names_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, in struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -462,7 +462,7 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -471,12 +471,12 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i return -ENOTSUP; if (name == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL", dev_id); return -EINVAL; } if (value == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL", dev_id); return -EINVAL; } @@ -490,7 +490,7 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -499,12 +499,12 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t return -ENOTSUP; if (stat_ids == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL", dev_id); return -EINVAL; } if (values == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL", dev_id); return -EINVAL; } @@ -518,7 +518,7 @@ rte_ml_dev_xstats_reset(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_ struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -535,7 +535,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -544,7 +544,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) return -ENOTSUP; if (fd == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL", dev_id); return -EINVAL; } @@ -557,7 +557,7 @@ rte_ml_dev_selftest(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -574,7 +574,7 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -583,12 +583,12 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * return -ENOTSUP; if (params == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL", dev_id); return -EINVAL; } if (model_id == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL", dev_id); return -EINVAL; } @@ -601,7 +601,7 @@ rte_ml_model_unload(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -618,7 +618,7 @@ rte_ml_model_start(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -635,7 +635,7 @@ rte_ml_model_stop(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -652,7 +652,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -661,7 +661,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf return -ENOTSUP; if (model_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL\n", dev_id, + RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL", dev_id, model_id); return -EINVAL; } @@ -675,7 +675,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -684,7 +684,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) return -ENOTSUP; if (buffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL", dev_id); return -EINVAL; } @@ -698,7 +698,7 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -707,12 +707,12 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d return -ENOTSUP; if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -726,7 +726,7 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -735,12 +735,12 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * return -ENOTSUP; if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -811,7 +811,7 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -823,13 +823,13 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -847,7 +847,7 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -859,13 +859,13 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -883,7 +883,7 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -892,12 +892,12 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error return -ENOTSUP; if (op == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL", dev_id); return -EINVAL; } if (error == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL", dev_id); return -EINVAL; } #else diff --git a/lib/net/rte_net_crc.c b/lib/net/rte_net_crc.c index a685f9e7bb..900d6de7f4 100644 --- a/lib/net/rte_net_crc.c +++ b/lib/net/rte_net_crc.c @@ -179,7 +179,7 @@ avx512_vpclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_512) return handlers_avx512; #endif - NET_LOG(INFO, "Requirements not met, can't use AVX512\n"); + NET_LOG(INFO, "Requirements not met, can't use AVX512"); return NULL; } @@ -205,7 +205,7 @@ sse42_pclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_sse42; #endif - NET_LOG(INFO, "Requirements not met, can't use SSE\n"); + NET_LOG(INFO, "Requirements not met, can't use SSE"); return NULL; } @@ -231,7 +231,7 @@ neon_pmull_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_neon; #endif - NET_LOG(INFO, "Requirements not met, can't use NEON\n"); + NET_LOG(INFO, "Requirements not met, can't use NEON"); return NULL; } diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c index 3e8fac1df4..475eff6abe 100644 --- a/lib/node/ethdev_rx.c +++ b/lib/node/ethdev_rx.c @@ -160,13 +160,13 @@ ethdev_ptype_setup(uint16_t port, uint16_t queue) if (!l3_ipv4 || !l3_ipv6) { node_info("ethdev_rx", - "Enabling ptype callback for required ptypes on port %u\n", + "Enabling ptype callback for required ptypes on port %u", port); if (!rte_eth_add_rx_callback(port, queue, eth_pkt_parse_cb, NULL)) { node_err("ethdev_rx", - "Failed to add rx ptype cb: port=%d, queue=%d\n", + "Failed to add rx ptype cb: port=%d, queue=%d", port, queue); return -EINVAL; } diff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c index 0dbfde64fe..18955971f6 100644 --- a/lib/node/ip4_lookup.c +++ b/lib/node/ip4_lookup.c @@ -143,7 +143,7 @@ rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop, ip, depth, val); if (ret < 0) { node_err("ip4_lookup", - "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d\n", + "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/ip6_lookup.c b/lib/node/ip6_lookup.c index 6f56eb5ec5..309964f60f 100644 --- a/lib/node/ip6_lookup.c +++ b/lib/node/ip6_lookup.c @@ -283,7 +283,7 @@ rte_node_ip6_route_add(const uint8_t *ip, uint8_t depth, uint16_t next_hop, if (ret < 0) { node_err("ip6_lookup", "Unable to add entry %s / %d nh (%x) to LPM " - "table on sock %d, rc=%d\n", + "table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/kernel_rx.c b/lib/node/kernel_rx.c index 2dba7c8cc7..6c20cdbb1e 100644 --- a/lib/node/kernel_rx.c +++ b/lib/node/kernel_rx.c @@ -134,7 +134,7 @@ kernel_rx_node_do(struct rte_graph *graph, struct rte_node *node, kernel_rx_node if (len == 0 || len == 0xFFFF) { rte_pktmbuf_free(m); if (rx->idx <= 0) - node_dbg("kernel_rx", "rx_mbuf array is empty\n"); + node_dbg("kernel_rx", "rx_mbuf array is empty"); rx->idx--; break; } @@ -207,20 +207,20 @@ kernel_rx_node_init(const struct rte_graph *graph, struct rte_node *node) RTE_VERIFY(elem != NULL); if (ctx->pktmbuf_pool == NULL) { - node_err("kernel_rx", "Invalid mbuf pool on graph %s\n", graph->name); + node_err("kernel_rx", "Invalid mbuf pool on graph %s", graph->name); return -EINVAL; } recv_info = rte_zmalloc_socket("kernel_rx_info", sizeof(kernel_rx_info_t), RTE_CACHE_LINE_SIZE, graph->socket); if (!recv_info) { - node_err("kernel_rx", "Kernel recv_info is NULL\n"); + node_err("kernel_rx", "Kernel recv_info is NULL"); return -ENOMEM; } sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (sock < 0) { - node_err("kernel_rx", "Unable to open RAW socket\n"); + node_err("kernel_rx", "Unable to open RAW socket"); return sock; } diff --git a/lib/node/kernel_tx.c b/lib/node/kernel_tx.c index 27d1808c71..3a96741622 100644 --- a/lib/node/kernel_tx.c +++ b/lib/node/kernel_tx.c @@ -36,7 +36,7 @@ kernel_tx_process_mbuf(struct rte_node *node, struct rte_mbuf **mbufs, uint16_t sin.sin_addr.s_addr = ip4->dst_addr; if (sendto(ctx->sock, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)) < 0) - node_err("kernel_tx", "Unable to send packets: %s\n", strerror(errno)); + node_err("kernel_tx", "Unable to send packets: %s", strerror(errno)); } } @@ -87,7 +87,7 @@ kernel_tx_node_init(const struct rte_graph *graph __rte_unused, struct rte_node ctx->sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (ctx->sock < 0) - node_err("kernel_tx", "Unable to open RAW socket\n"); + node_err("kernel_tx", "Unable to open RAW socket"); return 0; } diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c index a9f3d6cc98..41a44be4b9 100644 --- a/lib/rcu/rte_rcu_qsbr.c +++ b/lib/rcu/rte_rcu_qsbr.c @@ -92,7 +92,7 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; @@ -144,7 +144,7 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index 5979fb0efb..6b908e7ee0 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -299,7 +299,7 @@ rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Copy the current value of token. @@ -350,7 +350,7 @@ rte_rcu_qsbr_thread_offline(struct rte_rcu_qsbr *v, unsigned int thread_id) { RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* The reader can go offline only after the load of the @@ -427,7 +427,7 @@ rte_rcu_qsbr_unlock(__rte_unused struct rte_rcu_qsbr *v, 1, rte_memory_order_release); __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, WARNING, - "Lock counter %u. Nested locks?\n", + "Lock counter %u. Nested locks?", v->qsbr_cnt[thread_id].lock_cnt); #endif } @@ -481,7 +481,7 @@ rte_rcu_qsbr_quiescent(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Acquire the changes to the shared data structure released diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c index 1fabec2bfe..1dab6d6645 100644 --- a/lib/stack/rte_stack.c +++ b/lib/stack/rte_stack.c @@ -56,7 +56,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, int ret; if (flags & ~(RTE_STACK_F_LF)) { - STACK_LOG_ERR("Unsupported stack flags %#x\n", flags); + STACK_LOG_ERR("Unsupported stack flags %#x", flags); return NULL; } @@ -65,7 +65,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, #endif #if !defined(RTE_STACK_LF_SUPPORTED) if (flags & RTE_STACK_F_LF) { - STACK_LOG_ERR("Lock-free stack is not supported on your platform\n"); + STACK_LOG_ERR("Lock-free stack is not supported on your platform"); rte_errno = ENOTSUP; return NULL; } @@ -82,7 +82,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, te = rte_zmalloc("STACK_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { - STACK_LOG_ERR("Cannot reserve memory for tailq\n"); + STACK_LOG_ERR("Cannot reserve memory for tailq"); rte_errno = ENOMEM; return NULL; } @@ -92,7 +92,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, mz = rte_memzone_reserve_aligned(mz_name, sz, socket_id, 0, __alignof__(*s)); if (mz == NULL) { - STACK_LOG_ERR("Cannot reserve stack memzone!\n"); + STACK_LOG_ERR("Cannot reserve stack memzone!"); rte_mcfg_tailq_write_unlock(); rte_free(te); return NULL; diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c index 3e1ef1ac25..6e5443e5f8 100644 --- a/lib/vhost/vhost_crypto.c +++ b/lib/vhost/vhost_crypto.c @@ -245,7 +245,7 @@ transform_cipher_param(struct rte_crypto_sym_xform *xform, return ret; if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) { - VC_LOG_DBG("Invalid cipher key length\n"); + VC_LOG_DBG("Invalid cipher key length"); return -VIRTIO_CRYPTO_BADMSG; } @@ -301,7 +301,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms, return ret; if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) { - VC_LOG_DBG("Invalid cipher key length\n"); + VC_LOG_DBG("Invalid cipher key length"); return -VIRTIO_CRYPTO_BADMSG; } @@ -321,7 +321,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms, return ret; if (param->auth_key_len > VHOST_USER_CRYPTO_MAX_HMAC_KEY_LENGTH) { - VC_LOG_DBG("Invalid auth key length\n"); + VC_LOG_DBG("Invalid auth key length"); return -VIRTIO_CRYPTO_BADMSG; } -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
[parent not found: <20231220153607.718606-1-david.marchand@redhat.com>]
* [PATCH v5 01/13] hash: remove some dead code [not found] ` <20231220153607.718606-1-david.marchand@redhat.com> @ 2023-12-20 15:35 ` David Marchand 2023-12-21 5:58 ` Ruifeng Wang 2023-12-21 6:26 ` Ruifeng Wang 2023-12-20 15:35 ` [PATCH v5 02/13] regexdev: fix logtype register David Marchand ` (3 subsequent siblings) 4 siblings, 2 replies; 39+ messages in thread From: David Marchand @ 2023-12-20 15:35 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Yipeng Wang, Sameh Gobriel, Vladimir Medvedkin, Ruifeng Wang, Ray Kinsella, Dharmik Thakkar This macro is not used. Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> --- lib/hash/rte_cuckoo_hash.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h index f7afc4dd79..8ea793c66e 100644 --- a/lib/hash/rte_cuckoo_hash.h +++ b/lib/hash/rte_cuckoo_hash.h @@ -29,17 +29,6 @@ #define RETURN_IF_TRUE(cond, retval) #endif -#if defined(RTE_LIBRTE_HASH_DEBUG) -#define ERR_IF_TRUE(cond, fmt, args...) do { \ - if (cond) { \ - RTE_LOG(ERR, HASH, fmt, ##args); \ - return; \ - } \ -} while (0) -#else -#define ERR_IF_TRUE(cond, fmt, args...) -#endif - #include <rte_hash_crc.h> #include <rte_jhash.h> -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v5 01/13] hash: remove some dead code 2023-12-20 15:35 ` [PATCH v5 01/13] hash: remove some dead code David Marchand @ 2023-12-21 5:58 ` Ruifeng Wang 2023-12-21 6:26 ` Ruifeng Wang 1 sibling, 0 replies; 39+ messages in thread From: Ruifeng Wang @ 2023-12-21 5:58 UTC (permalink / raw) To: David Marchand, dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Yipeng Wang, Sameh Gobriel, Vladimir Medvedkin, Ray Kinsella, Dharmik Thakkar On 2023/12/20 11:35 PM, David Marchand wrote: > This macro is not used. > > Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> > Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> > --- > lib/hash/rte_cuckoo_hash.h | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h > index f7afc4dd79..8ea793c66e 100644 > --- a/lib/hash/rte_cuckoo_hash.h > +++ b/lib/hash/rte_cuckoo_hash.h > @@ -29,17 +29,6 @@ > #define RETURN_IF_TRUE(cond, retval) > #endif > > -#if defined(RTE_LIBRTE_HASH_DEBUG) > -#define ERR_IF_TRUE(cond, fmt, args...) do { \ > - if (cond) { \ > - RTE_LOG(ERR, HASH, fmt, ##args); \ > - return; \ > - } \ > -} while (0) > -#else > -#define ERR_IF_TRUE(cond, fmt, args...) > -#endif > - > #include <rte_hash_crc.h> > #include <rte_jhash.h> > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v5 01/13] hash: remove some dead code 2023-12-20 15:35 ` [PATCH v5 01/13] hash: remove some dead code David Marchand 2023-12-21 5:58 ` Ruifeng Wang @ 2023-12-21 6:26 ` Ruifeng Wang 1 sibling, 0 replies; 39+ messages in thread From: Ruifeng Wang @ 2023-12-21 6:26 UTC (permalink / raw) To: David Marchand, dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Yipeng Wang, Sameh Gobriel, Vladimir Medvedkin, Ray Kinsella, Dharmik Thakkar, nd On 2023/12/20 11:35 PM, David Marchand wrote: > This macro is not used. > > Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand <david.marchand@redhat.com> > Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> > Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> > --- > lib/hash/rte_cuckoo_hash.h | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h > index f7afc4dd79..8ea793c66e 100644 > --- a/lib/hash/rte_cuckoo_hash.h > +++ b/lib/hash/rte_cuckoo_hash.h > @@ -29,17 +29,6 @@ > #define RETURN_IF_TRUE(cond, retval) > #endif > > -#if defined(RTE_LIBRTE_HASH_DEBUG) > -#define ERR_IF_TRUE(cond, fmt, args...) do { \ > - if (cond) { \ > - RTE_LOG(ERR, HASH, fmt, ##args); \ > - return; \ > - } \ > -} while (0) > -#else > -#define ERR_IF_TRUE(cond, fmt, args...) > -#endif > - > #include <rte_hash_crc.h> > #include <rte_jhash.h> > To correct the disclaimer issue. Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v5 02/13] regexdev: fix logtype register [not found] ` <20231220153607.718606-1-david.marchand@redhat.com> 2023-12-20 15:35 ` [PATCH v5 01/13] hash: remove some dead code David Marchand @ 2023-12-20 15:35 ` David Marchand 2023-12-20 15:35 ` [PATCH v5 03/13] lib: use dedicated logtypes and macros David Marchand ` (2 subsequent siblings) 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-20 15:35 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Ori Kam, Guy Kaneti, Parav Pandit This library logtype was not initialized so its logs would end up under the 0 logtype, iow, RTE_LOGTYPE_EAL. Fixes: b25246beaefc ("regexdev: add core functions") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Ori Kam <orika@nvidia.com> --- lib/regexdev/rte_regexdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c index caec069182..d38a85eb0b 100644 --- a/lib/regexdev/rte_regexdev.c +++ b/lib/regexdev/rte_regexdev.c @@ -19,7 +19,7 @@ static struct { struct rte_regexdev_data data[RTE_MAX_REGEXDEV_DEVS]; } *rte_regexdev_shared_data; -int rte_regexdev_logtype; +RTE_LOG_REGISTER_DEFAULT(rte_regexdev_logtype, INFO); static uint16_t regexdev_find_free_dev(void) -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v5 03/13] lib: use dedicated logtypes and macros [not found] ` <20231220153607.718606-1-david.marchand@redhat.com> 2023-12-20 15:35 ` [PATCH v5 01/13] hash: remove some dead code David Marchand 2023-12-20 15:35 ` [PATCH v5 02/13] regexdev: fix logtype register David Marchand @ 2023-12-20 15:35 ` David Marchand 2023-12-20 15:35 ` [PATCH v5 04/13] lib: add newline in logs David Marchand 2023-12-20 15:35 ` [PATCH v5 05/13] lib: remove redundant newline from logs David Marchand 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-20 15:35 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Andrew Rybchenko, Akhil Goyal, Fan Zhang, Amit Prakash Shukla, Jerin Jacob, Naga Harish K S V 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. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> --- 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_dma_adapter.c | 4 ++-- lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++++------ lib/eventdev/rte_eventdev.c | 6 +++--- lib/mempool/rte_mempool_ops.c | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 25e3ec12d1..ead8c9a623 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2684,7 +2684,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 fff4b7b4cd..55a9dcc565 100644 --- a/lib/ethdev/ethdev_driver.c +++ b/lib/ethdev/ethdev_driver.c @@ -487,7 +487,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; @@ -713,7 +713,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 e98b7188b0..0e1c7b23c1 100644 --- a/lib/ethdev/ethdev_private.c +++ b/lib/ethdev/ethdev_private.c @@ -182,7 +182,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_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; } } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 6db03adf04..82ae31712d 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -314,9 +314,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; \ } \ @@ -3671,7 +3671,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); @@ -3743,7 +3743,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); @@ -3813,7 +3813,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); @@ -3868,7 +3868,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 0ca32d6721..ae50821a3f 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1428,8 +1428,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; } @@ -1444,7 +1444,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 ae1d288f27..e871de9ec9 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.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v5 04/13] lib: add newline in logs [not found] ` <20231220153607.718606-1-david.marchand@redhat.com> ` (2 preceding siblings ...) 2023-12-20 15:35 ` [PATCH v5 03/13] lib: use dedicated logtypes and macros David Marchand @ 2023-12-20 15:35 ` David Marchand 2023-12-20 15:35 ` [PATCH v5 05/13] lib: remove redundant newline from logs David Marchand 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-20 15:35 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Tyler Retzlaff, Andrew Rybchenko, Harman Kalra, Vladimir Medvedkin, Anatoly Burakov, David Hunt, Sivaprasad Tummala Fix places leading to a log message not terminated with a newline. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> --- lib/eal/common/eal_common_options.c | 2 +- lib/eal/linux/eal_hugepage_info.c | 2 +- lib/eal/linux/eal_interrupts.c | 2 +- lib/ethdev/ethdev_pci.h | 2 +- lib/ethdev/rte_ethdev.c | 40 ++++++++++++++--------------- lib/lpm/rte_lpm6.c | 6 ++--- lib/power/guest_channel.c | 2 +- lib/power/rte_power_pmd_mgmt.c | 6 ++--- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index a6d21f1cba..e9ba01fb89 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -2141,7 +2141,7 @@ rte_vect_set_max_simd_bitwidth(uint16_t bitwidth) struct internal_config *internal_conf = eal_get_internal_configuration(); if (internal_conf->max_simd_bitwidth.forced) { - RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled"); + RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled\n"); return -EPERM; } diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c index 581d9dfc91..36a495fb1f 100644 --- a/lib/eal/linux/eal_hugepage_info.c +++ b/lib/eal/linux/eal_hugepage_info.c @@ -403,7 +403,7 @@ inspect_hugedir_cb(const struct walk_hugedir_data *whd) struct stat st; if (fstat(whd->file_fd, &st) < 0) - RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s", + RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s\n", __func__, whd->file_name, strerror(errno)); else (*total_size) += st.st_size; diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index d4919dff45..eabac24992 100644 --- a/lib/eal/linux/eal_interrupts.c +++ b/lib/eal/linux/eal_interrupts.c @@ -1542,7 +1542,7 @@ rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd) /* only check, initialization would be done in vdev driver.*/ if ((uint64_t)rte_intr_efd_counter_size_get(intr_handle) > sizeof(union rte_intr_read_buffer)) { - RTE_LOG(ERR, EAL, "the efd_counter_size is oversized"); + RTE_LOG(ERR, EAL, "the efd_counter_size is oversized\n"); return -EINVAL; } } else { diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h index 320e3e0093..ddb559aa95 100644 --- a/lib/ethdev/ethdev_pci.h +++ b/lib/ethdev/ethdev_pci.h @@ -31,7 +31,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev) { if ((eth_dev == NULL) || (pci_dev == NULL)) { - RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p", + RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p\n", (void *)eth_dev, (void *)pci_dev); return; } diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 3858983fcc..b9d99ece15 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -724,7 +724,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) uint16_t pid; if (name == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name"); + RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name\n"); return -EINVAL; } @@ -2394,41 +2394,41 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, nb_rx_desc = cap.max_nb_desc; if (nb_rx_desc > cap.max_nb_desc) { RTE_ETHDEV_LOG(ERR, - "Invalid value for nb_rx_desc(=%hu), should be: <= %hu", + "Invalid value for nb_rx_desc(=%hu), should be: <= %hu\n", nb_rx_desc, cap.max_nb_desc); return -EINVAL; } if (conf->peer_count > cap.max_rx_2_tx) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Rx queue(=%u), should be: <= %hu", + "Invalid value for number of peers for Rx queue(=%u), should be: <= %hu\n", conf->peer_count, cap.max_rx_2_tx); return -EINVAL; } if (conf->use_locked_device_memory && !cap.rx_cap.locked_device_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use locked device memory for Rx queue, which is not supported"); + "Attempt to use locked device memory for Rx queue, which is not supported\n"); return -EINVAL; } if (conf->use_rte_memory && !cap.rx_cap.rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use DPDK memory for Rx queue, which is not supported"); + "Attempt to use DPDK memory for Rx queue, which is not supported\n"); return -EINVAL; } if (conf->use_locked_device_memory && conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use mutually exclusive memory settings for Rx queue"); + "Attempt to use mutually exclusive memory settings for Rx queue\n"); return -EINVAL; } if (conf->force_memory && !conf->use_locked_device_memory && !conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to force Rx queue memory settings, but none is set"); + "Attempt to force Rx queue memory settings, but none is set\n"); return -EINVAL; } if (conf->peer_count == 0) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Rx queue(=%u), should be: > 0", + "Invalid value for number of peers for Rx queue(=%u), should be: > 0\n", conf->peer_count); return -EINVAL; } @@ -2438,7 +2438,7 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, count++; } if (count > cap.max_nb_queues) { - RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d", + RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d\n", cap.max_nb_queues); return -EINVAL; } @@ -2597,41 +2597,41 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, nb_tx_desc = cap.max_nb_desc; if (nb_tx_desc > cap.max_nb_desc) { RTE_ETHDEV_LOG(ERR, - "Invalid value for nb_tx_desc(=%hu), should be: <= %hu", + "Invalid value for nb_tx_desc(=%hu), should be: <= %hu\n", nb_tx_desc, cap.max_nb_desc); return -EINVAL; } if (conf->peer_count > cap.max_tx_2_rx) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Tx queue(=%u), should be: <= %hu", + "Invalid value for number of peers for Tx queue(=%u), should be: <= %hu\n", conf->peer_count, cap.max_tx_2_rx); return -EINVAL; } if (conf->use_locked_device_memory && !cap.tx_cap.locked_device_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use locked device memory for Tx queue, which is not supported"); + "Attempt to use locked device memory for Tx queue, which is not supported\n"); return -EINVAL; } if (conf->use_rte_memory && !cap.tx_cap.rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use DPDK memory for Tx queue, which is not supported"); + "Attempt to use DPDK memory for Tx queue, which is not supported\n"); return -EINVAL; } if (conf->use_locked_device_memory && conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to use mutually exclusive memory settings for Tx queue"); + "Attempt to use mutually exclusive memory settings for Tx queue\n"); return -EINVAL; } if (conf->force_memory && !conf->use_locked_device_memory && !conf->use_rte_memory) { RTE_ETHDEV_LOG(ERR, - "Attempt to force Tx queue memory settings, but none is set"); + "Attempt to force Tx queue memory settings, but none is set\n"); return -EINVAL; } if (conf->peer_count == 0) { RTE_ETHDEV_LOG(ERR, - "Invalid value for number of peers for Tx queue(=%u), should be: > 0", + "Invalid value for number of peers for Tx queue(=%u), should be: > 0\n", conf->peer_count); return -EINVAL; } @@ -2641,7 +2641,7 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, count++; } if (count > cap.max_nb_queues) { - RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d", + RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d\n", cap.max_nb_queues); return -EINVAL; } @@ -6716,7 +6716,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id, } if (reassembly_capa == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL"); + RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL\n"); return -EINVAL; } @@ -6752,7 +6752,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id, } if (conf == NULL) { - RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL"); + RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL\n"); return -EINVAL; } @@ -6780,7 +6780,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, if (dev->data->dev_configured == 0) { RTE_ETHDEV_LOG(ERR, "Device with port_id=%u is not configured.\n" - "Cannot set IP reassembly configuration", + "Cannot set IP reassembly configuration\n", port_id); return -EINVAL; } diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c index 873cc8bc26..24ce7dd022 100644 --- a/lib/lpm/rte_lpm6.c +++ b/lib/lpm/rte_lpm6.c @@ -280,7 +280,7 @@ rte_lpm6_create(const char *name, int socket_id, rules_tbl = rte_hash_create(&rule_hash_tbl_params); if (rules_tbl == NULL) { - RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); goto fail_wo_unlock; } @@ -290,7 +290,7 @@ rte_lpm6_create(const char *name, int socket_id, sizeof(uint32_t) * config->number_tbl8s, RTE_CACHE_LINE_SIZE); if (tbl8_pool == NULL) { - RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); rte_errno = ENOMEM; goto fail_wo_unlock; @@ -301,7 +301,7 @@ rte_lpm6_create(const char *name, int socket_id, sizeof(struct rte_lpm_tbl8_hdr) * config->number_tbl8s, RTE_CACHE_LINE_SIZE); if (tbl8_hdrs == NULL) { - RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)", + RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)\n", rte_strerror(rte_errno), rte_errno); rte_errno = ENOMEM; goto fail_wo_unlock; diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c index cc05347425..a6f2097d5b 100644 --- a/lib/power/guest_channel.c +++ b/lib/power/guest_channel.c @@ -90,7 +90,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id) flags |= O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) < 0) { RTE_LOG(ERR, GUEST_CHANNEL, "Failed on setting non-blocking mode for " - "file %s", fd_path); + "file %s\n", fd_path); goto error; } /* QEMU needs a delay after connection */ diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c index 38f8384085..6f18ed0adf 100644 --- a/lib/power/rte_power_pmd_mgmt.c +++ b/lib/power/rte_power_pmd_mgmt.c @@ -686,7 +686,7 @@ int rte_power_pmd_mgmt_set_pause_duration(unsigned int duration) { if (duration == 0) { - RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged"); + RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged\n"); return -EINVAL; } pause_duration = duration; @@ -709,7 +709,7 @@ rte_power_pmd_mgmt_set_scaling_freq_min(unsigned int lcore, unsigned int min) } if (min > scale_freq_max[lcore]) { - RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency"); + RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency\n"); return -EINVAL; } scale_freq_min[lcore] = min; @@ -729,7 +729,7 @@ rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max) if (max == 0) max = UINT32_MAX; if (max < scale_freq_min[lcore]) { - RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency"); + RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency\n"); return -EINVAL; } -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v5 05/13] lib: remove redundant newline from logs [not found] ` <20231220153607.718606-1-david.marchand@redhat.com> ` (3 preceding siblings ...) 2023-12-20 15:35 ` [PATCH v5 04/13] lib: add newline in logs David Marchand @ 2023-12-20 15:35 ` David Marchand 4 siblings, 0 replies; 39+ messages in thread From: David Marchand @ 2023-12-20 15:35 UTC (permalink / raw) To: dev Cc: thomas, ferruh.yigit, bruce.richardson, stephen, mb, stable, Chengwen Feng, Mattias Rönnblom, Kai Ji, Pablo de Lara, Nicolas Chautru, Cristian Dumitrescu, Fan Zhang, Ashish Gupta, Akhil Goyal, Kevin Laatz, Dmitry Kozlyuk, Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam, Jerin Jacob, Abhinandan Gujjar, Amit Prakash Shukla, Naga Harish K S V, Erik Gabriel Carrillo, Srikanth Yalavarthi, Jasvinder Singh, Nithin Dabilpuram, Pavan Nikhilesh, Honnappa Nagarahalli, Maxime Coquelin, Chenbo Xia Fix places where two newline characters may be logged. Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> --- Changes since RFC v1: - split fixes on direct calls to printf or RTE_LOG in a previous patch, --- drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 2 +- lib/bbdev/rte_bbdev.c | 6 +- lib/cfgfile/rte_cfgfile.c | 14 ++-- lib/compressdev/rte_compressdev_pmd.c | 4 +- lib/cryptodev/rte_cryptodev.c | 2 +- lib/dispatcher/rte_dispatcher.c | 12 +-- lib/dmadev/rte_dmadev.c | 2 +- lib/eal/windows/eal_memory.c | 2 +- lib/eventdev/eventdev_pmd.h | 6 +- lib/eventdev/rte_event_crypto_adapter.c | 12 +-- lib/eventdev/rte_event_dma_adapter.c | 14 ++-- lib/eventdev/rte_event_eth_rx_adapter.c | 28 +++---- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- lib/eventdev/rte_event_timer_adapter.c | 4 +- lib/eventdev/rte_eventdev.c | 4 +- lib/metrics/rte_metrics_telemetry.c | 2 +- lib/mldev/rte_mldev.c | 102 ++++++++++++------------ lib/net/rte_net_crc.c | 6 +- lib/node/ethdev_rx.c | 4 +- lib/node/ip4_lookup.c | 2 +- lib/node/ip6_lookup.c | 2 +- lib/node/kernel_rx.c | 8 +- lib/node/kernel_tx.c | 4 +- lib/rcu/rte_rcu_qsbr.c | 4 +- lib/rcu/rte_rcu_qsbr.h | 8 +- lib/stack/rte_stack.c | 8 +- lib/vhost/vhost_crypto.c | 6 +- 27 files changed, 135 insertions(+), 135 deletions(-) diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c index 52d6d010c7..f21f9cc5a0 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c +++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c @@ -407,7 +407,7 @@ ipsec_mb_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer) resp_param->result = ipsec_mb_qp_release(dev, qp_id); break; default: - CDEV_LOG_ERR("invalid mp request type\n"); + CDEV_LOG_ERR("invalid mp request type"); } out: diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index cfebea09c7..e09bb97abb 100644 --- a/lib/bbdev/rte_bbdev.c +++ b/lib/bbdev/rte_bbdev.c @@ -1106,12 +1106,12 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, intr_handle = dev->intr_handle; if (intr_handle == NULL) { - rte_bbdev_log(ERR, "Device %u intr handle unset\n", dev_id); + rte_bbdev_log(ERR, "Device %u intr handle unset", dev_id); return -ENOTSUP; } if (queue_id >= RTE_MAX_RXTX_INTR_VEC_ID) { - rte_bbdev_log(ERR, "Device %u queue_id %u is too big\n", + rte_bbdev_log(ERR, "Device %u queue_id %u is too big", dev_id, queue_id); return -ENOTSUP; } @@ -1120,7 +1120,7 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, ret = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data); if (ret && (ret != -EEXIST)) { rte_bbdev_log(ERR, - "dev %u q %u int ctl error op %d epfd %d vec %u\n", + "dev %u q %u int ctl error op %d epfd %d vec %u", dev_id, queue_id, op, epfd, vec); return ret; } diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c index eefba6e408..2f9cc0722a 100644 --- a/lib/cfgfile/rte_cfgfile.c +++ b/lib/cfgfile/rte_cfgfile.c @@ -137,7 +137,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) unsigned int i; if (!params) { - CFG_LOG(ERR, "missing cfgfile parameters\n"); + CFG_LOG(ERR, "missing cfgfile parameters"); return -EINVAL; } @@ -150,7 +150,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params) } if (valid_comment == 0) { - CFG_LOG(ERR, "invalid comment characters %c\n", + CFG_LOG(ERR, "invalid comment characters %c", params->comment_character); return -ENOTSUP; } @@ -188,7 +188,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, lineno++; if ((len >= sizeof(buffer) - 1) && (buffer[len-1] != '\n')) { CFG_LOG(ERR, " line %d - no \\n found on string. " - "Check if line too long\n", lineno); + "Check if line too long", lineno); goto error1; } /* skip parsing if comment character found */ @@ -209,7 +209,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, char *end = memchr(buffer, ']', len); if (end == NULL) { CFG_LOG(ERR, - "line %d - no terminating ']' character found\n", + "line %d - no terminating ']' character found", lineno); goto error1; } @@ -225,7 +225,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, split[1] = memchr(buffer, '=', len); if (split[1] == NULL) { CFG_LOG(ERR, - "line %d - no '=' character found\n", + "line %d - no '=' character found", lineno); goto error1; } @@ -249,7 +249,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags, if (!(flags & CFG_FLAG_EMPTY_VALUES) && (*split[1] == '\0')) { CFG_LOG(ERR, - "line %d - cannot use empty values\n", + "line %d - cannot use empty values", lineno); goto error1; } @@ -414,7 +414,7 @@ int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname, return 0; } - CFG_LOG(ERR, "entry name doesn't exist\n"); + CFG_LOG(ERR, "entry name doesn't exist"); return -EINVAL; } diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c index 156bccd972..762b44f03e 100644 --- a/lib/compressdev/rte_compressdev_pmd.c +++ b/lib/compressdev/rte_compressdev_pmd.c @@ -100,12 +100,12 @@ rte_compressdev_pmd_create(const char *name, struct rte_compressdev *compressdev; if (params->name[0] != '\0') { - COMPRESSDEV_LOG(INFO, "User specified device name = %s\n", + COMPRESSDEV_LOG(INFO, "User specified device name = %s", params->name); name = params->name; } - COMPRESSDEV_LOG(INFO, "Creating compressdev %s\n", name); + COMPRESSDEV_LOG(INFO, "Creating compressdev %s", name); COMPRESSDEV_LOG(INFO, "Init parameters - name: %s, socket id: %d", name, params->socket_id); diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index ead8c9a623..b233c0ecd7 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2074,7 +2074,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id, } if (xforms == NULL) { - CDEV_LOG_ERR("Invalid xform\n"); + CDEV_LOG_ERR("Invalid xform"); rte_errno = EINVAL; return NULL; } diff --git a/lib/dispatcher/rte_dispatcher.c b/lib/dispatcher/rte_dispatcher.c index 10d02edde9..95dd41b818 100644 --- a/lib/dispatcher/rte_dispatcher.c +++ b/lib/dispatcher/rte_dispatcher.c @@ -246,7 +246,7 @@ evd_service_register(struct rte_dispatcher *dispatcher) rc = rte_service_component_register(&service, &dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Registration of dispatcher service " - "%s failed with error code %d\n", + "%s failed with error code %d", service.name, rc); return rc; @@ -260,7 +260,7 @@ evd_service_unregister(struct rte_dispatcher *dispatcher) rc = rte_service_component_unregister(dispatcher->service_id); if (rc != 0) RTE_EDEV_LOG_ERR("Unregistration of dispatcher service " - "failed with error code %d\n", rc); + "failed with error code %d", rc); return rc; } @@ -279,7 +279,7 @@ rte_dispatcher_create(uint8_t event_dev_id) RTE_CACHE_LINE_SIZE, socket_id); if (dispatcher == NULL) { - RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher\n"); + RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher"); rte_errno = ENOMEM; return NULL; } @@ -483,7 +483,7 @@ evd_lcore_uninstall_handler(struct rte_dispatcher_lcore *lcore, unreg_handler = evd_lcore_get_handler_by_id(lcore, handler_id); if (unreg_handler == NULL) { - RTE_EDEV_LOG_ERR("Invalid handler id %d\n", handler_id); + RTE_EDEV_LOG_ERR("Invalid handler id %d", handler_id); return -EINVAL; } @@ -602,7 +602,7 @@ rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher, unreg_finalizer = evd_get_finalizer_by_id(dispatcher, finalizer_id); if (unreg_finalizer == NULL) { - RTE_EDEV_LOG_ERR("Invalid finalizer id %d\n", finalizer_id); + RTE_EDEV_LOG_ERR("Invalid finalizer id %d", finalizer_id); return -EINVAL; } @@ -636,7 +636,7 @@ evd_set_service_runstate(struct rte_dispatcher *dispatcher, int state) */ if (rc != 0) RTE_EDEV_LOG_ERR("Unexpected error %d occurred while setting " - "service component run state to %d\n", rc, + "service component run state to %d", rc, state); RTE_VERIFY(rc == 0); diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 4e5e420c82..009a21849a 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -726,7 +726,7 @@ rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status * return -EINVAL; if (vchan >= dev->data->dev_conf.nb_vchans) { - RTE_DMA_LOG(ERR, "Device %u vchan %u out of range\n", dev_id, vchan); + RTE_DMA_LOG(ERR, "Device %u vchan %u out of range", dev_id, vchan); return -EINVAL; } diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c index 31410a41fd..fd39155163 100644 --- a/lib/eal/windows/eal_memory.c +++ b/lib/eal/windows/eal_memory.c @@ -110,7 +110,7 @@ eal_mem_win32api_init(void) VirtualAlloc2_ptr = (VirtualAlloc2_type)( (void *)GetProcAddress(library, function)); if (VirtualAlloc2_ptr == NULL) { - RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")\n", + RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")", library_name, function); /* Contrary to the docs, Server 2016 is not supported. */ diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index 30bd90085c..2ec5aec0a8 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -49,14 +49,14 @@ extern "C" { /* Macros to check for valid device */ #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return retval; \ } \ } while (0) #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ rte_errno = errno; \ return retval; \ } \ @@ -64,7 +64,7 @@ extern "C" { #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \ if (!rte_event_pmd_is_valid_dev((dev_id))) { \ - RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ + RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \ return; \ } \ } while (0) diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 1b435c9f0e..d46595d190 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -133,7 +133,7 @@ static struct event_crypto_adapter **event_crypto_adapter; /* Macros to check for valid adapter */ #define EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!eca_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -309,7 +309,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", dev_id); + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) return -EIO; @@ -319,7 +319,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -391,7 +391,7 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, sizeof(struct crypto_device_info), 0, socket_id); if (adapter->cdevs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices\n"); + RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices"); eca_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -1403,7 +1403,7 @@ rte_event_crypto_adapter_runtime_params_set(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1436,7 +1436,7 @@ rte_event_crypto_adapter_runtime_params_get(uint8_t id, EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c index cbf9405438..4196164305 100644 --- a/lib/eventdev/rte_event_dma_adapter.c +++ b/lib/eventdev/rte_event_dma_adapter.c @@ -20,7 +20,7 @@ #define EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) \ do { \ if (!edma_adapter_valid_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d", id); \ return retval; \ } \ } while (0) @@ -313,7 +313,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_dev_configure(evdev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to configure event dev %u\n", evdev_id); + RTE_EDEV_LOG_ERR("Failed to configure event dev %u", evdev_id); if (started) { if (rte_event_dev_start(evdev_id)) return -EIO; @@ -323,7 +323,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte ret = rte_event_port_setup(evdev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("Failed to setup event port %u\n", port_id); + RTE_EDEV_LOG_ERR("Failed to setup event port %u", port_id); return ret; } @@ -407,7 +407,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, num_dma_dev * sizeof(struct dma_device_info), 0, socket_id); if (adapter->dma_devs == NULL) { - RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices\n"); + RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return -ENOMEM; @@ -417,7 +417,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, for (i = 0; i < num_dma_dev; i++) { ret = rte_dma_info_get(i, &info); if (ret) { - RTE_EDEV_LOG_ERR("Failed to get dma device info\n"); + RTE_EDEV_LOG_ERR("Failed to get dma device info"); edma_circular_buffer_free(&adapter->ebuf); rte_free(adapter); return ret; @@ -1297,7 +1297,7 @@ rte_event_dma_adapter_runtime_params_set(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } @@ -1326,7 +1326,7 @@ rte_event_dma_adapter_runtime_params_get(uint8_t id, EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); if (params == NULL) { - RTE_EDEV_LOG_ERR("params pointer is NULL\n"); + RTE_EDEV_LOG_ERR("params pointer is NULL"); return -EINVAL; } diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 82ae31712d..1b83a55b5c 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -293,14 +293,14 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ return retval; \ } \ } while (0) #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_GOTO_ERR_RET(id, retval) do { \ if (!rxa_validate_id(id)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \ ret = retval; \ goto error; \ } \ @@ -308,7 +308,7 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id, #define RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, retval) do { \ if ((token) == NULL || strlen(token) == 0 || !isdigit(*token)) { \ - RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token\n"); \ + RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token"); \ ret = retval; \ goto error; \ } \ @@ -1540,7 +1540,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", + RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id); if (started) { if (rte_event_dev_start(dev_id)) @@ -1551,7 +1551,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); return ret; } @@ -1628,7 +1628,7 @@ rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter) if (!err) return 0; - RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); error: rte_ring_free(rx_adapter->intr_ring); @@ -1644,12 +1644,12 @@ rxa_destroy_intr_thread(struct event_eth_rx_adapter *rx_adapter) err = pthread_cancel((pthread_t)rx_adapter->rx_intr_thread.opaque_id); if (err) - RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d\n", + RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d", err); err = rte_thread_join(rx_adapter->rx_intr_thread, NULL); if (err) - RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d\n", err); + RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d", err); rte_free(rx_adapter->epoll_events); rte_ring_free(rx_adapter->intr_ring); @@ -1915,7 +1915,7 @@ rxa_init_service(struct event_eth_rx_adapter *rx_adapter, uint8_t id) if (rte_mbuf_dyn_rx_timestamp_register( &event_eth_rx_timestamp_dynfield_offset, &event_eth_rx_timestamp_dynflag) != 0) { - RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf\n"); + RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf"); return -rte_errno; } @@ -2445,7 +2445,7 @@ rxa_create(uint8_t id, uint8_t dev_id, RTE_DIM(default_rss_key)); if (rx_adapter->eth_devices == NULL) { - RTE_EDEV_LOG_ERR("failed to get mem for eth devices\n"); + RTE_EDEV_LOG_ERR("failed to get mem for eth devices"); rte_free(rx_adapter); return -ENOMEM; } @@ -2497,12 +2497,12 @@ rxa_config_params_validate(struct rte_event_eth_rx_adapter_params *rxa_params, return 0; } else if (!rxa_params->use_queue_event_buf && rxa_params->event_buf_size == 0) { - RTE_EDEV_LOG_ERR("event buffer size can't be zero\n"); + RTE_EDEV_LOG_ERR("event buffer size can't be zero"); return -EINVAL; } else if (rxa_params->use_queue_event_buf && rxa_params->event_buf_size != 0) { RTE_EDEV_LOG_ERR("event buffer size needs to be configured " - "as part of queue add\n"); + "as part of queue add"); return -EINVAL; } @@ -3597,7 +3597,7 @@ handle_rxa_stats(const char *cmd __rte_unused, /* Get Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, &rx_adptr_stats)) { - RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats"); return -1; } @@ -3636,7 +3636,7 @@ handle_rxa_stats_reset(const char *cmd __rte_unused, /* Reset Rx adapter stats */ if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { - RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats"); return -1; } diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index 360d5caf6a..56435be991 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -334,7 +334,7 @@ txa_service_conf_cb(uint8_t __rte_unused id, uint8_t dev_id, ret = rte_event_port_setup(dev_id, port_id, pc); if (ret) { - RTE_EDEV_LOG_ERR("failed to setup event port %u\n", + RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id); if (started) { if (rte_event_dev_start(dev_id)) diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index 27466707bc..3f22e85173 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -106,7 +106,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_dev_configure(dev_id, &dev_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to configure event dev %u\n", dev_id); + EVTIM_LOG_ERR("failed to configure event dev %u", dev_id); if (started) if (rte_event_dev_start(dev_id)) return -EIO; @@ -116,7 +116,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, ret = rte_event_port_setup(dev_id, port_id, port_conf); if (ret < 0) { - EVTIM_LOG_ERR("failed to setup event port %u on event dev %u\n", + EVTIM_LOG_ERR("failed to setup event port %u on event dev %u", port_id, dev_id); return ret; } diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index ae50821a3f..157752868d 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1007,13 +1007,13 @@ rte_event_port_profile_links_set(uint8_t dev_id, uint8_t port_id, const uint8_t } if (*dev->dev_ops->port_link == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } if (profile_id && *dev->dev_ops->port_link_profile == NULL) { - RTE_EDEV_LOG_ERR("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } diff --git a/lib/metrics/rte_metrics_telemetry.c b/lib/metrics/rte_metrics_telemetry.c index 5be21b2e86..1d133e1f8c 100644 --- a/lib/metrics/rte_metrics_telemetry.c +++ b/lib/metrics/rte_metrics_telemetry.c @@ -363,7 +363,7 @@ rte_metrics_tel_stat_names_to_ids(const char * const *stat_names, } } if (j == num_metrics) { - METRICS_LOG_WARN("Invalid stat name %s\n", + METRICS_LOG_WARN("Invalid stat name %s", stat_names[i]); free(names); return -EINVAL; diff --git a/lib/mldev/rte_mldev.c b/lib/mldev/rte_mldev.c index cc5f2e0cc6..196b1850e6 100644 --- a/lib/mldev/rte_mldev.c +++ b/lib/mldev/rte_mldev.c @@ -159,7 +159,7 @@ int rte_ml_dev_init(size_t dev_max) { if (dev_max == 0 || dev_max > INT16_MAX) { - RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)\n", dev_max, INT16_MAX); + RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)", dev_max, INT16_MAX); rte_errno = EINVAL; return -rte_errno; } @@ -217,7 +217,7 @@ rte_ml_dev_socket_id(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -232,7 +232,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -241,7 +241,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info) return -ENOTSUP; if (dev_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL", dev_id); return -EINVAL; } memset(dev_info, 0, sizeof(struct rte_ml_dev_info)); @@ -257,7 +257,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -271,7 +271,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) } if (config == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL", dev_id); return -EINVAL; } @@ -280,7 +280,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config) return ret; if (config->nb_queue_pairs > dev_info.max_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u\n", dev_id, + RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u", dev_id, config->nb_queue_pairs, dev_info.max_queue_pairs); return -EINVAL; } @@ -294,7 +294,7 @@ rte_ml_dev_close(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -318,7 +318,7 @@ rte_ml_dev_start(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -345,7 +345,7 @@ rte_ml_dev_stop(int16_t dev_id) int ret; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -372,7 +372,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -386,7 +386,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id, } if (qp_conf == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL", dev_id); return -EINVAL; } @@ -404,7 +404,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -413,7 +413,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats) return -ENOTSUP; if (stats == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL", dev_id); return -EINVAL; } memset(stats, 0, sizeof(struct rte_ml_dev_stats)); @@ -427,7 +427,7 @@ rte_ml_dev_stats_reset(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return; } @@ -445,7 +445,7 @@ rte_ml_dev_xstats_names_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, in struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -462,7 +462,7 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -471,12 +471,12 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i return -ENOTSUP; if (name == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL", dev_id); return -EINVAL; } if (value == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL", dev_id); return -EINVAL; } @@ -490,7 +490,7 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -499,12 +499,12 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t return -ENOTSUP; if (stat_ids == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL", dev_id); return -EINVAL; } if (values == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL", dev_id); return -EINVAL; } @@ -518,7 +518,7 @@ rte_ml_dev_xstats_reset(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_ struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -535,7 +535,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -544,7 +544,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd) return -ENOTSUP; if (fd == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL", dev_id); return -EINVAL; } @@ -557,7 +557,7 @@ rte_ml_dev_selftest(int16_t dev_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -574,7 +574,7 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -583,12 +583,12 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t * return -ENOTSUP; if (params == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL", dev_id); return -EINVAL; } if (model_id == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL", dev_id); return -EINVAL; } @@ -601,7 +601,7 @@ rte_ml_model_unload(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -618,7 +618,7 @@ rte_ml_model_start(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -635,7 +635,7 @@ rte_ml_model_stop(int16_t dev_id, uint16_t model_id) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -652,7 +652,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -661,7 +661,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf return -ENOTSUP; if (model_info == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL\n", dev_id, + RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL", dev_id, model_id); return -EINVAL; } @@ -675,7 +675,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -684,7 +684,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer) return -ENOTSUP; if (buffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL", dev_id); return -EINVAL; } @@ -698,7 +698,7 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -707,12 +707,12 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d return -ENOTSUP; if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -726,7 +726,7 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * struct rte_ml_dev *dev; if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -735,12 +735,12 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg * return -ENOTSUP; if (qbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id); return -EINVAL; } if (dbuffer == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id); return -EINVAL; } @@ -811,7 +811,7 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -823,13 +823,13 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -847,7 +847,7 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); rte_errno = -EINVAL; return 0; } @@ -859,13 +859,13 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin } if (ops == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id); rte_errno = -EINVAL; return 0; } if (qp_id >= dev->data->nb_queue_pairs) { - RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id); + RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id); rte_errno = -EINVAL; return 0; } @@ -883,7 +883,7 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error #ifdef RTE_LIBRTE_ML_DEV_DEBUG if (!rte_ml_dev_is_valid_dev(dev_id)) { - RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id); + RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id); return -EINVAL; } @@ -892,12 +892,12 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error return -ENOTSUP; if (op == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL", dev_id); return -EINVAL; } if (error == NULL) { - RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL\n", dev_id); + RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL", dev_id); return -EINVAL; } #else diff --git a/lib/net/rte_net_crc.c b/lib/net/rte_net_crc.c index a685f9e7bb..900d6de7f4 100644 --- a/lib/net/rte_net_crc.c +++ b/lib/net/rte_net_crc.c @@ -179,7 +179,7 @@ avx512_vpclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_512) return handlers_avx512; #endif - NET_LOG(INFO, "Requirements not met, can't use AVX512\n"); + NET_LOG(INFO, "Requirements not met, can't use AVX512"); return NULL; } @@ -205,7 +205,7 @@ sse42_pclmulqdq_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_sse42; #endif - NET_LOG(INFO, "Requirements not met, can't use SSE\n"); + NET_LOG(INFO, "Requirements not met, can't use SSE"); return NULL; } @@ -231,7 +231,7 @@ neon_pmull_get_handlers(void) max_simd_bitwidth >= RTE_VECT_SIMD_128) return handlers_neon; #endif - NET_LOG(INFO, "Requirements not met, can't use NEON\n"); + NET_LOG(INFO, "Requirements not met, can't use NEON"); return NULL; } diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c index 3e8fac1df4..475eff6abe 100644 --- a/lib/node/ethdev_rx.c +++ b/lib/node/ethdev_rx.c @@ -160,13 +160,13 @@ ethdev_ptype_setup(uint16_t port, uint16_t queue) if (!l3_ipv4 || !l3_ipv6) { node_info("ethdev_rx", - "Enabling ptype callback for required ptypes on port %u\n", + "Enabling ptype callback for required ptypes on port %u", port); if (!rte_eth_add_rx_callback(port, queue, eth_pkt_parse_cb, NULL)) { node_err("ethdev_rx", - "Failed to add rx ptype cb: port=%d, queue=%d\n", + "Failed to add rx ptype cb: port=%d, queue=%d", port, queue); return -EINVAL; } diff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c index 0dbfde64fe..18955971f6 100644 --- a/lib/node/ip4_lookup.c +++ b/lib/node/ip4_lookup.c @@ -143,7 +143,7 @@ rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop, ip, depth, val); if (ret < 0) { node_err("ip4_lookup", - "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d\n", + "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/ip6_lookup.c b/lib/node/ip6_lookup.c index 6f56eb5ec5..309964f60f 100644 --- a/lib/node/ip6_lookup.c +++ b/lib/node/ip6_lookup.c @@ -283,7 +283,7 @@ rte_node_ip6_route_add(const uint8_t *ip, uint8_t depth, uint16_t next_hop, if (ret < 0) { node_err("ip6_lookup", "Unable to add entry %s / %d nh (%x) to LPM " - "table on sock %d, rc=%d\n", + "table on sock %d, rc=%d", abuf, depth, val, socket, ret); return ret; } diff --git a/lib/node/kernel_rx.c b/lib/node/kernel_rx.c index 2dba7c8cc7..6c20cdbb1e 100644 --- a/lib/node/kernel_rx.c +++ b/lib/node/kernel_rx.c @@ -134,7 +134,7 @@ kernel_rx_node_do(struct rte_graph *graph, struct rte_node *node, kernel_rx_node if (len == 0 || len == 0xFFFF) { rte_pktmbuf_free(m); if (rx->idx <= 0) - node_dbg("kernel_rx", "rx_mbuf array is empty\n"); + node_dbg("kernel_rx", "rx_mbuf array is empty"); rx->idx--; break; } @@ -207,20 +207,20 @@ kernel_rx_node_init(const struct rte_graph *graph, struct rte_node *node) RTE_VERIFY(elem != NULL); if (ctx->pktmbuf_pool == NULL) { - node_err("kernel_rx", "Invalid mbuf pool on graph %s\n", graph->name); + node_err("kernel_rx", "Invalid mbuf pool on graph %s", graph->name); return -EINVAL; } recv_info = rte_zmalloc_socket("kernel_rx_info", sizeof(kernel_rx_info_t), RTE_CACHE_LINE_SIZE, graph->socket); if (!recv_info) { - node_err("kernel_rx", "Kernel recv_info is NULL\n"); + node_err("kernel_rx", "Kernel recv_info is NULL"); return -ENOMEM; } sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (sock < 0) { - node_err("kernel_rx", "Unable to open RAW socket\n"); + node_err("kernel_rx", "Unable to open RAW socket"); return sock; } diff --git a/lib/node/kernel_tx.c b/lib/node/kernel_tx.c index 27d1808c71..3a96741622 100644 --- a/lib/node/kernel_tx.c +++ b/lib/node/kernel_tx.c @@ -36,7 +36,7 @@ kernel_tx_process_mbuf(struct rte_node *node, struct rte_mbuf **mbufs, uint16_t sin.sin_addr.s_addr = ip4->dst_addr; if (sendto(ctx->sock, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)) < 0) - node_err("kernel_tx", "Unable to send packets: %s\n", strerror(errno)); + node_err("kernel_tx", "Unable to send packets: %s", strerror(errno)); } } @@ -87,7 +87,7 @@ kernel_tx_node_init(const struct rte_graph *graph __rte_unused, struct rte_node ctx->sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (ctx->sock < 0) - node_err("kernel_tx", "Unable to open RAW socket\n"); + node_err("kernel_tx", "Unable to open RAW socket"); return 0; } diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c index a9f3d6cc98..41a44be4b9 100644 --- a/lib/rcu/rte_rcu_qsbr.c +++ b/lib/rcu/rte_rcu_qsbr.c @@ -92,7 +92,7 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; @@ -144,7 +144,7 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v, unsigned int thread_id) return 1; } - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); id = thread_id & __RTE_QSBR_THRID_MASK; diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index 5979fb0efb..6b908e7ee0 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -299,7 +299,7 @@ rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Copy the current value of token. @@ -350,7 +350,7 @@ rte_rcu_qsbr_thread_offline(struct rte_rcu_qsbr *v, unsigned int thread_id) { RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* The reader can go offline only after the load of the @@ -427,7 +427,7 @@ rte_rcu_qsbr_unlock(__rte_unused struct rte_rcu_qsbr *v, 1, rte_memory_order_release); __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, WARNING, - "Lock counter %u. Nested locks?\n", + "Lock counter %u. Nested locks?", v->qsbr_cnt[thread_id].lock_cnt); #endif } @@ -481,7 +481,7 @@ rte_rcu_qsbr_quiescent(struct rte_rcu_qsbr *v, unsigned int thread_id) RTE_ASSERT(v != NULL && thread_id < v->max_threads); - __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n", + __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u", v->qsbr_cnt[thread_id].lock_cnt); /* Acquire the changes to the shared data structure released diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c index 1fabec2bfe..1dab6d6645 100644 --- a/lib/stack/rte_stack.c +++ b/lib/stack/rte_stack.c @@ -56,7 +56,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, int ret; if (flags & ~(RTE_STACK_F_LF)) { - STACK_LOG_ERR("Unsupported stack flags %#x\n", flags); + STACK_LOG_ERR("Unsupported stack flags %#x", flags); return NULL; } @@ -65,7 +65,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, #endif #if !defined(RTE_STACK_LF_SUPPORTED) if (flags & RTE_STACK_F_LF) { - STACK_LOG_ERR("Lock-free stack is not supported on your platform\n"); + STACK_LOG_ERR("Lock-free stack is not supported on your platform"); rte_errno = ENOTSUP; return NULL; } @@ -82,7 +82,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, te = rte_zmalloc("STACK_TAILQ_ENTRY", sizeof(*te), 0); if (te == NULL) { - STACK_LOG_ERR("Cannot reserve memory for tailq\n"); + STACK_LOG_ERR("Cannot reserve memory for tailq"); rte_errno = ENOMEM; return NULL; } @@ -92,7 +92,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, mz = rte_memzone_reserve_aligned(mz_name, sz, socket_id, 0, __alignof__(*s)); if (mz == NULL) { - STACK_LOG_ERR("Cannot reserve stack memzone!\n"); + STACK_LOG_ERR("Cannot reserve stack memzone!"); rte_mcfg_tailq_write_unlock(); rte_free(te); return NULL; diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c index 3e1ef1ac25..6e5443e5f8 100644 --- a/lib/vhost/vhost_crypto.c +++ b/lib/vhost/vhost_crypto.c @@ -245,7 +245,7 @@ transform_cipher_param(struct rte_crypto_sym_xform *xform, return ret; if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) { - VC_LOG_DBG("Invalid cipher key length\n"); + VC_LOG_DBG("Invalid cipher key length"); return -VIRTIO_CRYPTO_BADMSG; } @@ -301,7 +301,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms, return ret; if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) { - VC_LOG_DBG("Invalid cipher key length\n"); + VC_LOG_DBG("Invalid cipher key length"); return -VIRTIO_CRYPTO_BADMSG; } @@ -321,7 +321,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms, return ret; if (param->auth_key_len > VHOST_USER_CRYPTO_MAX_HMAC_KEY_LENGTH) { - VC_LOG_DBG("Invalid auth key length\n"); + VC_LOG_DBG("Invalid auth key length"); return -VIRTIO_CRYPTO_BADMSG; } -- 2.43.0 ^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2023-12-21 6:27 UTC | newest] Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20231117131824.1977792-1-david.marchand@redhat.com> 2023-11-17 13:18 ` [RFC 1/3] lib: remove redundant newline from logs David Marchand [not found] ` <20231208145950.2184940-1-david.marchand@redhat.com> 2023-12-08 14:59 ` [RFC v2 01/14] hash: remove some dead code David Marchand 2023-12-08 16:53 ` Stephen Hemminger 2023-12-08 20:46 ` Tyler Retzlaff 2023-12-08 14:59 ` [RFC v2 02/14] regexdev: fix logtype register David Marchand 2023-12-08 16:58 ` Stephen Hemminger 2023-12-08 20:46 ` Tyler Retzlaff 2023-12-14 10:11 ` Ori Kam 2023-12-08 14:59 ` [RFC v2 03/14] lib: use dedicated logtypes David Marchand 2023-12-08 17:00 ` Stephen Hemminger 2023-12-08 20:49 ` Tyler Retzlaff 2023-12-16 9:47 ` Andrew Rybchenko 2023-12-08 14:59 ` [RFC v2 04/14] lib: add newline in logs David Marchand 2023-12-08 17:01 ` Stephen Hemminger 2023-12-11 12:38 ` David Marchand 2023-12-08 20:50 ` Tyler Retzlaff 2023-12-16 9:43 ` Andrew Rybchenko 2023-12-08 14:59 ` [RFC v2 05/14] lib: remove redundant newline from logs David Marchand 2023-12-08 17:02 ` Stephen Hemminger 2023-12-09 7:15 ` fengchengwen 2023-12-11 8:48 ` Mattias Rönnblom [not found] ` <20231218092738.749604-1-david.marchand@redhat.com> 2023-12-18 9:27 ` [PATCH v3 01/14] hash: remove some dead code David Marchand 2023-12-18 9:27 ` [PATCH v3 02/14] regexdev: fix logtype register David Marchand 2023-12-18 9:27 ` [PATCH v3 03/14] lib: use dedicated logtypes and macros David Marchand 2023-12-18 9:27 ` [PATCH v3 04/14] lib: add newline in logs David Marchand 2023-12-18 9:27 ` [PATCH v3 05/14] lib: remove redundant newline from logs David Marchand [not found] ` <20231218143805.1500121-1-david.marchand@redhat.com> 2023-12-18 14:37 ` [PATCH v4 01/14] hash: remove some dead code David Marchand 2023-12-18 14:37 ` [PATCH v4 02/14] regexdev: fix logtype register David Marchand 2023-12-18 16:46 ` Stephen Hemminger 2023-12-18 14:37 ` [PATCH v4 03/14] lib: use dedicated logtypes and macros David Marchand 2023-12-18 14:37 ` [PATCH v4 04/14] lib: add newline in logs David Marchand 2023-12-18 14:37 ` [PATCH v4 05/14] lib: remove redundant newline from logs David Marchand [not found] ` <20231220153607.718606-1-david.marchand@redhat.com> 2023-12-20 15:35 ` [PATCH v5 01/13] hash: remove some dead code David Marchand 2023-12-21 5:58 ` Ruifeng Wang 2023-12-21 6:26 ` Ruifeng Wang 2023-12-20 15:35 ` [PATCH v5 02/13] regexdev: fix logtype register David Marchand 2023-12-20 15:35 ` [PATCH v5 03/13] lib: use dedicated logtypes and macros David Marchand 2023-12-20 15:35 ` [PATCH v5 04/13] lib: add newline in logs David Marchand 2023-12-20 15:35 ` [PATCH v5 05/13] lib: remove redundant newline from logs David Marchand
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).