From: Keith Wiles <keith.wiles@intel.com>
To: dev@dpdk.org
Cc: pascal.mazon@6wind.com, ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH v2 5/6] net/tap: cleanup log messages
Date: Sun, 5 Feb 2017 10:05:08 -0600 [thread overview]
Message-ID: <20170205160509.88530-5-keith.wiles@intel.com> (raw)
In-Reply-To: <20170205160509.88530-1-keith.wiles@intel.com>
In-Reply-To: <20170202223330.39240-1-keith.wiles@intel.com>
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
---
drivers/net/tap/rte_eth_tap.c | 54 ++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 26 deletions(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 7c923a2..65e4bab 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -155,12 +155,13 @@ tun_alloc(struct pmd_internals *pmd, uint16_t qid)
#endif
{
ifr.ifr_flags |= IFF_ONE_QUEUE;
- RTE_LOG(DEBUG, PMD, "Single queue only support\n");
+ RTE_LOG(DEBUG, PMD, " Single queue only support\n");
}
/* Set the TUN/TAP configuration and set the name if needed */
if (ioctl(fd, TUNSETIFF, (void *)&ifr) < 0) {
- RTE_LOG(ERR, PMD, "Unable to set TUNSETIFF for %s\n",
+ RTE_LOG(WARNING, PMD,
+ "Unable to set TUNSETIFF for %s\n",
ifr.ifr_name);
perror("TUNSETIFF");
goto error;
@@ -168,7 +169,9 @@ tun_alloc(struct pmd_internals *pmd, uint16_t qid)
/* Always set the file descriptor to non-blocking */
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
- RTE_LOG(ERR, PMD, "Unable to set to nonblocking\n");
+ RTE_LOG(WARNING, PMD,
+ "Unable to set %s to nonblocking\n",
+ ifr.ifr_name);
perror("F_SETFL, NONBLOCK");
goto error;
}
@@ -207,7 +210,7 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
/* allocate the next mbuf */
mbuf = rte_pktmbuf_alloc(rxq->mp);
if (unlikely(!mbuf)) {
- RTE_LOG(WARNING, PMD, "Unable to allocate mbuf\n");
+ RTE_LOG(WARNING, PMD, "TAP unable to allocate mbuf\n");
break;
}
@@ -276,7 +279,8 @@ pmd_tx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
return num_tx;
}
-static int tap_link_set_flags(struct pmd_internals *pmd, short flags, int add)
+static int
+tap_link_set_flags(struct pmd_internals *pmd, short flags, int add)
{
struct ifreq ifr;
int err, s;
@@ -296,8 +300,8 @@ static int tap_link_set_flags(struct pmd_internals *pmd, short flags, int add)
strncpy(ifr.ifr_name, pmd->name, IFNAMSIZ);
err = ioctl(s, SIOCGIFFLAGS, &ifr);
if (err < 0) {
- RTE_LOG(ERR, PMD, "Unable to get tap netdevice flags: %s\n",
- strerror(errno));
+ RTE_LOG(WARNING, PMD, "Unable to get %s device flags: %s\n",
+ pmd->name, strerror(errno));
close(s);
return -1;
}
@@ -307,7 +311,7 @@ static int tap_link_set_flags(struct pmd_internals *pmd, short flags, int add)
ifr.ifr_flags &= ~flags;
err = ioctl(s, SIOCSIFFLAGS, &ifr);
if (err < 0) {
- RTE_LOG(ERR, PMD, "Unable to %s flags 0x%x: %s\n",
+ RTE_LOG(WARNING, PMD, "Unable to %s flags 0x%x: %s\n",
add ? "set" : "unset", flags, strerror(errno));
close(s);
return -1;
@@ -511,8 +515,8 @@ tap_setup_queue(struct rte_eth_dev *dev,
pmd->name, qid);
fd = tun_alloc(pmd, qid);
if (fd < 0) {
- RTE_LOG(ERR, PMD, "tun_alloc(%s) failed\n",
- pmd->name);
+ RTE_LOG(ERR, PMD, "tun_alloc(%s, %d) failed\n",
+ pmd->name, qid);
return -1;
}
}
@@ -557,8 +561,8 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
int fd;
if ((rx_queue_id >= internals->nb_queues) || !mp) {
- RTE_LOG(ERR, PMD, "nb_queues %d mp %p\n",
- internals->nb_queues, mp);
+ RTE_LOG(WARNING, PMD, "nb_queues %d too small or mempool NULL\n",
+ internals->nb_queues);
return -1;
}
@@ -570,7 +574,7 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
RTE_PKTMBUF_HEADROOM);
if (buf_size < ETH_FRAME_LEN) {
- RTE_LOG(ERR, PMD,
+ RTE_LOG(WARNING, PMD,
"%s: %d bytes will not fit in mbuf (%d bytes)\n",
dev->data->name, ETH_FRAME_LEN, buf_size);
return -ENOMEM;
@@ -580,7 +584,7 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
if (fd == -1)
return -1;
- RTE_LOG(INFO, PMD, "RX TAP device name %s, qid %d on fd %d\n",
+ RTE_LOG(DEBUG, PMD, " RX TAP device name %s, qid %d on fd %d\n",
internals->name, rx_queue_id, internals->rxq[rx_queue_id].fd);
return 0;
@@ -603,7 +607,7 @@ tap_tx_queue_setup(struct rte_eth_dev *dev,
if (ret == -1)
return -1;
- RTE_LOG(INFO, PMD, "TX TAP device name %s, qid %d on fd %d\n",
+ RTE_LOG(DEBUG, PMD, " TX TAP device name %s, qid %d on fd %d\n",
internals->name, tx_queue_id, internals->txq[tx_queue_id].fd);
return 0;
@@ -639,25 +643,23 @@ eth_dev_tap_create(const char *name, char *tap_name)
struct rte_eth_dev_data *data = NULL;
int i;
- RTE_LOG(INFO, PMD,
- "%s: Create TAP Ethernet device with %d queues on numa %u\n",
- name, RTE_PMD_TAP_MAX_QUEUES, rte_socket_id());
+ RTE_LOG(DEBUG, PMD, " TAP device on numa %u\n", rte_socket_id());
data = rte_zmalloc_socket(tap_name, sizeof(*data), 0, numa_node);
if (!data) {
- RTE_LOG(ERR, PMD, "Failed to allocate data\n");
+ RTE_LOG(ERR, PMD, "TAP Failed to allocate data\n");
goto error_exit;
}
pmd = rte_zmalloc_socket(tap_name, sizeof(*pmd), 0, numa_node);
if (!pmd) {
- RTE_LOG(ERR, PMD, "Unable to allocate internal struct\n");
+ RTE_LOG(ERR, PMD, "TAP Unable to allocate internal struct\n");
goto error_exit;
}
dev = rte_eth_dev_allocate(tap_name);
if (!dev) {
- RTE_LOG(ERR, PMD, "Unable to allocate device struct\n");
+ RTE_LOG(ERR, PMD, "TAP Unable to allocate device struct\n");
goto error_exit;
}
@@ -694,7 +696,7 @@ eth_dev_tap_create(const char *name, char *tap_name)
return 0;
error_exit:
- RTE_PMD_DEBUG_TRACE("Unable to initialize %s\n", name);
+ RTE_LOG(DEBUG, PMD, "TAP Unable to initialize %s\n", name);
rte_free(data);
rte_free(pmd);
@@ -745,7 +747,7 @@ rte_pmd_tap_probe(const char *name, const char *params)
DEFAULT_TAP_NAME, tap_unit++);
if (params && (params[0] != '\0')) {
- RTE_LOG(INFO, PMD, "paramaters (%s)\n", params);
+ RTE_LOG(DEBUG, PMD, "paramaters (%s)\n", params);
kvlist = rte_kvargs_parse(params, valid_arguments);
if (kvlist) {
@@ -770,14 +772,14 @@ rte_pmd_tap_probe(const char *name, const char *params)
}
pmd_link.link_speed = speed;
- RTE_LOG(INFO, PMD, "Initializing pmd_tap for %s as %s\n",
+ RTE_LOG(NOTICE, PMD, "Initializing pmd_tap for %s as %s\n",
name, tap_name);
ret = eth_dev_tap_create(name, tap_name);
leave:
if (ret == -1) {
- RTE_LOG(INFO, PMD, "Failed to create pmd for %s as %s\n",
+ RTE_LOG(ERR, PMD, "Failed to create pmd for %s as %s\n",
name, tap_name);
tap_unit--; /* Restore the unit number */
}
@@ -795,7 +797,7 @@ rte_pmd_tap_remove(const char *name)
struct pmd_internals *internals;
int i;
- RTE_LOG(INFO, PMD, "Closing TUN/TAP Ethernet device on numa %u\n",
+ RTE_LOG(DEBUG, PMD, "Closing TUN/TAP Ethernet device on numa %u\n",
rte_socket_id());
/* find the ethdev entry */
--
2.8.0.GIT
next prev parent reply other threads:[~2017-02-05 16:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 22:33 [dpdk-dev] [PATCH 1/5] nic/tap: fix tap docs for device name Keith Wiles
2017-02-02 22:33 ` [dpdk-dev] [PATCH 2/5] net/tap: fix multi-queue support Keith Wiles
2017-02-03 9:37 ` Pascal Mazon
2017-02-03 20:32 ` Wiles, Keith
2017-02-02 22:33 ` [dpdk-dev] [PATCH 3/5] net/tap: remove redundant fds array Keith Wiles
2017-02-03 9:38 ` Pascal Mazon
2017-02-02 22:33 ` [dpdk-dev] [PATCH 4/5] net/tap: fix up log message to correct channel Keith Wiles
2017-02-03 9:45 ` Pascal Mazon
2017-02-02 22:33 ` [dpdk-dev] [PATCH 5/5] net/tap: remove unused variable and minor cleanup Keith Wiles
2017-02-03 9:47 ` Pascal Mazon
2017-02-03 9:32 ` [dpdk-dev] [PATCH 1/5] nic/tap: fix tap docs for device name Pascal Mazon
2017-02-03 11:48 ` Ferruh Yigit
2017-02-05 16:05 ` [dpdk-dev] [PATCH v2 1/6] net/tap: " Keith Wiles
2017-02-05 16:05 ` [dpdk-dev] [PATCH v2 2/6] net/tap: remove redundant fds array Keith Wiles
2017-02-05 16:05 ` [dpdk-dev] [PATCH v2 3/6] net/tap: remove unused variable and minor cleanup Keith Wiles
2017-02-05 16:05 ` [dpdk-dev] [PATCH v2 4/6] net/tap: fix multi-queue support Keith Wiles
2017-02-06 15:45 ` Pascal Mazon
2017-02-06 15:57 ` Wiles, Keith
2017-02-05 16:05 ` Keith Wiles [this message]
2017-02-05 16:05 ` [dpdk-dev] [PATCH v2 6/6] net/tap: link set down must be before close Keith Wiles
2017-02-06 15:57 ` Pascal Mazon
2017-02-06 16:03 ` Wiles, Keith
2017-02-06 19:40 ` [dpdk-dev] [PATCH v3 1/7] net/tap: fix tap docs for device name Keith Wiles
2017-02-06 19:40 ` [dpdk-dev] [PATCH v3 2/7] net/tap: remove redundant fds array Keith Wiles
2017-02-06 19:40 ` [dpdk-dev] [PATCH v3 3/7] net/tap: remove unused variable and minor cleanup Keith Wiles
2017-02-06 19:40 ` [dpdk-dev] [PATCH v3 4/7] net/tap: fix multi-queue support Keith Wiles
2017-02-06 19:40 ` [dpdk-dev] [PATCH v3 5/7] net/tap: cleanup log messages Keith Wiles
2017-02-06 19:40 ` [dpdk-dev] [PATCH v3 6/7] net/tap: link set down must be done before close Keith Wiles
2017-02-06 19:40 ` [dpdk-dev] [PATCH v3 7/7] net/tap: move closing fds to pmd close from pmd stop Keith Wiles
2017-02-07 8:51 ` Pascal Mazon
2017-02-07 14:06 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170205160509.88530-5-keith.wiles@intel.com \
--to=keith.wiles@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=pascal.mazon@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).