RE: [PATCH iwl-net 09/10] ice: program multicast magic wake before tearing down the main VSI
From: Loktionov, Aleksandr
Date: Mon Oct 05 2026 - 06:31:25 EST
> -----Original Message-----
> From: Petr Oros <poros@xxxxxxxxxx>
> Sent: Friday, October 2, 2026 3:08 PM
> To: netdev@xxxxxxxxxxxxxxx
> Cc: Oros, Petr <poros@xxxxxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@xxxxxxxxx>; Andrew Lunn <andrew+netdev@xxxxxxx>;
> David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>; Lobakin, Aleksander
> <aleksander.lobakin@xxxxxxxxx>; Alexei Starovoitov <ast@xxxxxxxxxx>;
> Daniel Borkmann <daniel@xxxxxxxxxxxxx>; Jesper Dangaard Brouer
> <hawk@xxxxxxxxxx>; John Fastabend <john.fastabend@xxxxxxxxx>;
> Stanislav Fomichev <sdf@xxxxxxxxxxx>; Henry Tieman
> <henry.w.tieman@xxxxxxxxx>; Anirudh Venkataramanan
> <anirudh.venkataramanan@xxxxxxxxx>; Michal Swiatkowski
> <michal.swiatkowski@xxxxxxxxxxxxxxx>; Jesse Brandeburg
> <jbrandeb@xxxxxxxxxx>; Preethi Banala <preethi.banala@xxxxxxxxx>;
> Kiran Patil <kiran.patil@xxxxxxxxx>; Dan Nowlin
> <dan.nowlin@xxxxxxxxx>; Stephen Hemminger
> <stephen@xxxxxxxxxxxxxxxxxx>; intel-wired-lan@xxxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; bpf@xxxxxxxxxxxxxxx
> Subject: [PATCH iwl-net 09/10] ice: program multicast magic wake
> before tearing down the main VSI
>
> Since commit 5b246e533d01 ("ice: split probe into smaller functions")
> ice_remove() calls ice_setup_mc_magic_wake() after ice_deinit(), which
> frees pf->vsi. ice_get_main_vsi() then returns NULL and the function
> returns before it sends the Manage MAC Write command, so multicast
> magic packet wake and keeping a locally administered address across
> the PF reset are never set up on shutdown with WoL enabled.
>
> Program it before the netdev and the VSIs are torn down, as it was
> done before that commit, so the current netdev address is used again.
>
> i40e had a similar problem, where the multicast magic wake setup ran
> after the admin queue had already been shut down, and fixed it in
> commit e661414c98df ("i40e: Remove duplicated prepare call in
> i40e_shutdown").
>
> Fixes: 5b246e533d01 ("ice: split probe into smaller functions")
> Assisted-by: LLM
> Signed-off-by: Petr Oros <poros@xxxxxxxxxx>
> ---
> drivers/net/ethernet/intel/ice/ice_main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c
> b/drivers/net/ethernet/intel/ice/ice_main.c
> index ceb9fec2af21e7..a885b3e0baaa5d 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -5456,6 +5456,8 @@ static void ice_remove(struct pci_dev *pdev)
> if (!ice_is_safe_mode(pf))
> ice_remove_arfs(pf);
>
> + ice_setup_mc_magic_wake(pf);
> +
> devl_lock(priv_to_devlink(pf));
> ice_dealloc_all_dynamic_ports(pf);
> ice_deinit_devlink(pf);
> @@ -5466,7 +5468,6 @@ static void ice_remove(struct pci_dev *pdev)
> ice_deinit(pf);
> ice_vsi_release_all(pf);
>
> - ice_setup_mc_magic_wake(pf);
> ice_set_wake(pf);
>
> ice_adapter_put(pdev);
> --
> 2.55.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>