[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221205152257.454610-1-jiri@resnulli.us>
Date: Mon, 5 Dec 2022 16:22:49 +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, michael.chan@...adcom.com,
ioana.ciornei@....com, dmichail@...gible.com,
jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com,
tchornyi@...vell.com, tariqt@...dia.com, saeedm@...dia.com,
leon@...nel.org, idosch@...dia.com, petrm@...dia.com,
vladimir.oltean@....com, claudiu.manoil@....com,
alexandre.belloni@...tlin.com, simon.horman@...igine.com,
shannon.nelson@....com, brett.creeley@....com
Subject: [patch net-next 0/8] 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 (8):
devlink: call devlink_port_register/unregister() on registered
instance
netdevsim: call devl_port_register/unregister() on registered instance
mlxsw: call devl_port_register/unregister() on registered instance
nfp: call devl_port_register/unregister() on registered instance
mlx4: call devl_port_register/unregister() on registered instance
mlx5: call devl_port_register/unregister() on registered instance
devlink: assert if devl_port_register/unregister() is called on
unregistered devlink instance
devlink: remove port notifications from devlink_register/unregister()
.../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 | 7 +--
18 files changed, 218 insertions(+), 105 deletions(-)
--
2.37.3
Powered by blists - more mailing lists