From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Jakub Kicinski <kuba@kernel.org>,
Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: Tariq Toukan <tariqt@nvidia.com>, Jianbo Liu <jianbol@nvidia.com>,
<netdev@vger.kernel.org>, Saeed Mahameed <saeedm@nvidia.com>,
Gal Pressman <gal@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>,
Mark Bloch <mbloch@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
ITP Upstream <nxne.cnse.osdt.itp.upstreaming@intel.com>
Subject: Re: [PATCH net 4/4] net/mlx5e: Keep netdev when leave switchdev for devlink set legacy only
Date: Fri, 20 Dec 2024 16:10:54 +0100 [thread overview]
Message-ID: <65ef1684-b2d5-40f6-b20a-71ccb9ee302d@intel.com> (raw)
In-Reply-To: <20241220064634.10b127f9@kernel.org>
On 12/20/24 15:46, Jakub Kicinski wrote:
> 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.
good to know, I will pass it down to my folks
>
>>> + * 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.
[1] says
"Also, use braces when a loop contains more than a single simple statement:"
And I see that here we have and if() instead of a loop, but I believe
that the intent of "the rule" (not sure how hard) was to pet the brace
in such cases.
To be clear, I don't want to stop an otherwise good PR just for this!
[1]
https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces
next prev parent reply other threads:[~2024-12-20 15:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 8:15 [PATCH net 0/4] mlx5 misc fixes 2024-12-20 Tariq Toukan
2024-12-20 8:15 ` [PATCH net 1/4] net/mlx5: DR, select MSIX vector 0 for completion queue creation Tariq Toukan
2024-12-20 8:15 ` [PATCH net 2/4] net/mlx5e: macsec: Maintain TX SA from encoding_sa Tariq Toukan
2024-12-20 8:15 ` [PATCH net 3/4] net/mlx5e: Skip restore TC rules for vport rep without loaded flag Tariq Toukan
2024-12-20 8:15 ` [PATCH net 4/4] net/mlx5e: Keep netdev when leave switchdev for devlink set legacy only Tariq Toukan
2024-12-20 8:48 ` Przemek Kitszel
2024-12-20 14:46 ` Jakub Kicinski
2024-12-20 15:10 ` Przemek Kitszel [this message]
2024-12-23 19:10 ` [PATCH net 0/4] mlx5 misc fixes 2024-12-20 patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65ef1684-b2d5-40f6-b20a-71ccb9ee302d@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=jianbol@nvidia.com \
--cc=kuba@kernel.org \
--cc=leonro@nvidia.com \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=nxne.cnse.osdt.itp.upstreaming@intel.com \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).