From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 82ACD5A65 for ; Mon, 2 Nov 2015 08:21:13 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 01 Nov 2015 23:21:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,233,1444719600"; d="scan'208";a="824692152" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 01 Nov 2015 23:21:12 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 1 Nov 2015 23:21:11 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 1 Nov 2015 23:21:11 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.253]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.96]) with mapi id 14.03.0248.002; Mon, 2 Nov 2015 15:21:10 +0800 From: "Lu, Wenzhuo" To: David Marchand , "dev@dpdk.org" Thread-Topic: [PATCH] igbvf: fix vlan filtering Thread-Index: AQHREy4MnrPUMc7Jx0+97KtGmSyPbZ6IUuYg Date: Mon, 2 Nov 2015 07:21:09 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC0909020A545A@shsmsx102.ccr.corp.intel.com> References: <1446221643-10763-1-git-send-email-david.marchand@6wind.com> In-Reply-To: <1446221643-10763-1-git-send-email-david.marchand@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsIiwiaWQiOiJhMDRlMzhjZC0yYTFmLTQ1YWYtYTI2ZC0wZjVlN2RjMDM0ZWQiLCJwcm9wcyI6W3sibiI6IkludGVsRGF0YUNsYXNzaWZpY2F0aW9uIiwidmFscyI6W3sidmFsdWUiOiJDVFBfUFVCTElDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOGJqMnM2MVpTNFBsdWFIVU1qYTRiNUhkeWZMS1wvVUwrZUR6cExtRkh0dmc9In0= x-inteldataclassification: CTP_PUBLIC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Julien Meunier Subject: Re: [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: Mon, 02 Nov 2015 07:21:14 -0000 Hi David, Julien, > -----Original Message----- > From: David Marchand [mailto:david.marchand@6wind.com] > Sent: Saturday, October 31, 2015 12:14 AM > To: dev@dpdk.org > Cc: Lu, Wenzhuo; Julien Meunier > Subject: [PATCH] igbvf: fix vlan filtering >=20 > From: Julien Meunier >=20 > Once posted through mailbox, we must check for nack from the PF and > report an error in this case. >=20 > Signed-off-by: Julien Meunier > Signed-off-by: David Marchand > --- > drivers/net/e1000/igb_ethdev.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethde= v.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 =3D &hw->mbx; > uint32_t msgbuf[2]; > + s32 err; >=20 > /* After set vlan, vlan strip will also be enabled in igb driver*/ > msgbuf[0] =3D 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] |=3D E1000_VF_SET_VLAN_ADD; >=20 > - return (mbx->ops.write_posted(hw, msgbuf, 2, 0)); > + mbx->ops.write_posted(hw, msgbuf, 2, 0); How about if write failed? I think we'd better check it. > + err =3D mbx->ops.read_posted(hw, msgbuf, 2, 0); > + > + msgbuf[0] &=3D ~E1000_VT_MSGTYPE_CTS; > + if (!err && (msgbuf[0] =3D=3D (E1000_VF_SET_VLAN | > E1000_VT_MSGTYPE_NACK))) > + err =3D -EINVAL; > + > + return err; > } >=20 > static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on) > -- > 1.9.1