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 871215A97 for ; Wed, 20 Jan 2016 15:32:53 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 20 Jan 2016 06:32:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,321,1449561600"; d="scan'208";a="864702360" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga001.jf.intel.com with ESMTP; 20 Jan 2016 06:32:51 -0800 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.30]) by IRSMSX101.ger.corp.intel.com ([169.254.1.113]) with mapi id 14.03.0248.002; Wed, 20 Jan 2016 14:32:50 +0000 From: "Singh, Jasvinder" To: "ravulakollu.kumar@wipro.com" , "dev@dpdk.org" Thread-Topic: How classification happens in scheduling ? Thread-Index: AdFTenjyLvjYTe7hRViYtfE+6j1Z3QADbtnA Date: Wed, 20 Jan 2016 14:32:50 +0000 Message-ID: <54CBAA185211B4429112C315DA58FF6DDB0234@IRSMSX103.ger.corp.intel.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODg0ODQwYWMtMThhMC00OWNjLWE5ZmQtODU3MWFkMzFmODIwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS40LjEwLjE5IiwiVHJ1c3RlZExhYmVsSGFzaCI6Im96bnhsWXNCWWxyYUpJb2pNTGF1ZHJaK3czZkZ1ODhuRG55cEFSc1p4cWs9In0= x-ctpclassification: CTP_PUBLIC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] How classification happens in scheduling ? 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, 20 Jan 2016 14:32:53 -0000 Hi Uday, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of > ravulakollu.kumar@wipro.com > Sent: Wednesday, January 20, 2016 12:06 PM > To: dev@dpdk.org > Subject: [dpdk-dev] How classification happens in scheduling ? >=20 > Hi all, >=20 > Could someone explain me how this code snippet determining > subport,pipe,traffic_class,queue,color. >=20 > uint16_t *pdata =3D rte_pktmbuf_mtod(m, uint16_t *); //points to = the > start of the data in the mbuf >=20 > *subport =3D (rte_be_to_cpu_16(pdata[SUBPORT_OFFSET]) & 0x0FFF) > &(port_params.n_subports_per_port - 1); /* Outer VLAN ID*/ > *pipe =3D (rte_be_to_cpu_16(pdata[PIPE_OFFSET]) & 0x0FFF) & > (port_params.n_pipes_per_subport - 1); /* Inner VLAN ID */ > *traffic_class =3D (pdata[QUEUE_OFFSET] & 0x0F) & > (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1); /* Destination IP */ > *queue =3D ((pdata[QUEUE_OFFSET] >> 8) & 0x0F) & > (RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS - 1) ; /* Destination IP */ > *color =3D pdata[COLOR_OFFSET] & 0x03; /* Destination IP */ >=20 > Thanks & Regards, > Uday To understand this, please refer to explanation (23.4) at http://dpdk.org/d= oc/guides/sample_app_ug/qos_scheduler.html=20 The above code snippet is about classifying the incoming traffic packets b= ased on their QinQ double VLAN tags and the IP destination address. =20 The subport ID and pipe ID are determined by reading 12 bits svlan field a= t SUBPORT_OFFSET and 12 bits cvlan field at PIPE_OFFSET from the packet he= ader.=20 Traffic Class, pipe queue and color are determined by reading specific fiel= ds at offset QUEUE_OFFSET (Destination IP), QUEUE_OFFSET (Destination I= P) and COLOR_OFFSET (Destination IP) from the packet's header. To read all these values from the packet header, first packet header fields= need to be converted from big endian to CPU order. Since these values sho= uld not exceed their maximum values determined from configuration file, the= refore, "&" operation with parameters such as port_params.n_subports_per_po= rt, port_params.n_pipes_per_subport etc is performed to upper limit them. = =20 For these kind of queries, please use users@dpdk.org. Thanks, Jasvinder