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>
"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,
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;
}
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 {
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;
}
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;
/* 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;
}
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;
}
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;
}
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;
}
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;
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;
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;
}
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;
}
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;
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;
}
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
}
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;
}
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;
}
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;
"\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),
!!(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);
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;
}