From patchwork Tue Dec 26 09:48:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Mintz X-Patchwork-Id: 852944 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z5WRX3Cb5z9sBW for ; Tue, 26 Dec 2017 20:49:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750862AbdLZJt3 (ORCPT ); Tue, 26 Dec 2017 04:49:29 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:45730 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750705AbdLZJt2 (ORCPT ); Tue, 26 Dec 2017 04:49:28 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yuvalm@mellanox.com) with ESMTPS (AES256-SHA encrypted); 26 Dec 2017 11:49:26 +0200 Received: from dev-r-vrt-155.mtr.labs.mlnx (dev-r-vrt-155.mtr.labs.mlnx [10.212.155.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id vBQ9nQ0n022884; Tue, 26 Dec 2017 11:49:26 +0200 From: Yuval Mintz To: netdev@vger.kernel.org, stephen@networkplumber.org Cc: mlxsw@mellanox.com, Yuval Mintz Subject: [PATCH iproute] qdisc: Print offload indication Date: Tue, 26 Dec 2017 11:48:45 +0200 Message-Id: <1514281725-47488-1-git-send-email-yuvalm@mellanox.com> X-Mailer: git-send-email 2.4.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Reviewed-by: Jiri Pirko --- include/uapi/linux/rtnetlink.h | 1 + tc/tc_qdisc.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index b8335b5..13bf56f 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h @@ -557,6 +557,7 @@ enum { TCA_PAD, TCA_DUMP_INVISIBLE, TCA_CHAIN, + TCA_HW_OFFLOAD, __TCA_MAX }; diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c index 4431d5f..70279b9 100644 --- a/tc/tc_qdisc.c +++ b/tc/tc_qdisc.c @@ -266,6 +266,10 @@ int print_qdisc(const struct sockaddr_nl *who, if (t->tcm_info != 1) 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 */ if (strcmp("pfifo_fast", RTA_DATA(tb[TCA_KIND])) == 0) q = get_qdisc_kind("prio");