OSDN Git Service

net: thunderx: add mutex to protect mailbox from concurrent calls for same VF
authorVadim Lomovtsev <vlomovtsev@marvell.com>
Wed, 20 Feb 2019 11:02:44 +0000 (11:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Feb 2019 19:43:45 +0000 (11:43 -0800)
commit609ea65c65a0f801c285abf524d36d1f4635d942
tree442d6d2cd438caea558fb11abdb9839f83457b9c
parent5354439612894033e3f3b934f0bc03afb5f4ddc5
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>
drivers/net/ethernet/cavium/thunder/nic.h
drivers/net/ethernet/cavium/thunder/nicvf_main.c