From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, idosch@mellanox.com,
dsahern@gmail.com, tariqt@mellanox.com, saeedm@mellanox.com,
kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, shuah@kernel.org,
mlxsw@mellanox.com
Subject: Re: [patch net-next v3 11/15] netdevsim: implement proper devlink reload
Date: Fri, 4 Oct 2019 08:19:14 +0200 [thread overview]
Message-ID: <20191004061914.GA2264@nanopsycho> (raw)
In-Reply-To: <20191003161730.6c61b48c@cakuba.hsd1.ca.comcast.net>
Fri, Oct 04, 2019 at 01:17:30AM CEST, jakub.kicinski@netronome.com wrote:
>On Thu, 3 Oct 2019 11:49:36 +0200, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>>
>> During devlink reload, all driver objects should be reinstantiated with
>> the exception of devlink instance and devlink resources and params.
>> Move existing devlink_resource_size_get() calls into fib_create() just
>> before fib notifier is registered. Also, make sure that extack is
>> propagated down to fib_notifier_register() call.
>>
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>
>Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>
>> diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
>> index d2aeac0f4c2c..fdc682f3a09a 100644
>> --- a/drivers/net/netdevsim/fib.c
>> +++ b/drivers/net/netdevsim/fib.c
>> @@ -63,12 +63,10 @@ u64 nsim_fib_get_val(struct nsim_fib_data *fib_data,
>> return max ? entry->max : entry->num;
>> }
>>
>> -int nsim_fib_set_max(struct nsim_fib_data *fib_data,
>> - enum nsim_resource_id res_id, u64 val,
>> - struct netlink_ext_ack *extack)
>> +static void nsim_fib_set_max(struct nsim_fib_data *fib_data,
>> + enum nsim_resource_id res_id, u64 val)
>> {
>> struct nsim_fib_entry *entry;
>> - int err = 0;
>>
>> switch (res_id) {
>> case NSIM_RESOURCE_IPV4_FIB:
>> @@ -84,20 +82,10 @@ int nsim_fib_set_max(struct nsim_fib_data *fib_data,
>> entry = &fib_data->ipv6.rules;
>> break;
>> default:
>> - return 0;
>> - }
>> -
>> - /* not allowing a new max to be less than curren occupancy
>> - * --> no means of evicting entries
>> - */
>> - if (val < entry->num) {
>> - NL_SET_ERR_MSG_MOD(extack, "New size is less than current occupancy");
>> - err = -EINVAL;
>
>This change in behaviour should perhaps be mentioned in the commit
>message. The reload will no longer fail if the resources are
>insufficient.
Reload is going to fail if the resources are insufficient. I have a
selftest for that, please see the last patch.
>
>Since we want to test reload more widely than just for the FIB limits
>that does make sense to me. Is that the thinking?
>
>> - } else {
>> - entry->max = val;
>> + WARN_ON(1);
>> + return;
>> }
>> -
>> - return err;
>> + entry->max = val;
>> }
>>
>> static int nsim_fib_rule_account(struct nsim_fib_entry *entry, bool add,
next prev parent reply other threads:[~2019-10-04 6:19 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-03 9:49 [patch net-next v3 00/15] devlink: allow devlink instances to change network namespace Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 01/15] netdevsim: change fib accounting and limitations to be per-device Jiri Pirko
2019-10-03 23:03 ` Jakub Kicinski
2019-10-03 9:49 ` [patch net-next v3 02/15] net: fib_notifier: make FIB notifier per-netns Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 03/15] net: fib_notifier: propagate possible error during fib notifier registration Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 04/15] mlxsw: spectrum_router: Don't rely on missing extack to symbolize dump Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 05/15] net: fib_notifier: propagate extack down to the notifier block callback Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 06/15] net: devlink: export devlink net getter Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 07/15] mlxsw: spectrum: Take devlink net instead of init_net Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 08/15] mlxsw: Register port netdevices into net of core Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 09/15] mlxsw: Propagate extack down to register_fib_notifier() Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 10/15] netdevsim: add all ports in nsim_dev_create() and del them in destroy() Jiri Pirko
2019-10-03 23:07 ` Jakub Kicinski
2019-10-03 9:49 ` [patch net-next v3 11/15] netdevsim: implement proper devlink reload Jiri Pirko
2019-10-03 23:17 ` Jakub Kicinski
2019-10-04 6:19 ` Jiri Pirko [this message]
2019-10-04 17:42 ` Jakub Kicinski
2019-10-04 20:49 ` Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 12/15] netdevsim: register port netdevices into net of device Jiri Pirko
2019-10-03 23:21 ` Jakub Kicinski
2019-10-04 6:20 ` Jiri Pirko
2019-10-03 9:49 ` [patch net-next v3 13/15] netdevsim: take devlink net instead of init_net Jiri Pirko
2019-10-03 23:21 ` Jakub Kicinski
2019-10-03 9:49 ` [patch net-next v3 14/15] net: devlink: allow to change namespaces during reload Jiri Pirko
2019-10-03 23:23 ` Jakub Kicinski
2019-10-03 9:49 ` [patch net-next v3 15/15] selftests: netdevsim: add tests for devlink reload with resources Jiri Pirko
2019-10-03 9:51 ` [patch iproute2-next v3 1/2] devlink: introduce cmdline option to switch to a different namespace Jiri Pirko
2019-10-07 22:01 ` David Ahern
2019-10-03 9:51 ` [patch iproute2-next v3 2/2] devlink: extend reload command to add support for network namespace change Jiri Pirko
2019-10-04 18:11 ` [patch net-next v3 00/15] devlink: allow devlink instances to change network namespace 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=20191004061914.GA2264@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=idosch@mellanox.com \
--cc=jakub.kicinski@netronome.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=shuah@kernel.org \
--cc=tariqt@mellanox.com \
--cc=yoshfuji@linux-ipv6.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;
as well as URLs for NNTP newsgroup(s).