[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1325787722.4759.25.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Date: Thu, 05 Jan 2012 19:22:02 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Laurent Chavey <chavey@...gle.com>
Cc: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>, Dave Taht <dave.taht@...il.com>
Subject: Re: [PATCH net-next] net_sched: sfq: extend limits
Le jeudi 05 janvier 2012 à 10:08 -0800, Laurent Chavey a écrit :
> > /*
> > @@ -131,9 +143,9 @@ struct sfq_sched_data {
> > */
> > static inline struct sfq_head *sfq_dep_head(struct sfq_sched_data *q, sfq_index val)
> > {
> > - if (val < SFQ_SLOTS)
>
>
> why not use q->maxflows here rather than SFQ_MAX_FLOWS ?
>
Debug-ability ? val indexes for dep[] array are not dependent on
q->maxflows : 0xFF80 -> 0xFFFF
> looking at sfq_change(), q->maxflows may be <= to SFQ_MAX_FLOWS
yep... but values between q->maxflows and SFQ_MAX_FLOWS wont be
possible.
>
> the initial creation of the slots array in sfq_init() uses q->maxflows.
> q->maxflows is initialized to SFQ_DEFAULT_FLOWS which is / maybe less
> than SFQ_MAX_FLOWS
>
It really doesnt matter, and code is faster on most arches.
if (val < SFQ_MAX_FLOWS)
return &q->slots[val].dep;
return &q->dep[val - SFQ_MAX_FLOWS];
faster than : (because of extra memory reference)
if (val < q->maxflows)
return &q->slots[val].dep;
return &q->dep[val - q->maxflows];
As a matter of fact, maxflows could be moved at the end of struct
sfq_sched_data since its not used in fast path.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists