DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: dev@dpdk.org
Cc: Julien Meunier <julien.meunier@6wind.com>
Subject: [dpdk-dev] [PATCH] igbvf: fix vlan filtering
Date: Fri, 30 Oct 2015 17:14:03 +0100	[thread overview]
Message-ID: <1446221643-10763-1-git-send-email-david.marchand@6wind.com> (raw)

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>
---
 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

             reply	other threads:[~2015-10-30 16:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 16:14 David Marchand [this message]
2015-11-02  7:21 ` Lu, Wenzhuo
2015-11-02 16:32   ` David Marchand
2015-11-03 14:25 ` [dpdk-dev] [PATCH v2] " David Marchand
2015-11-04  2:00   ` Lu, Wenzhuo
2015-11-10 16:15     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446221643-10763-1-git-send-email-david.marchand@6wind.com \
    --to=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=julien.meunier@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).