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

Fixes: b11a0bb231f3 ("net: hns3: Add mailbox support to VF driver")
Signed-off-by: Xi Wang <>
Signed-off-by: Peng Li <>
Signed-off-by: Salil Mehta <>
Signed-off-by: David S. Miller <>
1 file changed