Commit a0e4761d authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: core: Queue work immediately instead of delaying it

We always use zero delay before queueing a work on the ordered workqueue
('mlxsw_owq'), so use work_struct directly instead of delayable work.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fcdc103d
...@@ -1901,11 +1901,11 @@ int mlxsw_core_schedule_dw(struct delayed_work *dwork, unsigned long delay) ...@@ -1901,11 +1901,11 @@ int mlxsw_core_schedule_dw(struct delayed_work *dwork, unsigned long delay)
} }
EXPORT_SYMBOL(mlxsw_core_schedule_dw); EXPORT_SYMBOL(mlxsw_core_schedule_dw);
int mlxsw_core_schedule_odw(struct delayed_work *dwork, unsigned long delay) bool mlxsw_core_schedule_work(struct work_struct *work)
{ {
return queue_delayed_work(mlxsw_owq, dwork, delay); return queue_work(mlxsw_owq, work);
} }
EXPORT_SYMBOL(mlxsw_core_schedule_odw); EXPORT_SYMBOL(mlxsw_core_schedule_work);
void mlxsw_core_flush_owq(void) void mlxsw_core_flush_owq(void)
{ {
......
...@@ -207,7 +207,7 @@ enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core, ...@@ -207,7 +207,7 @@ enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core,
u8 local_port); u8 local_port);
int mlxsw_core_schedule_dw(struct delayed_work *dwork, unsigned long delay); int mlxsw_core_schedule_dw(struct delayed_work *dwork, unsigned long delay);
int mlxsw_core_schedule_odw(struct delayed_work *dwork, unsigned long delay); bool mlxsw_core_schedule_work(struct work_struct *work);
void mlxsw_core_flush_owq(void); void mlxsw_core_flush_owq(void);
#define MLXSW_CONFIG_PROFILE_SWID_COUNT 8 #define MLXSW_CONFIG_PROFILE_SWID_COUNT 8
......
...@@ -1964,7 +1964,7 @@ static void __mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp) ...@@ -1964,7 +1964,7 @@ static void __mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp)
} }
struct mlxsw_sp_fib_event_work { struct mlxsw_sp_fib_event_work {
struct delayed_work dw; struct work_struct work;
struct fib_entry_notifier_info fen_info; struct fib_entry_notifier_info fen_info;
struct mlxsw_sp *mlxsw_sp; struct mlxsw_sp *mlxsw_sp;
unsigned long event; unsigned long event;
...@@ -1973,7 +1973,7 @@ struct mlxsw_sp_fib_event_work { ...@@ -1973,7 +1973,7 @@ struct mlxsw_sp_fib_event_work {
static void mlxsw_sp_router_fib_event_work(struct work_struct *work) static void mlxsw_sp_router_fib_event_work(struct work_struct *work)
{ {
struct mlxsw_sp_fib_event_work *fib_work = struct mlxsw_sp_fib_event_work *fib_work =
container_of(work, struct mlxsw_sp_fib_event_work, dw.work); container_of(work, struct mlxsw_sp_fib_event_work, work);
struct mlxsw_sp *mlxsw_sp = fib_work->mlxsw_sp; struct mlxsw_sp *mlxsw_sp = fib_work->mlxsw_sp;
int err; int err;
...@@ -2014,7 +2014,7 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, ...@@ -2014,7 +2014,7 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb,
if (WARN_ON(!fib_work)) if (WARN_ON(!fib_work))
return NOTIFY_BAD; return NOTIFY_BAD;
INIT_DELAYED_WORK(&fib_work->dw, mlxsw_sp_router_fib_event_work); INIT_WORK(&fib_work->work, mlxsw_sp_router_fib_event_work);
fib_work->mlxsw_sp = mlxsw_sp; fib_work->mlxsw_sp = mlxsw_sp;
fib_work->event = event; fib_work->event = event;
...@@ -2029,7 +2029,7 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, ...@@ -2029,7 +2029,7 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb,
break; break;
} }
mlxsw_core_schedule_odw(&fib_work->dw, 0); mlxsw_core_schedule_work(&fib_work->work);
return NOTIFY_DONE; return NOTIFY_DONE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment