aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_cbq.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /net/sched/sch_cbq.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r--net/sched/sch_cbq.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 0e19948470b..24d94c097b3 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -250,11 +250,10 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)
250 else if ((cl = defmap[res.classid & TC_PRIO_MAX]) == NULL) 250 else if ((cl = defmap[res.classid & TC_PRIO_MAX]) == NULL)
251 cl = defmap[TC_PRIO_BESTEFFORT]; 251 cl = defmap[TC_PRIO_BESTEFFORT];
252 252
253 if (cl == NULL) 253 if (cl == NULL || cl->level >= head->level)
254 goto fallback; 254 goto fallback;
255 } 255 }
256 if (cl->level >= head->level) 256
257 goto fallback;
258#ifdef CONFIG_NET_CLS_ACT 257#ifdef CONFIG_NET_CLS_ACT
259 switch (result) { 258 switch (result) {
260 case TC_ACT_QUEUED: 259 case TC_ACT_QUEUED:
@@ -509,7 +508,8 @@ static void cbq_ovl_delay(struct cbq_class *cl)
509 cl->cpriority = TC_CBQ_MAXPRIO; 508 cl->cpriority = TC_CBQ_MAXPRIO;
510 q->pmask |= (1<<TC_CBQ_MAXPRIO); 509 q->pmask |= (1<<TC_CBQ_MAXPRIO);
511 510
512 expires = ns_to_ktime(PSCHED_TICKS2NS(sched)); 511 expires = ktime_set(0, 0);
512 expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched));
513 if (hrtimer_try_to_cancel(&q->delay_timer) && 513 if (hrtimer_try_to_cancel(&q->delay_timer) &&
514 ktime_to_ns(ktime_sub( 514 ktime_to_ns(ktime_sub(
515 hrtimer_get_expires(&q->delay_timer), 515 hrtimer_get_expires(&q->delay_timer),
@@ -1425,8 +1425,7 @@ static int cbq_dump_rate(struct sk_buff *skb, struct cbq_class *cl)
1425{ 1425{
1426 unsigned char *b = skb_tail_pointer(skb); 1426 unsigned char *b = skb_tail_pointer(skb);
1427 1427
1428 if (nla_put(skb, TCA_CBQ_RATE, sizeof(cl->R_tab->rate), &cl->R_tab->rate)) 1428 NLA_PUT(skb, TCA_CBQ_RATE, sizeof(cl->R_tab->rate), &cl->R_tab->rate);
1429 goto nla_put_failure;
1430 return skb->len; 1429 return skb->len;
1431 1430
1432nla_put_failure: 1431nla_put_failure:
@@ -1451,8 +1450,7 @@ static int cbq_dump_lss(struct sk_buff *skb, struct cbq_class *cl)
1451 opt.minidle = (u32)(-cl->minidle); 1450 opt.minidle = (u32)(-cl->minidle);
1452 opt.offtime = cl->offtime; 1451 opt.offtime = cl->offtime;
1453 opt.change = ~0; 1452 opt.change = ~0;
1454 if (nla_put(skb, TCA_CBQ_LSSOPT, sizeof(opt), &opt)) 1453 NLA_PUT(skb, TCA_CBQ_LSSOPT, sizeof(opt), &opt);
1455 goto nla_put_failure;
1456 return skb->len; 1454 return skb->len;
1457 1455
1458nla_put_failure: 1456nla_put_failure:
@@ -1470,8 +1468,7 @@ static int cbq_dump_wrr(struct sk_buff *skb, struct cbq_class *cl)
1470 opt.priority = cl->priority + 1; 1468 opt.priority = cl->priority + 1;
1471 opt.cpriority = cl->cpriority + 1; 1469 opt.cpriority = cl->cpriority + 1;
1472 opt.weight = cl->weight; 1470 opt.weight = cl->weight;
1473 if (nla_put(skb, TCA_CBQ_WRROPT, sizeof(opt), &opt)) 1471 NLA_PUT(skb, TCA_CBQ_WRROPT, sizeof(opt), &opt);
1474 goto nla_put_failure;
1475 return skb->len; 1472 return skb->len;
1476 1473
1477nla_put_failure: 1474nla_put_failure:
@@ -1488,8 +1485,7 @@ static int cbq_dump_ovl(struct sk_buff *skb, struct cbq_class *cl)
1488 opt.priority2 = cl->priority2 + 1; 1485 opt.priority2 = cl->priority2 + 1;
1489 opt.pad = 0; 1486 opt.pad = 0;
1490 opt.penalty = cl->penalty; 1487 opt.penalty = cl->penalty;
1491 if (nla_put(skb, TCA_CBQ_OVL_STRATEGY, sizeof(opt), &opt)) 1488 NLA_PUT(skb, TCA_CBQ_OVL_STRATEGY, sizeof(opt), &opt);
1492 goto nla_put_failure;
1493 return skb->len; 1489 return skb->len;
1494 1490
1495nla_put_failure: 1491nla_put_failure:
@@ -1506,8 +1502,7 @@ static int cbq_dump_fopt(struct sk_buff *skb, struct cbq_class *cl)
1506 opt.split = cl->split ? cl->split->common.classid : 0; 1502 opt.split = cl->split ? cl->split->common.classid : 0;
1507 opt.defmap = cl->defmap; 1503 opt.defmap = cl->defmap;
1508 opt.defchange = ~0; 1504 opt.defchange = ~0;
1509 if (nla_put(skb, TCA_CBQ_FOPT, sizeof(opt), &opt)) 1505 NLA_PUT(skb, TCA_CBQ_FOPT, sizeof(opt), &opt);
1510 goto nla_put_failure;
1511 } 1506 }
1512 return skb->len; 1507 return skb->len;
1513 1508
@@ -1526,8 +1521,7 @@ static int cbq_dump_police(struct sk_buff *skb, struct cbq_class *cl)
1526 opt.police = cl->police; 1521 opt.police = cl->police;
1527 opt.__res1 = 0; 1522 opt.__res1 = 0;
1528 opt.__res2 = 0; 1523 opt.__res2 = 0;
1529 if (nla_put(skb, TCA_CBQ_POLICE, sizeof(opt), &opt)) 1524 NLA_PUT(skb, TCA_CBQ_POLICE, sizeof(opt), &opt);
1530 goto nla_put_failure;
1531 } 1525 }
1532 return skb->len; 1526 return skb->len;
1533 1527