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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Jul 2016 12:09:36 +0200
From:	Jesper Dangaard Brouer <brouer@...hat.com>
To:	John Fastabend <john.fastabend@...il.com>
Cc:	fw@...len.de, jhs@...atatu.com, alexei.starovoitov@...il.com,
	eric.dumazet@...il.com, netdev@...r.kernel.org, brouer@...hat.com,
	"Michael S. Tsirkin" <mst@...hat.com>
Subject: Re: [RFC PATCH v2 08/10] net: sched: pfifo_fast use alf_queue

On Thu, 14 Jul 2016 17:09:43 -0700
John Fastabend <john.fastabend@...il.com> wrote:

> >>  static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc,
> >>  			      struct sk_buff **to_free)
> >>  {
> >> -	if (skb_queue_len(&qdisc->q) < qdisc_dev(qdisc)->tx_queue_len) {
> >> -		int band = prio2band[skb->priority & TC_PRIO_MAX];
> >> -		struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
> >> -		struct sk_buff_head *list = band2list(priv, band);
> >> -
> >> -		priv->bitmap |= (1 << band);
> >> -		qdisc->q.qlen++;
> >> -		return __qdisc_enqueue_tail(skb, qdisc, list);
> >> -	}
> >> +	int band = prio2band[skb->priority & TC_PRIO_MAX];
> >> +	struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
> >> +	struct skb_array *q = band2list(priv, band);
> >> +	int err;
> >>  
> >> -	return qdisc_drop(skb, qdisc, to_free);
> >> +	err = skb_array_produce_bh(q, skb);  
> > 
> > Do you need the _bh variant here?  (Doesn't the qdisc run with BH disabled?)
> > 
> >   
> 
> Yep its inside rcu_read_lock_bh().

The call rcu_read_lock_bh() already disabled BH (local_bh_disable()).
Thus, you can use the normal variants of skb_array_produce(), it is
(approx 20 cycles) faster than the _bh variant...

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ