From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Wojciech Drewek <wojciech.drewek@intel.com>,
intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, jiri@resnulli.us
Subject: Re: [Intel-wired-lan] [PATCH iwl-next] ice: Remove and readd netdev during devlink reload
Date: Tue, 23 Jan 2024 18:00:57 +0000 [thread overview]
Message-ID: <6b8ade34-d7f4-452d-9893-ace80c97dfed@linux.dev> (raw)
In-Reply-To: <20240123111849.9367-1-wojciech.drewek@intel.com>
On 23/01/2024 11:18, Wojciech Drewek wrote:
> Recent changes to the devlink reload (commit 9b2348e2d6c9
> ("devlink: warn about existing entities during reload-reinit"))
> force the drivers to destroy devlink ports during reinit.
> Adjust ice driver to this requirement, unregister netdvice, destroy
> devlink port. ice_init_eth() was removed and all the common code
> between probe and reload was moved to ice_load().
>
> During devlink reload we can't take devl_lock (it's already taken)
> and in ice_probe() we have to lock it. Use devl_* variant of the API
> which does not acquire and release devl_lock. Guard ice_load()
> with devl_lock only in case of probe.
>
> Introduce ice_debugfs_fwlog_deinit() in order to release PF's
> debugfs entries. Move ice_debugfs_exit() call to ice_module_exit().
>
> Suggested-by: Jiri Pirko <jiri@nvidia.com>
> Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice.h | 3 +
> drivers/net/ethernet/intel/ice/ice_debugfs.c | 10 +
> drivers/net/ethernet/intel/ice/ice_devlink.c | 68 ++++++-
> drivers/net/ethernet/intel/ice/ice_fwlog.c | 2 +
> drivers/net/ethernet/intel/ice/ice_main.c | 189 ++++++-------------
> 5 files changed, 139 insertions(+), 133 deletions(-)
>
[...]
> +/**
> + * ice_devlink_reinit_up - do reinit of the given PF
> + * @pf: pointer to the PF struct
> + */
> +static int ice_devlink_reinit_up(struct ice_pf *pf)
> +{
> + struct ice_vsi *vsi = ice_get_main_vsi(pf);
> + struct ice_vsi_cfg_params params = {};
no need for empy init here ...
> + int err;
> +
> + err = ice_init_dev(pf);
> + if (err)
> + return err;
> +
> + params = ice_vsi_to_params(vsi);
... because it's completely overwritten here.
> + params.flags = ICE_VSI_FLAG_INIT;
> +
> + rtnl_lock();
> + err = ice_vsi_cfg(vsi, ¶ms);
> + if (err)
> + goto err_vsi_cfg;
> + rtnl_unlock();
> +
> + /* No need to take devl_lock, it's already taken by devlink API */
> + err = ice_load(pf);
> + if (err)
> + goto err_load;
> +
> + return 0;
> +
> +err_load:
> + rtnl_lock();
> + ice_vsi_decfg(vsi);
> +err_vsi_cfg:
> + rtnl_unlock();
> + ice_deinit_dev(pf);
> + return err;
> +}
> +
WARNING: multiple messages have this Message-ID (diff)
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Wojciech Drewek <wojciech.drewek@intel.com>,
intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, jiri@resnulli.us
Subject: Re: [PATCH iwl-next] ice: Remove and readd netdev during devlink reload
Date: Tue, 23 Jan 2024 18:00:57 +0000 [thread overview]
Message-ID: <6b8ade34-d7f4-452d-9893-ace80c97dfed@linux.dev> (raw)
In-Reply-To: <20240123111849.9367-1-wojciech.drewek@intel.com>
On 23/01/2024 11:18, Wojciech Drewek wrote:
> Recent changes to the devlink reload (commit 9b2348e2d6c9
> ("devlink: warn about existing entities during reload-reinit"))
> force the drivers to destroy devlink ports during reinit.
> Adjust ice driver to this requirement, unregister netdvice, destroy
> devlink port. ice_init_eth() was removed and all the common code
> between probe and reload was moved to ice_load().
>
> During devlink reload we can't take devl_lock (it's already taken)
> and in ice_probe() we have to lock it. Use devl_* variant of the API
> which does not acquire and release devl_lock. Guard ice_load()
> with devl_lock only in case of probe.
>
> Introduce ice_debugfs_fwlog_deinit() in order to release PF's
> debugfs entries. Move ice_debugfs_exit() call to ice_module_exit().
>
> Suggested-by: Jiri Pirko <jiri@nvidia.com>
> Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice.h | 3 +
> drivers/net/ethernet/intel/ice/ice_debugfs.c | 10 +
> drivers/net/ethernet/intel/ice/ice_devlink.c | 68 ++++++-
> drivers/net/ethernet/intel/ice/ice_fwlog.c | 2 +
> drivers/net/ethernet/intel/ice/ice_main.c | 189 ++++++-------------
> 5 files changed, 139 insertions(+), 133 deletions(-)
>
[...]
> +/**
> + * ice_devlink_reinit_up - do reinit of the given PF
> + * @pf: pointer to the PF struct
> + */
> +static int ice_devlink_reinit_up(struct ice_pf *pf)
> +{
> + struct ice_vsi *vsi = ice_get_main_vsi(pf);
> + struct ice_vsi_cfg_params params = {};
no need for empy init here ...
> + int err;
> +
> + err = ice_init_dev(pf);
> + if (err)
> + return err;
> +
> + params = ice_vsi_to_params(vsi);
... because it's completely overwritten here.
> + params.flags = ICE_VSI_FLAG_INIT;
> +
> + rtnl_lock();
> + err = ice_vsi_cfg(vsi, ¶ms);
> + if (err)
> + goto err_vsi_cfg;
> + rtnl_unlock();
> +
> + /* No need to take devl_lock, it's already taken by devlink API */
> + err = ice_load(pf);
> + if (err)
> + goto err_load;
> +
> + return 0;
> +
> +err_load:
> + rtnl_lock();
> + ice_vsi_decfg(vsi);
> +err_vsi_cfg:
> + rtnl_unlock();
> + ice_deinit_dev(pf);
> + return err;
> +}
> +
next prev parent reply other threads:[~2024-01-23 18:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 11:18 [Intel-wired-lan] [PATCH iwl-next] ice: Remove and readd netdev during devlink reload Wojciech Drewek
2024-01-23 11:18 ` Wojciech Drewek
2024-01-23 11:28 ` [Intel-wired-lan] " Przemek Kitszel
2024-01-23 11:28 ` Przemek Kitszel
2024-01-23 18:00 ` Vadim Fedorenko [this message]
2024-01-23 18:00 ` Vadim Fedorenko
2024-01-25 11:07 ` [Intel-wired-lan] " Simon Horman
2024-01-25 11:07 ` Simon Horman
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=6b8ade34-d7f4-452d-9893-ace80c97dfed@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=wojciech.drewek@intel.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 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.