From patchwork Fri Jul 19 05:31:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 56749 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 13C041DBF; Fri, 19 Jul 2019 07:32:01 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 290221B53 for ; Fri, 19 Jul 2019 07:31:59 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 19 Jul 2019 08:31:58 +0300 Received: from pegasus12.mtr.labs.mlnx. (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6J5VwI4017766; Fri, 19 Jul 2019 08:31:58 +0300 From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: yskoh@mellanox.com, shahafs@mellanox.com, stephen@networkplumber.org Date: Fri, 19 Jul 2019 05:31:43 +0000 Message-Id: <1563514305-27405-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <20190712205425.17781-3-stephen@networkplumber.org> References: <20190712205425.17781-3-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 0/2] net/mlx5: cache the associated network device ifindex 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" In mlx5 PMD the associated device index is retrieved via Netlink request to underlying Infiniband device driver. This network device index is permanent throughout the lifetime of device. We do not spawn the rte_eth_dev ports without associated network device, and if network device is being unbound we get the remove notification event message and rte_eth_dev port is also detached. So, we may store the ifindex in mlx5_device_spawn() routine at rte_eth_dev port creation and initialization time and use the cached value further instead of doing actual Netlink request. This approach allows the query API routines like mlx5_link_update to be thread-safe due to Netlink request elimination. mlx5_link_update() may be called in asynchronous event handler concurrently and it may cause application hang. This patch extends and updates the [1]. [1] http://patches.dpdk.org/patch/56417/ Proposed-by: Stephen Hemminger Signed-off-by: Viacheslav Ovsiienko Viacheslav Ovsiienko (2): net/mlx5: cache the associated network device ifindex Revert "net/mlx5: fix master device Netlink socket sharing" drivers/net/mlx5/mlx5.c | 11 ++++ drivers/net/mlx5/mlx5.h | 7 +-- drivers/net/mlx5/mlx5_ethdev.c | 128 ++++------------------------------------- 3 files changed, 22 insertions(+), 124 deletions(-)