From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: [PATCH] igbvf: fix vlan filtering Date: Fri, 30 Oct 2015 17:14:03 +0100 Message-ID: <1446221643-10763-1-git-send-email-david.marchand@6wind.com> Cc: Julien Meunier To: dev@dpdk.org Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 75FF49204 for ; Fri, 30 Oct 2015 17:14:08 +0100 (CET) Received: by wmec75 with SMTP id c75so15931630wme.1 for ; Fri, 30 Oct 2015 09:14:08 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Julien Meunier Once posted through mailbox, we must check for nack from the PF and report an error in this case. Signed-off-by: Julien Meunier Signed-off-by: David Marchand --- drivers/net/e1000/igb_ethdev.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 3ab082e..84e593b 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -2494,6 +2494,7 @@ static int igbvf_set_vfta(struct e1000_hw *hw, uint16_t vid, bool on) { struct e1000_mbx_info *mbx = &hw->mbx; uint32_t msgbuf[2]; + s32 err; /* After set vlan, vlan strip will also be enabled in igb driver*/ msgbuf[0] = E1000_VF_SET_VLAN; @@ -2502,7 +2503,14 @@ static int igbvf_set_vfta(struct e1000_hw *hw, uint16_t vid, bool on) if (on) msgbuf[0] |= E1000_VF_SET_VLAN_ADD; - return (mbx->ops.write_posted(hw, msgbuf, 2, 0)); + mbx->ops.write_posted(hw, msgbuf, 2, 0); + err = mbx->ops.read_posted(hw, msgbuf, 2, 0); + + msgbuf[0] &= ~E1000_VT_MSGTYPE_CTS; + if (!err && (msgbuf[0] == (E1000_VF_SET_VLAN | E1000_VT_MSGTYPE_NACK))) + err = -EINVAL; + + return err; } static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on) -- 1.9.1