[infiniband] Disambiguate CM connection rejection reasons

There is diagnostic value in being able to disambiguate between the
various reasons why an IB CM has rejected a connection attempt.  In
particular, reason 8 "invalid service ID" can be used to identify an
incorrect SRP service_id root-path component, and reason 28 "consumer
reject" corresponds to a genuine SRP login rejection IU, which can be
passed up to the SRP layer.

For rejection reasons other than "consumer reject", we should not pass
through the private data, since it is most likely generated by the CM
without any protocol-specific knowledge.
This commit is contained in:
Michael Brown
2009-08-10 22:31:55 +01:00
parent 965a0f7a75
commit 0ff5c456cb
3 changed files with 32 additions and 4 deletions
+2 -1
View File
@@ -172,7 +172,8 @@ static void ib_cmrc_changed ( struct ib_device *ibdev __unused,
/* Pass up any private data */
DBGC2 ( cmrc, "CMRC %p received private data:\n", cmrc );
DBGC2_HDA ( cmrc, 0, private_data, private_data_len );
if ( ( rc_xfer = xfer_deliver_raw ( &cmrc->xfer, private_data,
if ( private_data &&
( rc_xfer = xfer_deliver_raw ( &cmrc->xfer, private_data,
private_data_len ) ) != 0 ) {
DBGC ( cmrc, "CMRC %p could not deliver private data: %s\n",
cmrc, strerror ( rc_xfer ) );