From patchwork Fri Nov 24 08:28:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 840983 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="aEOamDFp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yjqC26bhCz9t20 for ; Fri, 24 Nov 2017 19:30:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752457AbdKXIag (ORCPT ); Fri, 24 Nov 2017 03:30:36 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36223 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631AbdKXI2X (ORCPT ); Fri, 24 Nov 2017 03:28:23 -0500 Received: by mail-wr0-f193.google.com with SMTP id y42so19649671wrd.3 for ; Fri, 24 Nov 2017 00:28:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=lkRYgey4nUEMMtA3nY/xInr+oh/dEZBYyp1Gwr6m0Mo=; b=aEOamDFp5GbaygnNJf2m57g1tbQWnUu0fv7EIlcSUPGmMcvtIX2dQ00RqA1JAolQcP jfQhdBAxTtY2K4ly9bPPrdqtZIFlvpgzTd/uZiQwW13S4Yo7m6wWjREghpP0Kv/wxlzo CEC/gdeDrgYxuozHN9yDCqQANQjZOH6XxaJpdcKEikxfyGOORQazlMqZ814xQkeMzarR LsXU8LVobJKbDo7ZGULx6E3xbwXkT5qSXYVjpYMLnL8Jz6qR8dwhUe7o1tXusMiitcu2 /JgbvMQSy/l65w1sioHsbm1VrF8xO3QwtmJhSOZ229TF/MjlnDAYQ5ESJEWDSyJEMBp+ Ui8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lkRYgey4nUEMMtA3nY/xInr+oh/dEZBYyp1Gwr6m0Mo=; b=kKvy9JfLsCo2JMeejYh3lDD/nCfIXGUlbRp9B+eSDRm9FfD0IHS8KKkicL2lBrouXv 25vP5PEh90WuUVPqJMdCCPfwxZU761FA4BMCPsq/RrcJp95vRCrrRKWfWYrBuHtP6fwJ xLUyuP+wSAgWnQTEVHfnImX3HzyR+b5lsp1PhqfMYPL8A3Sf+N35hCUF/zCLZUmFewOl q6fke/cF1+vTkcIhOfn6mFKn/s5vK+izV4CnC8H78RE8WqS1aW49KiVFihzIfGg2eelA OCS4GaHEzcTAQeCAuB6PIl3/a8UDqqM+5oT15kwMZI6aXyFvk/VQIhS1It8j5IA/Xl/f cUUA== X-Gm-Message-State: AJaThX5ojgWXSODWkGyX6mQktbj4R9Gv/1pO7j1lWZXCeMI475rqG5q8 JhhNkjpI9QKlhcrOK9iipJKI8Fnl X-Google-Smtp-Source: AGs4zMYE61c43LLhZAMk9HRGkxyHpXBtMC+q1xNeAN+0Em1LxUOjaX5WN4TdOaW77Wam2u7A65ciyQ== X-Received: by 10.223.142.193 with SMTP id q59mr23934846wrb.262.1511512102722; Fri, 24 Nov 2017 00:28:22 -0800 (PST) Received: from localhost (ip-89-103-66-66.net.upcbroadband.cz. [89.103.66.66]) by smtp.gmail.com with ESMTPSA id e197sm349800wmf.42.2017.11.24.00.28.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Nov 2017 00:28:22 -0800 (PST) From: Jiri Pirko To: netdev@vger.kernel.org Cc: stephen@networkplumber.org, jhs@mojatatu.com, mlxsw@mellanox.com Subject: [patch iproute2] tc: move action cookie print out of the stats if Date: Fri, 24 Nov 2017 09:28:21 +0100 Message-Id: <20171124082821.1758-1-jiri@resnulli.us> X-Mailer: git-send-email 2.9.5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Cookie print was made dependent on show_stats for no good reason. Fix this bu pushing cookie print ot of the stats if. Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies") Signed-off-by: Jiri Pirko --- tc/m_action.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tc/m_action.c b/tc/m_action.c index 0dce97f..c2fc4f1 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -301,19 +301,18 @@ static int tc_print_one_action(FILE *f, struct rtattr *arg) return err; if (show_stats && tb[TCA_ACT_STATS]) { - fprintf(f, "\tAction statistics:\n"); print_tcstats2_attr(f, tb[TCA_ACT_STATS], "\t", NULL); - if (tb[TCA_ACT_COOKIE]) { - int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]); - char b1[strsz * 2 + 1]; - - fprintf(f, "\n\tcookie len %d %s ", strsz, - hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]), - strsz, b1, sizeof(b1))); - } fprintf(f, "\n"); } + if (tb[TCA_ACT_COOKIE]) { + int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]); + char b1[strsz * 2 + 1]; + + fprintf(f, "\tcookie len %d %s\n", strsz, + hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]), + strsz, b1, sizeof(b1))); + } return 0; }