diff mbox

IB/srp: Disallow duplicate RDMA/CM connections

Message ID 20180316175557.5796-1-bart.vanassche@wdc.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show

Commit Message

Bart Van Assche March 16, 2018, 5:55 p.m. UTC
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: 19f313438c77 ("IB/srp: Add RDMA/CM support")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
---
 drivers/infiniband/ulp/srp/ib_srp.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Jason Gunthorpe March 19, 2018, 8:26 p.m. UTC | #1
On Fri, Mar 16, 2018 at 10:55:57AM -0700, Bart Van Assche wrote:
> 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: 19f313438c77 ("IB/srp: Add RDMA/CM support")
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> ---
>  drivers/infiniband/ulp/srp/ib_srp.c | 3 ---
>  1 file changed, 3 deletions(-)

Applied to for-next

Thanks,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index eb1b19d972f1..9c7acb278021 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -3451,9 +3451,6 @@  static bool srp_conn_unique(struct srp_host *host,
 		if (t != target &&
 		    target->id_ext == t->id_ext &&
 		    target->ioc_guid == t->ioc_guid &&
-		    (!target->using_rdma_cm ||
-		     memcmp(&target->rdma_cm.dst, &t->rdma_cm.dst,
-			    sizeof(target->rdma_cm.dst)) == 0) &&
 		    target->initiator_ext == t->initiator_ext) {
 			ret = false;
 			break;