summaryrefslogtreecommitdiff
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorJan Dakinevich <jan.dakinevich@virtuozzo.com>2018-07-09 16:51:03 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-07-24 00:08:20 +0300
commit259e19145e1fa9bb9e502f625f7bce1a0c078fa0 (patch)
tree43152cb90098db361a362250ad89be0c31a2f34a /drivers/infiniband/ulp
parentc012691508f5fcc09b0a777fd1747f266093fe1b (diff)
downloadlinux-259e19145e1fa9bb9e502f625f7bce1a0c078fa0.tar.xz
IPoIB: use kvzalloc to allocate an array of bucket pointers
This table by default takes 32KiB which is 3rd memory order. Meanwhile, this memory is not aimed for DMA operation and could be safely allocated by vmalloc. Signed-off-by: Jan Dakinevich <jan.dakinevich@virtuozzo.com> Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 9bcd487e51c2..012c9e3970ac 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1530,7 +1530,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
return -ENOMEM;
set_bit(IPOIB_STOP_NEIGH_GC, &priv->flags);
size = roundup_pow_of_two(arp_tbl.gc_thresh3);
- buckets = kcalloc(size, sizeof(*buckets), GFP_KERNEL);
+ buckets = kvcalloc(size, sizeof(*buckets), GFP_KERNEL);
if (!buckets) {
kfree(htbl);
return -ENOMEM;
@@ -1558,7 +1558,7 @@ static void neigh_hash_free_rcu(struct rcu_head *head)
struct ipoib_neigh __rcu **buckets = htbl->buckets;
struct ipoib_neigh_table *ntbl = htbl->ntbl;
- kfree(buckets);
+ kvfree(buckets);
kfree(htbl);
complete(&ntbl->deleted);
}