netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Mashak <mrv@mojatatu.com>
To: David Ahern <dsahern@gmail.com>
Cc: Hangbin Liu <liuhangbin@gmail.com>,
	netdev@vger.kernel.org,
	Stephen Hemminger <stephen@networkplumber.org>,
	Phil Sutter <phil@nwl.cc>
Subject: Re: [iproute2 net-next PATCH] ip: add a new parameter -Numeric
Date: Fri, 14 Jun 2019 15:00:45 -0400	[thread overview]
Message-ID: <85muikuh42.fsf@mojatatu.com> (raw)
In-Reply-To: <c8bb54a4-604e-3082-c0bb-70c2ac1548b2@gmail.com> (David Ahern's message of "Fri, 14 Jun 2019 08:04:23 -0600")

David Ahern <dsahern@gmail.com> writes:

> On 6/12/19 10:01 AM, Roman Mashak wrote:
>> Hangbin Liu <liuhangbin@gmail.com> writes:
>> 
>>> Add a new parameter '-Numeric' to show the number of protocol, scope,
>>> dsfield, etc directly instead of converting it to human readable name.
>>> Do the same on tc and ss.
>>>
>>> This patch is based on David Ahern's previous patch.
>>>
>> 
>> [...]
>> 
>> It would be good idea to specify the numerical format, e.g. hex or dec,
>> very often hex is more conveninet representation (for example, when
>> skbmark is encoded of IP address or such).
>> 
>> Could you think of extending it '-Numeric' to have an optional argument
>> hex, and use decimal as default.
>> 
>
> I do not see how such an option could work.

'numeric' is extern object, so can be accessible from other modules. But
yes, it would require to add some wrappers around print_*int() APIs to
take into account this new parameter.

Yes, it is all-or-nothing approach, one can't have filters dumping their
integers values in hex but actions attached to the filters in decimal
(or the other way around).

> It would be best for iproute2 commands to output fields as hex
> or decimal based on what makes sense for each.

For example, m_police.c historically dumps its index value in hex,
although it's not very sensible IMHO :) Now it's risky to change the code,
because many scripts will likely break.

> That said, I do not see how this patch affects fields
> such as skbmark. Can you give an example? The patch looks fine to me.

The patch only exposes 'numeric' to tc, so yes -- it does not affect
anything. I only suggested to think of more generic approach.

On the 2nd thought: there already exists argument "-raw" for tc which
currently instructs printing handles in hex representation. Why not to
adopt this for ip and ss as well rather then adding new key?

  reply	other threads:[~2019-06-14 19:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12  9:21 [iproute2 net-next PATCH] ip: add a new parameter -Numeric Hangbin Liu
2019-06-12  9:25 ` Hangbin Liu
2019-06-12 16:01 ` Roman Mashak
2019-06-13  3:07   ` Hangbin Liu
2019-06-14 14:04   ` David Ahern
2019-06-14 19:00     ` Roman Mashak [this message]
2019-06-15  1:05       ` David Ahern
2019-06-18 15:41 ` David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85muikuh42.fsf@mojatatu.com \
    --to=mrv@mojatatu.com \
    --cc=dsahern@gmail.com \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=phil@nwl.cc \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).