[dpdk-dev,v2,1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY

Message ID 20170630143449.13990-1-declan.doherty@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Doherty, Declan June 30, 2017, 2:34 p.m. UTC
From: Jan Blunck <jblunck@infradead.org>

If the numa node is unknown, use the value from rte_socket_id() to avoid
an allocation failure.

Signed-off-by: Eric Kinzie <ekinzie@brocade.com>
CC: Eric Kinzie <ehkinzie@gmail.com>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Ferruh Yigit July 3, 2017, 12:17 p.m. UTC | #1
On 6/30/2017 3:34 PM, Declan Doherty wrote:
> From: Jan Blunck <jblunck@infradead.org>
> 
> If the numa node is unknown, use the value from rte_socket_id() to avoid
> an allocation failure.
> 
> Signed-off-by: Eric Kinzie <ekinzie@brocade.com>

> Signed-off-by: Declan Doherty <declan.doherty@intel.com>

Series applied to dpdk-next-net/master, thanks.

(patch subjects updated slightly)
  

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 57b9b32..7826296 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -886,7 +886,10 @@  bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
 
 	RTE_ASSERT(port->rx_ring == NULL);
 	RTE_ASSERT(port->tx_ring == NULL);
+
 	socket_id = rte_eth_devices[slave_id].data->numa_node;
+	if (socket_id == (int)LCORE_ID_ANY)
+		socket_id = rte_socket_id();
 
 	element_size = sizeof(struct slow_protocol_frame) +
 				RTE_PKTMBUF_HEADROOM;