Skip to content

Commit

Permalink
net/bonding: fix socket ID check
Browse files Browse the repository at this point in the history
[ upstream commit 46dac7d ]

Caught by code review, rte_eth_dev_socket_id() returns -1 on error.
The code should behave the same, but still, do not use LCORE_ID_ANY for
something that is not a lcore id.

Fixes: c15c589 ("net/bonding: avoid allocating mempool on unknown socket")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Chas Williams <chas3@att.com>
  • Loading branch information
david-marchand authored and kevintraynor committed Aug 20, 2020
1 parent 60e0fc5 commit f3f75f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/bonding/rte_eth_bond_8023ad.c
Expand Up @@ -958,7 +958,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
RTE_ASSERT(port->tx_ring == NULL);

socket_id = rte_eth_dev_socket_id(slave_id);
if (socket_id == (int)LCORE_ID_ANY)
if (socket_id == -1)
socket_id = rte_socket_id();

element_size = sizeof(struct slow_protocol_frame) +
Expand Down

0 comments on commit f3f75f6

Please sign in to comment.