From patchwork Mon Mar 13 11:35:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kavanagh X-Patchwork-Id: 738071 X-Patchwork-Delegate: dlu998@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vhbQY0Z0sz9s7B for ; Mon, 13 Mar 2017 22:35:33 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id F2E5ABAA; Mon, 13 Mar 2017 11:35:30 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 04266B6D for ; Mon, 13 Mar 2017 11:35:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8A578CD for ; Mon, 13 Mar 2017 11:35:29 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 13 Mar 2017 04:35:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,159,1486454400"; d="scan'208";a="66881052" Received: from silpixa00380299.ir.intel.com ([10.237.222.17]) by orsmga004.jf.intel.com with ESMTP; 13 Mar 2017 04:35:28 -0700 From: Mark Kavanagh To: dev@openvswitch.org Date: Mon, 13 Mar 2017 11:35:26 +0000 Message-Id: <1489404926-7008-1-git-send-email-mark.b.kavanagh@intel.com> X-Mailer: git-send-email 1.9.3 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH V2] netdev-dpdk: fix mempool_configure error state X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org netdev_dpdk_mempool_configure obtains a handle to a DPDK memory pool via a call to dpdk_mp_get. If dpdk_mp_get fails, the former informs the user that insufficient memory is available, and returns ENOMEM. However, this is potentially misleading, as there are a number of reasons why creation of a mempool can fail (as per rte_mempool_create), including: - insufficient memory available - mempool already exists - other memory allocation error Update the error log to reflect this fact, and return rte_errno in the event of error, instead of ENOMEM. Signed-off-by: Mark Kavanagh Fixes: 0072e931 ("netdev-dpdk: add support for jumbo frames") Acked-by: Ian Stokes Acked-by: Darrell Ball --- lib/netdev-dpdk.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index ddc651b..858d995 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -571,10 +571,11 @@ netdev_dpdk_mempool_configure(struct netdev_dpdk *dev) mp = dpdk_mp_get(dev->requested_socket_id, FRAME_LEN_TO_MTU(buf_size)); if (!mp) { - VLOG_ERR("Insufficient memory to create memory pool for netdev " - "%s, with MTU %d on socket %d\n", - dev->up.name, dev->requested_mtu, dev->requested_socket_id); - return ENOMEM; + VLOG_ERR("Failed to create memory pool for netdev " + "%s, with MTU %d on socket %d: %s\n", + dev->up.name, dev->requested_mtu, dev->requested_socket_id, + rte_strerror(rte_errno)); + return rte_errno; } else { dpdk_mp_put(dev->dpdk_mp); dev->dpdk_mp = mp;