From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: davem@davemloft.net, Johannes Berg <johannes@sipsolutions.net>,
"dsahern@gmail.com" <dsahern@gmail.com>,
netdev@vger.kernel.org, ayal@mellanox.com, moshe@mellanox.com,
eranbe@mellanox.com, mlxsw@mellanox.com
Subject: Re: [patch net-next v2 2/4] devlink: propagate extack down to health reporter ops
Date: Fri, 11 Oct 2019 08:13:38 +0200 [thread overview]
Message-ID: <20191011061338.GG2901@nanopsycho> (raw)
In-Reply-To: <20191010190429.4511a8de@cakuba.netronome.com>
Fri, Oct 11, 2019 at 04:04:29AM CEST, jakub.kicinski@netronome.com wrote:
>On Thu, 10 Oct 2019 15:18:49 +0200, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>>
>> During health reporter operations, driver might want to fill-up
>> the extack message, so propagate extack down to the health reporter ops.
>>
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>
>> @@ -507,11 +507,14 @@ enum devlink_health_reporter_state {
>> struct devlink_health_reporter_ops {
>> char *name;
>> int (*recover)(struct devlink_health_reporter *reporter,
>> - void *priv_ctx);
>> + void *priv_ctx, struct netlink_ext_ack *extack);
>> int (*dump)(struct devlink_health_reporter *reporter,
>> - struct devlink_fmsg *fmsg, void *priv_ctx);
>> + struct devlink_fmsg *fmsg, void *priv_ctx,
>> + struct netlink_ext_ack *extack);
>> int (*diagnose)(struct devlink_health_reporter *reporter,
>> - struct devlink_fmsg *fmsg);
>> + struct devlink_fmsg *fmsg,
>> + struct netlink_ext_ack *extack);
>> +
>
>nit: Looks like an extra new line snuck in here?
>
>> };
>>
>> /**
>
>> @@ -4946,11 +4947,12 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
>>
>> mutex_lock(&reporter->dump_lock);
>> /* store current dump of current error, for later analysis */
>> - devlink_health_do_dump(reporter, priv_ctx);
>> + devlink_health_do_dump(reporter, priv_ctx, NULL);
>> mutex_unlock(&reporter->dump_lock);
>>
>> if (reporter->auto_recover)
>> - return devlink_health_reporter_recover(reporter, priv_ctx);
>> + return devlink_health_reporter_recover(reporter,
>> + priv_ctx, NULL);
>>
>> return 0;
>> }
>
>Thinking about this again - would it be entirely insane to allocate the
>extack on the stack here? And if anything gets set output into the logs?
>
>For context the situation here is that the health API can be poked from
>user space, but also the recovery actions are triggered automatically
>when failure is detected, if so configured (usually we expect them to
>be).
>
>When we were adding the extack helper for the drivers to use Johannes
>was concerned about printing to logs because that gave us a
>disincentive to convert all locations, and people could get surprised
>by the logs disappearing when more places are converted to extack [1].
>
>I wonder if this is a special case where outputting to the logs is a
>good idea? Really for all auto-recoverable health reporters the extack
>argument will just confuse driver authors. If driver uses extack here
>instead of printing to the logs information why auto-recovery failed is
>likely to get lost.
>
>Am I over-thinking this?
My gut feeling is kidn of odd about allocating some netlink specific
struct and use it separatelly from netlink :/
In any case, I think that this should probably be a separate patch/set.
>
>[1] https://www.spinics.net/lists/netdev/msg431998.html
next prev parent reply other threads:[~2019-10-11 6:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 13:18 [patch net-next v2 0/4] netdevsim: add devlink health reporters suppor Jiri Pirko
2019-10-10 13:18 ` [patch net-next v2 1/4] devlink: don't do reporter recovery if the state is healthy Jiri Pirko
2019-10-10 13:18 ` [patch net-next v2 2/4] devlink: propagate extack down to health reporter ops Jiri Pirko
2019-10-11 2:04 ` Jakub Kicinski
2019-10-11 6:13 ` Jiri Pirko [this message]
2019-10-11 6:45 ` Johannes Berg
2019-10-11 23:10 ` David Ahern
2019-10-10 13:18 ` [patch net-next v2 3/4] netdevsim: implement couple of testing devlink health reporters Jiri Pirko
2019-10-10 13:18 ` [patch net-next v2 4/4] selftests: add netdevsim devlink health tests Jiri Pirko
2019-10-12 4:05 ` [patch net-next v2 0/4] netdevsim: add devlink health reporters suppor David Miller
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=20191011061338.GG2901@nanopsycho \
--to=jiri@resnulli.us \
--cc=ayal@mellanox.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=eranbe@mellanox.com \
--cc=jakub.kicinski@netronome.com \
--cc=johannes@sipsolutions.net \
--cc=mlxsw@mellanox.com \
--cc=moshe@mellanox.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox