[dpdk-dev,v2] igbvf: fix vlan filtering
Commit Message
From: Julien Meunier <julien.meunier@6wind.com>
Once posted through mailbox, we must check for nack from the PF and report an
error in this case.
Signed-off-by: Julien Meunier <julien.meunier@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
---
Changes since v1:
- added check on error when writing to mailbox
---
drivers/net/e1000/igb_ethdev.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
Comments
Hi,
> -----Original Message-----
> From: David Marchand [mailto:david.marchand@6wind.com]
> Sent: Tuesday, November 3, 2015 10:25 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo; Julien Meunier
> Subject: [PATCH v2] igbvf: fix vlan filtering
>
> From: Julien Meunier <julien.meunier@6wind.com>
>
> Once posted through mailbox, we must check for nack from the PF and
> report an error in this case.
>
> Signed-off-by: Julien Meunier <julien.meunier@6wind.com>
> Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > From: Julien Meunier <julien.meunier@6wind.com>
> >
> > Once posted through mailbox, we must check for nack from the PF and
> > report an error in this case.
> >
> > Signed-off-by: Julien Meunier <julien.meunier@6wind.com>
> > Signed-off-by: David Marchand <david.marchand@6wind.com>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Applied, thanks
@@ -2771,6 +2771,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;
@@ -2779,7 +2780,20 @@ 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));
+ err = mbx->ops.write_posted(hw, msgbuf, 2, 0);
+ if (err)
+ goto mbx_err;
+
+ err = mbx->ops.read_posted(hw, msgbuf, 2, 0);
+ if (err)
+ goto mbx_err;
+
+ msgbuf[0] &= ~E1000_VT_MSGTYPE_CTS;
+ if (msgbuf[0] == (E1000_VF_SET_VLAN | E1000_VT_MSGTYPE_NACK))
+ err = -EINVAL;
+
+mbx_err:
+ return err;
}
static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)