Skip to content

Commit

Permalink
net/mlx5: Use own workqueue for lag netdev events processing
Browse files Browse the repository at this point in the history
Instead of using the system workqueue, allocate our own workqueue.
This workqueue will be used to handle more work in the next patch.

This patch doesn't change functionality.

Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Roi Dayan authored and Saeed Mahameed committed Mar 1, 2019
1 parent 10a193e commit e6ee5e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/lag.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ static void mlx5_do_bond(struct mlx5_lag *ldev)

static void mlx5_queue_bond_work(struct mlx5_lag *ldev, unsigned long delay)
{
schedule_delayed_work(&ldev->bond_work, delay);
queue_delayed_work(ldev->wq, &ldev->bond_work, delay);
}

static void mlx5_do_bond_work(struct work_struct *work)
Expand Down Expand Up @@ -498,13 +498,20 @@ static struct mlx5_lag *mlx5_lag_dev_alloc(void)
if (!ldev)
return NULL;

ldev->wq = create_singlethread_workqueue("mlx5_lag");
if (!ldev->wq) {
kfree(ldev);
return NULL;
}

INIT_DELAYED_WORK(&ldev->bond_work, mlx5_do_bond_work);

return ldev;
}

static void mlx5_lag_dev_free(struct mlx5_lag *ldev)
{
destroy_workqueue(ldev->wq);
kfree(ldev);
}

Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/lag.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct mlx5_lag {
u8 v2p_map[MLX5_MAX_PORTS];
struct lag_func pf[MLX5_MAX_PORTS];
struct lag_tracker tracker;
struct workqueue_struct *wq;
struct delayed_work bond_work;
struct notifier_block nb;
};
Expand Down

0 comments on commit e6ee5e7

Please sign in to comment.