]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
IB/iser: Decrement CQ's active QPs accounting when QP creation fails
authorSagi Grimberg <sagig@mellanox.com>
Sun, 7 Dec 2014 14:09:55 +0000 (16:09 +0200)
committerRoland Dreier <roland@purestorage.com>
Tue, 16 Dec 2014 02:11:44 +0000 (18:11 -0800)
When creating a connection QP we choose the least used CQ and inc the
number of active QPs on that. If we fail to create the QP, we need to
decrement the active QPs counter.

Reported-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/ulp/iser/iser_verbs.c

index 6a2a91c7cdb7a5572d0df4338a6c7a82e0e70f27..583b09e4840999e6f47716c6daa37a1e9ee6ec4b 100644 (file)
@@ -494,7 +494,11 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn)
        return ret;
 
 out_err:
+       mutex_lock(&ig.connlist_mutex);
+       ib_conn->comp->active_qps--;
+       mutex_unlock(&ig.connlist_mutex);
        iser_err("unable to alloc mem or create resource, err %d\n", ret);
+
        return ret;
 }