netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [RFC] sched: CHOKe packet scheduler (v0.2)
Date: Wed, 5 Jan 2011 12:15:52 -0800	[thread overview]
Message-ID: <20110105121552.1b4ccb03@nehalam> (raw)
In-Reply-To: <1294257967.2723.9.camel@edumazet-laptop>

On Wed, 05 Jan 2011 21:06:07 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Le mercredi 05 janvier 2011 à 11:21 -0800, Stephen Hemminger a écrit :
> > This implements the CHOKe packet scheduler based on the existing
> > Linux RED scheduler based on the algorithm described in the paper.
> > 
> 
> > +
> > +static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> > +{
> > +	struct choke_sched_data *q = qdisc_priv(sch);
> > +	struct red_parms *p = &q->parms;
> > +
> > +	p->qavg = red_calc_qavg(p, skb_queue_len(&sch->q));
> > +	if (red_is_idling(p))
> > +		red_end_of_idle_period(p);
> > +
> > +	if (p->qavg <= p->qth_min)
> > +		p->qcount = -1;
> > +	else {
> > +		struct sk_buff *oskb;
> > +
> > +		/* Draw a packet at random from queue */
> > +		oskb = skb_peek_random(&sch->q);
> > +
> > +		/* Both packets from same flow?
> > +		 * Assumes skb_get_rxhash already set hash on oskb->rxhash
> > +		 * prior to queuing
> 
> but this is not true... if at that time, p->qavg was <= p->qth_min.
> Packet was directly enqueued.
> 
> Just use :
> 
> if (skb_get_rxhash(oskb) == skb_get_rxhash(skb))
> 
> Since skb_get_rxhash(skb) doesnt recompute rxhash if already set.
> 
> Hmm... I am now wondering if this actually works on egress at all
> (can we use rxhash here I mean)
> 
> 
> 
> > +		 */
> > +		if (oskb->rxhash == skb_get_rxhash(skb)) {
> > +			/* Drop both packets */
> > +			__skb_unlink(oskb, &sch->q);
> > +			qdisc_drop(oskb, sch);
> > +			goto congestion_drop;
> > +		}
> 

The code computes a value, whether it is correct or not is another question.
Also a little concerned that different NIC's compute different flow hash
values which could cause false positives.

-- 

  reply	other threads:[~2011-01-05 20:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-05  0:29 [RFC] sched: CHOKe packet scheduler Stephen Hemminger
2011-01-05  6:02 ` Eric Dumazet
2011-01-05  6:19 ` Eric Dumazet
2011-01-05 17:17   ` Stephen Hemminger
2011-01-05 17:25     ` Eric Dumazet
2011-01-05 19:21       ` [RFC] sched: CHOKe packet scheduler (v0.2) Stephen Hemminger
2011-01-05 20:06         ` Eric Dumazet
2011-01-05 20:15           ` Stephen Hemminger [this message]
2011-01-06  4:07         ` Eric Dumazet
2011-01-06  6:53           ` Stephen Hemminger
2011-01-07  4:55           ` Stephen Hemminger
2011-01-07  5:39             ` Changli Gao
2011-01-07  7:10               ` Stephen Hemminger
2011-01-07  8:37             ` Eric Dumazet
2011-01-10 13:46             ` Eric Dumazet
2011-01-10 17:31               ` Stephen Hemminger
2011-01-10 17:45                 ` Eric Dumazet
2011-01-10 23:44               ` [RFC] sched: CHOKe packet scheduler (v0.4) Stephen Hemminger
2011-01-11  0:00                 ` Eric Dumazet
2011-01-11  1:10                   ` Stephen Hemminger
2011-01-11  6:18                     ` Eric Dumazet
2011-01-11  6:34                       ` Eric Dumazet
2011-01-11 23:48                         ` Stephen Hemminger
2011-01-12  0:04                           ` Eric Dumazet
2011-01-12  7:13                         ` [RFC] sched: CHOKe packet scheduler (v0.6) Eric Dumazet
2011-01-12 17:27                           ` Stephen Hemminger
2011-01-12 17:33                             ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110105121552.1b4ccb03@nehalam \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).