Skip to content

Commit

Permalink
net/bonding: avoid allocating mempool on unknown socket
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Kinzie authored and Ferruh Yigit committed Jul 6, 2017
1 parent aab2161 commit c15c589
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/bonding/rte_eth_bond_8023ad.c
Expand Up @@ -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;
Expand Down

0 comments on commit c15c589

Please sign in to comment.