#include "core_priv.h"
#include <linux/in.h>
#include <linux/in6.h>
#include <net/addrconf.h>
#include <net/bonding.h>
#include <rdma/ib_cache.h>
#include <rdma/ib_addr.h>
static struct workqueue_struct *gid_cache_wq;
enum gid_op_type { … };
struct update_gid_event_work { … };
#define ROCE_NETDEV_CALLBACK_SZ …
struct netdev_event_work_cmd { … };
struct netdev_event_work { … };
static const struct { … } PORT_CAP_TO_GID_TYPE[] = …;
#define CAP_TO_GID_TABLE_SIZE …
unsigned long roce_gid_type_mask_support(struct ib_device *ib_dev, u32 port)
{ … }
EXPORT_SYMBOL(…);
static void update_gid(enum gid_op_type gid_op, struct ib_device *ib_dev,
u32 port, union ib_gid *gid,
struct ib_gid_attr *gid_attr)
{ … }
enum bonding_slave_state { … };
static enum bonding_slave_state is_eth_active_slave_of_bonding_rcu(struct net_device *dev,
struct net_device *upper)
{ … }
#define REQUIRED_BOND_STATES …
static bool
is_eth_port_of_netdev_filter(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static bool
is_eth_port_inactive_slave_filter(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static bool
is_ndev_for_default_gid_filter(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static bool pass_all_filter(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static bool upper_device_filter(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static bool
is_upper_ndev_bond_master_filter(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev,
void *cookie)
{ … }
static void update_gid_ip(enum gid_op_type gid_op,
struct ib_device *ib_dev,
u32 port, struct net_device *ndev,
struct sockaddr *addr)
{ … }
static void bond_delete_netdev_default_gids(struct ib_device *ib_dev,
u32 port,
struct net_device *rdma_ndev,
struct net_device *event_ndev)
{ … }
static void enum_netdev_ipv4_ips(struct ib_device *ib_dev,
u32 port, struct net_device *ndev)
{ … }
static void enum_netdev_ipv6_ips(struct ib_device *ib_dev,
u32 port, struct net_device *ndev)
{ … }
static void _add_netdev_ips(struct ib_device *ib_dev, u32 port,
struct net_device *ndev)
{ … }
static void add_netdev_ips(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static void del_netdev_ips(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static void del_default_gids(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static void add_default_gids(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static void enum_all_gids_of_dev_cb(struct ib_device *ib_dev,
u32 port,
struct net_device *rdma_ndev,
void *cookie)
{ … }
void rdma_roce_rescan_device(struct ib_device *ib_dev)
{ … }
EXPORT_SYMBOL(…);
static void callback_for_addr_gid_device_scan(struct ib_device *device,
u32 port,
struct net_device *rdma_ndev,
void *cookie)
{ … }
struct upper_list { … };
static int netdev_upper_walk(struct net_device *upper,
struct netdev_nested_priv *priv)
{ … }
static void handle_netdev_upper(struct ib_device *ib_dev, u32 port,
void *cookie,
void (*handle_netdev)(struct ib_device *ib_dev,
u32 port,
struct net_device *ndev))
{ … }
static void _roce_del_all_netdev_gids(struct ib_device *ib_dev, u32 port,
struct net_device *event_ndev)
{ … }
static void del_netdev_upper_ips(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static void add_netdev_upper_ips(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev, void *cookie)
{ … }
static void del_netdev_default_ips_join(struct ib_device *ib_dev, u32 port,
struct net_device *rdma_ndev,
void *cookie)
{ … }
static void netdevice_event_work_handler(struct work_struct *_work)
{ … }
static int netdevice_queue_work(struct netdev_event_work_cmd *cmds,
struct net_device *ndev)
{ … }
static const struct netdev_event_work_cmd add_cmd = …;
static const struct netdev_event_work_cmd add_cmd_upper_ips = …;
static void
ndev_event_unlink(struct netdev_notifier_changeupper_info *changeupper_info,
struct netdev_event_work_cmd *cmds)
{ … }
static const struct netdev_event_work_cmd bonding_default_add_cmd = …;
static void
ndev_event_link(struct net_device *event_ndev,
struct netdev_notifier_changeupper_info *changeupper_info,
struct netdev_event_work_cmd *cmds)
{ … }
static void netdevice_event_changeupper(struct net_device *event_ndev,
struct netdev_notifier_changeupper_info *changeupper_info,
struct netdev_event_work_cmd *cmds)
{ … }
static const struct netdev_event_work_cmd add_default_gid_cmd = …;
static int netdevice_event(struct notifier_block *this, unsigned long event,
void *ptr)
{ … }
static void update_gid_event_work_handler(struct work_struct *_work)
{ … }
static int addr_event(struct notifier_block *this, unsigned long event,
struct sockaddr *sa, struct net_device *ndev)
{ … }
static int inetaddr_event(struct notifier_block *this, unsigned long event,
void *ptr)
{ … }
static int inet6addr_event(struct notifier_block *this, unsigned long event,
void *ptr)
{ … }
static struct notifier_block nb_netdevice = …;
static struct notifier_block nb_inetaddr = …;
static struct notifier_block nb_inet6addr = …;
int __init roce_gid_mgmt_init(void)
{ … }
void __exit roce_gid_mgmt_cleanup(void)
{ … }