summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cavium/thunder/nic.h
diff options
context:
space:
mode:
authorVadim Lomovtsev <vlomovtsev@marvell.com>2019-02-20 11:02:44 +0000
committerDavid S. Miller <davem@davemloft.net>2019-02-22 11:43:45 -0800
commit609ea65c65a0f801c285abf524d36d1f4635d942 (patch)
tree442d6d2cd438caea558fb11abdb9839f83457b9c /drivers/net/ethernet/cavium/thunder/nic.h
parent5354439612894033e3f3b934f0bc03afb5f4ddc5 (diff)
downloadtalos-obmc-linux-609ea65c65a0f801c285abf524d36d1f4635d942.tar.gz
talos-obmc-linux-609ea65c65a0f801c285abf524d36d1f4635d942.zip
net: thunderx: add mutex to protect mailbox from concurrent calls for same VF
In some cases it could happen that nicvf_send_msg_to_pf() could be called concurrently for the same NIC VF, and thus re-writing mailbox contents and breaking messaging sequence with PF by re-writing NICVF data. This commit is to implement mutex for NICVF to protect mailbox registers and NICVF messaging control data from concurrent access. Signed-off-by: Vadim Lomovtsev <vlomovtsev@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/thunder/nic.h')
-rw-r--r--drivers/net/ethernet/cavium/thunder/nic.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h
index 227343625e83..86cda3f4b37b 100644
--- a/drivers/net/ethernet/cavium/thunder/nic.h
+++ b/drivers/net/ethernet/cavium/thunder/nic.h
@@ -329,6 +329,8 @@ struct nicvf {
spinlock_t rx_mode_wq_lock;
/* workqueue for handling kernel ndo_set_rx_mode() calls */
struct workqueue_struct *nicvf_rx_mode_wq;
+ /* mutex to protect VF's mailbox contents from concurrent access */
+ struct mutex rx_mode_mtx;
/* PTP timestamp */
struct cavium_ptp *ptp_clock;
OpenPOWER on IntegriCloud