Skip to content

Commit

Permalink
net: devlink: move port_type_warn_schedule() call to __devlink_port_t…
Browse files Browse the repository at this point in the history
…ype_set()

As __devlink_port_type_set() is going to be called directly from netdevice
notifier event handle in one of the follow-up patches, move the
port_type_warn_schedule() call there.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jiri Pirko authored and Jakub Kicinski committed Nov 4, 2022
1 parent 3830c57 commit 8573a04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/core/devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -10000,7 +10000,11 @@ static void __devlink_port_type_set(struct devlink_port *devlink_port,
{
ASSERT_DEVLINK_PORT_REGISTERED(devlink_port);

devlink_port_type_warn_cancel(devlink_port);
if (type == DEVLINK_PORT_TYPE_NOTSET)
devlink_port_type_warn_schedule(devlink_port);
else
devlink_port_type_warn_cancel(devlink_port);

spin_lock_bh(&devlink_port->type_lock);
devlink_port->type = type;
switch (type) {
Expand Down Expand Up @@ -10095,7 +10099,6 @@ EXPORT_SYMBOL_GPL(devlink_port_type_ib_set);
void devlink_port_type_clear(struct devlink_port *devlink_port)
{
__devlink_port_type_set(devlink_port, DEVLINK_PORT_TYPE_NOTSET, NULL);
devlink_port_type_warn_schedule(devlink_port);
}
EXPORT_SYMBOL_GPL(devlink_port_type_clear);

Expand Down

0 comments on commit 8573a04

Please sign in to comment.