From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B19CDC4361B for ; Tue, 15 Dec 2020 22:27:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80C6022BE9 for ; Tue, 15 Dec 2020 22:27:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731507AbgLOW1k (ORCPT ); Tue, 15 Dec 2020 17:27:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731458AbgLOW1h (ORCPT ); Tue, 15 Dec 2020 17:27:37 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FE6EC0613D6 for ; Tue, 15 Dec 2020 14:26:57 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id t37so16192306pga.7 for ; Tue, 15 Dec 2020 14:26:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ifcco6PX76YQ45tKe2inJrTYkvhCiuEFvk/GLF6t8GA=; b=audUKUjpjL1xOWFsdnHuf+NEn7nNffaFm0l75KCHXdEJkz8gosVrIKngDgDjPhh7wR DD3lhn6RuqN34t5U71QxX/NOpZd093GP3P9Ocz9IT/obrn5RgiE69wRNInleDE0bbqDa db7EN6M6qIFoajU1tMsJoO9z6bnYxyVCJceNft1bC3u8iIzkgEc6RHggz2yeZAbpmZVI tXBBxunYl9TbUWsQfXRettZMuKKkTVCS13XQsN9QwBZPuBGUGcti1yq6op4U5KIkbdIW k79m3JxwPqlGboqm7R+mJmtGi10yIugVI5lTPb5qtx4KtFnEkWBB+iwarLGplMbQUb2D T3bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ifcco6PX76YQ45tKe2inJrTYkvhCiuEFvk/GLF6t8GA=; b=fGpYL1OhlDOpd8V6oor2np7bgliJ24z8vXKPT+WVYG9CLTJ5YesDaL506Wy+fJ7Tl/ 9PosITwWHL3FrEIP+XFeasMXpZFYPOtzMTNorhnGio/tVGLKTz4CK2VlA8/et79mZpdk VHUDbnat9v7t3ApeSw5c7GR+91EqJwrgmz5N65waxmQhkEZDYs37Kl4J2jYQs6WPc/Rp 0KEhHxjCEsDPyu3c+CcsHVhpccmDcemVzvHlg3fSvrHcGg45/SBc6lk2cZWAVzQh1uBp J5ig0pxiNHINf4q2kH3E2/WkCa7JV+9fegOyVekMCpfHLuidLNL3SPotqgM0AJf+/mei 964g== X-Gm-Message-State: AOAM5309a6s201ZUUpoIJDwFyued6UguNgH6K6la45meSLJ8DM4JBlz/ 0o4rZ5IcdBX+WRZhrWYrmR7PYA== X-Google-Smtp-Source: ABdhPJzIzxRVOR9BpmwQ0FHqr2Aua3g74/CMP05BJ3Iroxe2pxYIkgsVVZJI8Dg9nthEOzOG2C0ENw== X-Received: by 2002:a62:19cc:0:b029:19e:321b:a22e with SMTP id 195-20020a6219cc0000b029019e321ba22emr22973030pfz.73.1608071217090; Tue, 15 Dec 2020 14:26:57 -0800 (PST) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id a17sm131174pgw.80.2020.12.15.14.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 14:26:56 -0800 (PST) Date: Tue, 15 Dec 2020 14:26:53 -0800 From: Stephen Hemminger To: Maxim Mikityanskiy Cc: "David S. Miller" , Jamal Hadi Salim , Cong Wang , Jiri Pirko , David Ahern , Saeed Mahameed , Jakub Kicinski , Tariq Toukan , Yossi Kuperman , Maxim Mikityanskiy , Dan Carpenter , netdev@vger.kernel.org Subject: Re: [PATCH iproute2-next] tc/htb: Hierarchical QoS hardware offload Message-ID: <20201215142653.2a16e888@hermes.local> In-Reply-To: <20201215074213.32652-1-maximmi@mellanox.com> References: <20201215074213.32652-1-maximmi@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 15 Dec 2020 09:42:08 +0200 Maxim Mikityanskiy wrote: > + print_uint(PRINT_ANY, "offload", " offload %d", !!tb[TCA_HTB_OFFLOAD]); This is not the best way to represent a boolean flag in JSON. Also it breaks the "output should be the same as command line" mantra. My preference is json_null to indicate presence of a flag. Something like: if (tb[TCA_HTB_OFFLOAD]) print_null(PRINT_ANY, "offload", "offload", NULL);