diff options
author | Guangguan Wang <guangguan.wang@linux.alibaba.com> | 2023-08-17 21:20:31 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-08-19 12:46:53 +0100 |
commit | 69b888e3bb4b186ec597a368bc8348e0e4bc6e65 (patch) | |
tree | 061c699eeeaaaacc9ee06b8311edd61df9e87cc0 /net/smc/smc_core.c | |
parent | 7f0620b9940b3b4c5d83a815d46b97ac0b88a595 (diff) | |
download | lwn-69b888e3bb4b186ec597a368bc8348e0e4bc6e65.tar.gz lwn-69b888e3bb4b186ec597a368bc8348e0e4bc6e65.zip |
net/smc: support max links per lgr negotiation in clc handshake
Support max links per lgr negotiation in clc handshake for SMCR v2.1,
which is one of smc v2.1 features. Server makes decision for the final
value of max links based on the client preferred max links and
self-preferred max links. Here use the minimum value of the client
preferred max links and server preferred max links.
Client Server
Proposal(max links(client preferred))
-------------------------------------->
Accept(max links(accepted value))
accepted value=min(client preferred, server preferred)
<-------------------------------------
Confirm(max links(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.c')
-rw-r--r-- | net/smc/smc_core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 8c69cbb70f6e..aae8d3f5c3cf 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -896,10 +896,12 @@ static int smc_lgr_create(struct smc_sock *smc, struct smc_init_info *ini) memcpy(lgr->nexthop_mac, ini->smcrv2.nexthop_mac, ETH_ALEN); lgr->max_conns = ini->max_conns; + lgr->max_links = ini->max_links; } else { ibdev = ini->ib_dev; ibport = ini->ib_port; lgr->max_conns = SMC_CONN_PER_LGR_MAX; + lgr->max_links = SMC_LINKS_ADD_LNK_MAX; } memcpy(lgr->pnet_id, ibdev->pnetid[ibport - 1], SMC_MAX_PNETID_LEN); @@ -1666,6 +1668,9 @@ void smcr_port_add(struct smc_ib_device *smcibdev, u8 ibport) !rdma_dev_access_netns(smcibdev->ibdev, lgr->net)) continue; + if (lgr->type == SMC_LGR_SINGLE && lgr->max_links <= 1) + continue; + /* trigger local add link processing */ link = smc_llc_usable_link(lgr); if (link) |