#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/skbuff.h>
#include <linux/if_vlan.h>
#include <linux/if_bridge.h>
#include <linux/workqueue.h>
#include <linux/jiffies.h>
#include <linux/rtnetlink.h>
#include <linux/netlink.h>
#include <net/switchdev.h>
#include <net/vxlan.h>
#include "spectrum_span.h"
#include "spectrum_switchdev.h"
#include "spectrum.h"
#include "core.h"
#include "reg.h"
struct mlxsw_sp_bridge_ops;
struct mlxsw_sp_bridge { … };
struct mlxsw_sp_bridge_device { … };
struct mlxsw_sp_bridge_port { … };
struct mlxsw_sp_bridge_vlan { … };
struct mlxsw_sp_bridge_ops { … };
struct mlxsw_sp_switchdev_ops { … };
struct mlxsw_sp_mdb_entry_key { … };
struct mlxsw_sp_mdb_entry { … };
struct mlxsw_sp_mdb_entry_port { … };
static const struct rhashtable_params mlxsw_sp_mdb_ht_params = …;
static int
mlxsw_sp_bridge_port_fdb_flush(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_port *bridge_port,
u16 fid_index);
static void
mlxsw_sp_bridge_port_mdb_flush(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_port *bridge_port,
u16 fid_index);
static int
mlxsw_sp_bridge_mdb_mc_enable_sync(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_device
*bridge_device, bool mc_enabled);
static void
mlxsw_sp_port_mrouter_update_mdb(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_port *bridge_port,
bool add);
static struct mlxsw_sp_bridge_device *
mlxsw_sp_bridge_device_find(const struct mlxsw_sp_bridge *bridge,
const struct net_device *br_dev)
{ … }
bool mlxsw_sp_bridge_device_is_offloaded(const struct mlxsw_sp *mlxsw_sp,
const struct net_device *br_dev)
{ … }
static int mlxsw_sp_bridge_device_upper_rif_destroy(struct net_device *dev,
struct netdev_nested_priv *priv)
{ … }
static void mlxsw_sp_bridge_device_rifs_destroy(struct mlxsw_sp *mlxsw_sp,
struct net_device *dev)
{ … }
static int mlxsw_sp_bridge_device_vxlan_init(struct mlxsw_sp_bridge *bridge,
struct net_device *br_dev,
struct netlink_ext_ack *extack)
{ … }
static void mlxsw_sp_bridge_device_vxlan_fini(struct mlxsw_sp_bridge *bridge,
struct net_device *br_dev)
{ … }
static void mlxsw_sp_fdb_notify_work_schedule(struct mlxsw_sp *mlxsw_sp,
bool no_delay)
{ … }
static struct mlxsw_sp_bridge_device *
mlxsw_sp_bridge_device_create(struct mlxsw_sp_bridge *bridge,
struct net_device *br_dev,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp_bridge_device_destroy(struct mlxsw_sp_bridge *bridge,
struct mlxsw_sp_bridge_device *bridge_device)
{ … }
static struct mlxsw_sp_bridge_device *
mlxsw_sp_bridge_device_get(struct mlxsw_sp_bridge *bridge,
struct net_device *br_dev,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp_bridge_device_put(struct mlxsw_sp_bridge *bridge,
struct mlxsw_sp_bridge_device *bridge_device)
{ … }
static struct mlxsw_sp_bridge_port *
__mlxsw_sp_bridge_port_find(const struct mlxsw_sp_bridge_device *bridge_device,
const struct net_device *brport_dev)
{ … }
struct mlxsw_sp_bridge_port *
mlxsw_sp_bridge_port_find(struct mlxsw_sp_bridge *bridge,
struct net_device *brport_dev)
{ … }
static int mlxsw_sp_port_obj_add(struct net_device *dev, const void *ctx,
const struct switchdev_obj *obj,
struct netlink_ext_ack *extack);
static int mlxsw_sp_port_obj_del(struct net_device *dev, const void *ctx,
const struct switchdev_obj *obj);
struct mlxsw_sp_bridge_port_replay_switchdev_objs { … };
static int
mlxsw_sp_bridge_port_replay_switchdev_objs(struct notifier_block *nb,
unsigned long event, void *ptr)
{ … }
static struct notifier_block mlxsw_sp_bridge_port_replay_switchdev_objs_nb = …;
static int
mlxsw_sp_bridge_port_unreplay_switchdev_objs(struct notifier_block *nb,
unsigned long event, void *ptr)
{ … }
static struct notifier_block mlxsw_sp_bridge_port_unreplay_switchdev_objs_nb = …;
static struct mlxsw_sp_bridge_port *
mlxsw_sp_bridge_port_create(struct mlxsw_sp_bridge_device *bridge_device,
struct net_device *brport_dev,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp_bridge_port_destroy(struct mlxsw_sp_bridge_port *bridge_port)
{ … }
static struct mlxsw_sp_bridge_port *
mlxsw_sp_bridge_port_get(struct mlxsw_sp_bridge *bridge,
struct net_device *brport_dev,
struct netlink_ext_ack *extack)
{ … }
static void mlxsw_sp_bridge_port_put(struct mlxsw_sp_bridge *bridge,
struct mlxsw_sp_bridge_port *bridge_port)
{ … }
static struct mlxsw_sp_port_vlan *
mlxsw_sp_port_vlan_find_by_bridge(struct mlxsw_sp_port *mlxsw_sp_port,
const struct mlxsw_sp_bridge_device *
bridge_device,
u16 vid)
{ … }
static struct mlxsw_sp_port_vlan*
mlxsw_sp_port_vlan_find_by_fid(struct mlxsw_sp_port *mlxsw_sp_port,
u16 fid_index)
{ … }
static struct mlxsw_sp_bridge_vlan *
mlxsw_sp_bridge_vlan_find(const struct mlxsw_sp_bridge_port *bridge_port,
u16 vid)
{ … }
static struct mlxsw_sp_bridge_vlan *
mlxsw_sp_bridge_vlan_create(struct mlxsw_sp_bridge_port *bridge_port, u16 vid)
{ … }
static void
mlxsw_sp_bridge_vlan_destroy(struct mlxsw_sp_bridge_vlan *bridge_vlan)
{ … }
static struct mlxsw_sp_bridge_vlan *
mlxsw_sp_bridge_vlan_get(struct mlxsw_sp_bridge_port *bridge_port, u16 vid)
{ … }
static void mlxsw_sp_bridge_vlan_put(struct mlxsw_sp_bridge_vlan *bridge_vlan)
{ … }
static int
mlxsw_sp_port_bridge_vlan_stp_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_vlan *bridge_vlan,
u8 state)
{ … }
static int mlxsw_sp_port_attr_stp_state_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *orig_dev,
u8 state)
{ … }
static int
mlxsw_sp_port_bridge_vlan_flood_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_vlan *bridge_vlan,
enum mlxsw_sp_flood_type packet_type,
bool member)
{ … }
static int
mlxsw_sp_bridge_port_flood_table_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_port *bridge_port,
enum mlxsw_sp_flood_type packet_type,
bool member)
{ … }
static int
mlxsw_sp_bridge_vlans_flood_set(struct mlxsw_sp_bridge_vlan *bridge_vlan,
enum mlxsw_sp_flood_type packet_type,
bool member)
{ … }
static int
mlxsw_sp_bridge_ports_flood_table_set(struct mlxsw_sp_bridge_port *bridge_port,
enum mlxsw_sp_flood_type packet_type,
bool member)
{ … }
static int
mlxsw_sp_port_bridge_vlan_learning_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_vlan *bridge_vlan,
bool set)
{ … }
static int
mlxsw_sp_bridge_port_learning_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_port *bridge_port,
bool set)
{ … }
static int
mlxsw_sp_port_attr_br_pre_flags_set(struct mlxsw_sp_port *mlxsw_sp_port,
const struct net_device *orig_dev,
struct switchdev_brport_flags flags,
struct netlink_ext_ack *extack)
{ … }
static int mlxsw_sp_port_attr_br_flags_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *orig_dev,
struct switchdev_brport_flags flags)
{ … }
static int mlxsw_sp_ageing_set(struct mlxsw_sp *mlxsw_sp, u32 ageing_time)
{ … }
static int mlxsw_sp_port_attr_br_ageing_set(struct mlxsw_sp_port *mlxsw_sp_port,
unsigned long ageing_clock_t)
{ … }
static int mlxsw_sp_port_attr_br_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *orig_dev,
bool vlan_enabled)
{ … }
static int mlxsw_sp_port_attr_br_vlan_proto_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *orig_dev,
u16 vlan_proto)
{ … }
static int mlxsw_sp_port_attr_mrouter_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *orig_dev,
bool is_port_mrouter)
{ … }
static bool mlxsw_sp_mc_flood(const struct mlxsw_sp_bridge_port *bridge_port)
{ … }
static int mlxsw_sp_port_mc_disabled_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *orig_dev,
bool mc_disabled)
{ … }
static struct mlxsw_sp_mdb_entry_port *
mlxsw_sp_mdb_entry_port_lookup(struct mlxsw_sp_mdb_entry *mdb_entry,
u16 local_port)
{ … }
static struct mlxsw_sp_mdb_entry_port *
mlxsw_sp_mdb_entry_port_get(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_mdb_entry *mdb_entry,
u16 local_port)
{ … }
static void
mlxsw_sp_mdb_entry_port_put(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_mdb_entry *mdb_entry,
u16 local_port, bool force)
{ … }
static __always_unused struct mlxsw_sp_mdb_entry_port *
mlxsw_sp_mdb_entry_mrouter_port_get(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_mdb_entry *mdb_entry,
u16 local_port)
{ … }
static __always_unused void
mlxsw_sp_mdb_entry_mrouter_port_put(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_mdb_entry *mdb_entry,
u16 local_port)
{ … }
static void
mlxsw_sp_bridge_mrouter_update_mdb(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_device *bridge_device,
bool add)
{ … }
static int
mlxsw_sp_port_attr_br_mrouter_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *orig_dev,
bool is_mrouter)
{ … }
static int mlxsw_sp_port_attr_set(struct net_device *dev, const void *ctx,
const struct switchdev_attr *attr,
struct netlink_ext_ack *extack)
{ … }
static int
mlxsw_sp_port_vlan_fid_join(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan,
struct mlxsw_sp_bridge_port *bridge_port,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp_port_vlan_fid_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan)
{ … }
static u16
mlxsw_sp_port_pvid_determine(const struct mlxsw_sp_port *mlxsw_sp_port,
u16 vid, bool is_pvid)
{ … }
static int
mlxsw_sp_port_vlan_bridge_join(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan,
struct mlxsw_sp_bridge_port *bridge_port,
struct netlink_ext_ack *extack)
{ … }
void
mlxsw_sp_port_vlan_bridge_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan)
{ … }
static int
mlxsw_sp_bridge_port_vlan_add(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_port *bridge_port,
u16 vid, bool is_untagged, bool is_pvid,
struct netlink_ext_ack *extack)
{ … }
static int
mlxsw_sp_br_rif_pvid_change(struct mlxsw_sp *mlxsw_sp,
struct net_device *br_dev,
const struct switchdev_obj_port_vlan *vlan,
struct netlink_ext_ack *extack)
{ … }
static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port,
const struct switchdev_obj_port_vlan *vlan,
struct netlink_ext_ack *extack)
{ … }
static enum mlxsw_reg_sfdf_flush_type mlxsw_sp_fdb_flush_type(bool lagged)
{ … }
static int
mlxsw_sp_bridge_port_fdb_flush(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_port *bridge_port,
u16 fid_index)
{ … }
static enum mlxsw_reg_sfd_rec_policy mlxsw_sp_sfd_rec_policy(bool dynamic)
{ … }
static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding)
{ … }
static int
mlxsw_sp_port_fdb_tun_uc_op4(struct mlxsw_sp *mlxsw_sp, bool dynamic,
const char *mac, u16 fid, __be32 addr, bool adding)
{ … }
static int mlxsw_sp_port_fdb_tun_uc_op6_sfd_write(struct mlxsw_sp *mlxsw_sp,
const char *mac, u16 fid,
u32 kvdl_index, bool adding)
{ … }
static int mlxsw_sp_port_fdb_tun_uc_op6_add(struct mlxsw_sp *mlxsw_sp,
const char *mac, u16 fid,
const struct in6_addr *addr)
{ … }
static void mlxsw_sp_port_fdb_tun_uc_op6_del(struct mlxsw_sp *mlxsw_sp,
const char *mac, u16 fid,
const struct in6_addr *addr)
{ … }
static int
mlxsw_sp_port_fdb_tun_uc_op6(struct mlxsw_sp *mlxsw_sp, const char *mac,
u16 fid, const struct in6_addr *addr, bool adding)
{ … }
static int mlxsw_sp_port_fdb_tunnel_uc_op(struct mlxsw_sp *mlxsw_sp,
const char *mac, u16 fid,
enum mlxsw_sp_l3proto proto,
const union mlxsw_sp_l3addr *addr,
bool adding, bool dynamic)
{ … }
static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u16 local_port,
const char *mac, u16 fid, u16 vid,
bool adding,
enum mlxsw_reg_sfd_rec_action action,
enum mlxsw_reg_sfd_rec_policy policy)
{ … }
static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u16 local_port,
const char *mac, u16 fid, u16 vid,
bool adding, bool dynamic)
{ … }
int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid,
bool adding)
{ … }
static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id,
const char *mac, u16 fid, u16 lag_vid,
bool adding, bool dynamic)
{ … }
static int
mlxsw_sp_port_fdb_set(struct mlxsw_sp_port *mlxsw_sp_port,
struct switchdev_notifier_fdb_info *fdb_info, bool adding)
{ … }
static int mlxsw_sp_mdb_entry_write(struct mlxsw_sp *mlxsw_sp,
const struct mlxsw_sp_mdb_entry *mdb_entry,
bool adding)
{ … }
static void
mlxsw_sp_bridge_port_get_ports_bitmap(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_ports_bitmap *ports_bm)
{ … }
static void
mlxsw_sp_mc_get_mrouters_bitmap(struct mlxsw_sp_ports_bitmap *flood_bm,
struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp *mlxsw_sp)
{ … }
static int mlxsw_sp_mc_mdb_mrouters_add(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_ports_bitmap *ports_bm,
struct mlxsw_sp_mdb_entry *mdb_entry)
{ … }
static void mlxsw_sp_mc_mdb_mrouters_del(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_ports_bitmap *ports_bm,
struct mlxsw_sp_mdb_entry *mdb_entry)
{ … }
static int
mlxsw_sp_mc_mdb_mrouters_set(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_mdb_entry *mdb_entry, bool add)
{ … }
static struct mlxsw_sp_mdb_entry *
mlxsw_sp_mc_mdb_entry_init(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_device *bridge_device,
const unsigned char *addr, u16 fid, u16 local_port)
{ … }
static void
mlxsw_sp_mc_mdb_entry_fini(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_mdb_entry *mdb_entry,
struct mlxsw_sp_bridge_device *bridge_device,
u16 local_port, bool force)
{ … }
static struct mlxsw_sp_mdb_entry *
mlxsw_sp_mc_mdb_entry_get(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_device *bridge_device,
const unsigned char *addr, u16 fid, u16 local_port)
{ … }
static bool
mlxsw_sp_mc_mdb_entry_remove(struct mlxsw_sp_mdb_entry *mdb_entry,
struct mlxsw_sp_mdb_entry_port *removed_entry_port,
bool force)
{ … }
static void
mlxsw_sp_mc_mdb_entry_put(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_mdb_entry *mdb_entry, u16 local_port,
bool force)
{ … }
static int mlxsw_sp_port_mdb_add(struct mlxsw_sp_port *mlxsw_sp_port,
const struct switchdev_obj_port_mdb *mdb)
{ … }
static int
mlxsw_sp_bridge_mdb_mc_enable_sync(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_device *bridge_device,
bool mc_enabled)
{ … }
static void
mlxsw_sp_port_mrouter_update_mdb(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_port *bridge_port,
bool add)
{ … }
static int mlxsw_sp_port_obj_add(struct net_device *dev, const void *ctx,
const struct switchdev_obj *obj,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp_bridge_port_vlan_del(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_port *bridge_port, u16 vid)
{ … }
static int mlxsw_sp_port_vlans_del(struct mlxsw_sp_port *mlxsw_sp_port,
const struct switchdev_obj_port_vlan *vlan)
{ … }
static int mlxsw_sp_port_mdb_del(struct mlxsw_sp_port *mlxsw_sp_port,
const struct switchdev_obj_port_mdb *mdb)
{ … }
static void
mlxsw_sp_bridge_port_mdb_flush(struct mlxsw_sp_port *mlxsw_sp_port,
struct mlxsw_sp_bridge_port *bridge_port,
u16 fid_index)
{ … }
static int mlxsw_sp_port_obj_del(struct net_device *dev, const void *ctx,
const struct switchdev_obj *obj)
{ … }
static struct mlxsw_sp_port *mlxsw_sp_lag_rep_port(struct mlxsw_sp *mlxsw_sp,
u16 lag_id)
{ … }
static int
mlxsw_sp_bridge_port_replay(struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port,
struct netlink_ext_ack *extack)
{ … }
static int
mlxsw_sp_bridge_vlan_aware_port_join(struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port,
struct netlink_ext_ack *extack)
{ … }
static int
mlxsw_sp_bridge_8021q_port_join(struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp_bridge_vlan_aware_port_leave(struct mlxsw_sp_port *mlxsw_sp_port)
{ … }
static void
mlxsw_sp_bridge_8021q_port_leave(struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port)
{ … }
static int
mlxsw_sp_bridge_vlan_aware_vxlan_join(struct mlxsw_sp_bridge_device *bridge_device,
const struct net_device *vxlan_dev,
u16 vid, u16 ethertype,
struct netlink_ext_ack *extack)
{ … }
static int
mlxsw_sp_bridge_8021q_vxlan_join(struct mlxsw_sp_bridge_device *bridge_device,
const struct net_device *vxlan_dev, u16 vid,
struct netlink_ext_ack *extack)
{ … }
static struct net_device *
mlxsw_sp_bridge_8021q_vxlan_dev_find(struct net_device *br_dev, u16 vid)
{ … }
static struct mlxsw_sp_fid *
mlxsw_sp_bridge_8021q_fid_get(struct mlxsw_sp_bridge_device *bridge_device,
u16 vid, struct netlink_ext_ack *extack)
{ … }
static struct mlxsw_sp_fid *
mlxsw_sp_bridge_8021q_fid_lookup(struct mlxsw_sp_bridge_device *bridge_device,
u16 vid)
{ … }
static u16
mlxsw_sp_bridge_8021q_fid_vid(struct mlxsw_sp_bridge_device *bridge_device,
const struct mlxsw_sp_fid *fid)
{ … }
static const struct mlxsw_sp_bridge_ops mlxsw_sp_bridge_8021q_ops = …;
static bool
mlxsw_sp_port_is_br_member(const struct mlxsw_sp_port *mlxsw_sp_port,
const struct net_device *br_dev)
{ … }
static int
mlxsw_sp_bridge_8021d_port_join(struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp_bridge_8021d_port_leave(struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port)
{ … }
static int
mlxsw_sp_bridge_8021d_vxlan_join(struct mlxsw_sp_bridge_device *bridge_device,
const struct net_device *vxlan_dev, u16 vid,
struct netlink_ext_ack *extack)
{ … }
static struct mlxsw_sp_fid *
mlxsw_sp_bridge_8021d_fid_get(struct mlxsw_sp_bridge_device *bridge_device,
u16 vid, struct netlink_ext_ack *extack)
{ … }
static struct mlxsw_sp_fid *
mlxsw_sp_bridge_8021d_fid_lookup(struct mlxsw_sp_bridge_device *bridge_device,
u16 vid)
{ … }
static u16
mlxsw_sp_bridge_8021d_fid_vid(struct mlxsw_sp_bridge_device *bridge_device,
const struct mlxsw_sp_fid *fid)
{ … }
static const struct mlxsw_sp_bridge_ops mlxsw_sp_bridge_8021d_ops = …;
static int
mlxsw_sp_bridge_8021ad_port_join(struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp_bridge_8021ad_port_leave(struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port)
{ … }
static int
mlxsw_sp_bridge_8021ad_vxlan_join(struct mlxsw_sp_bridge_device *bridge_device,
const struct net_device *vxlan_dev, u16 vid,
struct netlink_ext_ack *extack)
{ … }
static const struct mlxsw_sp_bridge_ops mlxsw_sp1_bridge_8021ad_ops = …;
static int
mlxsw_sp2_bridge_8021ad_port_join(struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp2_bridge_8021ad_port_leave(struct mlxsw_sp_bridge_device *bridge_device,
struct mlxsw_sp_bridge_port *bridge_port,
struct mlxsw_sp_port *mlxsw_sp_port)
{ … }
static const struct mlxsw_sp_bridge_ops mlxsw_sp2_bridge_8021ad_ops = …;
int mlxsw_sp_port_bridge_join(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *brport_dev,
struct net_device *br_dev,
struct netlink_ext_ack *extack)
{ … }
void mlxsw_sp_port_bridge_leave(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *brport_dev,
struct net_device *br_dev)
{ … }
int mlxsw_sp_bridge_vxlan_join(struct mlxsw_sp *mlxsw_sp,
const struct net_device *br_dev,
const struct net_device *vxlan_dev, u16 vid,
struct netlink_ext_ack *extack)
{ … }
void mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp,
const struct net_device *vxlan_dev)
{ … }
static void
mlxsw_sp_switchdev_vxlan_addr_convert(const union vxlan_addr *vxlan_addr,
enum mlxsw_sp_l3proto *proto,
union mlxsw_sp_l3addr *addr)
{ … }
static void
mlxsw_sp_switchdev_addr_vxlan_convert(enum mlxsw_sp_l3proto proto,
const union mlxsw_sp_l3addr *addr,
union vxlan_addr *vxlan_addr)
{ … }
static void mlxsw_sp_fdb_vxlan_call_notifiers(struct net_device *dev,
const char *mac,
enum mlxsw_sp_l3proto proto,
union mlxsw_sp_l3addr *addr,
__be32 vni, bool adding)
{ … }
static void mlxsw_sp_fdb_nve_call_notifiers(struct net_device *dev,
const char *mac,
enum mlxsw_sp_l3proto proto,
union mlxsw_sp_l3addr *addr,
__be32 vni,
bool adding)
{ … }
static void
mlxsw_sp_fdb_call_notifiers(enum switchdev_notifier_type type,
const char *mac, u16 vid,
struct net_device *dev, bool offloaded, bool locked)
{ … }
static void mlxsw_sp_fdb_notify_mac_process(struct mlxsw_sp *mlxsw_sp,
char *sfn_pl, int rec_index,
bool adding)
{ … }
static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp,
char *sfn_pl, int rec_index,
bool adding)
{ … }
static int
__mlxsw_sp_fdb_notify_mac_uc_tunnel_process(struct mlxsw_sp *mlxsw_sp,
const struct mlxsw_sp_fid *fid,
bool adding,
struct net_device **nve_dev,
u16 *p_vid, __be32 *p_vni)
{ … }
static void mlxsw_sp_fdb_notify_mac_uc_tunnel_process(struct mlxsw_sp *mlxsw_sp,
char *sfn_pl,
int rec_index,
bool adding)
{ … }
static void mlxsw_sp_fdb_notify_rec_process(struct mlxsw_sp *mlxsw_sp,
char *sfn_pl, int rec_index)
{ … }
#define MLXSW_SP_FDB_SFN_QUERIES_PER_SESSION …
static void mlxsw_sp_fdb_notify_work(struct work_struct *work)
{ … }
struct mlxsw_sp_switchdev_event_work { … };
static void
mlxsw_sp_switchdev_bridge_vxlan_fdb_event(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_switchdev_event_work *
switchdev_work,
struct mlxsw_sp_fid *fid, __be32 vni)
{ … }
static void
mlxsw_sp_switchdev_bridge_nve_fdb_event(struct mlxsw_sp_switchdev_event_work *
switchdev_work)
{ … }
static void mlxsw_sp_switchdev_bridge_fdb_event_work(struct work_struct *work)
{ … }
static void
mlxsw_sp_switchdev_vxlan_fdb_add(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_switchdev_event_work *
switchdev_work)
{ … }
static void
mlxsw_sp_switchdev_vxlan_fdb_del(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_switchdev_event_work *
switchdev_work)
{ … }
static void mlxsw_sp_switchdev_vxlan_fdb_event_work(struct work_struct *work)
{ … }
static int
mlxsw_sp_switchdev_vxlan_work_prepare(struct mlxsw_sp_switchdev_event_work *
switchdev_work,
struct switchdev_notifier_info *info)
{ … }
static int mlxsw_sp_switchdev_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{ … }
struct notifier_block mlxsw_sp_switchdev_notifier = …;
static int
mlxsw_sp_switchdev_vxlan_vlan_add(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_device *bridge_device,
const struct net_device *vxlan_dev, u16 vid,
bool flag_untagged, bool flag_pvid,
struct netlink_ext_ack *extack)
{ … }
static void
mlxsw_sp_switchdev_vxlan_vlan_del(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_bridge_device *bridge_device,
const struct net_device *vxlan_dev, u16 vid)
{ … }
static int
mlxsw_sp_switchdev_vxlan_vlans_add(struct net_device *vxlan_dev,
struct switchdev_notifier_port_obj_info *
port_obj_info)
{ … }
static void
mlxsw_sp_switchdev_vxlan_vlans_del(struct net_device *vxlan_dev,
struct switchdev_notifier_port_obj_info *
port_obj_info)
{ … }
static int
mlxsw_sp_switchdev_handle_vxlan_obj_add(struct net_device *vxlan_dev,
struct switchdev_notifier_port_obj_info *
port_obj_info)
{ … }
static void
mlxsw_sp_switchdev_handle_vxlan_obj_del(struct net_device *vxlan_dev,
struct switchdev_notifier_port_obj_info *
port_obj_info)
{ … }
static int mlxsw_sp_switchdev_blocking_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{ … }
static struct notifier_block mlxsw_sp_switchdev_blocking_notifier = …;
u8
mlxsw_sp_bridge_port_stp_state(struct mlxsw_sp_bridge_port *bridge_port)
{ … }
static int mlxsw_sp_fdb_init(struct mlxsw_sp *mlxsw_sp)
{ … }
static void mlxsw_sp_fdb_fini(struct mlxsw_sp *mlxsw_sp)
{ … }
static void mlxsw_sp1_switchdev_init(struct mlxsw_sp *mlxsw_sp)
{ … }
const struct mlxsw_sp_switchdev_ops mlxsw_sp1_switchdev_ops = …;
static void mlxsw_sp2_switchdev_init(struct mlxsw_sp *mlxsw_sp)
{ … }
const struct mlxsw_sp_switchdev_ops mlxsw_sp2_switchdev_ops = …;
int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp)
{ … }
void mlxsw_sp_switchdev_fini(struct mlxsw_sp *mlxsw_sp)
{ … }