netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Ido Schimmel <idosch@mellanox.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"dsahern@gmail.com" <dsahern@gmail.com>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>,
	Tariq Toukan <tariqt@mellanox.com>, mlxsw <mlxsw@mellanox.com>
Subject: Re: [patch net-next v2 3/3] net: devlink: move reload fail indication to devlink core and expose to user
Date: Wed, 11 Sep 2019 08:17:10 +0200	[thread overview]
Message-ID: <20190911061710.GA2202@nanopsycho> (raw)
In-Reply-To: <20190908103928.GA21777@splinter>

Sun, Sep 08, 2019 at 12:39:32PM CEST, idosch@mellanox.com wrote:
>On Sat, Sep 07, 2019 at 10:54:00PM +0200, Jiri Pirko wrote:
>> diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
>> index 546e75dd74ac..7cb5e8c5ae0d 100644
>> --- a/include/uapi/linux/devlink.h
>> +++ b/include/uapi/linux/devlink.h
>> @@ -410,6 +410,8 @@ enum devlink_attr {
>>  	DEVLINK_ATTR_TRAP_METADATA,			/* nested */
>>  	DEVLINK_ATTR_TRAP_GROUP_NAME,			/* string */
>>  
>> +	DEVLINK_ATTR_RELOAD_FAILED,			/* u8 0 or 1 */
>> +
>>  	/* add new attributes above here, update the policy in devlink.c */
>>  
>>  	__DEVLINK_ATTR_MAX,
>> diff --git a/net/core/devlink.c b/net/core/devlink.c
>> index 1e3a2288b0b2..e00a4a643d17 100644
>> --- a/net/core/devlink.c
>> +++ b/net/core/devlink.c
>> @@ -471,6 +471,8 @@ static int devlink_nl_fill(struct sk_buff *msg, struct devlink *devlink,
>>  
>>  	if (devlink_nl_put_handle(msg, devlink))
>>  		goto nla_put_failure;
>> +	if (nla_put_u8(msg, DEVLINK_ATTR_RELOAD_FAILED, devlink->reload_failed))
>
>Why not use NLA_FLAG for this?

Bacause older kernel does not return this. So the user would not know if
everything is fine or if the kernel does not support the attribute.
Using u8 instead allows it.


>
>> +		goto nla_put_failure;
>>  
>>  	genlmsg_end(msg, hdr);
>>  	return 0;
>> @@ -2677,6 +2679,21 @@ static bool devlink_reload_supported(struct devlink *devlink)
>>  	return devlink->ops->reload_down && devlink->ops->reload_up;
>>  }

  reply	other threads:[~2019-09-11  6:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-07 20:53 [patch net-next v2 0/3] net: devlink: move reload fail indication to devlink core and expose to user Jiri Pirko
2019-09-07 20:53 ` [patch net-next v2 1/3] mlx4: Split restart_one into two functions Jiri Pirko
2019-09-07 20:53 ` [patch net-next v2 2/3] net: devlink: split reload op into two Jiri Pirko
2019-09-07 20:54 ` [patch net-next v2 3/3] net: devlink: move reload fail indication to devlink core and expose to user Jiri Pirko
2019-09-08 10:39   ` Ido Schimmel
2019-09-11  6:17     ` Jiri Pirko [this message]
2019-09-08 11:25   ` Ido Schimmel
2019-09-11  6:17     ` Jiri Pirko

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=20190911061710.GA2202@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@mellanox.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).