DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] bond: replace rte_panic with errno code return
Date: Fri, 27 May 2016 17:20:53 +0200	[thread overview]
Message-ID: <1464362453-5732-2-git-send-email-michalx.k.jastrzebski@intel.com> (raw)
In-Reply-To: <1464362453-5732-1-git-send-email-michalx.k.jastrzebski@intel.com>

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 <michalx.k.jastrzebski@intel.com>
---
 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

  reply	other threads:[~2016-05-27 15:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 15:20 [dpdk-dev] [PATCH] app/test: fix bond device name too long Michal Jastrzebski
2016-05-27 15:20 ` Michal Jastrzebski [this message]
2016-05-27 16:13   ` [dpdk-dev] [PATCH] bond: replace rte_panic with errno code return Iremonger, Bernard
2016-06-13 13:57     ` Bruce Richardson
2016-05-27 16:14 ` [dpdk-dev] [PATCH] app/test: fix bond device name too long Iremonger, Bernard
2016-06-13 20:14   ` Thomas Monjalon
2016-05-27 16:38 ` Thomas Monjalon
2016-06-08 10:40   ` Thomas Monjalon
2016-06-08 11:50     ` Jastrzebski, MichalX K
2016-06-08 13:31       ` Thomas Monjalon
2016-06-08 14:27         ` Jastrzebski, MichalX K
2016-06-01  1:29 ` Xu, HuilongX
2016-06-01  3:25 ` Xu, HuilongX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464362453-5732-2-git-send-email-michalx.k.jastrzebski@intel.com \
    --to=michalx.k.jastrzebski@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).