Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
39 lines
1.1 KiB
C
39 lines
1.1 KiB
C
/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
|
|
/* Copyright (c) 2020 Mellanox Technologies. All rights reserved */
|
|
|
|
#ifndef _MLXSW_SPECTRUM_TRAP_H
|
|
#define _MLXSW_SPECTRUM_TRAP_H
|
|
|
|
#include <linux/list.h>
|
|
#include <net/devlink.h>
|
|
|
|
struct mlxsw_sp_trap {
|
|
struct mlxsw_sp_trap_policer_item *policer_items_arr;
|
|
size_t policers_count; /* Number of registered policers */
|
|
|
|
struct mlxsw_sp_trap_group_item *group_items_arr;
|
|
size_t groups_count; /* Number of registered groups */
|
|
|
|
struct mlxsw_sp_trap_item *trap_items_arr;
|
|
size_t traps_count; /* Number of registered traps */
|
|
|
|
u16 thin_policer_hw_id;
|
|
|
|
u64 max_policers;
|
|
unsigned long policers_usage[]; /* Usage bitmap */
|
|
};
|
|
|
|
struct mlxsw_sp_trap_ops {
|
|
int (*groups_init)(struct mlxsw_sp *mlxsw_sp,
|
|
const struct mlxsw_sp_trap_group_item **arr,
|
|
size_t *p_groups_count);
|
|
int (*traps_init)(struct mlxsw_sp *mlxsw_sp,
|
|
const struct mlxsw_sp_trap_item **arr,
|
|
size_t *p_traps_count);
|
|
};
|
|
|
|
extern const struct mlxsw_sp_trap_ops mlxsw_sp1_trap_ops;
|
|
extern const struct mlxsw_sp_trap_ops mlxsw_sp2_trap_ops;
|
|
|
|
#endif
|