Message ID | 1563721001-3730-1-git-send-email-viacheslavo@mellanox.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> 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 B95912BC7; Sun, 21 Jul 2019 16:56:58 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 2A2F02BBD for <dev@dpdk.org>; Sun, 21 Jul 2019 16:56:57 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 21 Jul 2019 17:56:56 +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 x6LEuuep009498; Sun, 21 Jul 2019 17:56:56 +0300 Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id x6LEuu0b003897; Sun, 21 Jul 2019 14:56:56 GMT Received: (from viacheslavo@localhost) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id x6LEutPD003896; Sun, 21 Jul 2019 14:56:55 GMT X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko <viacheslavo@mellanox.com> To: dev@dpdk.org Cc: yskoh@mellanox.com, shahafs@mellanox.com, stephen@networkplumber.org Date: Sun, 21 Jul 2019 14:56:39 +0000 Message-Id: <1563721001-3730-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1563514305-27405-1-git-send-email-viacheslavo@mellanox.com> References: <1563514305-27405-1-git-send-email-viacheslavo@mellanox.com> Subject: [dpdk-dev] [PATCH v2 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 <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
net/mlx5: cache the associated network device ifindex
|
|
Message
Slava Ovsiienko
July 21, 2019, 2:56 p.m. UTC
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/
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
v2:
-- comments addressed
v1:
-- http://patches.dpdk.org/cover/56749/
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 | 7 +++
drivers/net/mlx5/mlx5.h | 7 +--
drivers/net/mlx5/mlx5_ethdev.c | 128 ++++-------------------------------------
3 files changed, 18 insertions(+), 124 deletions(-)
Comments
Hi, > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Viacheslav Ovsiienko > Sent: Sunday, July 21, 2019 5:57 PM > To: dev@dpdk.org > Cc: Yongseok Koh <yskoh@mellanox.com>; Shahaf Shuler > <shahafs@mellanox.com>; stephen@networkplumber.org > Subject: [dpdk-dev] [PATCH v2 0/2] net/mlx5: cache the associated network > device ifindex > > 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] > https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatch > es.dpdk.org%2Fpatch%2F56417%2F&data=02%7C01%7Crasland%40mell > anox.com%7C3c155fb435384529783608d70debb168%7Ca652971c7d2e4d9ba6 > a4d149256f461b%7C0%7C0%7C636993178256642102&sdata=GNj8%2B79 > %2FoBQzu7esmy4wN4e6WC7RHREDbV4OZTq6SOA%3D&reserved=0 > > Reported-by: Stephen Hemminger <stephen@networkplumber.org> > Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> > > --- Series applied to next-net-mlx Kindest regards, Raslan Darawsheh