summaryrefslogtreecommitdiff
path: root/net/smc/smc_core.h
diff options
context:
space:
mode:
authorGuangguan Wang <guangguan.wang@linux.alibaba.com>2023-08-17 21:20:30 +0800
committerDavid S. Miller <davem@davemloft.net>2023-08-19 12:46:52 +0100
commit7f0620b9940b3b4c5d83a815d46b97ac0b88a595 (patch)
treeb70e4d4425270bbeff30169717cfc966e3828adf /net/smc/smc_core.h
parent6ac1e6563f5915cd38b6bc6a8b26964b2252f751 (diff)
net/smc: support max connections per lgr negotiation
Support max connections per lgr negotiation for SMCR v2.1, which is one of smc v2.1 features. Server makes decision for the final value of max conns based on the client preferred max conns and self-preferred max conns. Here use the minimum value of client preferred max conns and server preferred max conns. Client Server Proposal(max conns(client preferred)) ------------------------------------> Accept(max conns(accepted value)) accepted value=min(client preferred, server preferred) <----------------------------------- Confirm(max conns(accepted value)) -----------------------------------> Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com> Reviewed-by: Tony Lu <tonylu@linux.alibaba.com> Reviewed-by: Jan Karcher <jaka@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_core.h')
-rw-r--r--net/smc/smc_core.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h
index b6c68db61f23..32b199477ef3 100644
--- a/net/smc/smc_core.h
+++ b/net/smc/smc_core.h
@@ -22,6 +22,15 @@
#include "smc_ib.h"
#define SMC_RMBS_PER_LGR_MAX 255 /* max. # of RMBs per link group */
+#define SMC_CONN_PER_LGR_MIN 16 /* min. # of connections per link group */
+#define SMC_CONN_PER_LGR_MAX 255 /* max. # of connections per link group,
+ * also is the default value for SMC-R v1 and v2.0
+ */
+#define SMC_CONN_PER_LGR_PREFER 255 /* Preferred connections per link group used for
+ * SMC-R v2.1 and later negotiation, vendors or
+ * distrubutions may modify it to a value between
+ * 16-255 as needed.
+ */
struct smc_lgr_list { /* list of link group definition */
struct list_head list;
@@ -331,6 +340,8 @@ struct smc_link_group {
__be32 saddr;
/* net namespace */
struct net *net;
+ u8 max_conns;
+ /* max conn can be assigned to lgr */
};
struct { /* SMC-D */
u64 peer_gid;
@@ -375,6 +386,7 @@ struct smc_init_info {
u8 smc_type_v1;
u8 smc_type_v2;
u8 release_nr;
+ u8 max_conns;
u8 first_contact_peer;
u8 first_contact_local;
unsigned short vlan_id;