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: <MW4PR11MB5776312E93F8FF5BED3B4343FDD6A@MW4PR11MB5776.namprd11.prod.outlook.com>
Date: Tue, 17 Oct 2023 08:58:08 +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 3/4] iavf: add a common
 function for undoing the interrupt scheme



> -----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 3/4] iavf: add a common function
> for undoing the interrupt scheme
> 
> Add a new function iavf_free_interrupt_scheme that does the inverse of
> iavf_init_interrupt_scheme. Symmetry is nice. And there will be three
> callers already.
> 
> Signed-off-by: Michal Schmidt <mschmidt@...hat.com>

I like symmetry :)
Reviewed-by: Wojciech Drewek <wojciech.drewek@...el.com>

> ---
>  drivers/net/ethernet/intel/iavf/iavf_main.c | 26 ++++++++++++---------
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 6036a4582196..791517cafc3c 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -1954,6 +1954,17 @@ static int iavf_init_interrupt_scheme(struct
> iavf_adapter *adapter)
>  	return err;
>  }
> 
> +/**
> + * iavf_free_interrupt_scheme - Undo what iavf_init_interrupt_scheme does
> + * @adapter: board private structure
> + **/
> +static void iavf_free_interrupt_scheme(struct iavf_adapter *adapter)
> +{
> +	iavf_free_q_vectors(adapter);
> +	iavf_reset_interrupt_capability(adapter);
> +	iavf_free_queues(adapter);
> +}
> +
>  /**
>   * iavf_free_rss - Free memory used by RSS structs
>   * @adapter: board private structure
> @@ -1982,11 +1993,9 @@ static int iavf_reinit_interrupt_scheme(struct
> iavf_adapter *adapter, bool runni
>  	if (running)
>  		iavf_free_traffic_irqs(adapter);
>  	iavf_free_misc_irq(adapter);
> -	iavf_reset_interrupt_capability(adapter);
> -	iavf_free_q_vectors(adapter);
> -	iavf_free_queues(adapter);
> +	iavf_free_interrupt_scheme(adapter);
> 
> -	err =  iavf_init_interrupt_scheme(adapter);
> +	err = iavf_init_interrupt_scheme(adapter);
>  	if (err)
>  		goto err;
> 
> @@ -2973,9 +2982,7 @@ static void iavf_disable_vf(struct iavf_adapter
> *adapter)
>  	spin_unlock_bh(&adapter->cloud_filter_list_lock);
> 
>  	iavf_free_misc_irq(adapter);
> -	iavf_reset_interrupt_capability(adapter);
> -	iavf_free_q_vectors(adapter);
> -	iavf_free_queues(adapter);
> +	iavf_free_interrupt_scheme(adapter);
>  	memset(adapter->vf_res, 0, IAVF_VIRTCHNL_VF_RESOURCE_SIZE);
>  	iavf_shutdown_adminq(&adapter->hw);
>  	adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
> @@ -5206,9 +5213,7 @@ static void iavf_remove(struct pci_dev *pdev)
>  	iavf_free_all_tx_resources(adapter);
>  	iavf_free_all_rx_resources(adapter);
>  	iavf_free_misc_irq(adapter);
> -
> -	iavf_reset_interrupt_capability(adapter);
> -	iavf_free_q_vectors(adapter);
> +	iavf_free_interrupt_scheme(adapter);
> 
>  	iavf_free_rss(adapter);
> 
> @@ -5224,7 +5229,6 @@ static void iavf_remove(struct pci_dev *pdev)
> 
>  	iounmap(hw->hw_addr);
>  	pci_release_regions(pdev);
> -	iavf_free_queues(adapter);
>  	kfree(adapter->vf_res);
>  	spin_lock_bh(&adapter->mac_vlan_list_lock);
>  	/* If we got removed before an up/down sequence, we've got a filter
> --
> 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