From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id F3E7E5A9D for ; Fri, 27 May 2016 17:21:05 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP; 27 May 2016 08:21:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,374,1459839600"; d="scan'208";a="975811331" Received: from unknown (HELO Sent) ([10.217.248.103]) by fmsmga001.fm.intel.com with SMTP; 27 May 2016 08:21:03 -0700 Received: by Sent (sSMTP sendmail emulation); Fri, 27 May 2016 17:21:02 +0200 From: Michal Jastrzebski To: dev@dpdk.org Date: Fri, 27 May 2016 17:20:53 +0200 Message-Id: <1464362453-5732-2-git-send-email-michalx.k.jastrzebski@intel.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1464362453-5732-1-git-send-email-michalx.k.jastrzebski@intel.com> References: <1464362453-5732-1-git-send-email-michalx.k.jastrzebski@intel.com> Subject: [dpdk-dev] [PATCH] bond: replace rte_panic with errno code return X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 15:21:06 -0000 This patch modifies bond_mode_alb_enable function. When mempool allocation fails errno code is returned instead of rte_panic. This allow to decide on application level if it should quit or retry for mempool allocation. Signed-off-by: Michal Jastrzebski --- drivers/net/bonding/rte_eth_bond_alb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c index 3157543..194c1da 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.c +++ b/drivers/net/bonding/rte_eth_bond_alb.c @@ -90,14 +90,14 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev) if (internals->mode6.mempool == NULL) { RTE_LOG(ERR, PMD, "%s: Failed to initialize ALB mempool.\n", bond_dev->data->name); - rte_panic( - "Failed to allocate memory pool ('%s')\n" - "for bond device '%s'\n", - mem_name, bond_dev->data->name); + goto mempool_alloc_error; } } return 0; + + mempool_alloc_error: + return -ENOMEM; } void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, -- 1.7.9.5