[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221201164608.209537-1-jiri@resnulli.us>
Date: Thu, 1 Dec 2022 17:46:01 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, yangyingliang@...wei.com, leon@...nel.org
Subject: [patch net-next RFC 0/7] devlink: make sure devlink port registers/unregisters only for registered instance
From: Jiri Pirko <jiri@...dia.com>
Currently, the devlink_register() is called as the last thing during
driver init phase. For devlink objects, this is fine as the
notifications of objects creations are withheld to be send only after
devlink instance is registered. Until devlink is registered it is not
visible to userspace.
But if a netdev is registered before, user gets a notification with
a link to devlink, which is not visible to the user yet.
This is the event order user sees:
* new netdev event over RT netlink
* new devlink event over devlink netlink
* new devlink_port event over devlink netlink
Also, this is not consistent with devlink port split or devlink reload
flows, where user gets notifications in following order:
* new devlink event over devlink netlink
and then during port split or reload operation:
* new devlink_port event over devlink netlink
* new netdev event over RT netlink
In this case, devlink port and related netdev are registered on already
registered devlink instance.
Purpose of this patchset is to fix the drivers init flow so devlink port
gets registered only after devlink instance is registered.
Jiri Pirko (7):
devlink: Reorder devlink_port_register/unregister() calls to be done
when devlink is registered
netdevsim: Reorder devl_port_register/unregister() calls to be done
when devlink is registered
mlxsw: Reorder devl_port_register/unregister() calls to be done when
devlink is registered
nfp: Reorder devl_port_register/unregister() calls to be done when
devlink is registered
mlx4: Reorder devl_port_register/unregister() calls to be done when
devlink is registered
mlx5: Reorder devl_port_register/unregister() calls to be done when
devlink is registered
devlink: assert if devl_port_register/unregister() is called on
unregistered devlink instance
.../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 29 +++++----
.../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 7 ++-
.../ethernet/fungible/funeth/funeth_main.c | 17 ++++--
drivers/net/ethernet/intel/ice/ice_main.c | 21 ++++---
.../ethernet/marvell/prestera/prestera_main.c | 6 +-
drivers/net/ethernet/mellanox/mlx4/main.c | 60 ++++++++++---------
drivers/net/ethernet/mellanox/mlx5/core/dev.c | 10 +++-
.../net/ethernet/mellanox/mlx5/core/main.c | 17 +++---
.../mellanox/mlx5/core/sf/dev/driver.c | 9 +++
drivers/net/ethernet/mellanox/mlxsw/core.c | 24 ++++++++
drivers/net/ethernet/mellanox/mlxsw/core.h | 2 +
.../net/ethernet/mellanox/mlxsw/spectrum.c | 38 +++++++++---
drivers/net/ethernet/mscc/ocelot_vsc7514.c | 10 ++--
.../net/ethernet/netronome/nfp/nfp_net_main.c | 22 +++++--
.../ethernet/pensando/ionic/ionic_devlink.c | 6 +-
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 7 ++-
drivers/net/netdevsim/dev.c | 31 ++++++++--
net/core/devlink.c | 2 +
18 files changed, 218 insertions(+), 100 deletions(-)
--
2.37.3
Powered by blists - more mailing lists