From patchwork Thu Apr 8 02:00:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 90831 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D196A0579; Thu, 8 Apr 2021 04:00:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D572F40698; Thu, 8 Apr 2021 04:00:44 +0200 (CEST) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id 8426340138 for ; Thu, 8 Apr 2021 04:00:43 +0200 (CEST) Received: by mail-pf1-f169.google.com with SMTP id 11so647026pfn.9 for ; Wed, 07 Apr 2021 19:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BM8qIVwPWUuYOc2h7wQBVxCl92u1q/G5wNh4sn7MnIw=; b=BGU6j2xgSigns3r8JB+NgDRfyC180MEp64s8k5NDPn06nokRF/16v2utCBC8/LRn2S rVl4O0D7Ybkxn91n7I3+2gGt5B7jd7uZ0jGUXr3v7tAteraEGViEOrKpA6aSafi5v0LA BhcRLGY5MgqAOCgndsr1rutkVedTXgNhYepNnTuVuiUh3qukcXV7J+uY3csukBRsXiw6 fPVRGOGG4dWdXzBOb2HtZ0HF5Fe0XY2cb7BuS6u5fR+xFZDTEjjguV4vWa0fa6LeuD/w kirbb16SEdFXDEqQeekHomWA1J1S3IDADci4OdBGviecdM28F0G45yRoAk39TmMzffCf lx4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BM8qIVwPWUuYOc2h7wQBVxCl92u1q/G5wNh4sn7MnIw=; b=Fr5norpxTNXkmOCWJ0E3MbJ5zkaxjfjqUkdN2/qqP2GUfzZEieaMOXXMCM6CFLYxa4 IXzWDCF5whrJ7iPahn09GywCzpnEn4tKMv5KJQV3ykNReSShNfTWpbHo4E5h46+wQ2U7 uYl1jRueI5VjprFAAJ/T45Eju/Al5QV+3U0XRZFPvv536zyVxiLuga3o6InCrNqGXw9D P7zRPJ0PCvPjPQCVgRw0OU8Df/n7hJZNXzqglJcqBJd+3TbnlYzO6ewUAwbLXRlN57Wp vpCXyVqb29iXMohxGfg3d5iKJVaF3sgkN2uZ3zkSzAIzsja+d8MMDGyIJdLrIvuA2AMT pu2Q== X-Gm-Message-State: AOAM531r73gB6kWHiXZEem9B3H5bBQx68pXiuZBnaIvD0icdhthOKMKB bJFrZnNOS10KRQMCXbrAwZAK3w== X-Google-Smtp-Source: ABdhPJwslfRcBmx0waQDbUDcVNdVs7eYobdrkgKXQRqWpRiuoWYRA25CQn2bNdrO6y7btvuXL++4JA== X-Received: by 2002:aa7:943b:0:b029:23f:8fa1:5f11 with SMTP id y27-20020aa7943b0000b029023f8fa15f11mr5332767pfo.67.1617847242539; Wed, 07 Apr 2021 19:00:42 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id h137sm22168636pfe.151.2021.04.07.19.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 19:00:41 -0700 (PDT) From: Stephen Hemminger To: longli@microsoft.com Cc: dev@dpdk.org, Stephen Hemminger Date: Wed, 7 Apr 2021 19:00:34 -0700 Message-Id: <20210408020034.293271-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] net/netvsc: fix log double spaced messages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The PMD_DRV_LOG macro in netvsc (like other drivers) adds a newline to the log message as part of the macro expansion; therefore the message should not have its own newline. In a couple places, log messages were split across source lines which can make looking them up in the source tree harder. Signed-off-by: Stephen Hemminger Acked-by: Long Li --- Note: did not add stable or fixes line since this is only impacts log messages drivers/net/netvsc/hn_ethdev.c | 25 ++++++++++++------------ drivers/net/netvsc/hn_vf.c | 35 +++++++++++++++++----------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 04904b151441..51e950413c88 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -564,7 +564,7 @@ static void netvsc_hotplug_retry(void *args) struct rte_ether_addr eth_addr; int s; - PMD_DRV_LOG(DEBUG, "%s: retry count %d\n", + PMD_DRV_LOG(DEBUG, "%s: retry count %d", __func__, hv->eal_hot_plug_retry); if (hv->eal_hot_plug_retry++ > NETVSC_MAX_HOTADD_RETRY) @@ -574,7 +574,7 @@ static void netvsc_hotplug_retry(void *args) di = opendir(buf); if (!di) { PMD_DRV_LOG(DEBUG, "%s: can't open directory %s, " - "retrying in 1 second\n", __func__, buf); + "retrying in 1 second", __func__, buf); goto retry; } @@ -586,7 +586,7 @@ static void netvsc_hotplug_retry(void *args) /* trying to get mac address if this is a network device*/ s = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); if (s == -1) { - PMD_DRV_LOG(ERR, "Failed to create socket errno %d\n", + PMD_DRV_LOG(ERR, "Failed to create socket errno %d", errno); break; } @@ -594,8 +594,9 @@ static void netvsc_hotplug_retry(void *args) ret = ioctl(s, SIOCGIFHWADDR, &req); close(s); if (ret == -1) { - PMD_DRV_LOG(ERR, "Failed to send SIOCGIFHWADDR for " - "device %s\n", dir->d_name); + PMD_DRV_LOG(ERR, + "Failed to send SIOCGIFHWADDR for device %s", + dir->d_name); break; } if (req.ifr_hwaddr.sa_family != ARPHRD_ETHER) { @@ -606,14 +607,14 @@ static void netvsc_hotplug_retry(void *args) RTE_DIM(eth_addr.addr_bytes)); if (rte_is_same_ether_addr(ð_addr, dev->data->mac_addrs)) { - PMD_DRV_LOG(NOTICE, "Found matching MAC address, " - "adding device %s network name %s\n", + PMD_DRV_LOG(NOTICE, + "Found matching MAC address, adding device %s network name %s", d->name, dir->d_name); ret = rte_eal_hotplug_add(d->bus->name, d->name, d->args); if (ret) { PMD_DRV_LOG(ERR, - "Failed to add PCI device %s\n", + "Failed to add PCI device %s", d->name); break; } @@ -638,7 +639,7 @@ netvsc_hotadd_callback(const char *device_name, enum rte_dev_event_type type, struct rte_devargs *d = &hv->devargs; int ret; - PMD_DRV_LOG(INFO, "Device notification type=%d device_name=%s\n", + PMD_DRV_LOG(INFO, "Device notification type=%d device_name=%s", type, device_name); switch (type) { @@ -650,7 +651,7 @@ netvsc_hotadd_callback(const char *device_name, enum rte_dev_event_type type, ret = rte_devargs_parse(d, device_name); if (ret) { PMD_DRV_LOG(ERR, - "devargs parsing failed ret=%d\n", ret); + "devargs parsing failed ret=%d", ret); return; } @@ -961,7 +962,7 @@ hn_dev_start(struct rte_eth_dev *dev) error = rte_dev_event_callback_register(NULL, netvsc_hotadd_callback, hv); if (error) { - PMD_DRV_LOG(ERR, "failed to register device event callback\n"); + PMD_DRV_LOG(ERR, "failed to register device event callback"); return error; } @@ -1240,7 +1241,7 @@ static int eth_hn_probe(struct rte_vmbus_driver *drv __rte_unused, ret = rte_dev_event_monitor_start(); if (ret) { - PMD_DRV_LOG(ERR, "Failed to start device event monitoring\n"); + PMD_DRV_LOG(ERR, "Failed to start device event monitoring"); return ret; } diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index 2dc7abe354ad..75192e631978 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -69,7 +69,7 @@ static int hn_vf_attach(struct rte_eth_dev *dev, struct hn_data *hv) return port; } - PMD_DRV_LOG(NOTICE, "found matching VF port %d\n", port); + PMD_DRV_LOG(NOTICE, "found matching VF port %d", port); ret = rte_eth_dev_owner_get(port, &owner); if (ret < 0) { PMD_DRV_LOG(ERR, "Can not find owner for port %d", port); @@ -106,13 +106,13 @@ static void hn_remove_delayed(void *args) /* Tell VSP to switch data path to synthentic */ hn_vf_remove(hv); - PMD_DRV_LOG(NOTICE, "Start to remove port %d\n", port_id); + PMD_DRV_LOG(NOTICE, "Start to remove port %d", port_id); rte_rwlock_write_lock(&hv->vf_lock); /* Give back ownership */ ret = rte_eth_dev_owner_unset(port_id, hv->owner.id); if (ret) - PMD_DRV_LOG(ERR, "rte_eth_dev_owner_unset failed ret=%d\n", + PMD_DRV_LOG(ERR, "rte_eth_dev_owner_unset failed ret=%d", ret); hv->vf_ctx.vf_attached = false; @@ -120,18 +120,18 @@ static void hn_remove_delayed(void *args) hn_eth_rmv_event_callback, hv); if (ret) PMD_DRV_LOG(ERR, - "rte_eth_dev_callback_unregister failed ret=%d\n", + "rte_eth_dev_callback_unregister failed ret=%d", ret); /* Detach and release port_id from system */ ret = rte_eth_dev_stop(port_id); if (ret) - PMD_DRV_LOG(ERR, "rte_eth_dev_stop failed port_id=%u ret=%d\n", + PMD_DRV_LOG(ERR, "rte_eth_dev_stop failed port_id=%u ret=%d", port_id, ret); ret = rte_eth_dev_close(port_id); if (ret) - PMD_DRV_LOG(ERR, "rte_eth_dev_close failed port_id=%u ret=%d\n", + PMD_DRV_LOG(ERR, "rte_eth_dev_close failed port_id=%u ret=%d", port_id, ret); ret = rte_dev_remove(dev); @@ -146,7 +146,7 @@ int hn_eth_rmv_event_callback(uint16_t port_id, { struct hn_data *hv = cb_arg; - PMD_DRV_LOG(NOTICE, "Removing VF portid %d\n", port_id); + PMD_DRV_LOG(NOTICE, "Removing VF portid %d", port_id); rte_eal_alarm_set(1, hn_remove_delayed, hv); return 0; @@ -163,7 +163,7 @@ static int hn_setup_vf_queues(int port, struct rte_eth_dev *dev) ret = rte_eth_tx_queue_info_get(dev->data->port_id, i, &txinfo); if (ret) { PMD_DRV_LOG(ERR, - "rte_eth_tx_queue_info_get failed ret=%d\n", + "rte_eth_tx_queue_info_get failed ret=%d", ret); return ret; } @@ -172,7 +172,7 @@ static int hn_setup_vf_queues(int port, struct rte_eth_dev *dev) &txinfo.conf); if (ret) { PMD_DRV_LOG(ERR, - "rte_eth_tx_queue_setup failed ret=%d\n", + "rte_eth_tx_queue_setup failed ret=%d", ret); return ret; } @@ -182,7 +182,7 @@ static int hn_setup_vf_queues(int port, struct rte_eth_dev *dev) ret = rte_eth_rx_queue_info_get(dev->data->port_id, i, &rxinfo); if (ret) { PMD_DRV_LOG(ERR, - "rte_eth_rx_queue_info_get failed ret=%d\n", + "rte_eth_rx_queue_info_get failed ret=%d", ret); return ret; } @@ -193,7 +193,7 @@ static int hn_setup_vf_queues(int port, struct rte_eth_dev *dev) &rxinfo.conf, rx_queue->mb_pool); if (ret) { PMD_DRV_LOG(ERR, - "rte_eth_rx_queue_setup failed ret=%d\n", + "rte_eth_rx_queue_setup failed ret=%d", ret); return ret; } @@ -244,10 +244,10 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv) goto exit; } - PMD_DRV_LOG(NOTICE, "configuring VF port %d\n", port); + PMD_DRV_LOG(NOTICE, "configuring VF port %d", port); ret = hn_vf_configure(dev, &dev->data->dev_conf); if (ret) { - PMD_DRV_LOG(ERR, "Failed to configure VF port %d\n", + PMD_DRV_LOG(ERR, "Failed to configure VF port %d", port); goto exit; } @@ -255,15 +255,15 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv) ret = hn_setup_vf_queues(port, dev); if (ret) { PMD_DRV_LOG(ERR, - "Failed to configure VF queues port %d\n", + "Failed to configure VF queues port %d", port); goto exit; } - PMD_DRV_LOG(NOTICE, "Starting VF port %d\n", port); + PMD_DRV_LOG(NOTICE, "Starting VF port %d", port); ret = rte_eth_dev_start(port); if (ret) { - PMD_DRV_LOG(ERR, "rte_eth_dev_start failed ret=%d\n", + PMD_DRV_LOG(ERR, "rte_eth_dev_start failed ret=%d", ret); goto exit; } @@ -414,8 +414,7 @@ int hn_vf_configure(struct rte_eth_dev *dev, hv); if (ret) { PMD_DRV_LOG(ERR, - "Registering callback failed for " - "vf port %d ret %d\n", + "Registering callback failed for vf port %d ret %d", hv->vf_ctx.vf_port, ret); return ret; }