From: Jacob Keller <jacob.e.keller@intel.com>
To: <intel-wired-lan@osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next 3/4] iavf: add a common function for undoing the interrupt scheme
Date: Tue, 17 Oct 2023 10:35:35 -0700 [thread overview]
Message-ID: <91efda87-c60d-4988-987c-9824717f5a2a@intel.com> (raw)
In-Reply-To: <20231016164849.45691-4-mschmidt@redhat.com>
On 10/16/2023 9:48 AM, Michal Schmidt wrote:
> 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@redhat.com>
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@intel.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);
Strictly speaking this does change some flow because we didn't release
queues until much later.. but I think that should be ok. I don't see how
waiting to free the queues would matter here.
> 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
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2023-10-17 17:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 16:48 [Intel-wired-lan] [PATCH iwl-next 0/4] iavf: cleanups, dead code removal Michal Schmidt
2023-10-16 16:48 ` [Intel-wired-lan] [PATCH iwl-next 1/4] iavf: rely on netdev's own registered state Michal Schmidt
2023-10-17 8:01 ` Drewek, Wojciech
2023-10-17 17:30 ` Jacob Keller
2023-10-24 9:09 ` Romanowski, Rafal
2023-10-16 16:48 ` [Intel-wired-lan] [PATCH iwl-next 2/4] iavf: use unregister_netdev Michal Schmidt
2023-10-17 8:06 ` Drewek, Wojciech
2023-10-24 9:11 ` Romanowski, Rafal
2023-10-17 17:33 ` Jacob Keller
2023-10-17 18:43 ` Jacob Keller
2023-10-16 16:48 ` [Intel-wired-lan] [PATCH iwl-next 3/4] iavf: add a common function for undoing the interrupt scheme Michal Schmidt
2023-10-17 8:58 ` Drewek, Wojciech
2023-10-17 17:35 ` Jacob Keller [this message]
2023-10-24 9:12 ` Romanowski, Rafal
2023-10-16 16:48 ` [Intel-wired-lan] [PATCH iwl-next 4/4] iavf: delete the iavf client interface Michal Schmidt
2023-10-17 17:46 ` Jacob Keller
2023-10-24 9:12 ` Romanowski, Rafal
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=91efda87-c60d-4988-987c-9824717f5a2a@intel.com \
--to=jacob.e.keller@intel.com \
--cc=intel-wired-lan@osuosl.org \
/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