Skip to content

Commit b470c15

Browse files
KAGA-KOKOjgunthorpe
authored andcommitted
IB/srp: Disallow duplicate RDMA/CM connections
According to the SRP standard the INITIATOR and TARGET PORT IDENTIFIER fields from the login request specify the I_T nexus. Whether or not an SRP target closes an existing connection for an I_T nexus when a login request is received depends on the value of the MULTICHANNEL field in the login request. The SRP initiator derives the value of the INITIATOR and TARGET PORT IDENTIFIER fields from the .id_ext, .ioc_guid, .initiator_ext .sgid members of the srp_target_port structure. This means that the .rdma_cm.dst check must be removed from srp_conn_unique(). This patch avoids that for target ports that have multiple addresses, e.g. an IPv4 and an IPv6 address, and if a connection is established to both target port addresses, that the initiator logs in alternatingly every 10 seconds to the other target port address. An SRP target must namely terminate all but one connections for a given I_T nexus if the MULTICHANNEL field has not been set in the login request. Fixes: 19f3134 ("IB/srp: Add RDMA/CM support") Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 61147f3 commit b470c15

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/infiniband/ulp/srp/ib_srp.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,9 +3334,6 @@ static bool srp_conn_unique(struct srp_host *host,
33343334
if (t != target &&
33353335
target->id_ext == t->id_ext &&
33363336
target->ioc_guid == t->ioc_guid &&
3337-
(!target->using_rdma_cm ||
3338-
memcmp(&target->rdma_cm.dst, &t->rdma_cm.dst,
3339-
sizeof(target->rdma_cm.dst)) == 0) &&
33403337
target->initiator_ext == t->initiator_ext) {
33413338
ret = false;
33423339
break;

0 commit comments

Comments
 (0)