Commit 259e1914 authored by Jan Dakinevich's avatar Jan Dakinevich Committed by Jason Gunthorpe

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: default avatarJan Dakinevich <jan.dakinevich@virtuozzo.com>
Reviewed-by: default avatarHåkon Bugge <haakon.bugge@oracle.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent c0126915
...@@ -1530,7 +1530,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv) ...@@ -1530,7 +1530,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
return -ENOMEM; return -ENOMEM;
set_bit(IPOIB_STOP_NEIGH_GC, &priv->flags); set_bit(IPOIB_STOP_NEIGH_GC, &priv->flags);
size = roundup_pow_of_two(arp_tbl.gc_thresh3); 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) { if (!buckets) {
kfree(htbl); kfree(htbl);
return -ENOMEM; return -ENOMEM;
...@@ -1558,7 +1558,7 @@ static void neigh_hash_free_rcu(struct rcu_head *head) ...@@ -1558,7 +1558,7 @@ static void neigh_hash_free_rcu(struct rcu_head *head)
struct ipoib_neigh __rcu **buckets = htbl->buckets; struct ipoib_neigh __rcu **buckets = htbl->buckets;
struct ipoib_neigh_table *ntbl = htbl->ntbl; struct ipoib_neigh_table *ntbl = htbl->ntbl;
kfree(buckets); kvfree(buckets);
kfree(htbl); kfree(htbl);
complete(&ntbl->deleted); complete(&ntbl->deleted);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment