ionic: make all rx_mode work threadsafe
authorShannon Nelson <snelson@pensando.io>
Fri, 23 Jul 2021 18:02:45 +0000 (11:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Jul 2021 20:57:41 +0000 (21:57 +0100)
commit6840e17b8ea992453e2d6f460d403cb05d194e76
treeec3b722ea54b69c6a03a2a013e0b4d541239b118
parent0506c93fba05d91d40faa04c579e35783a4aa6f6
ionic: make all rx_mode work threadsafe

Move the bulk of the code from ionic_set_rx_mode(), which
can be called from atomic context, into ionic_lif_rx_mode()
which is a safe context.

A call from the stack will get pushed off into a work thread,
but it is also possible to simultaneously have a call driven
by a queue reconfig request from an ethtool command or fw
recovery event.  We add a mutex around the rx_mode work to be
sure they don't collide.

Fixes: 81dbc24147f9 ("ionic: change set_rx_mode from_ndo to can_sleep")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_lif.c
drivers/net/ethernet/pensando/ionic/ionic_lif.h