From patchwork Tue Feb 2 06:54:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12060833 X-Patchwork-Delegate: kuba@kernel.org 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=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 5573EC43381 for ; Tue, 2 Feb 2021 06:56:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FA5564EE1 for ; Tue, 2 Feb 2021 06:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232239AbhBBGz6 (ORCPT ); Tue, 2 Feb 2021 01:55:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:50028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232042AbhBBGzy (ORCPT ); Tue, 2 Feb 2021 01:55:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4FA7D64EE8; Tue, 2 Feb 2021 06:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612248913; bh=6h96t0KmVA/ZHg0SCIB7LAec9IKH97aWu3/bgP48UsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iXSvA9gkea0AQTuk2mp7nBz2UN+ZUnb+bRydeoq5JM8juF9M/7qWFMO7Wp9DGUR/z cdwa5nqvw7epkxY20oiyBj2eU1D5dJ9WJsoLxmY2fv94KpyNLTpz0Dww+G/9mpOwO5 didPuc/sHz9NBJdIzX5in8m1eog+PaqdKz0SHBFcKv6TOhFVsbupgLMZq/bmtegF7y l6CBN873akmOgC7NlF7moAg3pgcPtMtv2AdESWO0z9NvdTBYBZmc5KnqmHBnTJNKys yhVMSJSf5PTv3EoK1EznnxdUx0v3s7uk0zYnqUHVw+EF5j47HI7IMocMvCVyB56Bz+ njtJfoJkkUumA== From: Saeed Mahameed To: Jakub Kicinski Cc: "David S. Miller" , netdev@vger.kernel.org, Roi Dayan , Saeed Mahameed Subject: [net-next 04/14] net/mlx5e: Move netif_carrier_off() out of mlx5e_priv_init() Date: Mon, 1 Feb 2021 22:54:47 -0800 Message-Id: <20210202065457.613312-5-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202065457.613312-1-saeed@kernel.org> References: <20210202065457.613312-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Roi Dayan It's not part of priv initialization. Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 +++--- drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 177e076f6cce..e468d8329c2a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -5483,9 +5483,6 @@ int mlx5e_priv_init(struct mlx5e_priv *priv, if (!priv->wq) goto err_free_cpumask; - /* netdev init */ - netif_carrier_off(netdev); - return 0; err_free_cpumask: @@ -5523,6 +5520,8 @@ mlx5e_create_netdev(struct mlx5_core_dev *mdev, unsigned int txqs, unsigned int mlx5_core_err(mdev, "mlx5e_priv_init failed, err=%d\n", err); goto err_free_netdev; } + + netif_carrier_off(netdev); dev_net_set(netdev, mlx5_core_net(mdev)); return netdev; @@ -5630,6 +5629,7 @@ mlx5e_netdev_attach_profile(struct mlx5e_priv *priv, mlx5_core_err(mdev, "mlx5e_priv_init failed, err=%d\n", err); return err; } + netif_carrier_off(netdev); priv->profile = new_profile; priv->ppriv = new_ppriv; err = new_profile->init(priv->mdev, priv->netdev); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c index 8641bd9bbb53..1eeca45cfcdf 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c @@ -76,6 +76,7 @@ int mlx5i_init(struct mlx5_core_dev *mdev, struct net_device *netdev) { struct mlx5e_priv *priv = mlx5i_epriv(netdev); + netif_carrier_off(netdev); mlx5e_set_netdev_mtu_boundaries(priv); netdev->mtu = netdev->max_mtu;