diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2013-03-26 21:05:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-27 12:48:32 -0400 |
commit | 1d6f3cd8988822c7bdc3c685fac0a99315e83400 (patch) | |
tree | a66c7d4931aa49336e07e97d3a44ee674a05f79c /drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |
parent | 21776537b15f72dc9d8c16b00439fbdaa8ce7a34 (diff) |
bnx2x: Prevent VF race
The mail box containing the Vf-Pf messages is susceptible
to a race - it's possible for 2 flows to try and write commands,
causing one to override the other's message.
Use a mutex to synchronize the access, preventing said race.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index f6e9d15e3835..10af03e43394 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -12521,7 +12521,8 @@ static int bnx2x_init_one(struct pci_dev *pdev, | |||
12521 | * l2 connections. | 12521 | * l2 connections. |
12522 | */ | 12522 | */ |
12523 | if (IS_VF(bp)) { | 12523 | if (IS_VF(bp)) { |
12524 | bnx2x_vf_map_doorbells(bp); | 12524 | bp->doorbells = bnx2x_vf_doorbells(bp); |
12525 | mutex_init(&bp->vf2pf_mutex); | ||
12525 | rc = bnx2x_vf_pci_alloc(bp); | 12526 | rc = bnx2x_vf_pci_alloc(bp); |
12526 | if (rc) | 12527 | if (rc) |
12527 | goto init_one_exit; | 12528 | goto init_one_exit; |