From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1751208AD for ; Fri, 20 Dec 2024 14:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734705996; cv=none; b=dWuBM5Q0TBj/z9iC3VtDO4t2DD3GBkN0XH/javjcIH6pYuCioCFroiZbS/afx0jzTZLYqf5xVKm2xPnRqkoDQks61/5mVNwV3ghtckjG+6q3KbavkCr77lNlXnrXLS1qVo49M2/Qs1BDmbIKZFWJkgqFhnhCWXqHyvkb1/5APxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734705996; c=relaxed/simple; bh=aBRL6Si6HQP5DWl9Q2NNmZHJBb2ue1IOkPO8Lqcu/9w=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DFLNke+G9MWaW72QO3k8dYf9CzGlmSNrCnFPB4cMa/b9BLpY0/+zy4ixBIudx8Dggz6+Jwc4SWDQky1gE8s52jZzbnzZAcDEkzd+36Qan85pyrrcC2T4wAqwL3TGjKO3Pyvw/IxzBTrsiVghlM7vppwIfqNWYED1ZunlvzCJCLg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ReTsmGGk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ReTsmGGk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5C1BC4CED3; Fri, 20 Dec 2024 14:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734705996; bh=aBRL6Si6HQP5DWl9Q2NNmZHJBb2ue1IOkPO8Lqcu/9w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ReTsmGGkuYpo0o8UMztrJGVobDizNAQeUP4eX3nNovRuXEu+CAIO1I9e01X6/5M3O BKOAj5BfT6FDfSkDcEStPMKx5/4Q742VMaIMrJak7NXwRfu01n7IL7fO3szJWkBdB1 ool42nVOSZHJQemNBFxHMYyebTE5uVA3pzL1wQANlQ+sMxOC8y/giWT+R6OmvP/2T2 C2Na0nraBbRL41JmzHyp4NNvVp93kh6bp4v+42EiHt5vE7T45QotxEh9qpL91OdxIk rHFOO8/XwTeHE1mVXWvXRK3MCB7bOfqgVMXzRiQD9nx5HVIN3i7UnN1jdqeNo3QvIO fuseh7/O7dzMA== Date: Fri, 20 Dec 2024 06:46:34 -0800 From: Jakub Kicinski To: Przemek Kitszel Cc: Tariq Toukan , Jianbo Liu , , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Mark Bloch , "David S. Miller" , Paolo Abeni , Eric Dumazet , Andrew Lunn Subject: Re: [PATCH net 4/4] net/mlx5e: Keep netdev when leave switchdev for devlink set legacy only Message-ID: <20241220064634.10b127f9@kernel.org> In-Reply-To: References: <20241220081505.1286093-1-tariqt@nvidia.com> <20241220081505.1286093-5-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 20 Dec 2024 09:48:11 +0100 Przemek Kitszel wrote: > > mlx5_core_uplink_netdev_set(mdev, NULL); > > mlx5e_dcbnl_delete_app(priv); > > - unregister_netdev(priv->netdev); > > - _mlx5e_suspend(adev, false); > > + /* When unload driver, the netdev is in registered state > > /* > * Netdev dropped the special comment allowance rule, > * now you have to put one line almost blank at the front. > */ Incorrect, we still prefer the old comment style, we just give a pass now to people who have a strong preference the opposite way. > > + * if it's from legacy mode. If from switchdev mode, it > > + * is already unregistered before changing to NIC profile. > > + */ > > + if (priv->netdev->reg_state == NETREG_REGISTERED) { > > + unregister_netdev(priv->netdev); > > + _mlx5e_suspend(adev, false); > > + } else { > > + struct mlx5_core_dev *pos; > > + int i; > > + > > + if (test_bit(MLX5E_STATE_DESTROYING, &priv->state)) > > you have more than one statement/expression inside the if, > so you must wrap with braces I'm not aware of that as a hard rule either.