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

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>

authored by

Yuval Mintz and committed by
David S. Miller
7a4fa291 0a060697

+4
+1
include/net/sch_generic.h
··· 71 71 * qdisc_tree_decrease_qlen() should stop. 72 72 */ 73 73 #define TCQ_F_INVISIBLE 0x80 /* invisible by default in dump */ 74 + #define TCQ_F_OFFLOADED 0x200 /* qdisc is offloaded to HW */ 74 75 u32 limit; 75 76 const struct Qdisc_ops *ops; 76 77 struct qdisc_size_table __rcu *stab;
+1
include/uapi/linux/rtnetlink.h
··· 557 557 TCA_PAD, 558 558 TCA_DUMP_INVISIBLE, 559 559 TCA_CHAIN, 560 + TCA_HW_OFFLOAD, 560 561 __TCA_MAX 561 562 }; 562 563
+2
net/sched/sch_api.c
··· 795 795 tcm->tcm_info = refcount_read(&q->refcnt); 796 796 if (nla_put_string(skb, TCA_KIND, q->ops->id)) 797 797 goto nla_put_failure; 798 + if (nla_put_u8(skb, TCA_HW_OFFLOAD, !!(q->flags & TCQ_F_OFFLOADED))) 799 + goto nla_put_failure; 798 800 if (q->ops->dump && q->ops->dump(q, skb) < 0) 799 801 goto nla_put_failure; 800 802 qlen = q->q.qlen;