From: Leon Romanovsky <leon@kernel.org>
To: Michael Chan <michael.chan@broadcom.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org,
edwin.peer@broadcom.com, gospo@broadcom.com, jiri@nvidia.com
Subject: Re: [PATCH net-next v2 03/19] bnxt_en: implement devlink dev reload driver_reinit
Date: Fri, 29 Oct 2021 20:06:48 +0300 [thread overview]
Message-ID: <YXwqKCJkDOfvUce8@unreal> (raw)
In-Reply-To: <1635493676-10767-4-git-send-email-michael.chan@broadcom.com>
On Fri, Oct 29, 2021 at 03:47:40AM -0400, Michael Chan wrote:
> From: Edwin Peer <edwin.peer@broadcom.com>
>
> The RTNL lock must be held between down and up to prevent interleaving
> state changes, especially since external state changes might release
> and allocate different driver resource subsets that would otherwise
> need to be tracked and carefully handled. If the down function fails,
> then devlink will not call the corresponding up function, thus the
> lock is released in the down error paths.
>
> v2: Don't use devlink_reload_disable() and devlink_reload_enable().
> Instead, check that the netdev is not in unregistered state before
> proceeding with reload.
>
> Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
> Signed-Off-by: Michael Chan <michael.chan@broadcom.com>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 14 +--
> drivers/net/ethernet/broadcom/bnxt/bnxt.h | 5 +
> .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 97 +++++++++++++++++++
> drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 2 -
> drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h | 3 +
> 5 files changed, 110 insertions(+), 11 deletions(-)
<...>
> +static int bnxt_dl_reload_down(struct devlink *dl, bool netns_change,
> + enum devlink_reload_action action,
> + enum devlink_reload_limit limit,
> + struct netlink_ext_ack *extack)
> +{
> + struct bnxt *bp = bnxt_get_bp_from_dl(dl);
> + int rc = 0;
> +
> + switch (action) {
> + case DEVLINK_RELOAD_ACTION_DRIVER_REINIT: {
> + if (BNXT_PF(bp) && bp->pf.active_vfs) {
> + NL_SET_ERR_MSG_MOD(extack,
> + "reload is unsupported when VFs are allocated\n");
> + return -EOPNOTSUPP;
> + }
This is racy against bnxt_sriov_enable and bnxt_sriov_configure
Thanks
next prev parent reply other threads:[~2021-10-29 17:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 7:47 [PATCH net-next v2 00/19] bnxt_en: devlink enhancements Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 01/19] bnxt_en: refactor printing of device info Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 02/19] bnxt_en: refactor cancellation of resource reservations Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 03/19] bnxt_en: implement devlink dev reload driver_reinit Michael Chan
2021-10-29 17:06 ` Leon Romanovsky [this message]
2021-10-29 7:47 ` [PATCH net-next v2 04/19] bnxt_en: implement devlink dev reload fw_activate Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 05/19] bnxt_en: add enable_remote_dev_reset devlink parameter Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 06/19] bnxt_en: improve error recovery information messages Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 07/19] bnxt_en: remove fw_reset devlink health reporter Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 08/19] bnxt_en: consolidate fw devlink health reporters Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 09/19] bnxt_en: improve fw diagnose devlink health messages Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 10/19] bnxt_en: Refactor coredump functions Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 11/19] bnxt_en: move coredump functions into dedicated file Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 12/19] bnxt_en: Add compression flags information in coredump segment header Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 13/19] bnxt_en: Retrieve coredump and crashdump size via FW command Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 14/19] bnxt_en: extract coredump command line from current task Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 15/19] bnxt_en: implement dump callback for fw health reporter Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 16/19] bnxt_en: Update firmware interface to 1.10.2.63 Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 17/19] bnxt_en: implement firmware live patching Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 18/19] bnxt_en: Provide stored devlink "fw" version on older firmware Michael Chan
2021-10-29 7:47 ` [PATCH net-next v2 19/19] bnxt_en: Update bnxt.rst devlink documentation Michael Chan
2021-10-29 11:30 ` [PATCH net-next v2 00/19] bnxt_en: devlink enhancements patchwork-bot+netdevbpf
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=YXwqKCJkDOfvUce8@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=edwin.peer@broadcom.com \
--cc=gospo@broadcom.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.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 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).