[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221003105204.3315337-3-jiri@resnulli.us>
Date: Mon, 3 Oct 2022 12:51:53 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, tariqt@...dia.com, moshe@...dia.com,
saeedm@...dia.com, linux-rdma@...r.kernel.org
Subject: [patch net-next v2 02/13] net: devlink: move port_type_warn_schedule() call to __devlink_port_type_set()
From: Jiri Pirko <jiri@...dia.com>
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@...dia.com>
---
net/core/devlink.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 7e7645ae3d89..218cb1cdb50e 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -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) {
@@ -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);
--
2.37.1
Powered by blists - more mailing lists