diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-12-07 16:10:03 +0200 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-12-15 18:11:45 -0800 |
commit | da64bdb25b541ff261bdfc1bfba3408520cbaff0 (patch) | |
tree | 8aa659630b4597bab5c908279607695e137722cc /drivers/infiniband/ulp/iser/iser_verbs.c | |
parent | 7e1fd4d1e3c801a07609300e03912524b3abb5cb (diff) | |
download | talos-op-linux-da64bdb25b541ff261bdfc1bfba3408520cbaff0.tar.gz talos-op-linux-da64bdb25b541ff261bdfc1bfba3408520cbaff0.zip |
IB/iser: Use more completion queues
No reason to settle with four, can use the min between device max comp
vectors and number of cores.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp/iser/iser_verbs.c')
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index ad493d285be1..5d69927e9efc 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c @@ -104,9 +104,14 @@ static int iser_create_device_ib_res(struct iser_device *device) return -1; } - device->comps_used = min(ISER_MAX_CQ, + device->comps_used = min_t(int, num_online_cpus(), device->ib_device->num_comp_vectors); + device->comps = kcalloc(device->comps_used, sizeof(*device->comps), + GFP_KERNEL); + if (!device->comps) + goto comps_err; + max_cqe = min(ISER_MAX_CQ_LEN, dev_attr->max_cqe); iser_info("using %d CQs, device %s supports %d vectors max_cqe %d\n", @@ -165,6 +170,8 @@ cq_err: } ib_dealloc_pd(device->pd); pd_err: + kfree(device->comps); +comps_err: iser_err("failed to allocate an IB resource\n"); return -1; } @@ -190,6 +197,9 @@ static void iser_free_device_ib_res(struct iser_device *device) (void)ib_dereg_mr(device->mr); (void)ib_dealloc_pd(device->pd); + kfree(device->comps); + device->comps = NULL; + device->mr = NULL; device->pd = NULL; } |