summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorYuval Mintz <yuvalm@mellanox.com>2017-12-14 16:54:29 +0300
committerDavid S. Miller <davem@davemloft.net>2017-12-15 21:35:36 +0300
commit7a4fa29106d9a38ef005f5ab15d493c259f269c0 (patch)
treec9283f86e133216c20fa8f0d67ee53f5645734ad /net
parent0a0606970fa882c504a87c45407559595ef5a134 (diff)
downloadlinux-7a4fa29106d9a38ef005f5ab15d493c259f269c0.tar.xz
net: sched: Add TCA_HW_OFFLOAD
Qdiscs can be offloaded to HW, but current implementation isn't uniform. Instead, qdiscs either pass information about offload status via their TCA_OPTIONS or omit it altogether. Introduce a new attribute - TCA_HW_OFFLOAD that would form a uniform uAPI for the offloading status of qdiscs. Signed-off-by: Yuval Mintz <yuvalm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_api.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index b6c4f536876b..0f1eab99ff4e 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -795,6 +795,8 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
tcm->tcm_info = refcount_read(&q->refcnt);
if (nla_put_string(skb, TCA_KIND, q->ops->id))
goto nla_put_failure;
+ if (nla_put_u8(skb, TCA_HW_OFFLOAD, !!(q->flags & TCQ_F_OFFLOADED)))
+ goto nla_put_failure;
if (q->ops->dump && q->ops->dump(q, skb) < 0)
goto nla_put_failure;
qlen = q->q.qlen;