aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-10 03:04:35 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-10 03:04:35 -0500
commit25f666300625d894ebe04bac2b4b3aadb907c861 (patch)
tree47547369f2d6eb366268e85252444ecb1bdcfab5 /net/sched
parent0b6ca82af83a79f3d1001c8a0701ed34ac38126e (diff)
parent21347456abfbf5bc7fcace7327476736bbb28abe (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (28 commits) [NET_SCHED] sch_htb: htb_requeue fix [IPV6]: Replace using the magic constant "1024" with IP6_RT_PRIO_USER for fc_metric. starfire: secton fix via-velocity: section fix natsemi: section fix typhoon: section fix isdn: fix section mismatch warning for ISACVer isdn: fix section mismatch warnings from hisax_cs_setup_card isdn: fix section mismatch warnings in isac.c and isar.c isdn: fix section mismatch warning in hfc_sx.c [PKT_SCHED] ematch: tcf_em_destroy robustness [PKT_SCHED]: deinline functions in meta match [SCTP]: Convert sctp_dbg_objcnt to seq files. [SCTP]: Use snmp_fold_field instead of a homebrew analogue. [IGMP]: Optimize kfree_skb in igmp_rcv. [KEY]: Convert net/pfkey to use seq files. [KEY]: Clean up proc files creation a bit. pppol2tp: fix printk warnings bnx2: section fix bnx2x: section fix ...
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/em_meta.c6
-rw-r--r--net/sched/ematch.c10
-rw-r--r--net/sched/sch_htb.c13
3 files changed, 18 insertions, 11 deletions
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c
index d417ec8e3ca3..3da4129b89d1 100644
--- a/net/sched/em_meta.c
+++ b/net/sched/em_meta.c
@@ -687,8 +687,8 @@ static inline struct meta_type_ops * meta_type_ops(struct meta_value *v)
687 * Core 687 * Core
688 **************************************************************************/ 688 **************************************************************************/
689 689
690static inline int meta_get(struct sk_buff *skb, struct tcf_pkt_info *info, 690static int meta_get(struct sk_buff *skb, struct tcf_pkt_info *info,
691 struct meta_value *v, struct meta_obj *dst) 691 struct meta_value *v, struct meta_obj *dst)
692{ 692{
693 int err = 0; 693 int err = 0;
694 694
@@ -733,7 +733,7 @@ static int em_meta_match(struct sk_buff *skb, struct tcf_ematch *m,
733 return 0; 733 return 0;
734} 734}
735 735
736static inline void meta_delete(struct meta_match *meta) 736static void meta_delete(struct meta_match *meta)
737{ 737{
738 if (meta) { 738 if (meta) {
739 struct meta_type_ops *ops = meta_type_ops(&meta->lvalue); 739 struct meta_type_ops *ops = meta_type_ops(&meta->lvalue);
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 74ff918455a2..b29439ddcf71 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -312,10 +312,9 @@ int tcf_em_tree_validate(struct tcf_proto *tp, struct nlattr *nla,
312 struct tcf_ematch_tree_hdr *tree_hdr; 312 struct tcf_ematch_tree_hdr *tree_hdr;
313 struct tcf_ematch *em; 313 struct tcf_ematch *em;
314 314
315 if (!nla) { 315 memset(tree, 0, sizeof(*tree));
316 memset(tree, 0, sizeof(*tree)); 316 if (!nla)
317 return 0; 317 return 0;
318 }
319 318
320 err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, em_policy); 319 err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, em_policy);
321 if (err < 0) 320 if (err < 0)
@@ -410,14 +409,15 @@ void tcf_em_tree_destroy(struct tcf_proto *tp, struct tcf_ematch_tree *tree)
410 if (em->ops) { 409 if (em->ops) {
411 if (em->ops->destroy) 410 if (em->ops->destroy)
412 em->ops->destroy(tp, em); 411 em->ops->destroy(tp, em);
413 else if (!tcf_em_is_simple(em) && em->data) 412 else if (!tcf_em_is_simple(em))
414 kfree((void *) em->data); 413 kfree(em->data);
415 module_put(em->ops->owner); 414 module_put(em->ops->owner);
416 } 415 }
417 } 416 }
418 417
419 tree->hdr.nmatches = 0; 418 tree->hdr.nmatches = 0;
420 kfree(tree->matches); 419 kfree(tree->matches);
420 tree->matches = NULL;
421} 421}
422EXPORT_SYMBOL(tcf_em_tree_destroy); 422EXPORT_SYMBOL(tcf_em_tree_destroy);
423 423
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index e1a579efc215..795c761ad99f 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -609,14 +609,14 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
609/* TODO: requeuing packet charges it to policers again !! */ 609/* TODO: requeuing packet charges it to policers again !! */
610static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch) 610static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)
611{ 611{
612 int ret;
612 struct htb_sched *q = qdisc_priv(sch); 613 struct htb_sched *q = qdisc_priv(sch);
613 int ret = NET_XMIT_SUCCESS;
614 struct htb_class *cl = htb_classify(skb, sch, &ret); 614 struct htb_class *cl = htb_classify(skb, sch, &ret);
615 struct sk_buff *tskb; 615 struct sk_buff *tskb;
616 616
617 if (cl == HTB_DIRECT || !cl) { 617 if (cl == HTB_DIRECT) {
618 /* enqueue to helper queue */ 618 /* enqueue to helper queue */
619 if (q->direct_queue.qlen < q->direct_qlen && cl) { 619 if (q->direct_queue.qlen < q->direct_qlen) {
620 __skb_queue_head(&q->direct_queue, skb); 620 __skb_queue_head(&q->direct_queue, skb);
621 } else { 621 } else {
622 __skb_queue_head(&q->direct_queue, skb); 622 __skb_queue_head(&q->direct_queue, skb);
@@ -625,6 +625,13 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)
625 sch->qstats.drops++; 625 sch->qstats.drops++;
626 return NET_XMIT_CN; 626 return NET_XMIT_CN;
627 } 627 }
628#ifdef CONFIG_NET_CLS_ACT
629 } else if (!cl) {
630 if (ret == NET_XMIT_BYPASS)
631 sch->qstats.drops++;
632 kfree_skb(skb);
633 return ret;
634#endif
628 } else if (cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q) != 635 } else if (cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q) !=
629 NET_XMIT_SUCCESS) { 636 NET_XMIT_SUCCESS) {
630 sch->qstats.drops++; 637 sch->qstats.drops++;