From 19896c73935227fd345e224144a01626c309ebd1 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Wed, 16 Oct 2019 16:31:07 +0200 Subject: [PATCH] vhost: return error message for mbuf allocation failure mbuf allocation failure is a hard failure that highlights some significant issues with memory pool size or a mbuf leak. We still have the message for subsequent chained mbufs, but not for the first one. It was removed while introducing extbuf support for large buffers. But it was useful for catching mempool issues and needs to be returned back. Fixes: c3ff0ac70acb ("vhost: improve performance by supporting large buffer") Signed-off-by: Ilya Maximets Reviewed-by: Flavio Leitner Reviewed-by: Tiwei Bie --- lib/librte_vhost/virtio_net.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 5b8cb9e63a..eae7825f04 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -1651,8 +1651,11 @@ virtio_dev_pktmbuf_alloc(struct virtio_net *dev, struct rte_mempool *mp, { struct rte_mbuf *pkt = rte_pktmbuf_alloc(mp); - if (unlikely(pkt == NULL)) + if (unlikely(pkt == NULL)) { + RTE_LOG(ERR, VHOST_DATA, + "Failed to allocate memory for mbuf.\n"); return NULL; + } if (rte_pktmbuf_tailroom(pkt) >= data_len) return pkt; -- 2.20.1