2022-03-10 20:01:00

by Ertman, David M

[permalink] [raw]
Subject: RE: [PATCH net] ice: Fix race condition during interface enslave

> -----Original Message-----
> From: Ivan Vecera <[email protected]>
> Sent: Thursday, March 10, 2022 10:07 AM
> To: Ertman, David M <[email protected]>
> Cc: [email protected]; Petr Oros <[email protected]>; Brandeburg,
> Jesse <[email protected]>; Nguyen, Anthony L
> <[email protected]>; David S. Miller <[email protected]>;
> Jakub Kicinski <[email protected]>; moderated list:INTEL ETHERNET DRIVERS"
> <[email protected]>, open list <[email protected]>
> Subject: Re: [PATCH net] ice: Fix race condition during interface enslave
>
> On Thu, 10 Mar 2022 17:48:16 +0000
> "Ertman, David M" <[email protected]> wrote:
>
> > This only addresses one case of unplugging the auxiliary bus. Rather than
> controlling one instance of
> > calling ice_unplig_aux_dev(), it seems like it would be better to modify
> ice_unplug_aux_dev so that it
> > will pause until any plugging is done by the service task (check for the pf-
> >flag bit and wait until it clears
> > before progressing).
>
> You cannot wait in ice_unplug_aux_dev() for ICE_FLAG_PLUG_AUX_DEV to
> be cleared because
> ice_clear_rdma_cap() is called under RTNL.
> This patch is a counter part for commit 5dbbbd01cbba83 ("ice: Avoid RTNL
> lock when
> re-creating auxiliary device") that eliminates ice_plug_aux() and fixed first
> part
> of deadlock and this patch fixes a second part and eliminates also
> ice_unplug_aux_dev()
> to be called under RTNL.
>
> Thanks,
> Ivan

You are correct. I forgot about the RTNL context!

With this in mind - I agree with your approach.

Reviewed-by: Dave Ertman <[email protected]>