examples/ethtool: enhance Rx/Tx queue NUMA affinity
authorChengwen Feng <fengchengwen@huawei.com>
Thu, 6 May 2021 03:46:07 +0000 (11:46 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 17 Nov 2021 17:43:21 +0000 (18:43 +0100)
In DPDK, 'rte_socket_id' means the running socket while
'rte_eth_dev_socket_id' is the device socket.
For better performance, memory which queue setup used and device
should be in the same socket.

This patch make sure it calls rte_eth_dev_socket_id API to get device
socket_id when setting ringparam.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
examples/ethtool/lib/rte_ethtool.c

index e7cdf8d..86286d3 100644 (file)
@@ -465,12 +465,12 @@ rte_ethtool_set_ringparam(uint16_t port_id,
                return stat;
 
        stat = rte_eth_tx_queue_setup(port_id, 0, ring_param->tx_pending,
-               rte_socket_id(), NULL);
+               rte_eth_dev_socket_id(port_id), NULL);
        if (stat != 0)
                return stat;
 
        stat = rte_eth_rx_queue_setup(port_id, 0, ring_param->rx_pending,
-               rte_socket_id(), NULL, rx_qinfo.mp);
+               rte_eth_dev_socket_id(port_id), NULL, rx_qinfo.mp);
        if (stat != 0)
                return stat;