linux_dsm_epyc7002/drivers/net/ethernet/broadcom
Yuval Mintz 8b09be5f17 bnx2x: Revising locking scheme for MAC configuration
On very rare occasions, repeated load/unload stress test in the presence of
our storage driver (bnx2i/bnx2fc) causes a kernel panic in bnx2x code
(NULL pointer dereference). Stack traces indicate the issue happens during MAC
configuration; thorough code review showed that indeed several races exist
in which one thread can iterate over the list of configured MACs while another
deletes entries from the same list.

This patch adds a varient on the single-writer/Multiple-reader lock mechanism -
It utilizes an already exsiting bottom-half lock, using it so that Whenever
a writer is unable to continue due to the existence of another writer/reader,
it pends its request for future deliverance.
The writer / last readers will check for the existence of such requests and
perform them instead of the original initiator.
This prevents the writer from having to sleep while waiting for the lock
to be accessible, which might cause deadlocks given the locks already
held by the writer.

Another result of this patch is that setting of Rx Mode is now made in
sleepable context - Setting of Rx Mode is made under a bottom-half lock, which
was always nontrivial for the bnx2x driver, as the HW/FW configuration requires
wait for completions.
Since sleep was impossible (due to the sleepless-context), various mechanisms
were utilized to prevent the calling thread from sleep, but the truth was that
when the caller thread (i.e, the one calling ndo_set_rx_mode()) returned, the
Rx mode was still not set in HW/FW.

bnx2x_set_rx_mode() will now overtly schedule for the Rx changes to be
configured by the sp_rtnl_task which hold the RTNL lock and is sleepable
context.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-01 15:56:27 -07:00
..
bnx2x bnx2x: Revising locking scheme for MAC configuration 2013-08-01 15:56:27 -07:00
b44.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into mips-for-linux-next 2013-02-22 10:07:30 +01:00
b44.h b44: add 64 bit stats 2012-07-18 09:29:43 -07:00
bcm63xx_enet.c bcm63xx_enet: fix return value check in bcm_enet_shared_probe() 2013-06-19 00:48:58 -07:00
bcm63xx_enet.h bcm63xx_enet: add support Broadcom BCM6345 Ethernet 2013-06-13 17:22:08 -07:00
bgmac.c drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb 2013-03-09 16:09:19 -05:00
bgmac.h bgmac: register MII bus 2013-03-07 16:28:26 -05:00
bnx2_fw.h
bnx2.c bnx2: use pdev->pm_cap instead of pci_find_capability(.., PCI_CAP_ID_PM) 2013-06-19 22:22:57 -07:00
bnx2.h cnic, bnx2x, bnx2: Simplify cnic probing. 2012-12-07 12:44:02 -05:00
cnic_defs.h cnic: Update version to 2.5.17 and copyright year. 2013-07-29 22:03:07 -07:00
cnic_if.h cnic: Update version to 2.5.17 and copyright year. 2013-07-29 22:03:07 -07:00
cnic.c cnic: Update version to 2.5.17 and copyright year. 2013-07-29 22:03:07 -07:00
cnic.h cnic: Update version to 2.5.17 and copyright year. 2013-07-29 22:03:07 -07:00
Kconfig bgmac: add dependency to phylib 2013-07-16 12:34:19 -07:00
Makefile bgmac: driver for GBit MAC core on BCMA bus 2013-01-09 23:37:03 -08:00
sb1250-mac.c net: ethernet: use platform_{get,set}_drvdata() 2013-05-25 21:27:58 -07:00
tg3.c tg3: Update version to 3.133 2013-07-29 23:38:52 -07:00
tg3.h tg3: Fix UDP fragments treated as RMCP 2013-07-29 23:38:52 -07:00