From: Ilya Maximets Date: Wed, 16 Oct 2019 14:31:07 +0000 (+0200) Subject: vhost: return error message for mbuf allocation failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=19896c73935227fd345e224144a01626c309ebd1;p=dpdk.git 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 --- 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;