diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_api.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index b5c2cf2aa6d4..f7e6d13e270f 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1171,6 +1171,35 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n) } /* + * enable/disable flow on qdisc. + */ +void +tc_qdisc_flow_control(struct net_device *dev, u32 tcm_handle, int enable_flow) +{ + struct Qdisc *q; + struct __qdisc_change_req { + struct nlattr attr; + struct tc_prio_qopt data; + } req = { + .attr = {sizeof(struct __qdisc_change_req), TCA_OPTIONS}, + .data = {3, {1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}, 1} + }; + + /* override flow bit */ + req.data.enable_flow = enable_flow; + + /* look up using tcm handle */ + q = qdisc_lookup(dev, tcm_handle); + + /* call registered change function */ + if (q) { + if (q->ops->change(q, &(req.attr)) != 0) + pr_err("tc_qdisc_flow_control: qdisc change failed"); + } +} +EXPORT_SYMBOL(tc_qdisc_flow_control); + +/* * Create/change qdisc. */ |