netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Vlad Buslov <vlad@buslov.dev>
Cc: Vlad Buslov <vladbu@nvidia.com>,
	dsahern@gmail.com, stephen@networkplumber.org,
	netdev@vger.kernel.org, davem@davemloft.net,
	xiyou.wangcong@gmail.com, jiri@resnulli.us, ivecera@redhat.com,
	Vlad Buslov <vladbu@mellanox.com>
Subject: Re: [PATCH iproute2-next v3 2/2] tc: implement support for terse dump
Date: Mon, 19 Oct 2020 09:48:41 -0400	[thread overview]
Message-ID: <b8138715-8fd7-cbef-d220-76bdb8c52ba5@mojatatu.com> (raw)
In-Reply-To: <877drn20h3.fsf@buslov.dev>

On 2020-10-18 8:16 a.m., Vlad Buslov wrote:
> On Sat 17 Oct 2020 at 14:20, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>> On 2020-10-16 12:42 p.m., Vlad Buslov wrote:
>>

>> Either one sounds appealing - the refactoring feels simpler
>> as opposed to a->terse_print().
> 
> With such refactoring we action type will be printed before some basic
> validation which can lead to outputting the type together with error
> message. Consider tunnel key action output callback as example:
> 
> static int print_tunnel_key(struct action_util *au, FILE *f, struct rtattr *arg)
> {
> 	struct rtattr *tb[TCA_TUNNEL_KEY_MAX + 1];
> 	struct tc_tunnel_key *parm;
> 
> 	if (!arg)
> 		return 0;
> 
> 	parse_rtattr_nested(tb, TCA_TUNNEL_KEY_MAX, arg);
> 
> 	if (!tb[TCA_TUNNEL_KEY_PARMS]) {
> 		fprintf(stderr, "Missing tunnel_key parameters\n");
> 		return -1;
> 	}
> 	parm = RTA_DATA(tb[TCA_TUNNEL_KEY_PARMS]);
> 
> 	print_string(PRINT_ANY, "kind", "%s ", "tunnel_key");
> 
> If print "kind" call is moved before checking the arg it will always be
> printed, even when immediately followed by "Missing tunnel_key
> parameters\n" string. Is this a concern?
> 

That could be a good thing, no? you get to see the action name with the
error. Its really not a big deal if you decide to do a->terse_print()
instead.

>>
>> BTW: the action index, unless i missed something, is not transported
>> from the kernel for terse option. It is an important parameter
>> when actions are shared by filters (since they will have the same
>> index).
>> Am i missing something?
> 
> Yes, tc_action_ops->dump(), which outputs action index among other data,
> is not called at all by terse dump.

I am suggesting it is an important detail that is currently missing.
Alternatively since you have the cookies in there - it is feasible that
someone who creates the action could "encode" the index in the cookie.
But that makes it a "proprietary" choice of whoever is creating
the filter/action.

cheers,
jamal


  reply	other threads:[~2020-10-19 13:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 14:42 [PATCH iproute2-next v3 0/2] Implement filter terse dump mode support Vlad Buslov
2020-10-16 14:42 ` [PATCH iproute2-next v3 1/2] tc: skip actions that don't have options attribute when printing Vlad Buslov
2020-10-16 14:42 ` [PATCH iproute2-next v3 2/2] tc: implement support for terse dump Vlad Buslov
2020-10-16 16:07   ` Jamal Hadi Salim
2020-10-16 16:42     ` Vlad Buslov
2020-10-17 11:20       ` Jamal Hadi Salim
2020-10-18 12:16         ` Vlad Buslov
2020-10-19 13:48           ` Jamal Hadi Salim [this message]
2020-10-19 15:18             ` Vlad Buslov
2020-10-20 12:29               ` Jamal Hadi Salim
2020-10-21  8:19                 ` Vlad Buslov
2020-10-22 14:05                   ` Jamal Hadi Salim
2020-10-23 12:48                     ` Vlad Buslov
2020-10-24 17:40                       ` Jamal Hadi Salim
2020-10-26 11:28                         ` Vlad Buslov
2020-10-26 14:52                           ` David Ahern
2020-10-26 15:06                             ` Vlad Buslov
2020-10-26 15:17                               ` David Ahern
2020-10-26 17:12                           ` Jamal Hadi Salim
2020-10-26 17:46                             ` Vlad Buslov
2020-10-26 18:01                               ` Jamal Hadi Salim
2020-10-26 18:03                                 ` Vlad Buslov
2020-10-26 19:56                                   ` Jamal Hadi Salim

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=b8138715-8fd7-cbef-d220-76bdb8c52ba5@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=vlad@buslov.dev \
    --cc=vladbu@mellanox.com \
    --cc=vladbu@nvidia.com \
    --cc=xiyou.wangcong@gmail.com \
    /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).