From patchwork Mon Mar 13 10:11:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kavanagh X-Patchwork-Id: 738056 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 3vhYZH6JH0z9s0Z for ; Mon, 13 Mar 2017 21:12:07 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 6A837B5F; Mon, 13 Mar 2017 10:12:04 +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 4F538826 for ; Mon, 13 Mar 2017 10:12:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D21C2AB for ; Mon, 13 Mar 2017 10:12:02 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2017 03:12:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,158,1486454400"; d="scan'208";a="59560033" Received: from silpixa00380299.ir.intel.com ([10.237.222.17]) by orsmga002.jf.intel.com with ESMTP; 13 Mar 2017 03:12:00 -0700 From: Mark Kavanagh To: dev@openvswitch.org Date: Mon, 13 Mar 2017 10:11:57 +0000 Message-Id: <1489399917-192190-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] 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") --- lib/netdev-dpdk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index ddc651b..7eeced8 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -571,10 +571,10 @@ 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 " + VLOG_ERR("Failed 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; + return rte_errno; } else { dpdk_mp_put(dev->dpdk_mp); dev->dpdk_mp = mp;