iser-target: Fix identification of login rx descriptor type
authorJenny Derzhavetz <jennyf@mellanox.com>
Wed, 24 Feb 2016 17:23:58 +0000 (19:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:09:02 +0000 (09:09 -0700)
commit b89a7c25462b164db280abc3b05d4d9d888d40e9 upstream.

Once connection request is accepted, one rx descriptor
is posted to receive login request. This descriptor has rx type,
but is outside the main pool of rx descriptors, and thus
was mistreated as tx type.

Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/ulp/isert/ib_isert.c

index 8a51c3b5d657e5a49ae50c4e5f104a7298d732f2..addb57265cb24fe0b5ff392d144d2eee3455d6a0 100644 (file)
@@ -2035,7 +2035,8 @@ is_isert_tx_desc(struct isert_conn *isert_conn, void *wr_id)
        void *start = isert_conn->rx_descs;
        int len = ISERT_QP_MAX_RECV_DTOS * sizeof(*isert_conn->rx_descs);
 
-       if (wr_id >= start && wr_id < start + len)
+       if ((wr_id >= start && wr_id < start + len) ||
+           (wr_id == isert_conn->login_req_buf))
                return false;
 
        return true;