[dpdk-dev] [PATCH] vhost: change mbuf allocation logs to debug

Allain Legacy allain.legacy at windriver.com
Mon Mar 27 18:29:30 CEST 2017


From: Matt Peters <matt.peters at windriver.com>

The current packet buffer alloc failures of the vhost dequeue operations
can flood the log system with error logs due to logging a runtime error
condition within the data path.  In order to prevent this condition, but
still enable debugging, the logs are being changed to debug logs to ensure
they are not emitted unless the CONFIG_RTE_LIBRTE_VHOST_DEBUG option is
enabled.

Signed-off-by: Matt Peters <matt.peters at windriver.com>
Signed-off-by: Allain Legacy <allain.legacy at windriver.com>
---
 lib/librte_vhost/virtio_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 337470d64..850b56082 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -901,7 +901,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vring_desc *descs,
 		if (mbuf_avail == 0) {
 			cur = rte_pktmbuf_alloc(mbuf_pool);
 			if (unlikely(cur == NULL)) {
-				RTE_LOG(ERR, VHOST_DATA, "Failed to "
+				LOG_DEBUG(VHOST_DATA, "Failed to "
 					"allocate memory for mbuf.\n");
 				return -1;
 			}
@@ -1129,7 +1129,7 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id,
 
 		pkts[i] = rte_pktmbuf_alloc(mbuf_pool);
 		if (unlikely(pkts[i] == NULL)) {
-			RTE_LOG(ERR, VHOST_DATA,
+			LOG_DEBUG(VHOST_DATA,
 				"Failed to allocate memory for mbuf.\n");
 			break;
 		}
-- 
2.12.1



More information about the dev mailing list