From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=IfVjYzJqGPAnFhz6qNu4iWorceA6pQjqqf9KBheK9GY=; b=IDbCEDpFo4bw217GL0QGe932YlEg5DEzJ+SRhrMFYoArdNuXCyUXs1X+KryJmi+iF7 weia4jccIjdHNLkpLIueo0oEZBYXgPYLnQvlW6P6F5vibWq9GJzbPaMeiRhBDR6PDxv1 PK7/0S8UuVVTlc1HOSlJ7+SxYDkD+SR2L92e4dY8uUXZuicr2HkF3TUhV3XY7Hncw8sQ SA6TEzpe1/A2c8sLkVvg9ZD4HIulv5E1WLB+iotsD4AxLx2TEMDK8F6/bQ1KDEDhpnk2 33hnsLsHbXfd/3ig2R8o6fVCiJVgu+hfH3FJf1mM7J3IdG5R8G05cSz6GQoKjeGW609W Esag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IfVjYzJqGPAnFhz6qNu4iWorceA6pQjqqf9KBheK9GY=; b=ZjBIxrP4yierYF27HZ9vHHWUB3NP/XeMnJkb9ay+3qFx/6re5zJghcOA6LgYzmfc0c p7jKiD8whfz7V1y2VyTL1oGJMwcijWak9bQ+B85pCT+uId7QFc15Ku1MOZ1FS8+qGuP/ yAmOJKykC50lW9JBk/wTJJ4OeCB8r6WBQP8rU1ZySlUuC2C/Xe4f1Yzb62z0iPsCd93C Z7DuOe63rvJ7TdGWy0M6VkY3gYNpq7PN1T357Yh9NIN+rGGIE5j6E0/P0FaBXfvJK7Wz POVTNs8KJsHpAEo/Z2tXuhemHNhmOrOoJ+cjlTsBZJqFSW0Im+V6qIKOxhA1eaPJrPMK Tx6Q== X-Gm-Message-State: ALoCoQlrbr7htECfwjyyVeZJT5yGwT45v4WtMIZg+G4KlxvoA2fZmVG/J23Loi2sCNTeoNgdO7k8 X-Received: by 10.28.93.145 with SMTP id r139mr4257759wmb.20.1446221648341; Fri, 30 Oct 2015 09:14:08 -0700 (PDT) Received: from gloops.dev.6wind.com (89-158-215-180.rev.numericable.fr. [89.158.215.180]) by smtp.gmail.com with ESMTPSA id wx10sm7730573wjb.40.2015.10.30.09.14.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Oct 2015 09:14:07 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Fri, 30 Oct 2015 17:14:03 +0100 Message-Id: <1446221643-10763-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 Cc: Julien Meunier Subject: [dpdk-dev] [PATCH] igbvf: fix vlan filtering X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Oct 2015 16:14:08 -0000 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