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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MW4PR11MB57767D448938D07B818D3DDBFDD6A@MW4PR11MB5776.namprd11.prod.outlook.com>
Date: Tue, 17 Oct 2023 08:01:30 +0000
From: "Drewek, Wojciech" <wojciech.drewek@...el.com>
To: mschmidt <mschmidt@...hat.com>, "intel-wired-lan@...ts.osuosl.org"
	<intel-wired-lan@...ts.osuosl.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "Nguyen, Anthony L"
	<anthony.l.nguyen@...el.com>, "Brandeburg, Jesse"
	<jesse.brandeburg@...el.com>
Subject: RE: [Intel-wired-lan] [PATCH iwl-next 1/4] iavf: rely on netdev's own
 registered state



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Michal Schmidt
> Sent: Monday, October 16, 2023 6:49 PM
> To: intel-wired-lan@...ts.osuosl.org
> Cc: netdev@...r.kernel.org; Nguyen, Anthony L
> <anthony.l.nguyen@...el.com>; Brandeburg, Jesse
> <jesse.brandeburg@...el.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next 1/4] iavf: rely on netdev's own
> registered state
> 
> The information whether a netdev has been registered is already present
> in the netdev itself. There's no need for a driver flag with the same
> meaning.
> 
> Signed-off-by: Michal Schmidt <mschmidt@...hat.com>

Thanks Michal, nice cleanup!
Reviewed-by: Wojciech Drewek <wojciech.drewek@...el.com>

> ---
>  drivers/net/ethernet/intel/iavf/iavf.h      | 1 -
>  drivers/net/ethernet/intel/iavf/iavf_main.c | 9 +++------
>  2 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf.h
> b/drivers/net/ethernet/intel/iavf/iavf.h
> index 44daf335e8c5..f026d0670338 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf.h
> @@ -377,7 +377,6 @@ struct iavf_adapter {
>  	unsigned long crit_section;
> 
>  	struct delayed_work watchdog_task;
> -	bool netdev_registered;
>  	bool link_up;
>  	enum virtchnl_link_speed link_speed;
>  	/* This is only populated if the VIRTCHNL_VF_CAP_ADV_LINK_SPEED
> is set
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index f35d74566faa..d2f4648a6156 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -2021,7 +2021,7 @@ static void iavf_finish_config(struct work_struct
> *work)
>  	mutex_lock(&adapter->crit_lock);
> 
>  	if ((adapter->flags & IAVF_FLAG_SETUP_NETDEV_FEATURES) &&
> -	    adapter->netdev_registered &&
> +	    adapter->netdev->reg_state == NETREG_REGISTERED &&
>  	    !test_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section)) {
>  		netdev_update_features(adapter->netdev);
>  		adapter->flags &= ~IAVF_FLAG_SETUP_NETDEV_FEATURES;
> @@ -2029,7 +2029,7 @@ static void iavf_finish_config(struct work_struct
> *work)
> 
>  	switch (adapter->state) {
>  	case __IAVF_DOWN:
> -		if (!adapter->netdev_registered) {
> +		if (adapter->netdev->reg_state != NETREG_REGISTERED) {
>  			err = register_netdevice(adapter->netdev);
>  			if (err) {
>  				dev_err(&adapter->pdev->dev, "Unable to
> register netdev (%d)\n",
> @@ -2043,7 +2043,6 @@ static void iavf_finish_config(struct work_struct
> *work)
> 
> __IAVF_INIT_CONFIG_ADAPTER);
>  				goto out;
>  			}
> -			adapter->netdev_registered = true;
>  		}
> 
>  		/* Set the real number of queues when reset occurs while
> @@ -5173,10 +5172,8 @@ static void iavf_remove(struct pci_dev *pdev)
>  	cancel_work_sync(&adapter->finish_config);
> 
>  	rtnl_lock();
> -	if (adapter->netdev_registered) {
> +	if (netdev->reg_state == NETREG_REGISTERED)
>  		unregister_netdevice(netdev);
> -		adapter->netdev_registered = false;
> -	}
>  	rtnl_unlock();
> 
>  	if (CLIENT_ALLOWED(adapter)) {
> --
> 2.41.0
> 
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@...osl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ