From dd18b06a32833543c6951b6206ac39896eaac154 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Wed, 27 Dec 2017 15:22:30 -0500 Subject: [PATCH] net/e1000: fix mailbox interrupt handler Mailbox interrupt handler only takecare of the PF reset notification, for other message mbx->ops.read should not be called since it gets chance to break the foreground VF to PF communication. Fixes: 316f4f1adc2e ("net/igb: support VF mailbox interrupt for link up/down") Cc: stable@dpdk.org Signed-off-by: Qi Zhang Acked-by: Wei Dai --- drivers/net/e1000/igb_ethdev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index ae43adeb1e..077e09400d 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -2961,13 +2961,17 @@ void igbvf_mbx_process(struct rte_eth_dev *dev) struct e1000_mbx_info *mbx = &hw->mbx; u32 in_msg = 0; - if (mbx->ops.read(hw, &in_msg, 1, 0)) - return; + /* peek the message first */ + in_msg = E1000_READ_REG(hw, E1000_VMBMEM(0)); /* PF reset VF event */ - if (in_msg == E1000_PF_CONTROL_MSG) + if (in_msg == E1000_PF_CONTROL_MSG) { + /* dummy mbx read to ack pf */ + if (mbx->ops.read(hw, &in_msg, 1, 0)) + return; _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL); + } } static int