Commit fb8ed3af authored by Jan Dakinevich's avatar Jan Dakinevich Committed by David S. Miller

cnic: use kvzalloc to allocate memory for csk_tbl

Size of csk_tbl is about 58K, which means 3rd order page allocation.
kvzalloc provides a fallback if no high order memory is available.
Signed-off-by: default avatarJan Dakinevich <jan.dakinevich@virtuozzo.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3c546728
...@@ -4088,7 +4088,7 @@ static void cnic_cm_free_mem(struct cnic_dev *dev) ...@@ -4088,7 +4088,7 @@ static void cnic_cm_free_mem(struct cnic_dev *dev)
{ {
struct cnic_local *cp = dev->cnic_priv; struct cnic_local *cp = dev->cnic_priv;
kfree(cp->csk_tbl); kvfree(cp->csk_tbl);
cp->csk_tbl = NULL; cp->csk_tbl = NULL;
cnic_free_id_tbl(&cp->csk_port_tbl); cnic_free_id_tbl(&cp->csk_port_tbl);
} }
...@@ -4098,8 +4098,8 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev) ...@@ -4098,8 +4098,8 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev)
struct cnic_local *cp = dev->cnic_priv; struct cnic_local *cp = dev->cnic_priv;
u32 port_id; u32 port_id;
cp->csk_tbl = kcalloc(MAX_CM_SK_TBL_SZ, sizeof(struct cnic_sock), cp->csk_tbl = kvcalloc(MAX_CM_SK_TBL_SZ, sizeof(struct cnic_sock),
GFP_KERNEL); GFP_KERNEL);
if (!cp->csk_tbl) if (!cp->csk_tbl)
return -ENOMEM; return -ENOMEM;
......
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