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 E1D4D214A for ; Fri, 6 Jan 2017 17:00:47 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 06 Jan 2017 08:00:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,325,1477983600"; d="scan'208";a="919646682" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 06 Jan 2017 08:00:45 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Jan 2017 08:00:45 -0800 Received: from bgsmsx152.gar.corp.intel.com (10.224.48.50) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Jan 2017 08:00:45 -0800 Received: from BGSMSX108.gar.corp.intel.com ([169.254.8.175]) by BGSMSX152.gar.corp.intel.com ([169.254.6.169]) with mapi id 14.03.0248.002; Fri, 6 Jan 2017 21:30:42 +0530 From: "Jyoti, Anand B" To: "dev@dpdk.org" CC: "Dumitrescu, Cristian" Thread-Topic: [PATCH] examples/ip_pipeline: check vlan and mpls params Thread-Index: AdJoNYAXnSYc7WbXSHOLFXLPjQDlxgAAF1tg Date: Fri, 6 Jan 2017 16:00:41 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmRkNDU1MzQtNWEzNC00ODAyLTgxNzAtY2JmMjA0MjhkYWRmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjIuMTEuMCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ0M2pJMGRHeVdlaVBIemRndGJHQ2Q1XC9CXC8zUHEwMXR3RTdZSWVrWlViZ3M9In0= x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] examples/ip_pipeline: check vlan and mpls params X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 16:00:48 -0000 diff --git a/examples/ip_pipeline/pipeline/pipeline_routing.c b/examples/ip= _pipeline/pipeline/pipeline_routing.c index 3aadbf9..b7faf5b 100644 --- a/examples/ip_pipeline/pipeline/pipeline_routing.c +++ b/examples/ip_pipeline/pipeline/pipeline_routing.c @@ -494,6 +494,26 @@ app_pipeline_routing_add_route(struct app_params *app, /* data */ if (data->port_id >=3D p->n_ports_out) return -1; + + /* Valid range of VLAN tags 12 bits */ + if(data->flags & PIPELINE_ROUTING_ROUTE_QINQ) + if((data->l2.qinq.svlan & 0xF000) || + (data->l2.qinq.cvlan & 0xF000)) + return -1; + + /* Max number of MPLS labels supported */ + if(data->flags & PIPELINE_ROUTING_ROUTE_MPLS){ + uint32_t i; + + if(data->l2.mpls.n_labels > + PIPELINE_ROUTING_MPLS_LABELS_MAX) + return -1; + + /* Max MPLS label value 20 bits */ + for(i =3D 0; i < data->l2.mpls.n_labels; i++) + if(data->l2.mpls.labels[i] & 0xFFF00000) + return -1; + } } break;