From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B9B9A00E6 for ; Mon, 5 Aug 2019 08:51:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B14031BE46; Mon, 5 Aug 2019 08:51:03 +0200 (CEST) Received: from st43p00im-zteg10062001.me.com (st43p00im-zteg10062001.me.com [17.58.63.166]) by dpdk.org (Postfix) with ESMTP id 7C21834F0 for ; Mon, 5 Aug 2019 08:51:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1564987861; bh=CU5t+2SJzY7vFU/OL8RXWaonsLtVecc44y5NuBxJkdo=; h=To:From:Subject:Date:Message-id:Content-Type; b=runpQL55VLqQsoLkW/FuMn/fC4ksBNDIbyy9fki9EYryhIt3ghVZcptiiQypwxvAL e72IbywzWTfKTGVBoT9NKIqLIjT1HkL3gmScJvRZ6sIGq6JhlUeyZwXoLm2zzVJFM8 L5Mo9jMBodnDVkSw1vUpW/PcLSPyWYfGb4F1T4A3tcPiq2XHdx0B6hVXAJn7AvEIXW lsLiR8ZkaBTEg6zfjI8TIOeaJPsGv+ufRlwbt6qcyLW7u498PhvIIVj94+ywFxoDRW J0AiFmvaoqKprYU2gx7oT48XQ1KFUyW+MhB4AOgAX+0ggFcsz0DUvywGRHK6est+Ln ZirmFrG2rGKcQ== Received: from localhost (pv33p03im-webms003.me.com [17.142.224.114]) by st43p00im-zteg10062001.me.com (Postfix) with ESMTP id 6AB376C083E for ; Mon, 5 Aug 2019 06:51:01 +0000 (UTC) To: dev@dpdk.org From: He Peng Date: Mon, 05 Aug 2019 06:50:59 GMT X-Mailer: iCloud MailClient1913Project39 MailServer1913B46.10000-1913B-0-be2a8866e288 Message-id: <55d89397-f2ac-4fee-bb11-d044c2d43113@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-05_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=634 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1908050077 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] *mlx5_get_ifname* should be protected by lock X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi,=C2=A0=0A=0A=0AIn 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=C2=A0disposable=C2= =A0=C2=A0socket and the socket will be used to set/get specific device fea= tures, and will be closed at the end of API call.=0A=0A=0AHowever, as we o= bserve that in DPDK 1811, many APIs will call *mlx5_get_ifname* which migh= t reuse a pre-created socket as the code shows:=0A=0A=0Aint=0Amlx5_get_ifn= ame(const struct rte_eth_dev *dev, char (*ifname)[IF_NAMESIZE])=0A{=0A=C2=A0= =C2=A0 struct priv *priv =3D dev->data->dev_private;=0A=C2=A0 =C2=A0 unsi= gned int ifindex =3D=0A=C2=A0 =C2=A0 =C2=A0 =C2=A0 priv->nl_socket_rdma >=3D= 0 ?=0A=C2=A0 =C2=A0 =C2=A0 =C2=A0 mlx5_nl_ifindex(priv->nl_socket_rdma, p= riv->ibdev_name) : 0;=0A=0A=0A=0A=0ASo, 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 communit= y and seek if there are some other limitations on the usage of mlx5 APIs.=0A= =0A=0AThanks.