From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 058205961 for ; Tue, 5 Jan 2016 17:49:31 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 05 Jan 2016 08:49:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,525,1444719600"; d="scan'208";a="628417710" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jan 2016 08:49:30 -0800 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 5 Jan 2016 16:49:29 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.104]) by irsmsx112.ger.corp.intel.com ([10.108.20.5]) with mapi id 14.03.0248.002; Tue, 5 Jan 2016 16:49:29 +0000 From: "Ananyev, Konstantin" To: "Tan, Jianfeng" , "dev@dpdk.org" Thread-Topic: [PATCH 12/12] examples/l3fwd: add option to parse ptype Thread-Index: AQHRQ9KvyEachG7b/02o97KzXN+Oyp7rscFggACMggCAAOoeQA== Date: Tue, 5 Jan 2016 16:49:27 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836AE18CF@irsmsx105.ger.corp.intel.com> References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1451544799-70776-13-git-send-email-jianfeng.tan@intel.com> <2601191342CEEE43887BDE71AB97725836AE1333@irsmsx105.ger.corp.intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzk4YzA2MzMtNzJkMy00NTNiLWFkZTYtYjhjODM3NzMxMDg3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibWg4K2tqa0FDTlB2NVAyazlvNVwvaVZlY0djN0dBN0M5eXdmRk95Qk1FNDg9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 12/12] examples/l3fwd: add option to parse ptype 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, 05 Jan 2016 16:49:32 -0000 Hi Jianfeng, > > > > > > +static int > > > +check_packet_type_ok(int portid) > > > +{ > > > + int i; > > > + int ret; > > > + uint32_t ptypes[RTE_PTYPE_L3_MAX_NUM]; > > > + int ptype_l3_ipv4 =3D 0, ptype_l3_ipv6 =3D 0; > > > + > > > + ret =3D rte_eth_dev_get_ptype_info(portid, RTE_PTYPE_L3_MASK, > > ptypes); > > > + for (i =3D 0; i < ret; ++i) { > > > + if (ptypes[i] & RTE_PTYPE_L3_IPV4) > > > + ptype_l3_ipv4 =3D 1; > > > + if (ptypes[i] & RTE_PTYPE_L3_IPV6) > > > + ptype_l3_ipv6 =3D 1; > > > + } > > > + > > > + if (ptype_l3_ipv4 =3D=3D 0) > > > + printf("port %d cannot parse RTE_PTYPE_L3_IPV4\n", portid); > > > + > > > + if (ptype_l3_ipv6 =3D=3D 0) > > > + printf("port %d cannot parse RTE_PTYPE_L3_IPV6\n", portid); > > > + > > > + if (ptype_l3_ipv4 || ptype_l3_ipv6) > > > + return 1; Forgot one thing: I think it should be: if (ptype_l3_ipv4 && ptype_l3_ipv6) return 1; return 0; or just: return ptype_l3_ipv4 && ptype_l3_ipv6; Konstantin