From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 72CCB8E7A for ; Tue, 3 Nov 2015 15:25:45 +0100 (CET) Received: by wicfx6 with SMTP id fx6so70452524wic.1 for ; Tue, 03 Nov 2015 06:25:45 -0800 (PST) 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:in-reply-to:references; bh=Cn/McnH76A/KZe9+KL6KKimSQTPovYlg7K1IAZ69jlM=; b=kNAKy0Y3K/JgXa83f3W9pKSZWaoD3DC+PViHLUb3Sr9kEhpJzQafcuHE7AGdFEUlNt bVQM7h9WuGwcVnkOnLfkGbRFxvhYyFLebVWowWui3c/Fs7JPIfwFAN9iUz3a+q0t66Vk 6BZIxXUu15Xx/mru88LaHCYNphcrDKJ9wiYa5N+IZ3uiJuFj/oDTFMZQnBpJF0ZuAt8O RYy+MrwJewgf4ADdsZkm4onLdSpOFe7/TDurOBc9+2oy3Z6MT7q/2eYJDfKFaIYqptJB 6xTGl1k8v5l/ani1S8hHxV4InJERgOp4jtTAFeZ50a/3ziOmqM7ZElSs3dt5thot38co ThJg== 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:in-reply-to :references; bh=Cn/McnH76A/KZe9+KL6KKimSQTPovYlg7K1IAZ69jlM=; b=Ubof5qOEPgX6+kgsuGylRGsIicV/bCcA0TVAYX3Lwy4dO0Uub5L/H82n3AR0RBdg9g 5DGgXHxl0QEhD1k4ASN1cdagMJq+AOkgf0QPX6QovWLzd+vLuaCYWyShegHL9jBRZMkp Al8AXoP+1Ig93w6W/Wrt2mWhGEkiLv8eLeM1rpO7dCiwMRIJI7QyuW6KMnAbJ9B3rK+S Ng06KHIK0QWI/PGZYbLsu3kT5+Bp5/jxLtmox8x/BMPr7N+hAjq6MK+N3O/OSGGcpIud i7zgIkNosVc9hL1nJmY+0weGnpZHSjaM92XBp1kpFXpu+VUXolzzOLvA7h3C6XVbw4Tp X0sQ== X-Gm-Message-State: ALoCoQk2VquuotA8Fjsy3tL6oXIAfPjoqisIyZY0xEAo+tyr5u/feypGZ8TMwa1+ZyXHklNiMXIx X-Received: by 10.194.62.73 with SMTP id w9mr19484730wjr.126.1446560745218; Tue, 03 Nov 2015 06:25:45 -0800 (PST) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id w66sm18462032wme.11.2015.11.03.06.25.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 06:25:44 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Tue, 3 Nov 2015 15:25:22 +0100 Message-Id: <1446560722-25404-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1446221643-10763-1-git-send-email-david.marchand@6wind.com> References: <1446221643-10763-1-git-send-email-david.marchand@6wind.com> Cc: Julien Meunier Subject: [dpdk-dev] [PATCH v2] 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: Tue, 03 Nov 2015 14:25:45 -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 --- 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(-) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 97ca3c0..85de815 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -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) -- 1.9.1