summaryrefslogtreecommitdiff
path: root/net/smc/smc_clc.h
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.ibm.com>2020-09-26 12:44:29 +0200
committerDavid S. Miller <davem@davemloft.net>2020-09-28 15:19:03 -0700
commit5c21c4ccafe85906db809de3af391fd434df8a27 (patch)
tree8d96fda007f203e2ffb79b1f51be8db95a2eb66a /net/smc/smc_clc.h
parent8c3dca341aea885249e08856c4380300b75d2cf5 (diff)
net/smc: determine accepted ISM devices
SMCD Version 2 allows to propose up to 8 additional ISM devices offered to the peer as candidates for SMCD communication. This patch covers the server side, i.e. selection of an ISM device matching one of the proposed ISM devices, that will be used for CLC accept 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_clc.h')
-rw-r--r--net/smc/smc_clc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/smc/smc_clc.h b/net/smc/smc_clc.h
index 0157cffce62c..5cefb0a09eaf 100644
--- a/net/smc/smc_clc.h
+++ b/net/smc/smc_clc.h
@@ -260,6 +260,22 @@ smc_get_clc_v2_ext(struct smc_clc_msg_proposal *prop)
ntohs(prop_smcd->v2_ext_offset));
}
+static inline struct smc_clc_smcd_v2_extension *
+smc_get_clc_smcd_v2_ext(struct smc_clc_v2_extension *prop_v2ext)
+{
+ if (!prop_v2ext)
+ return NULL;
+ if (!ntohs(prop_v2ext->hdr.smcd_v2_ext_offset))
+ return NULL;
+
+ return (struct smc_clc_smcd_v2_extension *)
+ ((u8 *)prop_v2ext +
+ offsetof(struct smc_clc_v2_extension, hdr) +
+ offsetof(struct smc_clnt_opts_area_hdr, smcd_v2_ext_offset) +
+ sizeof(prop_v2ext->hdr.smcd_v2_ext_offset) +
+ ntohs(prop_v2ext->hdr.smcd_v2_ext_offset));
+}
+
struct smcd_dev;
struct smc_init_info;