DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: remove blank lines in log
@ 2021-09-15 14:15 Thomas Monjalon
  2021-09-15 14:45 ` David Marchand
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas Monjalon @ 2021-09-15 14:15 UTC (permalink / raw)
  To: dev; +Cc: Maxime Coquelin, Chenbo Xia

The macro PMD_INIT_LOG includes already the line feed character.
Redundant \n are removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/virtio/virtio_ethdev.c            |  2 +-
 drivers/net/virtio/virtio_pci.c               |  2 +-
 drivers/net/virtio/virtio_pci_ethdev.c        |  6 ++---
 .../net/virtio/virtio_user/virtio_user_dev.c  | 22 +++++++++----------
 drivers/net/virtio/virtio_user_ethdev.c       |  2 +-
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 9ca8bae0fe..d722fbe04a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -212,7 +212,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,
 			"vq->vq_avail_idx=%d\n"
 			"vq->vq_used_cons_idx=%d\n"
 			"vq->vq_packed.cached_flags=0x%x\n"
-			"vq->vq_packed.used_wrap_counter=%d\n",
+			"vq->vq_packed.used_wrap_counter=%d",
 			vq->vq_free_cnt,
 			vq->vq_avail_idx,
 			vq->vq_used_cons_idx,
diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
index c14d1339c9..182cfc9eae 100644
--- a/drivers/net/virtio/virtio_pci.c
+++ b/drivers/net/virtio/virtio_pci.c
@@ -410,7 +410,7 @@ static int
 modern_features_ok(struct virtio_hw *hw)
 {
 	if (!virtio_with_feature(hw, VIRTIO_F_VERSION_1)) {
-		PMD_INIT_LOG(ERR, "Version 1+ required with modern devices\n");
+		PMD_INIT_LOG(ERR, "Version 1+ required with modern devices");
 		return -1;
 	}
 
diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c
index 4083853c48..54645dc62e 100644
--- a/drivers/net/virtio/virtio_pci_ethdev.c
+++ b/drivers/net/virtio/virtio_pci_ethdev.c
@@ -81,7 +81,7 @@ eth_virtio_pci_init(struct rte_eth_dev *eth_dev)
 		VTPCI_DEV(hw) = pci_dev;
 		ret = vtpci_init(RTE_ETH_DEV_TO_PCI(eth_dev), dev);
 		if (ret) {
-			PMD_INIT_LOG(ERR, "Failed to init PCI device\n");
+			PMD_INIT_LOG(ERR, "Failed to init PCI device");
 			return -1;
 		}
 	} else {
@@ -93,14 +93,14 @@ eth_virtio_pci_init(struct rte_eth_dev *eth_dev)
 
 		ret = virtio_remap_pci(RTE_ETH_DEV_TO_PCI(eth_dev), dev);
 		if (ret < 0) {
-			PMD_INIT_LOG(ERR, "Failed to remap PCI device\n");
+			PMD_INIT_LOG(ERR, "Failed to remap PCI device");
 			return -1;
 		}
 	}
 
 	ret = eth_virtio_dev_init(eth_dev);
 	if (ret < 0) {
-		PMD_INIT_LOG(ERR, "Failed to init virtio device\n");
+		PMD_INIT_LOG(ERR, "Failed to init virtio device");
 		goto err_unmap;
 	}
 
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 16c58710d7..200942d622 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -44,7 +44,7 @@ virtio_user_create_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
 	file.fd = dev->callfds[queue_sel];
 	ret = dev->ops->set_vring_call(dev, &file);
 	if (ret < 0) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to create queue %u\n", dev->path, queue_sel);
+		PMD_INIT_LOG(ERR, "(%s) Failed to create queue %u", dev->path, queue_sel);
 		return -1;
 	}
 
@@ -108,7 +108,7 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
 
 	return 0;
 err:
-	PMD_INIT_LOG(ERR, "(%s) Failed to kick queue %u\n", dev->path, queue_sel);
+	PMD_INIT_LOG(ERR, "(%s) Failed to kick queue %u", dev->path, queue_sel);
 
 	return -1;
 }
@@ -214,7 +214,7 @@ virtio_user_start_device(struct virtio_user_dev *dev)
 	pthread_mutex_unlock(&dev->mutex);
 	rte_mcfg_mem_read_unlock();
 
-	PMD_INIT_LOG(ERR, "(%s) Failed to start device\n", dev->path);
+	PMD_INIT_LOG(ERR, "(%s) Failed to start device", dev->path);
 
 	/* TODO: free resource here or caller to check */
 	return -1;
@@ -255,7 +255,7 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
 err:
 	pthread_mutex_unlock(&dev->mutex);
 
-	PMD_INIT_LOG(ERR, "(%s) Failed to stop device\n", dev->path);
+	PMD_INIT_LOG(ERR, "(%s) Failed to stop device", dev->path);
 
 	return -1;
 }
@@ -500,17 +500,17 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)
 	}
 
 	if (dev->ops->setup(dev) < 0) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to setup backend\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to setup backend", dev->path);
 		return -1;
 	}
 
 	if (virtio_user_dev_init_notify(dev) < 0) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to init notifiers\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to init notifiers", dev->path);
 		goto destroy;
 	}
 
 	if (virtio_user_fill_intr_handle(dev) < 0) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to init interrupt handler\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to init interrupt handler", dev->path);
 		goto uninit;
 	}
 
@@ -642,7 +642,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 	if (rte_mem_event_callback_register(VIRTIO_USER_MEM_EVENT_CLB_NAME,
 				virtio_user_mem_event_cb, dev)) {
 		if (rte_errno != ENOTSUP) {
-			PMD_INIT_LOG(ERR, "(%s) Failed to register mem event callback\n",
+			PMD_INIT_LOG(ERR, "(%s) Failed to register mem event callback",
 					dev->path);
 			return -1;
 		}
@@ -866,7 +866,7 @@ virtio_user_dev_set_status(struct virtio_user_dev *dev, uint8_t status)
 	dev->status = status;
 	ret = dev->ops->set_status(dev, status);
 	if (ret && ret != -ENOTSUP)
-		PMD_INIT_LOG(ERR, "(%s) Failed to set backend status\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to set backend status", dev->path);
 
 	pthread_mutex_unlock(&dev->mutex);
 	return ret;
@@ -890,7 +890,7 @@ virtio_user_dev_update_status(struct virtio_user_dev *dev)
 			"\t-DRIVER_OK: %u\n"
 			"\t-FEATURES_OK: %u\n"
 			"\t-DEVICE_NEED_RESET: %u\n"
-			"\t-FAILED: %u\n",
+			"\t-FAILED: %u",
 			dev->status,
 			(dev->status == VIRTIO_CONFIG_STATUS_RESET),
 			!!(dev->status & VIRTIO_CONFIG_STATUS_ACK),
@@ -900,7 +900,7 @@ virtio_user_dev_update_status(struct virtio_user_dev *dev)
 			!!(dev->status & VIRTIO_CONFIG_STATUS_DEV_NEED_RESET),
 			!!(dev->status & VIRTIO_CONFIG_STATUS_FAILED));
 	} else if (ret != -ENOTSUP) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to get backend status\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to get backend status", dev->path);
 	}
 
 	pthread_mutex_unlock(&dev->mutex);
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 90fcd6e7cc..688c1104d5 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -398,7 +398,7 @@ virtio_user_backend_type(const char *path)
 		if (errno == ENOENT)
 			return VIRTIO_USER_BACKEND_VHOST_USER;
 
-		PMD_INIT_LOG(ERR, "Stat fails: %s (%s)\n", path,
+		PMD_INIT_LOG(ERR, "Stat fails: %s (%s)", path,
 			     strerror(errno));
 		return VIRTIO_USER_BACKEND_UNKNOWN;
 	}
-- 
2.33.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/virtio: remove blank lines in log
  2021-09-15 14:15 [dpdk-dev] [PATCH] net/virtio: remove blank lines in log Thomas Monjalon
@ 2021-09-15 14:45 ` David Marchand
  2021-09-16  1:32 ` Xia, Chenbo
  2021-09-16  9:53 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
  2 siblings, 0 replies; 6+ messages in thread
From: David Marchand @ 2021-09-15 14:45 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Maxime Coquelin, Chenbo Xia

On Wed, Sep 15, 2021 at 4:15 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The macro PMD_INIT_LOG includes already the line feed character.
> Redundant \n are removed.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Ah.. I did a similar patch cleaning logs in net/virtio this morning.

Applying and diffing with mine, the differences are:
- calls to PMD_DRV_LOG with the same issue,
- calls to RTE_LOG(xx, PMD, ) (maybe worth a separate patch with a
Fixes: + backport),

This could be done in a followup, or directly as a v2 of this cleanup.

In any case, the current patch lgtm.
Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/virtio: remove blank lines in log
  2021-09-15 14:15 [dpdk-dev] [PATCH] net/virtio: remove blank lines in log Thomas Monjalon
  2021-09-15 14:45 ` David Marchand
@ 2021-09-16  1:32 ` Xia, Chenbo
  2021-09-16  9:53 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
  2 siblings, 0 replies; 6+ messages in thread
From: Xia, Chenbo @ 2021-09-16  1:32 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: Maxime Coquelin

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, September 15, 2021 10:15 PM
> To: dev@dpdk.org
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Xia, Chenbo
> <chenbo.xia@intel.com>
> Subject: [PATCH] net/virtio: remove blank lines in log
> 
> The macro PMD_INIT_LOG includes already the line feed character.
> Redundant \n are removed.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/net/virtio/virtio_ethdev.c            |  2 +-
>  drivers/net/virtio/virtio_pci.c               |  2 +-
>  drivers/net/virtio/virtio_pci_ethdev.c        |  6 ++---
>  .../net/virtio/virtio_user/virtio_user_dev.c  | 22 +++++++++----------
>  drivers/net/virtio/virtio_user_ethdev.c       |  2 +-
>  5 files changed, 17 insertions(+), 17 deletions(-)
> 2.33.0

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] net/virtio: remove blank lines in log
  2021-09-15 14:15 [dpdk-dev] [PATCH] net/virtio: remove blank lines in log Thomas Monjalon
  2021-09-15 14:45 ` David Marchand
  2021-09-16  1:32 ` Xia, Chenbo
@ 2021-09-16  9:53 ` Thomas Monjalon
  2021-09-16 14:22   ` David Marchand
  2021-09-28 15:35   ` Maxime Coquelin
  2 siblings, 2 replies; 6+ messages in thread
From: Thomas Monjalon @ 2021-09-16  9:53 UTC (permalink / raw)
  To: dev; +Cc: David Marchand, Chenbo Xia, Maxime Coquelin

The macros PMD_*_LOG already include the line feed character.
Redundant \n are removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
v2: fix more macros than PMD_INIT_LOG
---
 drivers/net/virtio/virtio_ethdev.c            |  2 +-
 drivers/net/virtio/virtio_pci.c               |  2 +-
 drivers/net/virtio/virtio_pci_ethdev.c        |  6 ++---
 drivers/net/virtio/virtio_rxtx.c              |  2 +-
 .../net/virtio/virtio_user/vhost_kernel_tap.c |  4 ++--
 drivers/net/virtio/virtio_user/vhost_user.c   |  6 ++---
 drivers/net/virtio/virtio_user/vhost_vdpa.c   |  4 ++--
 .../net/virtio/virtio_user/virtio_user_dev.c  | 24 +++++++++----------
 drivers/net/virtio/virtio_user_ethdev.c       |  2 +-
 9 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 9ca8bae0fe..d722fbe04a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -212,7 +212,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,
 			"vq->vq_avail_idx=%d\n"
 			"vq->vq_used_cons_idx=%d\n"
 			"vq->vq_packed.cached_flags=0x%x\n"
-			"vq->vq_packed.used_wrap_counter=%d\n",
+			"vq->vq_packed.used_wrap_counter=%d",
 			vq->vq_free_cnt,
 			vq->vq_avail_idx,
 			vq->vq_used_cons_idx,
diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
index c14d1339c9..182cfc9eae 100644
--- a/drivers/net/virtio/virtio_pci.c
+++ b/drivers/net/virtio/virtio_pci.c
@@ -410,7 +410,7 @@ static int
 modern_features_ok(struct virtio_hw *hw)
 {
 	if (!virtio_with_feature(hw, VIRTIO_F_VERSION_1)) {
-		PMD_INIT_LOG(ERR, "Version 1+ required with modern devices\n");
+		PMD_INIT_LOG(ERR, "Version 1+ required with modern devices");
 		return -1;
 	}
 
diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c
index 4083853c48..54645dc62e 100644
--- a/drivers/net/virtio/virtio_pci_ethdev.c
+++ b/drivers/net/virtio/virtio_pci_ethdev.c
@@ -81,7 +81,7 @@ eth_virtio_pci_init(struct rte_eth_dev *eth_dev)
 		VTPCI_DEV(hw) = pci_dev;
 		ret = vtpci_init(RTE_ETH_DEV_TO_PCI(eth_dev), dev);
 		if (ret) {
-			PMD_INIT_LOG(ERR, "Failed to init PCI device\n");
+			PMD_INIT_LOG(ERR, "Failed to init PCI device");
 			return -1;
 		}
 	} else {
@@ -93,14 +93,14 @@ eth_virtio_pci_init(struct rte_eth_dev *eth_dev)
 
 		ret = virtio_remap_pci(RTE_ETH_DEV_TO_PCI(eth_dev), dev);
 		if (ret < 0) {
-			PMD_INIT_LOG(ERR, "Failed to remap PCI device\n");
+			PMD_INIT_LOG(ERR, "Failed to remap PCI device");
 			return -1;
 		}
 	}
 
 	ret = eth_virtio_dev_init(eth_dev);
 	if (ret < 0) {
-		PMD_INIT_LOG(ERR, "Failed to init virtio device\n");
+		PMD_INIT_LOG(ERR, "Failed to init virtio device");
 		goto err_unmap;
 	}
 
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index d0365ce4bf..21245f2b97 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -847,7 +847,7 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	if (tx_free_thresh >= (vq->vq_nentries - 3)) {
 		PMD_DRV_LOG(ERR, "tx_free_thresh must be less than the "
 			"number of TX entries minus 3 (%u)."
-			" (tx_free_thresh=%u port=%u queue=%u)\n",
+			" (tx_free_thresh=%u port=%u queue=%u)",
 			vq->vq_nentries - 3,
 			tx_free_thresh, dev->data->port_id, queue_idx);
 		return -EINVAL;
diff --git a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c
index 99096bdf39..7ef99c6485 100644
--- a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c
+++ b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c
@@ -62,14 +62,14 @@ vhost_kernel_tap_set_offload(int fd, uint64_t features)
 
 	/* Check if our kernel supports TUNSETOFFLOAD */
 	if (ioctl(fd, TUNSETOFFLOAD, 0) != 0 && errno == EINVAL) {
-		PMD_DRV_LOG(ERR, "Kernel doesn't support TUNSETOFFLOAD\n");
+		PMD_DRV_LOG(ERR, "Kernel doesn't support TUNSETOFFLOAD");
 		return -ENOTSUP;
 	}
 
 	if (ioctl(fd, TUNSETOFFLOAD, offload) != 0) {
 		offload &= ~TUN_F_UFO;
 		if (ioctl(fd, TUNSETOFFLOAD, offload) != 0) {
-			PMD_DRV_LOG(ERR, "TUNSETOFFLOAD ioctl() failed: %s\n",
+			PMD_DRV_LOG(ERR, "TUNSETOFFLOAD ioctl() failed: %s",
 				strerror(errno));
 			return -1;
 		}
diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index aec666405f..cc830a660f 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -167,7 +167,7 @@ vhost_user_read(int fd, struct vhost_user_msg *msg)
 	sz_payload = msg->size;
 
 	if ((size_t)sz_payload > sizeof(msg->payload)) {
-		PMD_DRV_LOG(ERR, "Payload size overflow, header says %d but max %zu\n",
+		PMD_DRV_LOG(ERR, "Payload size overflow, header says %d but max %zu",
 				sz_payload, sizeof(msg->payload));
 		return -1;
 	}
@@ -749,7 +749,7 @@ vhost_user_start_server(struct virtio_user_dev *dev, struct sockaddr_un *un)
 
 	ret = bind(fd, (struct sockaddr *)un, sizeof(*un));
 	if (ret < 0) {
-		PMD_DRV_LOG(ERR, "failed to bind to %s: %s; remove it and try again\n",
+		PMD_DRV_LOG(ERR, "failed to bind to %s: %s; remove it and try again",
 			    dev->path, strerror(errno));
 		return -1;
 	}
@@ -822,7 +822,7 @@ vhost_user_setup(struct virtio_user_dev *dev)
 
 	data = malloc(sizeof(*data));
 	if (!data) {
-		PMD_DRV_LOG(ERR, "(%s) Failed to allocate Vhost-user data\n", dev->path);
+		PMD_DRV_LOG(ERR, "(%s) Failed to allocate Vhost-user data", dev->path);
 		return -1;
 	}
 
diff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c b/drivers/net/virtio/virtio_user/vhost_vdpa.c
index 3d65f0079a..82f25a8674 100644
--- a/drivers/net/virtio/virtio_user/vhost_vdpa.c
+++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c
@@ -528,7 +528,7 @@ vhost_vdpa_setup(struct virtio_user_dev *dev)
 
 	data->vhostfd = open(dev->path, O_RDWR);
 	if (data->vhostfd < 0) {
-		PMD_DRV_LOG(ERR, "Failed to open %s: %s\n",
+		PMD_DRV_LOG(ERR, "Failed to open %s: %s",
 				dev->path, strerror(errno));
 		free(data);
 		return -1;
@@ -536,7 +536,7 @@ vhost_vdpa_setup(struct virtio_user_dev *dev)
 
 	if (ioctl(data->vhostfd, VHOST_VDPA_GET_DEVICE_ID, &did) < 0 ||
 			did != VIRTIO_ID_NETWORK) {
-		PMD_DRV_LOG(ERR, "Invalid vdpa device ID: %u\n", did);
+		PMD_DRV_LOG(ERR, "Invalid vdpa device ID: %u", did);
 		close(data->vhostfd);
 		free(data);
 		return -1;
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 16c58710d7..83f1affb56 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -44,7 +44,7 @@ virtio_user_create_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
 	file.fd = dev->callfds[queue_sel];
 	ret = dev->ops->set_vring_call(dev, &file);
 	if (ret < 0) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to create queue %u\n", dev->path, queue_sel);
+		PMD_INIT_LOG(ERR, "(%s) Failed to create queue %u", dev->path, queue_sel);
 		return -1;
 	}
 
@@ -108,7 +108,7 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
 
 	return 0;
 err:
-	PMD_INIT_LOG(ERR, "(%s) Failed to kick queue %u\n", dev->path, queue_sel);
+	PMD_INIT_LOG(ERR, "(%s) Failed to kick queue %u", dev->path, queue_sel);
 
 	return -1;
 }
@@ -214,7 +214,7 @@ virtio_user_start_device(struct virtio_user_dev *dev)
 	pthread_mutex_unlock(&dev->mutex);
 	rte_mcfg_mem_read_unlock();
 
-	PMD_INIT_LOG(ERR, "(%s) Failed to start device\n", dev->path);
+	PMD_INIT_LOG(ERR, "(%s) Failed to start device", dev->path);
 
 	/* TODO: free resource here or caller to check */
 	return -1;
@@ -255,7 +255,7 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
 err:
 	pthread_mutex_unlock(&dev->mutex);
 
-	PMD_INIT_LOG(ERR, "(%s) Failed to stop device\n", dev->path);
+	PMD_INIT_LOG(ERR, "(%s) Failed to stop device", dev->path);
 
 	return -1;
 }
@@ -471,7 +471,7 @@ virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,
 	pthread_mutex_unlock(&dev->mutex);
 
 	if (ret < 0)
-		PMD_DRV_LOG(ERR, "(%s) Failed to update memory table\n", dev->path);
+		PMD_DRV_LOG(ERR, "(%s) Failed to update memory table", dev->path);
 }
 
 static int
@@ -500,17 +500,17 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)
 	}
 
 	if (dev->ops->setup(dev) < 0) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to setup backend\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to setup backend", dev->path);
 		return -1;
 	}
 
 	if (virtio_user_dev_init_notify(dev) < 0) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to init notifiers\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to init notifiers", dev->path);
 		goto destroy;
 	}
 
 	if (virtio_user_fill_intr_handle(dev) < 0) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to init interrupt handler\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to init interrupt handler", dev->path);
 		goto uninit;
 	}
 
@@ -642,7 +642,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 	if (rte_mem_event_callback_register(VIRTIO_USER_MEM_EVENT_CLB_NAME,
 				virtio_user_mem_event_cb, dev)) {
 		if (rte_errno != ENOTSUP) {
-			PMD_INIT_LOG(ERR, "(%s) Failed to register mem event callback\n",
+			PMD_INIT_LOG(ERR, "(%s) Failed to register mem event callback",
 					dev->path);
 			return -1;
 		}
@@ -866,7 +866,7 @@ virtio_user_dev_set_status(struct virtio_user_dev *dev, uint8_t status)
 	dev->status = status;
 	ret = dev->ops->set_status(dev, status);
 	if (ret && ret != -ENOTSUP)
-		PMD_INIT_LOG(ERR, "(%s) Failed to set backend status\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to set backend status", dev->path);
 
 	pthread_mutex_unlock(&dev->mutex);
 	return ret;
@@ -890,7 +890,7 @@ virtio_user_dev_update_status(struct virtio_user_dev *dev)
 			"\t-DRIVER_OK: %u\n"
 			"\t-FEATURES_OK: %u\n"
 			"\t-DEVICE_NEED_RESET: %u\n"
-			"\t-FAILED: %u\n",
+			"\t-FAILED: %u",
 			dev->status,
 			(dev->status == VIRTIO_CONFIG_STATUS_RESET),
 			!!(dev->status & VIRTIO_CONFIG_STATUS_ACK),
@@ -900,7 +900,7 @@ virtio_user_dev_update_status(struct virtio_user_dev *dev)
 			!!(dev->status & VIRTIO_CONFIG_STATUS_DEV_NEED_RESET),
 			!!(dev->status & VIRTIO_CONFIG_STATUS_FAILED));
 	} else if (ret != -ENOTSUP) {
-		PMD_INIT_LOG(ERR, "(%s) Failed to get backend status\n", dev->path);
+		PMD_INIT_LOG(ERR, "(%s) Failed to get backend status", dev->path);
 	}
 
 	pthread_mutex_unlock(&dev->mutex);
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 90fcd6e7cc..688c1104d5 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -398,7 +398,7 @@ virtio_user_backend_type(const char *path)
 		if (errno == ENOENT)
 			return VIRTIO_USER_BACKEND_VHOST_USER;
 
-		PMD_INIT_LOG(ERR, "Stat fails: %s (%s)\n", path,
+		PMD_INIT_LOG(ERR, "Stat fails: %s (%s)", path,
 			     strerror(errno));
 		return VIRTIO_USER_BACKEND_UNKNOWN;
 	}
-- 
2.33.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/virtio: remove blank lines in log
  2021-09-16  9:53 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
@ 2021-09-16 14:22   ` David Marchand
  2021-09-28 15:35   ` Maxime Coquelin
  1 sibling, 0 replies; 6+ messages in thread
From: David Marchand @ 2021-09-16 14:22 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Chenbo Xia, Maxime Coquelin

On Thu, Sep 16, 2021 at 11:53 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The macros PMD_*_LOG already include the line feed character.
> Redundant \n are removed.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
> v2: fix more macros than PMD_INIT_LOG

Just confirming, v2 lgtm.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/virtio: remove blank lines in log
  2021-09-16  9:53 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
  2021-09-16 14:22   ` David Marchand
@ 2021-09-28 15:35   ` Maxime Coquelin
  1 sibling, 0 replies; 6+ messages in thread
From: Maxime Coquelin @ 2021-09-28 15:35 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: David Marchand, Chenbo Xia



On 9/16/21 11:53, Thomas Monjalon wrote:
> The macros PMD_*_LOG already include the line feed character.
> Redundant \n are removed.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
> v2: fix more macros than PMD_INIT_LOG
> ---
>   drivers/net/virtio/virtio_ethdev.c            |  2 +-
>   drivers/net/virtio/virtio_pci.c               |  2 +-
>   drivers/net/virtio/virtio_pci_ethdev.c        |  6 ++---
>   drivers/net/virtio/virtio_rxtx.c              |  2 +-
>   .../net/virtio/virtio_user/vhost_kernel_tap.c |  4 ++--
>   drivers/net/virtio/virtio_user/vhost_user.c   |  6 ++---
>   drivers/net/virtio/virtio_user/vhost_vdpa.c   |  4 ++--
>   .../net/virtio/virtio_user/virtio_user_dev.c  | 24 +++++++++----------
>   drivers/net/virtio/virtio_user_ethdev.c       |  2 +-
>   9 files changed, 26 insertions(+), 26 deletions(-)
> 

Applied to dpdk-next-virtio/main.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-28 15:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 14:15 [dpdk-dev] [PATCH] net/virtio: remove blank lines in log Thomas Monjalon
2021-09-15 14:45 ` David Marchand
2021-09-16  1:32 ` Xia, Chenbo
2021-09-16  9:53 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2021-09-16 14:22   ` David Marchand
2021-09-28 15:35   ` Maxime Coquelin

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).