From patchwork Fri Jun 28 22:36:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11023529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1410138D for ; Fri, 28 Jun 2019 22:36:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6E5F28876 for ; Fri, 28 Jun 2019 22:36:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA7872887B; Fri, 28 Jun 2019 22:36:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C6DE28876 for ; Fri, 28 Jun 2019 22:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727076AbfF1Wgu (ORCPT ); Fri, 28 Jun 2019 18:36:50 -0400 Received: from mail-eopbgr70049.outbound.protection.outlook.com ([40.107.7.49]:23750 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727074AbfF1Wgu (ORCPT ); Fri, 28 Jun 2019 18:36:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=testarcselector01; d=microsoft.com; cv=none; b=yXERfPUn0uO6Y+EguzP8VmibOj8Rht3olIy42Cf/3lFejH6ILu97fTGa+GISUuMQfnXAO7v08ztHJaTkXgVusIKGOmvR+HWfc53FJx1hq5JuoyzVK+FfixVSH0esGQ+qjt+Zn3/YpV32gUtBoH2GBZVKt3ccpAXHxehN6Vot0Gs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=testarcselector01; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xSFZ5A8TZfI4dMYNG28NJ+MK2Q8sR1zCq+auD1Z1EQE=; b=Q3QgpntFOt9qI5/JVDCHahgOe3Nf7SM5tsB+1zagKBnhYOP/lm4JQvlOW+qB+5vKIc79xCCbIucTL7XkMqkczfAA5c/0c4e5YA5Zwjkr1j0lIZuFGsw+WjkVKd7eBmwG+c1/RfqCp8Z9sEe1xJ5T9ezIPF/nhRHaY9JzaUhX9iM= ARC-Authentication-Results: i=1; test.office365.com 1;spf=none;dmarc=none;dkim=none;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xSFZ5A8TZfI4dMYNG28NJ+MK2Q8sR1zCq+auD1Z1EQE=; b=m1g3fgPFQpy2OaG4aoGUM1wrd+NEnx7w3Dn91fjmunVBY9t5VKcSXETeix1wJSUJ4BS6RE067b1h4syKjIUfNBnsxI00YDoQD1a+x6wTbChjJNwmKg8DgYC0b2D/Nqc8jsNgCHueTS0jQjkqOCVjbhvPaB/Quc7ADbha2bvQ8r8= Received: from DB6PR0501MB2759.eurprd05.prod.outlook.com (10.172.227.7) by DB6PR0501MB2357.eurprd05.prod.outlook.com (10.168.56.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.17; Fri, 28 Jun 2019 22:36:23 +0000 Received: from DB6PR0501MB2759.eurprd05.prod.outlook.com ([fe80::a901:6951:59de:3278]) by DB6PR0501MB2759.eurprd05.prod.outlook.com ([fe80::a901:6951:59de:3278%2]) with mapi id 15.20.2008.014; Fri, 28 Jun 2019 22:36:23 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky CC: "netdev@vger.kernel.org" , "linux-rdma@vger.kernel.org" , Bodong Wang Subject: [PATCH mlx5-next 18/18] net/mlx5: E-Switch, Handle UC address change in switchdev mode Thread-Topic: [PATCH mlx5-next 18/18] net/mlx5: E-Switch, Handle UC address change in switchdev mode Thread-Index: AQHVLgHq3WJ4LGI5dU6mL4Zjscg9Ig== Date: Fri, 28 Jun 2019 22:36:23 +0000 Message-ID: <20190628223516.9368-19-saeedm@mellanox.com> References: <20190628223516.9368-1-saeedm@mellanox.com> In-Reply-To: <20190628223516.9368-1-saeedm@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-originating-ip: [209.116.155.178] x-clientproxiedby: BY5PR13CA0035.namprd13.prod.outlook.com (2603:10b6:a03:180::48) To DB6PR0501MB2759.eurprd05.prod.outlook.com (2603:10a6:4:84::7) authentication-results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e52a8292-a84e-4497-9b41-08d6fc190c5b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:DB6PR0501MB2357; x-ms-traffictypediagnostic: DB6PR0501MB2357: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 00826B6158 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(396003)(346002)(366004)(136003)(376002)(189003)(199004)(107886003)(6436002)(1076003)(3846002)(6116002)(256004)(66446008)(50226002)(6636002)(66066001)(53936002)(36756003)(71200400001)(71190400001)(186003)(8676002)(52116002)(4326008)(5660300002)(26005)(6506007)(305945005)(450100002)(11346002)(446003)(478600001)(76176011)(64756008)(99286004)(386003)(102836004)(6512007)(110136005)(2906002)(316002)(66476007)(68736007)(14454004)(81166006)(486006)(86362001)(81156014)(73956011)(66946007)(2616005)(6486002)(476003)(66556008)(8936002)(25786009)(54906003)(7736002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0501MB2357;H:DB6PR0501MB2759.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: LSxzV+EXcoP7mG5TYmiAoxyeBFt6jxIsnSrhc/4nGFYE7n+YO7cZSEUBizjYQXINzVRmu7LaS+e80SKmRMx0YZ2zd5Kjer+zylGQkP/HlV+/MGFhXbHV0nFwv7vnPWX8IjcMUcX+okjTUFW8DuIRJkRQFa1Yw4LAEsYIL4QwvSikNh8KoL35O6Qol+JJ+K/Qkfs9mt+zfczmGVdrlMOd3t07jX2020I2Wsqh0REvweErs//QOuEJPq3G33EM7zkcwgvvHPCYFN4rvgYmQa2In+g7M5XqkGimZYoCH4nbNCUg741IMEnpq2AvqSYAlUHxAOHWi/p/6FfuLKlDXDpyAPbVJpbKb1LB12ElrQJMeSa+tS3Q8ffQia2XVdLWeogLBnViaClvbwkjUDx1K62Oj6z7A+uhCFByL4bURnIZIZg= MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e52a8292-a84e-4497-9b41-08d6fc190c5b X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2019 22:36:23.3768 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: saeedm@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2357 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bodong Wang When NVME device emulation mode is enabled, more than one PFs use the same physical port. In this case, MPFS is required to program L2 addresses. It used to rely on netdev set_rx_mode in switchdev mode, but driver later changed to not create netdev for eswitch manager once in switchdev mode. So, UC address event should be handled. Signed-off-by: Bodong Wang Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/eswitch.c | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index 935b9429bb2a..89f52370e770 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1727,10 +1727,10 @@ int mlx5_esw_query_functions(struct mlx5_core_dev *dev, u32 *out, int outlen) static void mlx5_eswitch_event_handlers_register(struct mlx5_eswitch *esw) { - if (esw->mode == MLX5_ESWITCH_LEGACY) { - MLX5_NB_INIT(&esw->nb, eswitch_vport_event, NIC_VPORT_CHANGE); - mlx5_eq_notifier_register(esw->dev, &esw->nb); - } else if (mlx5_eswitch_is_funcs_handler(esw->dev)) { + MLX5_NB_INIT(&esw->nb, eswitch_vport_event, NIC_VPORT_CHANGE); + mlx5_eq_notifier_register(esw->dev, &esw->nb); + + if (esw->mode == MLX5_ESWITCH_OFFLOADS && mlx5_eswitch_is_funcs_handler(esw->dev)) { MLX5_NB_INIT(&esw->esw_funcs.nb, mlx5_esw_funcs_changed_handler, ESW_FUNCTIONS_CHANGED); mlx5_eq_notifier_register(esw->dev, &esw->esw_funcs.nb); @@ -1739,11 +1739,11 @@ static void mlx5_eswitch_event_handlers_register(struct mlx5_eswitch *esw) static void mlx5_eswitch_event_handlers_unregister(struct mlx5_eswitch *esw) { - if (esw->mode == MLX5_ESWITCH_LEGACY) - mlx5_eq_notifier_unregister(esw->dev, &esw->nb); - else if (mlx5_eswitch_is_funcs_handler(esw->dev)) + if (esw->mode == MLX5_ESWITCH_OFFLOADS && mlx5_eswitch_is_funcs_handler(esw->dev)) mlx5_eq_notifier_unregister(esw->dev, &esw->esw_funcs.nb); + mlx5_eq_notifier_unregister(esw->dev, &esw->nb); + flush_workqueue(esw->work_queue); } @@ -1789,11 +1789,8 @@ int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int mode) if (err) esw_warn(esw->dev, "Failed to create eswitch TSAR"); - /* Don't enable vport events when in MLX5_ESWITCH_OFFLOADS mode, since: - * 1. L2 table (MPFS) is programmed by PF/VF representors netdevs set_rx_mode - * 2. FDB/Eswitch is programmed by user space tools - */ - enabled_events = (mode == MLX5_ESWITCH_LEGACY) ? SRIOV_VPORT_EVENTS : 0; + enabled_events = (mode == MLX5_ESWITCH_LEGACY) ? SRIOV_VPORT_EVENTS : + UC_ADDR_CHANGE; /* Enable PF vport */ vport = mlx5_eswitch_get_vport(esw, MLX5_VPORT_PF);