Commit a453e068 authored by Krishna Kumar's avatar Krishna Kumar Committed by David S. Miller

pkt_sched: Fix resource limiting in pfifo_fast

pfifo_fast_enqueue has this check:
        if (skb_queue_len(list) < qdisc_dev(qdisc)->tx_queue_len) {

which allows each band to enqueue upto tx_queue_len skbs for a
total of 3*tx_queue_len skbs. I am not sure if this was the
intention of limiting in qdisc.

Patch compiled and 32 simultaneous netperf testing ran fine. Also:
# tc -s qdisc show dev eth2
qdisc pfifo_fast 0: root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 16835026752 bytes 373116 pkt (dropped 0, overlimits 0 requeues 25) 
 rate 0bit 0pps backlog 0b 0p requeues 25 
Signed-off-by: default avatarKrishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 03a9a447
...@@ -432,11 +432,11 @@ static inline struct sk_buff_head *band2list(struct pfifo_fast_priv *priv, ...@@ -432,11 +432,11 @@ static inline struct sk_buff_head *band2list(struct pfifo_fast_priv *priv,
static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc) static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc)
{ {
int band = prio2band[skb->priority & TC_PRIO_MAX]; if (skb_queue_len(&qdisc->q) < qdisc_dev(qdisc)->tx_queue_len) {
struct pfifo_fast_priv *priv = qdisc_priv(qdisc); int band = prio2band[skb->priority & TC_PRIO_MAX];
struct sk_buff_head *list = band2list(priv, band); struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
struct sk_buff_head *list = band2list(priv, band);
if (skb_queue_len(list) < qdisc_dev(qdisc)->tx_queue_len) {
priv->bitmap |= (1 << band); priv->bitmap |= (1 << band);
qdisc->q.qlen++; qdisc->q.qlen++;
return __qdisc_enqueue_tail(skb, qdisc, list); return __qdisc_enqueue_tail(skb, qdisc, list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment