All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>, netdev@vger.kernel.org
Cc: Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH] genl: ctrl: print op -> policy idx mapping
Date: Fri, 2 Oct 2020 07:29:35 -0700	[thread overview]
Message-ID: <248a5646-9dc8-c640-e334-31e9d50495e8@gmail.com> (raw)
In-Reply-To: <20201002102609.224150-1-johannes@sipsolutions.net>

On 10/2/20 3:26 AM, Johannes Berg wrote:
> diff --git a/genl/ctrl.c b/genl/ctrl.c
> index 68099fe97f1a..c62212b40fa3 100644
> --- a/genl/ctrl.c
> +++ b/genl/ctrl.c
> @@ -162,6 +162,16 @@ static int print_ctrl(struct rtnl_ctrl_data *ctrl,
>  		__u32 *ma = RTA_DATA(tb[CTRL_ATTR_MAXATTR]);
>  		fprintf(fp, " max attribs: %d ",*ma);
>  	}
> +	if (tb[CTRL_ATTR_OP_POLICY]) {
> +		const struct rtattr *pos;
> +
> +		rtattr_for_each_nested(pos, tb[CTRL_ATTR_OP_POLICY]) {
> +			__u32 *v = RTA_DATA(pos);
> +
> +			fprintf(fp, " op %d has policy %d",
> +				pos->rta_type, *v);

did you look at pretty printing the op and type? I suspect only numbers
are going to cause a lot of staring at header files while counting to
decipher number to text.


  reply	other threads:[~2020-10-02 14:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 10:26 [PATCH] genl: ctrl: print op -> policy idx mapping Johannes Berg
2020-10-02 14:29 ` David Ahern [this message]
2020-10-02 14:39   ` Johannes Berg
2020-10-02 18:01     ` David Ahern
2020-10-02 19:06       ` Johannes Berg

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=248a5646-9dc8-c640-e334-31e9d50495e8@gmail.com \
    --to=dsahern@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.