#include <linux/err.h>
#include <linux/gfp.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/slab.h>
#include <net/inet_ecn.h>
#include <net/ipv6.h>
#include "reg.h"
#include "spectrum.h"
#include "spectrum_nve.h"
const struct mlxsw_sp_nve_ops *mlxsw_sp1_nve_ops_arr[] = …;
const struct mlxsw_sp_nve_ops *mlxsw_sp2_nve_ops_arr[] = …;
struct mlxsw_sp_nve_mc_entry;
struct mlxsw_sp_nve_mc_record;
struct mlxsw_sp_nve_mc_list;
struct mlxsw_sp_nve_mc_record_ops { … };
struct mlxsw_sp_nve_mc_list_key { … };
struct mlxsw_sp_nve_mc_ipv6_entry { … };
struct mlxsw_sp_nve_mc_entry { … };
struct mlxsw_sp_nve_mc_record { … };
struct mlxsw_sp_nve_mc_list { … };
static const struct rhashtable_params mlxsw_sp_nve_mc_list_ht_params = …;
static int
mlxsw_sp_nve_mc_record_ipv4_entry_add(struct mlxsw_sp_nve_mc_record *mc_record,
struct mlxsw_sp_nve_mc_entry *mc_entry,
const union mlxsw_sp_l3addr *addr)
{ … }
static void
mlxsw_sp_nve_mc_record_ipv4_entry_del(const struct mlxsw_sp_nve_mc_record *mc_record,
const struct mlxsw_sp_nve_mc_entry *mc_entry)
{ … }
static void
mlxsw_sp_nve_mc_record_ipv4_entry_set(const struct mlxsw_sp_nve_mc_record *mc_record,
const struct mlxsw_sp_nve_mc_entry *mc_entry,
char *tnumt_pl, unsigned int entry_index)
{ … }
static bool
mlxsw_sp_nve_mc_record_ipv4_entry_compare(const struct mlxsw_sp_nve_mc_record *mc_record,
const struct mlxsw_sp_nve_mc_entry *mc_entry,
const union mlxsw_sp_l3addr *addr)
{ … }
static const struct mlxsw_sp_nve_mc_record_ops
mlxsw_sp_nve_mc_record_ipv4_ops = …;
static int
mlxsw_sp_nve_mc_record_ipv6_entry_add(struct mlxsw_sp_nve_mc_record *mc_record,
struct mlxsw_sp_nve_mc_entry *mc_entry,
const union mlxsw_sp_l3addr *addr)
{ … }
static void
mlxsw_sp_nve_mc_record_ipv6_entry_del(const struct mlxsw_sp_nve_mc_record *mc_record,
const struct mlxsw_sp_nve_mc_entry *mc_entry)
{ … }
static void
mlxsw_sp_nve_mc_record_ipv6_entry_set(const struct mlxsw_sp_nve_mc_record *mc_record,
const struct mlxsw_sp_nve_mc_entry *mc_entry,
char *tnumt_pl, unsigned int entry_index)
{ … }
static bool
mlxsw_sp_nve_mc_record_ipv6_entry_compare(const struct mlxsw_sp_nve_mc_record *mc_record,
const struct mlxsw_sp_nve_mc_entry *mc_entry,
const union mlxsw_sp_l3addr *addr)
{ … }
static const struct mlxsw_sp_nve_mc_record_ops
mlxsw_sp_nve_mc_record_ipv6_ops = …;
static const struct mlxsw_sp_nve_mc_record_ops *
mlxsw_sp_nve_mc_record_ops_arr[] = …;
int mlxsw_sp_nve_learned_ip_resolve(struct mlxsw_sp *mlxsw_sp, u32 uip,
enum mlxsw_sp_l3proto proto,
union mlxsw_sp_l3addr *addr)
{ … }
static struct mlxsw_sp_nve_mc_list *
mlxsw_sp_nve_mc_list_find(struct mlxsw_sp *mlxsw_sp,
const struct mlxsw_sp_nve_mc_list_key *key)
{ … }
static struct mlxsw_sp_nve_mc_list *
mlxsw_sp_nve_mc_list_create(struct mlxsw_sp *mlxsw_sp,
const struct mlxsw_sp_nve_mc_list_key *key)
{ … }
static void mlxsw_sp_nve_mc_list_destroy(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nve_mc_list *mc_list)
{ … }
static struct mlxsw_sp_nve_mc_list *
mlxsw_sp_nve_mc_list_get(struct mlxsw_sp *mlxsw_sp,
const struct mlxsw_sp_nve_mc_list_key *key)
{ … }
static void
mlxsw_sp_nve_mc_list_put(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nve_mc_list *mc_list)
{ … }
static struct mlxsw_sp_nve_mc_record *
mlxsw_sp_nve_mc_record_create(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nve_mc_list *mc_list,
enum mlxsw_sp_l3proto proto)
{ … }
static void
mlxsw_sp_nve_mc_record_destroy(struct mlxsw_sp_nve_mc_record *mc_record)
{ … }
static struct mlxsw_sp_nve_mc_record *
mlxsw_sp_nve_mc_record_get(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nve_mc_list *mc_list,
enum mlxsw_sp_l3proto proto)
{ … }
static void
mlxsw_sp_nve_mc_record_put(struct mlxsw_sp_nve_mc_record *mc_record)
{ … }
static struct mlxsw_sp_nve_mc_entry *
mlxsw_sp_nve_mc_free_entry_find(struct mlxsw_sp_nve_mc_record *mc_record)
{ … }
static int
mlxsw_sp_nve_mc_record_refresh(struct mlxsw_sp_nve_mc_record *mc_record)
{ … }
static bool
mlxsw_sp_nve_mc_record_is_first(struct mlxsw_sp_nve_mc_record *mc_record)
{ … }
static struct mlxsw_sp_nve_mc_entry *
mlxsw_sp_nve_mc_entry_find(struct mlxsw_sp_nve_mc_record *mc_record,
union mlxsw_sp_l3addr *addr)
{ … }
static int
mlxsw_sp_nve_mc_record_ip_add(struct mlxsw_sp_nve_mc_record *mc_record,
union mlxsw_sp_l3addr *addr)
{ … }
static void
mlxsw_sp_nve_mc_record_entry_del(struct mlxsw_sp_nve_mc_record *mc_record,
struct mlxsw_sp_nve_mc_entry *mc_entry)
{ … }
static struct mlxsw_sp_nve_mc_record *
mlxsw_sp_nve_mc_record_find(struct mlxsw_sp_nve_mc_list *mc_list,
enum mlxsw_sp_l3proto proto,
union mlxsw_sp_l3addr *addr,
struct mlxsw_sp_nve_mc_entry **mc_entry)
{ … }
static int mlxsw_sp_nve_mc_list_ip_add(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nve_mc_list *mc_list,
enum mlxsw_sp_l3proto proto,
union mlxsw_sp_l3addr *addr)
{ … }
static void mlxsw_sp_nve_mc_list_ip_del(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nve_mc_list *mc_list,
enum mlxsw_sp_l3proto proto,
union mlxsw_sp_l3addr *addr)
{ … }
static int
mlxsw_sp_nve_fid_flood_index_set(struct mlxsw_sp_fid *fid,
struct mlxsw_sp_nve_mc_list *mc_list)
{ … }
static void
mlxsw_sp_nve_fid_flood_index_clear(struct mlxsw_sp_fid *fid,
struct mlxsw_sp_nve_mc_list *mc_list)
{ … }
int mlxsw_sp_nve_flood_ip_add(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_fid *fid,
enum mlxsw_sp_l3proto proto,
union mlxsw_sp_l3addr *addr)
{ … }
void mlxsw_sp_nve_flood_ip_del(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_fid *fid,
enum mlxsw_sp_l3proto proto,
union mlxsw_sp_l3addr *addr)
{ … }
static void
mlxsw_sp_nve_mc_record_delete(struct mlxsw_sp_nve_mc_record *mc_record)
{ … }
static void mlxsw_sp_nve_flood_ip_flush(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_fid *fid)
{ … }
static int mlxsw_sp_nve_tunnel_init(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nve_config *config)
{ … }
static void mlxsw_sp_nve_tunnel_fini(struct mlxsw_sp *mlxsw_sp)
{ … }
static void mlxsw_sp_nve_fdb_flush_by_fid(struct mlxsw_sp *mlxsw_sp,
u16 fid_index)
{ … }
static void mlxsw_sp_nve_fdb_clear_offload(struct mlxsw_sp *mlxsw_sp,
const struct mlxsw_sp_fid *fid,
const struct net_device *nve_dev,
__be32 vni)
{ … }
struct mlxsw_sp_nve_ipv6_ht_key { … };
struct mlxsw_sp_nve_ipv6_ht_node { … };
static const struct rhashtable_params mlxsw_sp_nve_ipv6_ht_params = …;
int mlxsw_sp_nve_ipv6_addr_kvdl_set(struct mlxsw_sp *mlxsw_sp,
const struct in6_addr *addr6,
u32 *p_kvdl_index)
{ … }
void mlxsw_sp_nve_ipv6_addr_kvdl_unset(struct mlxsw_sp *mlxsw_sp,
const struct in6_addr *addr6)
{ … }
static struct mlxsw_sp_nve_ipv6_ht_node *
mlxsw_sp_nve_ipv6_ht_node_lookup(struct mlxsw_sp *mlxsw_sp, const char *mac,
u16 fid_index)
{ … }
static int mlxsw_sp_nve_ipv6_ht_insert(struct mlxsw_sp *mlxsw_sp,
const char *mac, u16 fid_index,
const struct in6_addr *addr6)
{ … }
static void
mlxsw_sp_nve_ipv6_ht_remove(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nve_ipv6_ht_node *ipv6_ht_node)
{ … }
int
mlxsw_sp_nve_ipv6_addr_map_replace(struct mlxsw_sp *mlxsw_sp, const char *mac,
u16 fid_index,
const struct in6_addr *new_addr6)
{ … }
void mlxsw_sp_nve_ipv6_addr_map_del(struct mlxsw_sp *mlxsw_sp, const char *mac,
u16 fid_index)
{ … }
static void mlxsw_sp_nve_ipv6_addr_flush_by_fid(struct mlxsw_sp *mlxsw_sp,
u16 fid_index)
{ … }
int mlxsw_sp_nve_fid_enable(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid *fid,
struct mlxsw_sp_nve_params *params,
struct netlink_ext_ack *extack)
{ … }
void mlxsw_sp_nve_fid_disable(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_fid *fid)
{ … }
int mlxsw_sp_port_nve_init(struct mlxsw_sp_port *mlxsw_sp_port)
{ … }
void mlxsw_sp_port_nve_fini(struct mlxsw_sp_port *mlxsw_sp_port)
{ … }
static int mlxsw_sp_nve_qos_init(struct mlxsw_sp *mlxsw_sp)
{ … }
static int mlxsw_sp_nve_ecn_encap_init(struct mlxsw_sp *mlxsw_sp)
{ … }
static int __mlxsw_sp_nve_ecn_decap_init(struct mlxsw_sp *mlxsw_sp,
u8 inner_ecn, u8 outer_ecn)
{ … }
static int mlxsw_sp_nve_ecn_decap_init(struct mlxsw_sp *mlxsw_sp)
{ … }
static int mlxsw_sp_nve_ecn_init(struct mlxsw_sp *mlxsw_sp)
{ … }
static int mlxsw_sp_nve_resources_query(struct mlxsw_sp *mlxsw_sp)
{ … }
int mlxsw_sp_nve_init(struct mlxsw_sp *mlxsw_sp)
{ … }
void mlxsw_sp_nve_fini(struct mlxsw_sp *mlxsw_sp)
{ … }