From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C7F5D95EF for ; Thu, 23 Jun 2016 21:44:33 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 23 Jun 2016 12:44:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,518,1459839600"; d="scan'208";a="127474710" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga004.fm.intel.com with ESMTP; 23 Jun 2016 12:44:31 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.183]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0248.002; Thu, 23 Jun 2016 20:44:30 +0100 From: "Dumitrescu, Cristian" To: Simon Kagstrom , "stephen@networkplumber.org" , "dev@dpdk.org" , "thomas.monjalon@6wind.com" Thread-Topic: [PATCH / RFC] sched: Correct subport calcuation Thread-Index: AQHRwuF4U+gnjDuHuUqGWV+Hi48N7J/3hGWg Date: Thu, 23 Jun 2016 19:44:30 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D8912647A0C371@IRSMSX108.ger.corp.intel.com> References: <20160610082913.4878ab77@miho> In-Reply-To: <20160610082913.4878ab77@miho> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmRkOWYwMjMtNWMxMi00NjI0LWFkY2QtNDQ5ZTYyOTJkZTQ2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InJZeU9Wb21cLzVpWVlQK3JJT000ZFRVWHc4b3FqaDN1OHJSc281elFXeFBrPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH / RFC] sched: Correct subport calcuation 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: Thu, 23 Jun 2016 19:44:34 -0000 > -----Original Message----- > From: Simon Kagstrom [mailto:simon.kagstrom@netinsight.net] > Sent: Friday, June 10, 2016 7:29 AM > To: Dumitrescu, Cristian ; > stephen@networkplumber.org; dev@dpdk.org; > thomas.monjalon@6wind.com > Subject: [PATCH / RFC] sched: Correct subport calcuation >=20 > Signed-off-by: Simon Kagstrom > --- > I'm a total newbie to the rte_sched design and implementation, so I've > added the RFC. >=20 > We get crashes (at other places in the scheduler) without this code. >=20 > lib/librte_sched/rte_sched.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c > index 1609ea8..b46ecfb 100644 > --- a/lib/librte_sched/rte_sched.c > +++ b/lib/librte_sched/rte_sched.c > @@ -1869,7 +1869,7 @@ grinder_next_pipe(struct rte_sched_port *port, > uint32_t pos) >=20 > /* Install new pipe in the grinder */ > grinder->pindex =3D pipe_qindex >> 4; > - grinder->subport =3D port->subport + (grinder->pindex / port- > >n_pipes_per_subport); > + grinder->subport =3D port->subport + (grinder->pindex / port- > >n_subports_per_port); > grinder->pipe =3D port->pipe + grinder->pindex; > grinder->pipe_params =3D NULL; /* to be set after the pipe structure is > prefetched */ > grinder->productive =3D 0; > -- > 1.9.1 Hi Simon, NACK. Each port has an array of queues (size is port->n_queues_per_port), which a= re organized into equal size groups associated with pipes and subports: - Each pipe is assigned the next group of RTE_SCHED_QUEUES_PER_PIPE (i.e. 1= 6) queues in ascending order; - Each subport is assigned the next group of port->n_pipes_per_subport pipe= s (congurable parameter). The following is true: n_queues_per_port =3D RTE_SCHED_QUEUES_PER_PIPE * n_pipes_per_subport * n_= subports_per_port Given a queue index (pipe_qindex), the following are true: - Pipe index: pindex =3D pipe_qindex >> 4; - Subport index (let's call it sindex): sindex =3D pindex / n_pipes_per_sub= port, right? I don't know why you get crashes in your application, but what I do know is= that your proposed method to compute sindex is not correct :) Regards, Cristian