Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[NET_SCHED]: sch_dsmark: act_api support

Handle act_api classification results.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Patrick McHardy and committed by
David S. Miller
f6853e2d 92100804

+25 -16
+25 -16
net/sched/sch_dsmark.c
··· 237 237 D2PRINTK("result %d class 0x%04x\n", result, res.classid); 238 238 239 239 switch (result) { 240 - #ifdef CONFIG_NET_CLS_POLICE 241 - case TC_POLICE_SHOT: 242 - kfree_skb(skb); 243 - sch->qstats.drops++; 244 - return NET_XMIT_POLICED; 240 + #ifdef CONFIG_NET_CLS_ACT 241 + case TC_ACT_QUEUED: 242 + case TC_ACT_STOLEN: 243 + kfree_skb(skb); 244 + return NET_XMIT_SUCCESS; 245 + case TC_ACT_SHOT: 246 + kfree_skb(skb); 247 + sch->qstats.drops++; 248 + return NET_XMIT_BYPASS; 249 + #elif defined(CONFIG_NET_CLS_POLICE) 250 + case TC_POLICE_SHOT: 251 + kfree_skb(skb); 252 + sch->qstats.drops++; 253 + return NET_XMIT_POLICED; 245 254 #if 0 246 - case TC_POLICE_RECLASSIFY: 247 - /* FIXME: what to do here ??? */ 255 + case TC_POLICE_RECLASSIFY: 256 + /* FIXME: what to do here ??? */ 248 257 #endif 249 258 #endif 250 - case TC_POLICE_OK: 251 - skb->tc_index = TC_H_MIN(res.classid); 252 - break; 253 - case TC_POLICE_UNSPEC: 254 - /* fall through */ 255 - default: 256 - if (p->default_index != NO_DEFAULT_INDEX) 257 - skb->tc_index = p->default_index; 258 - break; 259 + case TC_POLICE_OK: 260 + skb->tc_index = TC_H_MIN(res.classid); 261 + break; 262 + case TC_POLICE_UNSPEC: 263 + /* fall through */ 264 + default: 265 + if (p->default_index != NO_DEFAULT_INDEX) 266 + skb->tc_index = p->default_index; 267 + break; 259 268 } 260 269 } 261 270