#include <linux/kernel.h>
#include <linux/mutex.h>
#include <net/devlink.h>
#include "spectrum.h"
#include "spectrum_dpipe.h"
#include "spectrum_router.h"
enum mlxsw_sp_field_metadata_id { … };
static struct devlink_dpipe_field mlxsw_sp_dpipe_fields_metadata[] = …;
enum mlxsw_sp_dpipe_header_id { … };
static struct devlink_dpipe_header mlxsw_sp_dpipe_header_metadata = …;
static struct devlink_dpipe_header *mlxsw_dpipe_headers[] = …;
static struct devlink_dpipe_headers mlxsw_sp_dpipe_headers = …;
static int mlxsw_sp_dpipe_table_erif_actions_dump(void *priv,
struct sk_buff *skb)
{ … }
static int mlxsw_sp_dpipe_table_erif_matches_dump(void *priv,
struct sk_buff *skb)
{ … }
static void
mlxsw_sp_erif_match_action_prepare(struct devlink_dpipe_match *match,
struct devlink_dpipe_action *action)
{ … }
static int mlxsw_sp_erif_entry_prepare(struct devlink_dpipe_entry *entry,
struct devlink_dpipe_value *match_value,
struct devlink_dpipe_match *match,
struct devlink_dpipe_value *action_value,
struct devlink_dpipe_action *action)
{ … }
static int mlxsw_sp_erif_entry_get(struct mlxsw_sp *mlxsw_sp,
struct devlink_dpipe_entry *entry,
struct mlxsw_sp_rif *rif,
bool counters_enabled)
{ … }
static int
mlxsw_sp_dpipe_table_erif_entries_dump(void *priv, bool counters_enabled,
struct devlink_dpipe_dump_ctx *dump_ctx)
{ … }
static int mlxsw_sp_dpipe_table_erif_counters_update(void *priv, bool enable)
{ … }
static u64 mlxsw_sp_dpipe_table_erif_size_get(void *priv)
{ … }
static const struct devlink_dpipe_table_ops mlxsw_sp_erif_ops = …;
static int mlxsw_sp_dpipe_erif_table_init(struct mlxsw_sp *mlxsw_sp)
{ … }
static void mlxsw_sp_dpipe_erif_table_fini(struct mlxsw_sp *mlxsw_sp)
{ … }
static int mlxsw_sp_dpipe_table_host_matches_dump(struct sk_buff *skb, int type)
{ … }
static int
mlxsw_sp_dpipe_table_host4_matches_dump(void *priv, struct sk_buff *skb)
{ … }
static int
mlxsw_sp_dpipe_table_host_actions_dump(void *priv, struct sk_buff *skb)
{ … }
enum mlxsw_sp_dpipe_table_host_match { … };
static void
mlxsw_sp_dpipe_table_host_match_action_prepare(struct devlink_dpipe_match *matches,
struct devlink_dpipe_action *action,
int type)
{ … }
static int
mlxsw_sp_dpipe_table_host_entry_prepare(struct devlink_dpipe_entry *entry,
struct devlink_dpipe_value *match_values,
struct devlink_dpipe_match *matches,
struct devlink_dpipe_value *action_value,
struct devlink_dpipe_action *action,
int type)
{ … }
static void
__mlxsw_sp_dpipe_table_host_entry_fill(struct devlink_dpipe_entry *entry,
struct mlxsw_sp_rif *rif,
unsigned char *ha, void *dip)
{ … }
static void
mlxsw_sp_dpipe_table_host4_entry_fill(struct devlink_dpipe_entry *entry,
struct mlxsw_sp_neigh_entry *neigh_entry,
struct mlxsw_sp_rif *rif)
{ … }
static void
mlxsw_sp_dpipe_table_host6_entry_fill(struct devlink_dpipe_entry *entry,
struct mlxsw_sp_neigh_entry *neigh_entry,
struct mlxsw_sp_rif *rif)
{ … }
static void
mlxsw_sp_dpipe_table_host_entry_fill(struct mlxsw_sp *mlxsw_sp,
struct devlink_dpipe_entry *entry,
struct mlxsw_sp_neigh_entry *neigh_entry,
struct mlxsw_sp_rif *rif,
int type)
{ … }
static int
mlxsw_sp_dpipe_table_host_entries_get(struct mlxsw_sp *mlxsw_sp,
struct devlink_dpipe_entry *entry,
bool counters_enabled,
struct devlink_dpipe_dump_ctx *dump_ctx,
int type)
{ … }
static int
mlxsw_sp_dpipe_table_host_entries_dump(struct mlxsw_sp *mlxsw_sp,
bool counters_enabled,
struct devlink_dpipe_dump_ctx *dump_ctx,
int type)
{ … }
static int
mlxsw_sp_dpipe_table_host4_entries_dump(void *priv, bool counters_enabled,
struct devlink_dpipe_dump_ctx *dump_ctx)
{ … }
static void
mlxsw_sp_dpipe_table_host_counters_update(struct mlxsw_sp *mlxsw_sp,
bool enable, int type)
{ … }
static int mlxsw_sp_dpipe_table_host4_counters_update(void *priv, bool enable)
{ … }
static u64
mlxsw_sp_dpipe_table_host_size_get(struct mlxsw_sp *mlxsw_sp, int type)
{ … }
static u64 mlxsw_sp_dpipe_table_host4_size_get(void *priv)
{ … }
static const struct devlink_dpipe_table_ops mlxsw_sp_host4_ops = …;
#define MLXSW_SP_DPIPE_TABLE_RESOURCE_UNIT_HOST4 …
static int mlxsw_sp_dpipe_host4_table_init(struct mlxsw_sp *mlxsw_sp)
{ … }
static void mlxsw_sp_dpipe_host4_table_fini(struct mlxsw_sp *mlxsw_sp)
{ … }
static int
mlxsw_sp_dpipe_table_host6_matches_dump(void *priv, struct sk_buff *skb)
{ … }
static int
mlxsw_sp_dpipe_table_host6_entries_dump(void *priv, bool counters_enabled,
struct devlink_dpipe_dump_ctx *dump_ctx)
{ … }
static int mlxsw_sp_dpipe_table_host6_counters_update(void *priv, bool enable)
{ … }
static u64 mlxsw_sp_dpipe_table_host6_size_get(void *priv)
{ … }
static const struct devlink_dpipe_table_ops mlxsw_sp_host6_ops = …;
#define MLXSW_SP_DPIPE_TABLE_RESOURCE_UNIT_HOST6 …
static int mlxsw_sp_dpipe_host6_table_init(struct mlxsw_sp *mlxsw_sp)
{ … }
static void mlxsw_sp_dpipe_host6_table_fini(struct mlxsw_sp *mlxsw_sp)
{ … }
static int mlxsw_sp_dpipe_table_adj_matches_dump(void *priv,
struct sk_buff *skb)
{ … }
static int mlxsw_sp_dpipe_table_adj_actions_dump(void *priv,
struct sk_buff *skb)
{ … }
static u64 mlxsw_sp_dpipe_table_adj_size(struct mlxsw_sp *mlxsw_sp)
{ … }
enum mlxsw_sp_dpipe_table_adj_match { … };
enum mlxsw_sp_dpipe_table_adj_action { … };
static void
mlxsw_sp_dpipe_table_adj_match_action_prepare(struct devlink_dpipe_match *matches,
struct devlink_dpipe_action *actions)
{ … }
static int
mlxsw_sp_dpipe_table_adj_entry_prepare(struct devlink_dpipe_entry *entry,
struct devlink_dpipe_value *match_values,
struct devlink_dpipe_match *matches,
struct devlink_dpipe_value *action_values,
struct devlink_dpipe_action *actions)
{ … }
static void
__mlxsw_sp_dpipe_table_adj_entry_fill(struct devlink_dpipe_entry *entry,
u32 adj_index, u32 adj_size,
u32 adj_hash_index, unsigned char *ha,
struct mlxsw_sp_rif *rif)
{ … }
static void mlxsw_sp_dpipe_table_adj_entry_fill(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nexthop *nh,
struct devlink_dpipe_entry *entry)
{ … }
static int
mlxsw_sp_dpipe_table_adj_entries_get(struct mlxsw_sp *mlxsw_sp,
struct devlink_dpipe_entry *entry,
bool counters_enabled,
struct devlink_dpipe_dump_ctx *dump_ctx)
{ … }
static int
mlxsw_sp_dpipe_table_adj_entries_dump(void *priv, bool counters_enabled,
struct devlink_dpipe_dump_ctx *dump_ctx)
{ … }
static int mlxsw_sp_dpipe_table_adj_counters_update(void *priv, bool enable)
{ … }
static u64
mlxsw_sp_dpipe_table_adj_size_get(void *priv)
{ … }
static const struct devlink_dpipe_table_ops mlxsw_sp_dpipe_table_adj_ops = …;
#define MLXSW_SP_DPIPE_TABLE_RESOURCE_UNIT_ADJ …
static int mlxsw_sp_dpipe_adj_table_init(struct mlxsw_sp *mlxsw_sp)
{ … }
static void mlxsw_sp_dpipe_adj_table_fini(struct mlxsw_sp *mlxsw_sp)
{ … }
int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp)
{ … }
void mlxsw_sp_dpipe_fini(struct mlxsw_sp *mlxsw_sp)
{ … }