[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d7482076-0a8d-ea12-a53a-731f5364c2df@cumulusnetworks.com>
Date: Wed, 25 Oct 2017 09:31:46 -0600
From: David Ahern <dsa@...ulusnetworks.com>
To: Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org,
Arkadi Sharshevsky <arkadis@...lanox.com>
Cc: davem@...emloft.net, mlxsw@...lanox.com, andrew@...n.ch,
vivien.didelot@...oirfairelinux.com, f.fainelli@...il.com,
michael.chan@...adcom.com, ganeshgr@...lsio.com,
saeedm@...lanox.com, matanb@...lanox.com, leonro@...lanox.com,
idosch@...lanox.com, jakub.kicinski@...ronome.com, ast@...nel.org,
daniel@...earbox.net, simon.horman@...ronome.com,
pieter.jansenvanvuuren@...ronome.com, john.hurley@...ronome.com,
alexander.h.duyck@...el.com, linville@...driver.com,
gospo@...adcom.com, steven.lin1@...adcom.com, yuvalm@...lanox.com,
ogerlitz@...lanox.com
Subject: Re: [patch net-next RFC 7/7] mlxsw: core: Add support for reload
On 10/24/17 3:22 AM, Jiri Pirko wrote:
> @@ -980,7 +998,7 @@ static const struct devlink_ops mlxsw_devlink_ops = {
>
> int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
> const struct mlxsw_bus *mlxsw_bus,
> - void *bus_priv)
> + void *bus_priv, bool reload)
> {
> const char *device_kind = mlxsw_bus_info->device_kind;
> struct mlxsw_core *mlxsw_core;
> @@ -992,11 +1010,14 @@ int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
> mlxsw_driver = mlxsw_core_driver_get(device_kind);
> if (!mlxsw_driver)
> return -EINVAL;
> - alloc_size = sizeof(*mlxsw_core) + mlxsw_driver->priv_size;
> - devlink = devlink_alloc(&mlxsw_devlink_ops, alloc_size);
> - if (!devlink) {
> - err = -ENOMEM;
> - goto err_devlink_alloc;
> +
> + if (!reload) {
> + alloc_size = sizeof(*mlxsw_core) + mlxsw_driver->priv_size;
> + devlink = devlink_alloc(&mlxsw_devlink_ops, alloc_size);
> + if (!devlink) {
> + err = -ENOMEM;
> + goto err_devlink_alloc;
> + }
> }
>
> mlxsw_core = devlink_priv(devlink);
devlink is not set if reload is true, yet is used in the line above.
Powered by blists - more mailing lists