net/bonding: replace panic with errno code return
authorMichal Jastrzebski <michalx.k.jastrzebski@intel.com>
Fri, 27 May 2016 15:20:53 +0000 (17:20 +0200)
committerBruce Richardson <bruce.richardson@intel.com>
Mon, 20 Jun 2016 15:21:48 +0000 (17:21 +0200)
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>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
drivers/net/bonding/rte_eth_bond_alb.c

index 3157543..38f5c4d 100644 (file)
@@ -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,