lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080731120457.34626tsepmygd1c0@hayate.ip6>
Date:	Thu, 31 Jul 2008 12:04:57 +0300
From:	"Jussi Kivilinna" <jussi.kivilinna@...et.fi>
To:	"Jarek Poplawski" <jarkao2@...il.com>
Cc:	"David Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] net-sched: add packet length pointer parameter for
	qdisc_enqueue

Quoting "Jarek Poplawski" <jarkao2@...il.com>:

> On 30-07-2008 20:55, Jussi Kivilinna wrote:
>> Pass packet length to caller through pointer so that length is
>> available to caller even if inner qdisc frees skb.
> ...
>> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
>> index b5f40d7..a428b93 100644
>> --- a/include/net/sch_generic.h
>> +++ b/include/net/sch_generic.h
>> @@ -331,19 +331,22 @@ static inline unsigned int  
>> qdisc_pkt_len(struct sk_buff *skb)
>>  	return qdisc_skb_cb(skb)->pkt_len;
>>  }
>>
>> -static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
>> +static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
>> +				unsigned int *pkt_len)
>>  {
>>  #ifdef CONFIG_NET_SCHED
>>  	if (sch->stab)
>>  		qdisc_calculate_pkt_len(skb, sch->stab);
>>  #endif
>> +	if (likely(pkt_len != NULL))
>> +		*pkt_len = qdisc_pkt_len(skb);
>>  	return sch->enqueue(skb, sch);
>>  }
>
> As I've written before, IMHO using an skb after enqueuing should be
> avoided unless we refcounted it or the returned code is clear enough,
> so the idea of this patch could be right to me. But, I guess, you are
> changing here the way it's done: the size is calculated before the
> current enqueing instead of after the last one.

Doh, you're right. qdisc->enqueue should pass packet length too.

>
> BTW, since I don't really get this "stab" idea enough, I wonder how
> it is expected to be used: with a top qdisc, a leaf one or some
> summing?
>

With top and/or leaf qdisc, inner stab overrides upper.


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ