qdisc: print offload indication

Use the newly added TCA_HW_OFFLOAD indication from kernel
to print a consistent 'offloaded' message to user when listing qdiscs.

Signed-off-by: Yuval Mintz <yuvalm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Yuval Mintz 2017-12-26 11:48:45 +02:00 committed by Stephen Hemminger
parent afdf9277eb
commit b97c6fa71d
1 changed files with 4 additions and 0 deletions

View File

@ -266,6 +266,10 @@ int print_qdisc(const struct sockaddr_nl *who,
if (t->tcm_info != 1) if (t->tcm_info != 1)
print_uint(PRINT_ANY, "refcnt", "refcnt %u ", t->tcm_info); print_uint(PRINT_ANY, "refcnt", "refcnt %u ", t->tcm_info);
if (tb[TCA_HW_OFFLOAD] &&
(rta_getattr_u8(tb[TCA_HW_OFFLOAD])))
print_bool(PRINT_ANY, "offloaded", "offloaded ", true);
/* pfifo_fast is generic enough to warrant the hardcoding --JHS */ /* pfifo_fast is generic enough to warrant the hardcoding --JHS */
if (strcmp("pfifo_fast", RTA_DATA(tb[TCA_KIND])) == 0) if (strcmp("pfifo_fast", RTA_DATA(tb[TCA_KIND])) == 0)
q = get_qdisc_kind("prio"); q = get_qdisc_kind("prio");