diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2013-03-27 01:05:17 +0000 |
---|---|---|
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.h | |
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.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index c59da2d7b065..c6303428f9e9 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h @@ -1277,6 +1277,8 @@ struct bnx2x { #define BP_FW_MB_IDX(bp) BP_FW_MB_IDX_VN(bp, BP_VN(bp)) #ifdef CONFIG_BNX2X_SRIOV + /* protects vf2pf mailbox from simultaneous access */ + struct mutex vf2pf_mutex; /* vf pf channel mailbox contains request and response buffers */ struct bnx2x_vf_mbx_msg *vf2pf_mbox; dma_addr_t vf2pf_mbox_mapping; |