lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YzFYYXcZaoPXcLz/@corigine.com>
Date:   Mon, 26 Sep 2022 09:44:33 +0200
From:   Simon Horman <simon.horman@...igine.com>
To:     Juhee Kang <claudiajkang@...il.com>
Cc:     netdev@...r.kernel.org, kuba@...nel.org, davem@...emloft.net,
        edumazet@...gle.com, pabeni@...hat.com, skhan@...uxfoundation.org
Subject: Re: [PATCH net-next 1/3] net: use netdev_unregistering instead of
 open code

On Sat, Sep 24, 2022 at 01:09:35AM +0900, Juhee Kang wrote:
> [You don't often get email from claudiajkang@...il.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> The open code is defined as a helper function(netdev_unregistering)
> on netdev.h, which the open code is dev->reg_state == NETREG_UNREGISTERING.
> Thus, netdev_unregistering() replaces the open code. This patch doesn't
> change logic.
> 
> Signed-off-by: Juhee Kang <claudiajkang@...il.com>

Reviewed-by: Simon Horman <simon.horman@...igine.com>

> ---
>  net/core/dev.c       | 9 ++++-----
>  net/core/net-sysfs.c | 2 +-
>  2 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index d66c73c1c734..f3f9394f0b5a 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2886,8 +2886,7 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
>         if (txq < 1 || txq > dev->num_tx_queues)
>                 return -EINVAL;
> 
> -       if (dev->reg_state == NETREG_REGISTERED ||
> -           dev->reg_state == NETREG_UNREGISTERING) {
> +       if (dev->reg_state == NETREG_REGISTERED || netdev_unregistering(dev)) {
>                 ASSERT_RTNL();
> 
>                 rc = netdev_queue_update_kobjects(dev, dev->real_num_tx_queues,

Is there any value in adding a netdev_registered() helper?

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ