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 F415A1F5 for ; Wed, 28 Jan 2015 02:38:10 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 27 Jan 2015 17:32:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,478,1418112000"; d="scan'208";a="677087076" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga002.jf.intel.com with ESMTP; 27 Jan 2015 17:38:07 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 28 Jan 2015 09:38:04 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.238]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.129]) with mapi id 14.03.0195.001; Wed, 28 Jan 2015 09:38:02 +0800 From: "Qiu, Michael" To: "Jastrzebski, MichalX K" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] testpmd check return value of rte_eth_dev_vlan_filter() Thread-Index: AQHQOlWPJMseh8x3zkqFiE+do3D8XQ== Date: Wed, 28 Jan 2015 01:38:02 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CBF07B@shsmsx102.ccr.corp.intel.com> References: <1422379175-10004-1-git-send-email-michalx.k.jastrzebski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] testpmd check return value of rte_eth_dev_vlan_filter() 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: Wed, 28 Jan 2015 01:38:13 -0000 On 1/28/2015 1:20 AM, Michal Jastrzebski wrote:=0A= > This patch modifies testpmd behavior when setting:=0A= > rx_vlan add all vf_port (enabling all vlanids=0A= > to be passed thru rx filter on VF).=0A= > Rx_vlan_all_filter_set() function,=0A= > checks if the next vlanid can be enabled by the driver.=0A= > Number of vlanids is limited by the NIC and thus the NIC=0A= > do not allow to enable more vlanids than it can allocate=0A= > in VFTA table.=0A= =0A= But what about if it is caused by other issue to lead a enable failure?=0A= =0A= =0A= > v2 - fix formatting errors=0A= >=0A= > Signed-off-by: Michal Jastrzebski =0A= > ---=0A= > app/test-pmd/config.c | 15 +++++++++------=0A= > app/test-pmd/testpmd.h | 2 +-=0A= > lib/librte_ether/rte_ethdev.c | 4 ++--=0A= > 3 files changed, 12 insertions(+), 9 deletions(-)=0A= >=0A= > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c=0A= > index c40f819..eda737e 100644=0A= > --- a/app/test-pmd/config.c=0A= > +++ b/app/test-pmd/config.c=0A= > @@ -1643,21 +1643,22 @@ rx_vlan_filter_set(portid_t port_id, int on)=0A= > "diag=3D%d\n", port_id, on, diag);=0A= > }=0A= > =0A= > -void=0A= > +int=0A= > rx_vft_set(portid_t port_id, uint16_t vlan_id, int on)=0A= > {=0A= > int diag;=0A= > =0A= > if (port_id_is_invalid(port_id))=0A= > - return;=0A= > + return 1;=0A= > if (vlan_id_is_invalid(vlan_id))=0A= > - return;=0A= > + return 1;=0A= > diag =3D rte_eth_dev_vlan_filter(port_id, vlan_id, on);=0A= > if (diag =3D=3D 0)=0A= > - return;=0A= > + return 0;=0A= > printf("rte_eth_dev_vlan_filter(port_pi=3D%d, vlan_id=3D%d, on=3D%d) fa= iled "=0A= > "diag=3D%d\n",=0A= > port_id, vlan_id, on, diag);=0A= > + return -1;=0A= > }=0A= > =0A= > void=0A= > @@ -1667,8 +1668,10 @@ rx_vlan_all_filter_set(portid_t port_id, int on)= =0A= > =0A= > if (port_id_is_invalid(port_id))=0A= > return;=0A= > - for (vlan_id =3D 0; vlan_id < 4096; vlan_id++)=0A= > - rx_vft_set(port_id, vlan_id, on);=0A= > + for (vlan_id =3D 0; vlan_id < 4096; vlan_id++) {=0A= =0A= Before "{" you use a Tab? One white space is OK.=0A= =0A= Thanks,=0A= Michael=0A= =0A= > + if (rx_vft_set(port_id, vlan_id, on))=0A= > + break;=0A= > + }=0A= > }=0A= > =0A= > void=0A= > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h=0A= > index 8f5e6c7..e0186b9 100644=0A= > --- a/app/test-pmd/testpmd.h=0A= > +++ b/app/test-pmd/testpmd.h=0A= > @@ -492,7 +492,7 @@ void rx_vlan_strip_set_on_queue(portid_t port_id, uin= t16_t queue_id, int on);=0A= > =0A= > void rx_vlan_filter_set(portid_t port_id, int on);=0A= > void rx_vlan_all_filter_set(portid_t port_id, int on);=0A= > -void rx_vft_set(portid_t port_id, uint16_t vlan_id, int on);=0A= > +int rx_vft_set(portid_t port_id, uint16_t vlan_id, int on);=0A= > void vlan_extend_set(portid_t port_id, int on);=0A= > void vlan_tpid_set(portid_t port_id, uint16_t tp_id);=0A= > void tx_vlan_set(portid_t port_id, uint16_t vlan_id);=0A= > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c=0A= > index ea3a1fb..064b5d6 100644=0A= > --- a/lib/librte_ether/rte_ethdev.c=0A= > +++ b/lib/librte_ether/rte_ethdev.c=0A= > @@ -1519,8 +1519,8 @@ rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t v= lan_id, int on)=0A= > return (-EINVAL);=0A= > }=0A= > FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vlan_filter_set, -ENOTSUP);=0A= > - (*dev->dev_ops->vlan_filter_set)(dev, vlan_id, on);=0A= > - return (0);=0A= > +=0A= > + return (*dev->dev_ops->vlan_filter_set)(dev, vlan_id, on);=0A= > }=0A= > =0A= > int=0A= =0A=