From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0088CA3168 for ; Wed, 16 Oct 2019 16:31:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9236D1E8CE; Wed, 16 Oct 2019 16:31:17 +0200 (CEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by dpdk.org (Postfix) with ESMTP id B90FB1D42A for ; Wed, 16 Oct 2019 16:31:16 +0200 (CEST) X-Originating-IP: 90.177.210.238 Received: from localhost.localdomain (238.210.broadband10.iol.cz [90.177.210.238]) (Authenticated sender: i.maximets@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 1BFC04001C; Wed, 16 Oct 2019 14:31:14 +0000 (UTC) From: Ilya Maximets To: dev@dpdk.org, Maxime Coquelin Cc: Flavio Leitner , David Marchand , Tiwei Bie , Ilya Maximets Date: Wed, 16 Oct 2019 16:31:07 +0200 Message-Id: <20191016143107.10424-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] vhost: return error message for mbuf allocation failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" 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. Cc: Flavio Leitner Fixes: 5005bcda7123 ("vhost: add support for large buffers") Signed-off-by: Ilya Maximets --- 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 66f0c7206..f8af4e0b3 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -1354,8 +1354,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.17.1