]> git.baikalelectronics.ru Git - kernel.git/commit
be2net: replace polling with sleeping in the FW completion path
authorSathya Perla <sathya.perla@broadcom.com>
Wed, 27 Jul 2016 09:26:18 +0000 (05:26 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Aug 2016 22:38:27 +0000 (15:38 -0700)
commit37694de101053380212d491ff61a743d307f9a73
treede17129e973a659f0cf7b8ebab45fd64e51189ac
parent3216840fa22366b3bc35920c62ed9a1e3daaf54e
be2net: replace polling with sleeping in the FW completion path

The ndo_set_rx_mode() and ndo_add/del_vxlan_port() calls may be called with
BHs disabled. The driver currently issues the required cmds to the FW in
these contexts and polls on completions from the FW, while BHs remain
disabled.  This can cause either packet loss or packet reception to be
delayed on that CPU.

This patch defers processing of the above cmds to a separate workqueue.
With this change, FW cmds are now issued only in process context.
Now that the FW cmds are issued only in process context, they can sleep
waiting for a completion instead of polling. All the spin_lock_bh(mcc_lock)
calls are now replaced with mutex calls.

Also a new rx_filter_lock is now needed to protect the RX filtering fields
like vids[] between be_vlan_add/rem_vid() and __be_set_rx_mode() contexts.

Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be.h
drivers/net/ethernet/emulex/benet/be_cmds.c
drivers/net/ethernet/emulex/benet/be_main.c