linux/drivers/infiniband/core/roce_gid_mgmt.c

/*
 * Copyright (c) 2015, Mellanox Technologies inc.  All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#include "core_priv.h"

#include <linux/in.h>
#include <linux/in6.h>

/* For in6_dev_get/in6_dev_put */
#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)
{}

/**
 * is_ndev_for_default_gid_filter - Check if a given netdevice
 * can be considered for default GIDs or not.
 * @ib_dev:		IB device to check
 * @port:		Port to consider for adding default GID
 * @rdma_ndev:		rdma netdevice pointer
 * @cookie:             Netdevice to consider to form a default GID
 *
 * is_ndev_for_default_gid_filter() returns true if a given netdevice can be
 * considered for deriving default RoCE GID, returns false otherwise.
 */
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)
{}

/**
 * is_upper_ndev_bond_master_filter - Check if a given netdevice
 * is bond master device of netdevice of the RDMA device of port.
 * @ib_dev:		IB device to check
 * @port:		Port to consider for adding default GID
 * @rdma_ndev:		Pointer to rdma netdevice
 * @cookie:	        Netdevice to consider to form a default GID
 *
 * is_upper_ndev_bond_master_filter() returns true if a cookie_netdev
 * is bond master device and rdma_ndev is its lower netdevice. It might
 * not have been established as slave device yet.
 */
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)
{}

/**
 * del_default_gids - Delete default GIDs of the event/cookie netdevice
 * @ib_dev:	RDMA device pointer
 * @port:	Port of the RDMA device whose GID table to consider
 * @rdma_ndev:	Unused rdma netdevice
 * @cookie:	Pointer to event netdevice
 *
 * del_default_gids() deletes the default GIDs of the event/cookie netdevice.
 */
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)
{}

/**
 * rdma_roce_rescan_device - Rescan all of the network devices in the system
 * and add their gids, as needed, to the relevant RoCE devices.
 *
 * @ib_dev:         the rdma device
 */
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)
{}

/* The following functions operate on all IB devices. netdevice_event and
 * addr_event execute ib_enum_all_roce_netdevs through a work.
 * ib_enum_all_roce_netdevs iterates through all IB devices.
 */

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)
{}