From: David Marchand Date: Tue, 16 Jun 2020 09:46:37 +0000 (+0200) Subject: net/bonding: fix socket ID check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=46dac7d1115c66762aa78e308d5f1c401ee5e3a0;p=dpdk.git net/bonding: fix socket ID check 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: c15c5897340d ("net/bonding: avoid allocating mempool on unknown socket") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Chas Williams --- diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index b77a37ddb3..b7ffa2f2cf 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -1043,7 +1043,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) +