[dpdk-dev] [PATCH v2 1/2] examples/ethtool: fix Rx/Tx queue setup with rte socket id

Min Hu (Connor) humin29 at huawei.com
Tue Sep 28 03:34:56 CEST 2021


Hi, Thomas,
	any comments?

在 2021/5/6 11:46, Min Hu (Connor) 写道:
> From: Chengwen Feng <fengchengwen at huawei.com>
> 
> 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.
> 
> Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
> ---
>   examples/ethtool/lib/rte_ethtool.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
> index 4132516..b2e45f5 100644
> --- a/examples/ethtool/lib/rte_ethtool.c
> +++ b/examples/ethtool/lib/rte_ethtool.c
> @@ -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;
>   
> 


More information about the dev mailing list