[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <035bdb1a-4aac-04cb-15ab-78fd687f5dc5@nvidia.com>
Date: Wed, 2 Dec 2020 09:01:28 +0200
From: Moshe Shemesh <moshe@...dia.com>
To: David Ahern <dsahern@...il.com>,
Moshe Shemesh <moshe@...lanox.com>,
Stephen Hemminger <stephen@...workplumber.org>,
Jakub Kicinski <kuba@...nel.org>, Jiri Pirko <jiri@...dia.com>,
<netdev@...r.kernel.org>
Subject: Re: [PATCH iproute2-net 3/3] devlink: Add reload stats to dev show
On 11/29/2020 11:22 PM, David Ahern wrote:
> On 11/26/20 4:14 AM, Moshe Shemesh wrote:
>> @@ -2975,17 +2996,93 @@ static int cmd_dev_param(struct dl *dl)
>> return -ENOENT;
>> }
>>
>> -static void pr_out_dev(struct dl *dl, struct nlattr **tb)
>> +static void pr_out_action_stats(struct dl *dl, struct nlattr *action_stats)
>> +{
>> + struct nlattr *tb_stats_entry[DEVLINK_ATTR_MAX + 1] = {};
>> + struct nlattr *reload_stats_entry;
>> + enum devlink_reload_limit limit;
>> + uint32_t value;
>> + int err;
>> +
>> + mnl_attr_for_each_nested(reload_stats_entry, action_stats) {
>> + err = mnl_attr_parse_nested(reload_stats_entry, attr_cb, tb_stats_entry);
> wrap lines at 80 columns unless it is a print statement.
Ack.
>
>> + if (err != MNL_CB_OK)
>> + return;
>> + if (!tb_stats_entry[DEVLINK_ATTR_RELOAD_STATS_LIMIT] ||
>> + !tb_stats_entry[DEVLINK_ATTR_RELOAD_STATS_VALUE])
>> + return;
>> +
>> + check_indent_newline(dl);
>> + limit = mnl_attr_get_u8(tb_stats_entry[DEVLINK_ATTR_RELOAD_STATS_LIMIT]);
>> + value = mnl_attr_get_u32(tb_stats_entry[DEVLINK_ATTR_RELOAD_STATS_VALUE]);
> Use temp variables for the attributes to make the code readable.
Ack.
>
>> + print_uint_name_value(reload_limit_name(limit), value);
>> + }
>> +}
>> +
> that applies to all of the patches.
>
Powered by blists - more mailing lists