]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: Fix for VF mailbox receiving unknown message
authorXi Wang <wangxi11@huawei.com>
Wed, 6 Jun 2018 13:07:52 +0000 (14:07 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Jun 2018 18:02:48 +0000 (14:02 -0400)
commit1ab4ddaabe8b1a97ecbb1e9157da77563a8637b2
tree54d907607d58aa3a9820c7070ec76a159a209ff3
parent8890e2cadc607d089c23fc5d54eeae9d1989833f
net: hns3: Fix for VF mailbox receiving unknown message

Before the firmware updates the crq's tail pointer, if the VF driver
reads the data in the crq, the data may be incomplete at this time,
which will lead to the driver read an unknown message.

This patch fixes it by checking if crq is empty before reading the
message.

Fixes: 1db7e16c8323 ("net: hns3: Add mailbox support to VF driver")
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c