aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r--net/sched/sch_api.c73
1 files changed, 39 insertions, 34 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index d92ea26982c5..13c09bc32aa3 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -278,11 +278,7 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
278 278
279 wd->qdisc->flags &= ~TCQ_F_THROTTLED; 279 wd->qdisc->flags &= ~TCQ_F_THROTTLED;
280 smp_wmb(); 280 smp_wmb();
281 if (spin_trylock(&dev->queue_lock)) { 281 netif_schedule(dev);
282 qdisc_run(dev);
283 spin_unlock(&dev->queue_lock);
284 } else
285 netif_schedule(dev);
286 282
287 return HRTIMER_NORESTART; 283 return HRTIMER_NORESTART;
288} 284}
@@ -1149,47 +1145,57 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
1149 to this qdisc, (optionally) tests for protocol and asks 1145 to this qdisc, (optionally) tests for protocol and asks
1150 specific classifiers. 1146 specific classifiers.
1151 */ 1147 */
1148int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp,
1149 struct tcf_result *res)
1150{
1151 __be16 protocol = skb->protocol;
1152 int err = 0;
1153
1154 for (; tp; tp = tp->next) {
1155 if ((tp->protocol == protocol ||
1156 tp->protocol == htons(ETH_P_ALL)) &&
1157 (err = tp->classify(skb, tp, res)) >= 0) {
1158#ifdef CONFIG_NET_CLS_ACT
1159 if (err != TC_ACT_RECLASSIFY && skb->tc_verd)
1160 skb->tc_verd = SET_TC_VERD(skb->tc_verd, 0);
1161#endif
1162 return err;
1163 }
1164 }
1165 return -1;
1166}
1167EXPORT_SYMBOL(tc_classify_compat);
1168
1152int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, 1169int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
1153 struct tcf_result *res) 1170 struct tcf_result *res)
1154{ 1171{
1155 int err = 0; 1172 int err = 0;
1156 __be16 protocol = skb->protocol; 1173 __be16 protocol;
1157#ifdef CONFIG_NET_CLS_ACT 1174#ifdef CONFIG_NET_CLS_ACT
1158 struct tcf_proto *otp = tp; 1175 struct tcf_proto *otp = tp;
1159reclassify: 1176reclassify:
1160#endif 1177#endif
1161 protocol = skb->protocol; 1178 protocol = skb->protocol;
1162 1179
1163 for ( ; tp; tp = tp->next) { 1180 err = tc_classify_compat(skb, tp, res);
1164 if ((tp->protocol == protocol ||
1165 tp->protocol == htons(ETH_P_ALL)) &&
1166 (err = tp->classify(skb, tp, res)) >= 0) {
1167#ifdef CONFIG_NET_CLS_ACT 1181#ifdef CONFIG_NET_CLS_ACT
1168 if ( TC_ACT_RECLASSIFY == err) { 1182 if (err == TC_ACT_RECLASSIFY) {
1169 __u32 verd = (__u32) G_TC_VERD(skb->tc_verd); 1183 u32 verd = G_TC_VERD(skb->tc_verd);
1170 tp = otp; 1184 tp = otp;
1171 1185
1172 if (MAX_REC_LOOP < verd++) { 1186 if (verd++ >= MAX_REC_LOOP) {
1173 printk("rule prio %d protocol %02x reclassify is buggy packet dropped\n", 1187 printk("rule prio %u protocol %02x reclassify loop, "
1174 tp->prio&0xffff, ntohs(tp->protocol)); 1188 "packet dropped\n",
1175 return TC_ACT_SHOT; 1189 tp->prio&0xffff, ntohs(tp->protocol));
1176 } 1190 return TC_ACT_SHOT;
1177 skb->tc_verd = SET_TC_VERD(skb->tc_verd,verd);
1178 goto reclassify;
1179 } else {
1180 if (skb->tc_verd)
1181 skb->tc_verd = SET_TC_VERD(skb->tc_verd,0);
1182 return err;
1183 }
1184#else
1185
1186 return err;
1187#endif
1188 } 1191 }
1189 1192 skb->tc_verd = SET_TC_VERD(skb->tc_verd, verd);
1193 goto reclassify;
1190 } 1194 }
1191 return -1; 1195#endif
1196 return err;
1192} 1197}
1198EXPORT_SYMBOL(tc_classify);
1193 1199
1194void tcf_destroy(struct tcf_proto *tp) 1200void tcf_destroy(struct tcf_proto *tp)
1195{ 1201{
@@ -1256,4 +1262,3 @@ EXPORT_SYMBOL(qdisc_get_rtab);
1256EXPORT_SYMBOL(qdisc_put_rtab); 1262EXPORT_SYMBOL(qdisc_put_rtab);
1257EXPORT_SYMBOL(register_qdisc); 1263EXPORT_SYMBOL(register_qdisc);
1258EXPORT_SYMBOL(unregister_qdisc); 1264EXPORT_SYMBOL(unregister_qdisc);
1259EXPORT_SYMBOL(tc_classify);