[dpdk-dev] *mlx5_get_ifname* should be protected by lock
xnhp0320 at icloud.com
Mon Aug 5 08:50:59 CEST 2019
In dpdk 16.11, most of mlnx device APIs except RX/TX are protected by a private lock. In DPDK 18.11, these locks are removed, from the code it seems this is due to all APIs will create a disposable socket and the socket will be used to set/get specific device features, and will be closed at the end of API call.
However, as we observe that in DPDK 1811, many APIs will call *mlx5_get_ifname* which might reuse a pre-created socket as the code shows:
mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[IF_NAMESIZE])
struct priv *priv = dev->data->dev_private;
unsigned int ifindex =
priv->nl_socket_rdma >= 0 ?
mlx5_nl_ifindex(priv->nl_socket_rdma, priv->ibdev_name) : 0;
So, we think at least the call to mlx5_get_ifname should be protected by a lock, and we do have experienced that the calling to API hangs in our code. Thus we report this to the community and seek if there are some other limitations on the usage of mlx5 APIs.
More information about the dev