summaryrefslogtreecommitdiff
path: root/net/smc/smc_pnet.h
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.ibm.com>2020-09-26 12:44:26 +0200
committerDavid S. Miller <davem@davemloft.net>2020-09-28 15:19:03 -0700
commite888a2e8337c96dd785d204cf8ff775e79173add (patch)
treed482a471ce79212c5965a8c44de2b05c75dee8e9 /net/smc/smc_pnet.h
parent8caaccf521c160d231587091f1f5e8aef2dd0a5e (diff)
net/smc: introduce list of pnetids for Ethernet devices
SMCD version 2 allows usage of ISM devices with hardware PNETID only, if an Ethernet net_device exists with the same hardware PNETID. This requires to maintain a list of pnetids belonging to Ethernet net_devices, which is covered by this patch. Signed-off-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_pnet.h')
-rw-r--r--net/smc/smc_pnet.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/smc/smc_pnet.h b/net/smc/smc_pnet.h
index 811a65986691..677a47ac158e 100644
--- a/net/smc/smc_pnet.h
+++ b/net/smc/smc_pnet.h
@@ -12,6 +12,8 @@
#ifndef _SMC_PNET_H
#define _SMC_PNET_H
+#include <net/smc.h>
+
#if IS_ENABLED(CONFIG_HAVE_PNETID)
#include <asm/pnet.h>
#endif
@@ -31,6 +33,17 @@ struct smc_pnettable {
struct list_head pnetlist;
};
+struct smc_pnetids_ndev { /* list of pnetids for net devices in UP state*/
+ struct list_head list;
+ rwlock_t lock;
+};
+
+struct smc_pnetids_ndev_entry {
+ struct list_head list;
+ u8 pnetid[SMC_MAX_PNETID_LEN];
+ refcount_t refcnt;
+};
+
static inline int smc_pnetid_by_dev_port(struct device *dev,
unsigned short port, u8 *pnetid)
{
@@ -52,4 +65,5 @@ int smc_pnetid_by_table_smcd(struct smcd_dev *smcd);
void smc_pnet_find_alt_roce(struct smc_link_group *lgr,
struct smc_init_info *ini,
struct smc_ib_device *known_dev);
+bool smc_pnet_is_ndev_pnetid(struct net *net, u8 *pnetid);
#endif