#include <linux/module.h>
#include <linux/list.h>
#include <linux/ctype.h>
#include <linux/mutex.h>
#include <net/netlink.h>
#include <net/genetlink.h>
#include <uapi/linux/if.h>
#include <uapi/linux/smc.h>
#include <rdma/ib_verbs.h>
#include <net/netns/generic.h>
#include "smc_netns.h"
#include "smc_pnet.h"
#include "smc_ib.h"
#include "smc_ism.h"
#include "smc_core.h"
static struct net_device *__pnet_find_base_ndev(struct net_device *ndev);
static struct net_device *pnet_find_base_ndev(struct net_device *ndev);
static const struct nla_policy smc_pnet_policy[SMC_PNETID_MAX + 1] = …;
static struct genl_family smc_pnet_nl_family;
enum smc_pnet_nametype { … };
struct smc_pnetentry { … };
bool smc_pnet_is_pnetid_set(u8 *pnetid)
{ … }
static bool smc_pnet_match(u8 *pnetid1, u8 *pnetid2)
{ … }
static int smc_pnet_remove_by_pnetid(struct net *net, char *pnet_name)
{ … }
static int smc_pnet_add_by_ndev(struct net_device *ndev)
{ … }
static int smc_pnet_remove_by_ndev(struct net_device *ndev)
{ … }
static bool smc_pnet_apply_ib(struct smc_ib_device *ib_dev, u8 ib_port,
char *pnet_name)
{ … }
static bool smc_pnet_apply_smcd(struct smcd_dev *smcd_dev, char *pnet_name)
{ … }
static bool smc_pnetid_valid(const char *pnet_name, char *pnetid)
{ … }
static struct smc_ib_device *smc_pnet_find_ib(char *ib_name)
{ … }
static struct smcd_dev *smc_pnet_find_smcd(char *smcd_name)
{ … }
static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net,
char *eth_name, char *pnet_name)
{ … }
static int smc_pnet_add_ib(struct smc_pnettable *pnettable, char *ib_name,
u8 ib_port, char *pnet_name)
{ … }
static int smc_pnet_enter(struct net *net, struct nlattr *tb[])
{ … }
static int smc_pnet_set_nla(struct sk_buff *msg,
struct smc_pnetentry *pnetelem)
{ … }
static int smc_pnet_add(struct sk_buff *skb, struct genl_info *info)
{ … }
static int smc_pnet_del(struct sk_buff *skb, struct genl_info *info)
{ … }
static int smc_pnet_dump_start(struct netlink_callback *cb)
{ … }
static int smc_pnet_dumpinfo(struct sk_buff *skb,
u32 portid, u32 seq, u32 flags,
struct smc_pnetentry *pnetelem)
{ … }
static int _smc_pnet_dump(struct net *net, struct sk_buff *skb, u32 portid,
u32 seq, u8 *pnetid, int start_idx)
{ … }
static int smc_pnet_dump(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static int smc_pnet_get(struct sk_buff *skb, struct genl_info *info)
{ … }
static int smc_pnet_flush(struct sk_buff *skb, struct genl_info *info)
{ … }
static const struct genl_ops smc_pnet_ops[] = …;
static struct genl_family smc_pnet_nl_family __ro_after_init = …;
bool smc_pnet_is_ndev_pnetid(struct net *net, u8 *pnetid)
{ … }
static int smc_pnet_add_pnetid(struct net *net, u8 *pnetid)
{ … }
static void smc_pnet_remove_pnetid(struct net *net, u8 *pnetid)
{ … }
static void smc_pnet_add_base_pnetid(struct net *net, struct net_device *dev,
u8 *ndev_pnetid)
{ … }
static void smc_pnet_create_pnetids_list(struct net *net)
{ … }
static void smc_pnet_destroy_pnetids_list(struct net *net)
{ … }
static int smc_pnet_netdev_event(struct notifier_block *this,
unsigned long event, void *ptr)
{ … }
static struct notifier_block smc_netdev_notifier = …;
int smc_pnet_net_init(struct net *net)
{ … }
int __init smc_pnet_init(void)
{ … }
void smc_pnet_net_exit(struct net *net)
{ … }
void smc_pnet_exit(void)
{ … }
static struct net_device *__pnet_find_base_ndev(struct net_device *ndev)
{ … }
static struct net_device *pnet_find_base_ndev(struct net_device *ndev)
{ … }
static int smc_pnet_find_ndev_pnetid_by_table(struct net_device *ndev,
u8 *pnetid)
{ … }
static int smc_pnet_determine_gid(struct smc_ib_device *ibdev, int i,
struct smc_init_info *ini)
{ … }
static void _smc_pnet_find_roce_by_pnetid(u8 *pnet_id,
struct smc_init_info *ini,
struct smc_ib_device *known_dev,
struct net *net)
{ … }
void smc_pnet_find_alt_roce(struct smc_link_group *lgr,
struct smc_init_info *ini,
struct smc_ib_device *known_dev)
{ … }
static void smc_pnet_find_rdma_dev(struct net_device *netdev,
struct smc_init_info *ini)
{ … }
static void smc_pnet_find_roce_by_pnetid(struct net_device *ndev,
struct smc_init_info *ini)
{ … }
static void smc_pnet_find_ism_by_pnetid(struct net_device *ndev,
struct smc_init_info *ini)
{ … }
void smc_pnet_find_roce_resource(struct sock *sk, struct smc_init_info *ini)
{ … }
void smc_pnet_find_ism_resource(struct sock *sk, struct smc_init_info *ini)
{ … }
int smc_pnetid_by_table_ib(struct smc_ib_device *smcibdev, u8 ib_port)
{ … }
int smc_pnetid_by_table_smcd(struct smcd_dev *smcddev)
{ … }