Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[sfrench/cifs-2.6.git] / drivers / net / ethernet / mellanox / mlx5 / core / devlink.h
1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2019, Mellanox Technologies */
3
4 #ifndef __MLX5_DEVLINK_H__
5 #define __MLX5_DEVLINK_H__
6
7 #include <net/devlink.h>
8
9 enum mlx5_devlink_param_id {
10         MLX5_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX,
11         MLX5_DEVLINK_PARAM_ID_FLOW_STEERING_MODE,
12         MLX5_DEVLINK_PARAM_ID_ESW_LARGE_GROUP_NUM,
13 };
14
15 struct mlx5_trap_ctx {
16         int id;
17         int action;
18 };
19
20 struct mlx5_devlink_trap {
21         struct mlx5_trap_ctx trap;
22         void *item;
23         struct list_head list;
24 };
25
26 struct mlx5_core_dev;
27 void mlx5_devlink_trap_report(struct mlx5_core_dev *dev, int trap_id, struct sk_buff *skb,
28                               struct devlink_port *dl_port);
29 int mlx5_devlink_trap_get_num_active(struct mlx5_core_dev *dev);
30 int mlx5_devlink_traps_get_action(struct mlx5_core_dev *dev, int trap_id,
31                                   enum devlink_trap_action *action);
32
33 struct devlink *mlx5_devlink_alloc(void);
34 void mlx5_devlink_free(struct devlink *devlink);
35 int mlx5_devlink_register(struct devlink *devlink, struct device *dev);
36 void mlx5_devlink_unregister(struct devlink *devlink);
37
38 #endif /* __MLX5_DEVLINK_H__ */