Subject: Re: [PATCH 3/6] pkt_sched: sch_generic: Add generic qdisc->ops->peek() implementation.

From: Jarek Poplawski <[email-masked]>
Date: Thu, 16 Oct 2008 12:43:15 +0000

On Thu, Oct 16, 2008 at 02:19:37PM +0200, Patrick McHardy wrote:
> Jarek Poplawski wrote:
>> pkt_sched: sch_generic: Add generic qdisc->ops->peek() implementation.
>>
>
>> +	if (qops->peek == NULL)
>> +		qops->peek = noop_qdisc_ops.peek;
>>  	if (qops->dequeue == NULL)
>>  		qops->dequeue = noop_qdisc_ops.dequeue;
>
> ->dequeue and ->peek are somewhat tied together, so I think we should
> only use the noop variants if both are unset. Whether this should be
> checked here of before merging new qdiscs is a different question of
> course :)

Actually, there is much less users of ->peek. Do you mean to always check
for NULL before using? It was meant mainly for these non-work-conserving
qdisc in case patch 6/6 isn't merged. Of course, IMHO it should be enough
to implement this always (while merging), but this code above could be
misleading what is optional/mandatory. (Please make it clear which way do
you prefer and I'll redo, no problem.)

Jarek P.