All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Moshe Shemesh <moshe@nvidia.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Moshe Shemesh <moshe@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jiri Pirko <jiri@mellanox.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next RFC v4 01/15] devlink: Add reload action option to devlink reload command
Date: Tue, 15 Sep 2020 15:26:48 +0200	[thread overview]
Message-ID: <20200915132648.GO2236@nanopsycho.orion> (raw)
In-Reply-To: <777fd1b8-1262-160e-a711-31e5f6e2c37c@nvidia.com>

Tue, Sep 15, 2020 at 02:56:48PM CEST, moshe@nvidia.com wrote:
>
>On 9/15/2020 12:33 AM, Jakub Kicinski wrote:
>> External email: Use caution opening links or attachments
>> 
>> 
>> On Mon, 14 Sep 2020 09:07:48 +0300 Moshe Shemesh wrote:
>> > @@ -3011,12 +3060,41 @@ static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
>> >                        return PTR_ERR(dest_net);
>> >        }
>> > 
>> > -     err = devlink_reload(devlink, dest_net, info->extack);
>> > +     if (info->attrs[DEVLINK_ATTR_RELOAD_ACTION])
>> > +             action = nla_get_u8(info->attrs[DEVLINK_ATTR_RELOAD_ACTION]);
>> > +     else
>> > +             action = DEVLINK_RELOAD_ACTION_DRIVER_REINIT;
>> > +
>> > +     if (action == DEVLINK_RELOAD_ACTION_UNSPEC || action > DEVLINK_RELOAD_ACTION_MAX) {
>> > +             NL_SET_ERR_MSG_MOD(info->extack, "Invalid reload action");
>> > +             return -EINVAL;
>> > +     } else if (!devlink_reload_action_is_supported(devlink, action)) {
>> > +             NL_SET_ERR_MSG_MOD(info->extack, "Requested reload action is not supported");
>> > +             return -EOPNOTSUPP;
>> > +     }
>> > +
>> > +     err = devlink_reload(devlink, dest_net, action, info->extack, &actions_performed);
>> > 
>> >        if (dest_net)
>> >                put_net(dest_net);
>> > 
>> > -     return err;
>> > +     if (err)
>> > +             return err;
>> > +
>> > +     WARN_ON(!actions_performed);
>> > +     msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
>> > +     if (!msg)
>> > +             return -ENOMEM;
>> > +
>> > +     err = devlink_nl_reload_actions_performed_fill(msg, devlink, actions_performed,
>> > +                                                    DEVLINK_CMD_RELOAD, info->snd_portid,
>> > +                                                    info->snd_seq, 0);
>> > +     if (err) {
>> > +             nlmsg_free(msg);
>> > +             return err;
>> > +     }
>> > +
>> > +     return genlmsg_reply(msg, info);
>> I think generating the reply may break existing users. Only generate
>> the reply if request contained DEVLINK_ATTR_RELOAD_ACTION (or any other
>> new attribute which existing users can't pass).
>
>
>OK, I can do that. But I update stats and generate devlink notification
>anyway, that should fine, right ?

Yes.

>

  reply	other threads:[~2020-09-16  0:36 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  6:07 [PATCH net-next RFC v4 00/15] Add devlink reload action and Moshe Shemesh
2020-09-14  6:07 ` [PATCH net-next RFC v4 01/15] devlink: Add reload action option to devlink reload command Moshe Shemesh
2020-09-14  7:08   ` Vasundhara Volam
2020-09-14  9:32     ` Jiri Pirko
2020-09-14  9:54       ` Vasundhara Volam
2020-09-14 11:28         ` Jiri Pirko
2020-09-14 21:31           ` Jakub Kicinski
2020-09-14 22:06             ` Michael Chan
2020-09-15  6:18               ` Jiri Pirko
2020-09-14 12:27   ` Jiri Pirko
2020-09-15 12:12     ` Moshe Shemesh
2020-09-15 13:26       ` Jiri Pirko
2020-09-15 20:06         ` Moshe Shemesh
2020-09-14 21:33   ` Jakub Kicinski
2020-09-15 12:56     ` Moshe Shemesh
2020-09-15 13:26       ` Jiri Pirko [this message]
2020-09-15 16:00       ` Jakub Kicinski
2020-09-14  6:07 ` [PATCH net-next RFC v4 02/15] devlink: Add reload action limit level Moshe Shemesh
2020-09-14 13:10   ` Jiri Pirko
2020-09-15 12:15     ` Moshe Shemesh
2020-09-14  6:07 ` [PATCH net-next RFC v4 03/15] devlink: Add reload action stats Moshe Shemesh
2020-09-14 13:39   ` Jiri Pirko
2020-09-15 12:30     ` Moshe Shemesh
2020-09-15 13:33       ` Jiri Pirko
2020-09-15 20:20         ` Moshe Shemesh
2020-09-16  6:07           ` Jiri Pirko
2020-09-14  6:07 ` [PATCH net-next RFC v4 04/15] devlink: Add reload actions stats to dev get Moshe Shemesh
2020-09-14 13:45   ` Jiri Pirko
2020-09-15  6:45     ` Ido Schimmel
2020-09-15  7:44       ` Jiri Pirko
2020-09-15 12:31         ` Moshe Shemesh
2020-09-15 13:34           ` Jiri Pirko
2020-09-15 20:33             ` Moshe Shemesh
2020-09-18 16:13               ` Moshe Shemesh
2020-09-21 10:33                 ` Jiri Pirko
2020-09-14  6:07 ` [PATCH net-next RFC v4 05/15] net/mlx5: Add functions to set/query MFRL register Moshe Shemesh
2020-09-14  6:07 ` [PATCH net-next RFC v4 06/15] net/mlx5: Set cap for pci sync for fw update event Moshe Shemesh
2020-09-14  6:07 ` [PATCH net-next RFC v4 07/15] net/mlx5: Handle sync reset request event Moshe Shemesh
2020-09-14  6:07 ` [PATCH net-next RFC v4 08/15] net/mlx5: Handle sync reset now event Moshe Shemesh
2020-09-14  6:07 ` [PATCH net-next RFC v4 09/15] net/mlx5: Handle sync reset abort event Moshe Shemesh
2020-09-14  6:07 ` [PATCH net-next RFC v4 10/15] net/mlx5: Add support for devlink reload action fw activate Moshe Shemesh
2020-09-14 13:52   ` Jiri Pirko
2020-09-15 12:38     ` Moshe Shemesh
2020-09-14 13:54   ` Jiri Pirko
2020-09-15 12:44     ` Moshe Shemesh
2020-09-15 13:37       ` Jiri Pirko
2020-09-15 20:28         ` Moshe Shemesh
2020-09-16  6:08           ` Jiri Pirko
2020-09-14  6:07 ` [PATCH net-next RFC v4 11/15] devlink: Add enable_remote_dev_reset generic parameter Moshe Shemesh
2020-09-14 14:12   ` Jiri Pirko
2020-09-14  6:07 ` [PATCH net-next RFC v4 12/15] net/mlx5: Add devlink param enable_remote_dev_reset support Moshe Shemesh
2020-09-14  6:08 ` [PATCH net-next RFC v4 13/15] net/mlx5: Add support for fw live patch event Moshe Shemesh
2020-09-14  6:08 ` [PATCH net-next RFC v4 14/15] net/mlx5: Add support for devlink reload action limit level no reset Moshe Shemesh
2020-09-14  6:08 ` [PATCH net-next RFC v4 15/15] devlink: Add Documentation/networking/devlink/devlink-reload.rst Moshe Shemesh
2020-09-14 11:43   ` Jiri Pirko
2020-09-15 16:04   ` Jakub Kicinski
2020-09-15 19:59     ` Moshe Shemesh

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=20200915132648.GO2236@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moshe@mellanox.com \
    --cc=moshe@nvidia.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 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.