Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A2A7C4360C for ; Mon, 30 Sep 2019 08:15:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11FC720679 for ; Mon, 30 Sep 2019 08:15:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="Ht42xRyT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729975AbfI3IPP (ORCPT ); Mon, 30 Sep 2019 04:15:15 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:56088 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfI3IPP (ORCPT ); Mon, 30 Sep 2019 04:15:15 -0400 Received: by mail-wm1-f65.google.com with SMTP id a6so12236704wma.5 for ; Mon, 30 Sep 2019 01:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cE/sibx2iPZOblQTNy18Le1yxE0X08JX8c+yNiafmbE=; b=Ht42xRyTDvcH1X1h1KiprH+m+OET3Lzbmqa+I8tJehGziR12IFG96hHAZwBhkSBwjQ BUjufRVHNONxalxVr+qJkhKCraEi7yhROxE6z9pTHaNjvXMHfO8Vpf9Iue4roZZcw/oP SZdNjVcbMcFK2eoOdYT5jhEVhVdYiz3mzdmsDkhvbc2rv3MN50uQoiPU2efnuDE4/NSs 022gDZFFCjVzeTFM/kVSJv0s4lPHN+vGWWHBxMA8mpcYIklnjQWFaD1ptrpweJfIdLye JQnCzSu1ybrv8NEKVf77oUe8IlM15YkjNxXgh2FKOGmNJCWzGitx5ggO8NkSyBm8mDwp vr7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cE/sibx2iPZOblQTNy18Le1yxE0X08JX8c+yNiafmbE=; b=isB7kBzlHsadbrdhJWX4AaUdPSmJweq1lpRJwm3Wt6w35AFscvFxCtOiRpNSMEfCxS VurLdODsWx2ruTqHO3c5alnbD+j3rZhxHvI/aRG7hIebZz0zN7+LyMpA7O1QdWsMiDJi C7eZaiZZ+KBKv8Y0DgVjwd6yIwG4SzfstEObe9Jpw7FvDOV2DJi83MCAbdwWstNVvos5 EzukuN1cu1pt4vRnI+SCxp0oAUVV7v6WAXRE87IUXBiJILfY8FPIX7hKOhA9ckB7XqG3 +kTOdddG1mI4qGqncPC66Panoau2RkaANx1r5DFSJt3PdxsSxIX2hk2Py0GMbQNWsqpL zlJg== X-Gm-Message-State: APjAAAXWKnFXYlSRxRtYjl8ac/8oFzcgWgOi40BNZHi6qkeXNqnmZbCA X9CoWdQrEgqCZU1llmdt0hGquTQ9bFE= X-Google-Smtp-Source: APXvYqz1TjQfmNi/41Z2xnii54zOEV2fWg+0gUcJ5c1//MvHXKX6qi6WP9sWGaegHqu0biXezW8cnw== X-Received: by 2002:a7b:c10c:: with SMTP id w12mr17027292wmi.26.1569831312874; Mon, 30 Sep 2019 01:15:12 -0700 (PDT) Received: from localhost (ip-89-177-132-96.net.upcbroadband.cz. [89.177.132.96]) by smtp.gmail.com with ESMTPSA id h6sm10891754wru.60.2019.09.30.01.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2019 01:15:12 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, idosch@mellanox.com, pabeni@redhat.com, edumazet@google.com, petrm@mellanox.com, sd@queasysnail.net, f.fainelli@gmail.com, stephen@networkplumber.org, mlxsw@mellanox.com Subject: [patch net-next 0/3] net: introduce per-netns netdevice notifiers and use them in mlxsw Date: Mon, 30 Sep 2019 10:15:08 +0200 Message-Id: <20190930081511.26915-1-jiri@resnulli.us> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Some drivers, like mlxsw, are not interested in notifications coming in for netdevices from other network namespaces. So introduce per-netns notifiers and allow to reduce overhead by listening only for notifications from the same netns. This is also a preparation for upcoming patchset "devlink: allow devlink instances to change network namespace". This resolves deadlock during reload mlxsw into initial netns made possible by 328fbe747ad4 ("net: Close race between {un, }register_netdevice_notifier() and setup_net()/cleanup_net()"). Jiri Pirko (3): net: push loops and nb calls into helper functions net: introduce per-netns netdevice notifiers mlxsw: spectrum: Use per-netns netdevice notifier registration .../net/ethernet/mellanox/mlxsw/spectrum.c | 9 +- include/linux/netdevice.h | 6 + include/net/net_namespace.h | 6 +- net/core/dev.c | 176 +++++++++++++++--- 4 files changed, 165 insertions(+), 32 deletions(-) -- 2.21.0