From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH iproute2 1/1] actions: Add support for user cookies Date: Thu, 23 Nov 2017 17:36:12 +0100 Message-ID: <20171123163612.GA2040@nanopsycho> References: <1492864583-20892-1-git-send-email-jhs@emojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: stephen@networkplumber.org, netdev@vger.kernel.org To: Jamal Hadi Salim Return-path: Received: from mail-wm0-f41.google.com ([74.125.82.41]:41507 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbdKWQgP (ORCPT ); Thu, 23 Nov 2017 11:36:15 -0500 Received: by mail-wm0-f41.google.com with SMTP id b189so17924630wmd.0 for ; Thu, 23 Nov 2017 08:36:14 -0800 (PST) Content-Disposition: inline In-Reply-To: <1492864583-20892-1-git-send-email-jhs@emojatatu.com> Sender: netdev-owner@vger.kernel.org List-ID: Sat, Apr 22, 2017 at 02:36:23PM CEST, jhs@mojatatu.com wrote: [...] >@@ -274,8 +302,17 @@ 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+1]; >+ >+ fprintf(f, "\n\tcookie len %d %s ", strsz, >+ hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]), >+ strsz, b1, sizeof(b1))); >+ } Jamal, is there any particular reason that you print cookie only in case you show stats? What is the relation between cookie and stats? > fprintf(f, "\n"); > } > >-- >1.9.1 >