Commit 2591c280 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

qed: Remove OOM messages

These messages are unnecessary as OOM allocation failures already do
a dump_stack() giving more or less the same information.

$ size drivers/net/ethernet/qlogic/qed/built-in.o* (defconfig x86-64)
   text	   data	    bss	    dec	    hex	filename
 127817	  27969	  32800	 188586	  2e0aa	drivers/net/ethernet/qlogic/qed/built-in.o.new
 132474	  27969	  32800	 193243	  2f2db	drivers/net/ethernet/qlogic/qed/built-in.o.old

Miscellanea:

o Change allocs to the generally preferred forms where possible.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c7ee5672
...@@ -792,10 +792,9 @@ static int qed_cxt_src_t2_alloc(struct qed_hwfn *p_hwfn) ...@@ -792,10 +792,9 @@ static int qed_cxt_src_t2_alloc(struct qed_hwfn *p_hwfn)
p_mngr->t2_num_pages = DIV_ROUND_UP(total_size, psz); p_mngr->t2_num_pages = DIV_ROUND_UP(total_size, psz);
/* allocate t2 */ /* allocate t2 */
p_mngr->t2 = kzalloc(p_mngr->t2_num_pages * sizeof(struct qed_dma_mem), p_mngr->t2 = kcalloc(p_mngr->t2_num_pages, sizeof(struct qed_dma_mem),
GFP_KERNEL); GFP_KERNEL);
if (!p_mngr->t2) { if (!p_mngr->t2) {
DP_NOTICE(p_hwfn, "Failed to allocate t2 table\n");
rc = -ENOMEM; rc = -ENOMEM;
goto t2_fail; goto t2_fail;
} }
...@@ -957,7 +956,6 @@ static int qed_ilt_shadow_alloc(struct qed_hwfn *p_hwfn) ...@@ -957,7 +956,6 @@ static int qed_ilt_shadow_alloc(struct qed_hwfn *p_hwfn)
p_mngr->ilt_shadow = kcalloc(size, sizeof(struct qed_dma_mem), p_mngr->ilt_shadow = kcalloc(size, sizeof(struct qed_dma_mem),
GFP_KERNEL); GFP_KERNEL);
if (!p_mngr->ilt_shadow) { if (!p_mngr->ilt_shadow) {
DP_NOTICE(p_hwfn, "Failed to allocate ilt shadow table\n");
rc = -ENOMEM; rc = -ENOMEM;
goto ilt_shadow_fail; goto ilt_shadow_fail;
} }
...@@ -1050,10 +1048,8 @@ int qed_cxt_mngr_alloc(struct qed_hwfn *p_hwfn) ...@@ -1050,10 +1048,8 @@ int qed_cxt_mngr_alloc(struct qed_hwfn *p_hwfn)
u32 i; u32 i;
p_mngr = kzalloc(sizeof(*p_mngr), GFP_KERNEL); p_mngr = kzalloc(sizeof(*p_mngr), GFP_KERNEL);
if (!p_mngr) { if (!p_mngr)
DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_cxt_mngr'\n");
return -ENOMEM; return -ENOMEM;
}
/* Initialize ILT client registers */ /* Initialize ILT client registers */
clients = p_mngr->clients; clients = p_mngr->clients;
...@@ -1105,24 +1101,18 @@ int qed_cxt_tables_alloc(struct qed_hwfn *p_hwfn) ...@@ -1105,24 +1101,18 @@ int qed_cxt_tables_alloc(struct qed_hwfn *p_hwfn)
/* Allocate the ILT shadow table */ /* Allocate the ILT shadow table */
rc = qed_ilt_shadow_alloc(p_hwfn); rc = qed_ilt_shadow_alloc(p_hwfn);
if (rc) { if (rc)
DP_NOTICE(p_hwfn, "Failed to allocate ilt memory\n");
goto tables_alloc_fail; goto tables_alloc_fail;
}
/* Allocate the T2 table */ /* Allocate the T2 table */
rc = qed_cxt_src_t2_alloc(p_hwfn); rc = qed_cxt_src_t2_alloc(p_hwfn);
if (rc) { if (rc)
DP_NOTICE(p_hwfn, "Failed to allocate T2 memory\n");
goto tables_alloc_fail; goto tables_alloc_fail;
}
/* Allocate and initialize the acquired cids bitmaps */ /* Allocate and initialize the acquired cids bitmaps */
rc = qed_cid_map_alloc(p_hwfn); rc = qed_cid_map_alloc(p_hwfn);
if (rc) { if (rc)
DP_NOTICE(p_hwfn, "Failed to allocate cid maps\n");
goto tables_alloc_fail; goto tables_alloc_fail;
}
return 0; return 0;
......
...@@ -874,11 +874,8 @@ int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn) ...@@ -874,11 +874,8 @@ int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn)
int rc = 0; int rc = 0;
p_hwfn->p_dcbx_info = kzalloc(sizeof(*p_hwfn->p_dcbx_info), GFP_KERNEL); p_hwfn->p_dcbx_info = kzalloc(sizeof(*p_hwfn->p_dcbx_info), GFP_KERNEL);
if (!p_hwfn->p_dcbx_info) { if (!p_hwfn->p_dcbx_info)
DP_NOTICE(p_hwfn,
"Failed to allocate 'struct qed_dcbx_info'\n");
rc = -ENOMEM; rc = -ENOMEM;
}
return rc; return rc;
} }
...@@ -1176,10 +1173,8 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn, ...@@ -1176,10 +1173,8 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn,
} }
dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_KERNEL); dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_KERNEL);
if (!dcbx_info) { if (!dcbx_info)
DP_ERR(p_hwfn, "Failed to allocate struct qed_dcbx_info\n");
return -ENOMEM; return -ENOMEM;
}
rc = qed_dcbx_query_params(p_hwfn, dcbx_info, QED_DCBX_OPERATIONAL_MIB); rc = qed_dcbx_query_params(p_hwfn, dcbx_info, QED_DCBX_OPERATIONAL_MIB);
if (rc) { if (rc) {
...@@ -1213,10 +1208,8 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn, ...@@ -1213,10 +1208,8 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn,
struct qed_dcbx_get *dcbx_info; struct qed_dcbx_get *dcbx_info;
dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_KERNEL); dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_KERNEL);
if (!dcbx_info) { if (!dcbx_info)
DP_ERR(hwfn->cdev, "Failed to allocate memory for dcbx_info\n");
return NULL; return NULL;
}
if (qed_dcbx_query_params(hwfn, dcbx_info, type)) { if (qed_dcbx_query_params(hwfn, dcbx_info, type)) {
kfree(dcbx_info); kfree(dcbx_info);
......
...@@ -340,7 +340,6 @@ static int qed_init_qm_info(struct qed_hwfn *p_hwfn, bool b_sleepable) ...@@ -340,7 +340,6 @@ static int qed_init_qm_info(struct qed_hwfn *p_hwfn, bool b_sleepable)
return 0; return 0;
alloc_err: alloc_err:
DP_NOTICE(p_hwfn, "Failed to allocate memory for QM params\n");
qed_qm_info_free(p_hwfn); qed_qm_info_free(p_hwfn);
return -ENOMEM; return -ENOMEM;
} }
...@@ -424,18 +423,12 @@ int qed_resc_alloc(struct qed_dev *cdev) ...@@ -424,18 +423,12 @@ int qed_resc_alloc(struct qed_dev *cdev)
RESC_NUM(p_hwfn, QED_L2_QUEUE); RESC_NUM(p_hwfn, QED_L2_QUEUE);
p_hwfn->p_tx_cids = kzalloc(tx_size, GFP_KERNEL); p_hwfn->p_tx_cids = kzalloc(tx_size, GFP_KERNEL);
if (!p_hwfn->p_tx_cids) { if (!p_hwfn->p_tx_cids)
DP_NOTICE(p_hwfn,
"Failed to allocate memory for Tx Cids\n");
goto alloc_no_mem; goto alloc_no_mem;
}
p_hwfn->p_rx_cids = kzalloc(rx_size, GFP_KERNEL); p_hwfn->p_rx_cids = kzalloc(rx_size, GFP_KERNEL);
if (!p_hwfn->p_rx_cids) { if (!p_hwfn->p_rx_cids)
DP_NOTICE(p_hwfn,
"Failed to allocate memory for Rx Cids\n");
goto alloc_no_mem; goto alloc_no_mem;
}
} }
for_each_hwfn(cdev, i) { for_each_hwfn(cdev, i) {
...@@ -522,26 +515,18 @@ int qed_resc_alloc(struct qed_dev *cdev) ...@@ -522,26 +515,18 @@ int qed_resc_alloc(struct qed_dev *cdev)
/* DMA info initialization */ /* DMA info initialization */
rc = qed_dmae_info_alloc(p_hwfn); rc = qed_dmae_info_alloc(p_hwfn);
if (rc) { if (rc)
DP_NOTICE(p_hwfn,
"Failed to allocate memory for dmae_info structure\n");
goto alloc_err; goto alloc_err;
}
/* DCBX initialization */ /* DCBX initialization */
rc = qed_dcbx_info_alloc(p_hwfn); rc = qed_dcbx_info_alloc(p_hwfn);
if (rc) { if (rc)
DP_NOTICE(p_hwfn,
"Failed to allocate memory for dcbx structure\n");
goto alloc_err; goto alloc_err;
}
} }
cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL); cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL);
if (!cdev->reset_stats) { if (!cdev->reset_stats)
DP_NOTICE(cdev, "Failed to allocate reset statistics\n");
goto alloc_no_mem; goto alloc_no_mem;
}
return 0; return 0;
...@@ -1713,10 +1698,8 @@ static int qed_hw_prepare_single(struct qed_hwfn *p_hwfn, ...@@ -1713,10 +1698,8 @@ static int qed_hw_prepare_single(struct qed_hwfn *p_hwfn,
/* Allocate PTT pool */ /* Allocate PTT pool */
rc = qed_ptt_pool_alloc(p_hwfn); rc = qed_ptt_pool_alloc(p_hwfn);
if (rc) { if (rc)
DP_NOTICE(p_hwfn, "Failed to prepare hwfn's hw\n");
goto err0; goto err0;
}
/* Allocate the main PTT */ /* Allocate the main PTT */
p_hwfn->p_main_ptt = qed_get_reserved_ptt(p_hwfn, RESERVED_PTT_MAIN); p_hwfn->p_main_ptt = qed_get_reserved_ptt(p_hwfn, RESERVED_PTT_MAIN);
...@@ -1746,10 +1729,8 @@ static int qed_hw_prepare_single(struct qed_hwfn *p_hwfn, ...@@ -1746,10 +1729,8 @@ static int qed_hw_prepare_single(struct qed_hwfn *p_hwfn,
/* Allocate the init RT array and initialize the init-ops engine */ /* Allocate the init RT array and initialize the init-ops engine */
rc = qed_init_alloc(p_hwfn); rc = qed_init_alloc(p_hwfn);
if (rc) { if (rc)
DP_NOTICE(p_hwfn, "Failed to allocate the init array\n");
goto err2; goto err2;
}
return rc; return rc;
err2: err2:
...@@ -1957,10 +1938,8 @@ qed_chain_alloc_next_ptr(struct qed_dev *cdev, struct qed_chain *p_chain) ...@@ -1957,10 +1938,8 @@ qed_chain_alloc_next_ptr(struct qed_dev *cdev, struct qed_chain *p_chain)
p_virt = dma_alloc_coherent(&cdev->pdev->dev, p_virt = dma_alloc_coherent(&cdev->pdev->dev,
QED_CHAIN_PAGE_SIZE, QED_CHAIN_PAGE_SIZE,
&p_phys, GFP_KERNEL); &p_phys, GFP_KERNEL);
if (!p_virt) { if (!p_virt)
DP_NOTICE(cdev, "Failed to allocate chain memory\n");
return -ENOMEM; return -ENOMEM;
}
if (i == 0) { if (i == 0) {
qed_chain_init_mem(p_chain, p_virt, p_phys); qed_chain_init_mem(p_chain, p_virt, p_phys);
...@@ -1990,10 +1969,8 @@ qed_chain_alloc_single(struct qed_dev *cdev, struct qed_chain *p_chain) ...@@ -1990,10 +1969,8 @@ qed_chain_alloc_single(struct qed_dev *cdev, struct qed_chain *p_chain)
p_virt = dma_alloc_coherent(&cdev->pdev->dev, p_virt = dma_alloc_coherent(&cdev->pdev->dev,
QED_CHAIN_PAGE_SIZE, &p_phys, GFP_KERNEL); QED_CHAIN_PAGE_SIZE, &p_phys, GFP_KERNEL);
if (!p_virt) { if (!p_virt)
DP_NOTICE(cdev, "Failed to allocate chain memory\n");
return -ENOMEM; return -ENOMEM;
}
qed_chain_init_mem(p_chain, p_virt, p_phys); qed_chain_init_mem(p_chain, p_virt, p_phys);
qed_chain_reset(p_chain); qed_chain_reset(p_chain);
...@@ -2010,13 +1987,9 @@ static int qed_chain_alloc_pbl(struct qed_dev *cdev, struct qed_chain *p_chain) ...@@ -2010,13 +1987,9 @@ static int qed_chain_alloc_pbl(struct qed_dev *cdev, struct qed_chain *p_chain)
void *p_virt = NULL; void *p_virt = NULL;
size = page_cnt * sizeof(*pp_virt_addr_tbl); size = page_cnt * sizeof(*pp_virt_addr_tbl);
pp_virt_addr_tbl = vmalloc(size); pp_virt_addr_tbl = vzalloc(size);
if (!pp_virt_addr_tbl) { if (!pp_virt_addr_tbl)
DP_NOTICE(cdev,
"Failed to allocate memory for the chain virtual addresses table\n");
return -ENOMEM; return -ENOMEM;
}
memset(pp_virt_addr_tbl, 0, size);
/* The allocation of the PBL table is done with its full size, since it /* The allocation of the PBL table is done with its full size, since it
* is expected to be successive. * is expected to be successive.
...@@ -2029,19 +2002,15 @@ static int qed_chain_alloc_pbl(struct qed_dev *cdev, struct qed_chain *p_chain) ...@@ -2029,19 +2002,15 @@ static int qed_chain_alloc_pbl(struct qed_dev *cdev, struct qed_chain *p_chain)
size, &p_pbl_phys, GFP_KERNEL); size, &p_pbl_phys, GFP_KERNEL);
qed_chain_init_pbl_mem(p_chain, p_pbl_virt, p_pbl_phys, qed_chain_init_pbl_mem(p_chain, p_pbl_virt, p_pbl_phys,
pp_virt_addr_tbl); pp_virt_addr_tbl);
if (!p_pbl_virt) { if (!p_pbl_virt)
DP_NOTICE(cdev, "Failed to allocate chain pbl memory\n");
return -ENOMEM; return -ENOMEM;
}
for (i = 0; i < page_cnt; i++) { for (i = 0; i < page_cnt; i++) {
p_virt = dma_alloc_coherent(&cdev->pdev->dev, p_virt = dma_alloc_coherent(&cdev->pdev->dev,
QED_CHAIN_PAGE_SIZE, QED_CHAIN_PAGE_SIZE,
&p_phys, GFP_KERNEL); &p_phys, GFP_KERNEL);
if (!p_virt) { if (!p_virt)
DP_NOTICE(cdev, "Failed to allocate chain memory\n");
return -ENOMEM; return -ENOMEM;
}
if (i == 0) { if (i == 0) {
qed_chain_init_mem(p_chain, p_virt, p_phys); qed_chain_init_mem(p_chain, p_virt, p_phys);
...@@ -2076,7 +2045,8 @@ int qed_chain_alloc(struct qed_dev *cdev, ...@@ -2076,7 +2045,8 @@ int qed_chain_alloc(struct qed_dev *cdev,
rc = qed_chain_alloc_sanity_check(cdev, cnt_type, elem_size, page_cnt); rc = qed_chain_alloc_sanity_check(cdev, cnt_type, elem_size, page_cnt);
if (rc) { if (rc) {
DP_NOTICE(cdev, DP_NOTICE(cdev,
"Cannot allocate a chain with the given arguments:\n" "Cannot allocate a chain with the given arguments:\n");
DP_NOTICE(cdev,
"[use_mode %d, mode %d, cnt_type %d, num_elems %d, elem_size %zu]\n", "[use_mode %d, mode %d, cnt_type %d, num_elems %d, elem_size %zu]\n",
intended_use, mode, cnt_type, num_elems, elem_size); intended_use, mode, cnt_type, num_elems, elem_size);
return rc; return rc;
......
...@@ -482,28 +482,22 @@ int qed_dmae_info_alloc(struct qed_hwfn *p_hwfn) ...@@ -482,28 +482,22 @@ int qed_dmae_info_alloc(struct qed_hwfn *p_hwfn)
*p_comp = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, *p_comp = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
sizeof(u32), p_addr, GFP_KERNEL); sizeof(u32), p_addr, GFP_KERNEL);
if (!*p_comp) { if (!*p_comp)
DP_NOTICE(p_hwfn, "Failed to allocate `p_completion_word'\n");
goto err; goto err;
}
p_addr = &p_hwfn->dmae_info.dmae_cmd_phys_addr; p_addr = &p_hwfn->dmae_info.dmae_cmd_phys_addr;
*p_cmd = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, *p_cmd = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
sizeof(struct dmae_cmd), sizeof(struct dmae_cmd),
p_addr, GFP_KERNEL); p_addr, GFP_KERNEL);
if (!*p_cmd) { if (!*p_cmd)
DP_NOTICE(p_hwfn, "Failed to allocate `struct dmae_cmd'\n");
goto err; goto err;
}
p_addr = &p_hwfn->dmae_info.intermediate_buffer_phys_addr; p_addr = &p_hwfn->dmae_info.intermediate_buffer_phys_addr;
*p_buff = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, *p_buff = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
sizeof(u32) * DMAE_MAX_RW_SIZE, sizeof(u32) * DMAE_MAX_RW_SIZE,
p_addr, GFP_KERNEL); p_addr, GFP_KERNEL);
if (!*p_buff) { if (!*p_buff)
DP_NOTICE(p_hwfn, "Failed to allocate `intermediate_buffer'\n");
goto err; goto err;
}
p_hwfn->dmae_info.channel = p_hwfn->rel_pf_id; p_hwfn->dmae_info.channel = p_hwfn->rel_pf_id;
......
...@@ -460,10 +460,8 @@ int qed_init_run(struct qed_hwfn *p_hwfn, ...@@ -460,10 +460,8 @@ int qed_init_run(struct qed_hwfn *p_hwfn,
init_ops = cdev->fw_data->init_ops; init_ops = cdev->fw_data->init_ops;
p_hwfn->unzip_buf = kzalloc(MAX_ZIPPED_SIZE * 4, GFP_ATOMIC); p_hwfn->unzip_buf = kzalloc(MAX_ZIPPED_SIZE * 4, GFP_ATOMIC);
if (!p_hwfn->unzip_buf) { if (!p_hwfn->unzip_buf)
DP_NOTICE(p_hwfn, "Failed to allocate unzip buffer\n");
return -ENOMEM; return -ENOMEM;
}
for (cmd_num = 0; cmd_num < num_init_ops; cmd_num++) { for (cmd_num = 0; cmd_num < num_init_ops; cmd_num++) {
union init_op *cmd = &init_ops[cmd_num]; union init_op *cmd = &init_ops[cmd_num];
......
...@@ -2370,10 +2370,8 @@ static int qed_int_sb_attn_alloc(struct qed_hwfn *p_hwfn, ...@@ -2370,10 +2370,8 @@ static int qed_int_sb_attn_alloc(struct qed_hwfn *p_hwfn,
/* SB struct */ /* SB struct */
p_sb = kmalloc(sizeof(*p_sb), GFP_KERNEL); p_sb = kmalloc(sizeof(*p_sb), GFP_KERNEL);
if (!p_sb) { if (!p_sb)
DP_NOTICE(cdev, "Failed to allocate `struct qed_sb_attn_info'\n");
return -ENOMEM; return -ENOMEM;
}
/* SB ring */ /* SB ring */
p_virt = dma_alloc_coherent(&cdev->pdev->dev, p_virt = dma_alloc_coherent(&cdev->pdev->dev,
...@@ -2381,7 +2379,6 @@ static int qed_int_sb_attn_alloc(struct qed_hwfn *p_hwfn, ...@@ -2381,7 +2379,6 @@ static int qed_int_sb_attn_alloc(struct qed_hwfn *p_hwfn,
&p_phys, GFP_KERNEL); &p_phys, GFP_KERNEL);
if (!p_virt) { if (!p_virt) {
DP_NOTICE(cdev, "Failed to allocate status block (attentions)\n");
kfree(p_sb); kfree(p_sb);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2667,17 +2664,14 @@ static int qed_int_sp_sb_alloc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -2667,17 +2664,14 @@ static int qed_int_sp_sb_alloc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
/* SB struct */ /* SB struct */
p_sb = kmalloc(sizeof(*p_sb), GFP_KERNEL); p_sb = kmalloc(sizeof(*p_sb), GFP_KERNEL);
if (!p_sb) { if (!p_sb)
DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_sb_info'\n");
return -ENOMEM; return -ENOMEM;
}
/* SB ring */ /* SB ring */
p_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, p_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
SB_ALIGNED_SIZE(p_hwfn), SB_ALIGNED_SIZE(p_hwfn),
&p_phys, GFP_KERNEL); &p_phys, GFP_KERNEL);
if (!p_virt) { if (!p_virt) {
DP_NOTICE(p_hwfn, "Failed to allocate status block\n");
kfree(p_sb); kfree(p_sb);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2959,7 +2953,6 @@ int qed_int_igu_read_cam(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -2959,7 +2953,6 @@ int qed_int_igu_read_cam(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
u16 prev_sb_id = 0xFF; u16 prev_sb_id = 0xFF;
p_hwfn->hw_info.p_igu_info = kzalloc(sizeof(*p_igu_info), GFP_KERNEL); p_hwfn->hw_info.p_igu_info = kzalloc(sizeof(*p_igu_info), GFP_KERNEL);
if (!p_hwfn->hw_info.p_igu_info) if (!p_hwfn->hw_info.p_igu_info)
return -ENOMEM; return -ENOMEM;
...@@ -3121,18 +3114,14 @@ int qed_int_alloc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -3121,18 +3114,14 @@ int qed_int_alloc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
int rc = 0; int rc = 0;
rc = qed_int_sp_dpc_alloc(p_hwfn); rc = qed_int_sp_dpc_alloc(p_hwfn);
if (rc) { if (rc)
DP_ERR(p_hwfn->cdev, "Failed to allocate sp dpc mem\n");
return rc; return rc;
}
rc = qed_int_sp_sb_alloc(p_hwfn, p_ptt); rc = qed_int_sp_sb_alloc(p_hwfn, p_ptt);
if (rc) { if (rc)
DP_ERR(p_hwfn->cdev, "Failed to allocate sp sb mem\n");
return rc; return rc;
}
rc = qed_int_sb_attn_alloc(p_hwfn, p_ptt); rc = qed_int_sb_attn_alloc(p_hwfn, p_ptt);
if (rc)
DP_ERR(p_hwfn->cdev, "Failed to allocate sb attn mem\n");
return rc; return rc;
} }
......
...@@ -841,10 +841,8 @@ static int qed_slowpath_start(struct qed_dev *cdev, ...@@ -841,10 +841,8 @@ static int qed_slowpath_start(struct qed_dev *cdev,
if (IS_PF(cdev)) { if (IS_PF(cdev)) {
/* Allocate stream for unzipping */ /* Allocate stream for unzipping */
rc = qed_alloc_stream_mem(cdev); rc = qed_alloc_stream_mem(cdev);
if (rc) { if (rc)
DP_NOTICE(cdev, "Failed to allocate stream memory\n");
goto err2; goto err2;
}
/* First Dword used to diffrentiate between various sources */ /* First Dword used to diffrentiate between various sources */
data = cdev->firmware->data + sizeof(u32); data = cdev->firmware->data + sizeof(u32);
......
...@@ -171,7 +171,6 @@ int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -171,7 +171,6 @@ int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
return 0; return 0;
err: err:
DP_NOTICE(p_hwfn, "Failed to allocate mcp memory\n");
qed_mcp_free(p_hwfn); qed_mcp_free(p_hwfn);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -323,10 +323,8 @@ struct qed_eq *qed_eq_alloc(struct qed_hwfn *p_hwfn, u16 num_elem) ...@@ -323,10 +323,8 @@ struct qed_eq *qed_eq_alloc(struct qed_hwfn *p_hwfn, u16 num_elem)
/* Allocate EQ struct */ /* Allocate EQ struct */
p_eq = kzalloc(sizeof(*p_eq), GFP_KERNEL); p_eq = kzalloc(sizeof(*p_eq), GFP_KERNEL);
if (!p_eq) { if (!p_eq)
DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_eq'\n");
return NULL; return NULL;
}
/* Allocate and initialize EQ chain*/ /* Allocate and initialize EQ chain*/
if (qed_chain_alloc(p_hwfn->cdev, if (qed_chain_alloc(p_hwfn->cdev,
...@@ -335,10 +333,8 @@ struct qed_eq *qed_eq_alloc(struct qed_hwfn *p_hwfn, u16 num_elem) ...@@ -335,10 +333,8 @@ struct qed_eq *qed_eq_alloc(struct qed_hwfn *p_hwfn, u16 num_elem)
QED_CHAIN_CNT_TYPE_U16, QED_CHAIN_CNT_TYPE_U16,
num_elem, num_elem,
sizeof(union event_ring_element), sizeof(union event_ring_element),
&p_eq->chain)) { &p_eq->chain))
DP_NOTICE(p_hwfn, "Failed to allocate eq chain\n");
goto eq_allocate_fail; goto eq_allocate_fail;
}
/* register EQ completion on the SP SB */ /* register EQ completion on the SP SB */
qed_int_register_cb(p_hwfn, qed_eq_completion, qed_int_register_cb(p_hwfn, qed_eq_completion,
...@@ -451,10 +447,8 @@ int qed_spq_alloc(struct qed_hwfn *p_hwfn) ...@@ -451,10 +447,8 @@ int qed_spq_alloc(struct qed_hwfn *p_hwfn)
/* SPQ struct */ /* SPQ struct */
p_spq = kzalloc(sizeof(struct qed_spq), GFP_KERNEL); p_spq = kzalloc(sizeof(struct qed_spq), GFP_KERNEL);
if (!p_spq) { if (!p_spq)
DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_spq'\n");
return -ENOMEM; return -ENOMEM;
}
/* SPQ ring */ /* SPQ ring */
if (qed_chain_alloc(p_hwfn->cdev, if (qed_chain_alloc(p_hwfn->cdev,
...@@ -463,18 +457,14 @@ int qed_spq_alloc(struct qed_hwfn *p_hwfn) ...@@ -463,18 +457,14 @@ int qed_spq_alloc(struct qed_hwfn *p_hwfn)
QED_CHAIN_CNT_TYPE_U16, QED_CHAIN_CNT_TYPE_U16,
0, /* N/A when the mode is SINGLE */ 0, /* N/A when the mode is SINGLE */
sizeof(struct slow_path_element), sizeof(struct slow_path_element),
&p_spq->chain)) { &p_spq->chain))
DP_NOTICE(p_hwfn, "Failed to allocate spq chain\n");
goto spq_allocate_fail; goto spq_allocate_fail;
}
/* allocate and fill the SPQ elements (incl. ramrod data list) */ /* allocate and fill the SPQ elements (incl. ramrod data list) */
capacity = qed_chain_get_capacity(&p_spq->chain); capacity = qed_chain_get_capacity(&p_spq->chain);
p_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, p_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
capacity * capacity * sizeof(struct qed_spq_entry),
sizeof(struct qed_spq_entry),
&p_phys, GFP_KERNEL); &p_phys, GFP_KERNEL);
if (!p_virt) if (!p_virt)
goto spq_allocate_fail; goto spq_allocate_fail;
...@@ -863,10 +853,8 @@ struct qed_consq *qed_consq_alloc(struct qed_hwfn *p_hwfn) ...@@ -863,10 +853,8 @@ struct qed_consq *qed_consq_alloc(struct qed_hwfn *p_hwfn)
/* Allocate ConsQ struct */ /* Allocate ConsQ struct */
p_consq = kzalloc(sizeof(*p_consq), GFP_KERNEL); p_consq = kzalloc(sizeof(*p_consq), GFP_KERNEL);
if (!p_consq) { if (!p_consq)
DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_consq'\n");
return NULL; return NULL;
}
/* Allocate and initialize EQ chain*/ /* Allocate and initialize EQ chain*/
if (qed_chain_alloc(p_hwfn->cdev, if (qed_chain_alloc(p_hwfn->cdev,
...@@ -874,10 +862,8 @@ struct qed_consq *qed_consq_alloc(struct qed_hwfn *p_hwfn) ...@@ -874,10 +862,8 @@ struct qed_consq *qed_consq_alloc(struct qed_hwfn *p_hwfn)
QED_CHAIN_MODE_PBL, QED_CHAIN_MODE_PBL,
QED_CHAIN_CNT_TYPE_U16, QED_CHAIN_CNT_TYPE_U16,
QED_CHAIN_PAGE_SIZE / 0x80, QED_CHAIN_PAGE_SIZE / 0x80,
0x80, &p_consq->chain)) { 0x80, &p_consq->chain))
DP_NOTICE(p_hwfn, "Failed to allocate consq chain");
goto consq_allocate_fail; goto consq_allocate_fail;
}
return p_consq; return p_consq;
......
...@@ -455,10 +455,8 @@ int qed_iov_alloc(struct qed_hwfn *p_hwfn) ...@@ -455,10 +455,8 @@ int qed_iov_alloc(struct qed_hwfn *p_hwfn)
} }
p_sriov = kzalloc(sizeof(*p_sriov), GFP_KERNEL); p_sriov = kzalloc(sizeof(*p_sriov), GFP_KERNEL);
if (!p_sriov) { if (!p_sriov)
DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_sriov'\n");
return -ENOMEM; return -ENOMEM;
}
p_hwfn->pf_iov_info = p_sriov; p_hwfn->pf_iov_info = p_sriov;
...@@ -507,10 +505,9 @@ int qed_iov_hw_info(struct qed_hwfn *p_hwfn) ...@@ -507,10 +505,9 @@ int qed_iov_hw_info(struct qed_hwfn *p_hwfn)
/* Allocate a new struct for IOV information */ /* Allocate a new struct for IOV information */
cdev->p_iov_info = kzalloc(sizeof(*cdev->p_iov_info), GFP_KERNEL); cdev->p_iov_info = kzalloc(sizeof(*cdev->p_iov_info), GFP_KERNEL);
if (!cdev->p_iov_info) { if (!cdev->p_iov_info)
DP_NOTICE(p_hwfn, "Can't support IOV due to lack of memory\n");
return -ENOMEM; return -ENOMEM;
}
cdev->p_iov_info->pos = pos; cdev->p_iov_info->pos = pos;
rc = qed_iov_pci_cfg_info(cdev); rc = qed_iov_pci_cfg_info(cdev);
......
...@@ -331,31 +331,23 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) ...@@ -331,31 +331,23 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
/* Allocate vf sriov info */ /* Allocate vf sriov info */
p_iov = kzalloc(sizeof(*p_iov), GFP_KERNEL); p_iov = kzalloc(sizeof(*p_iov), GFP_KERNEL);
if (!p_iov) { if (!p_iov)
DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_sriov'\n");
return -ENOMEM; return -ENOMEM;
}
/* Allocate vf2pf msg */ /* Allocate vf2pf msg */
p_iov->vf2pf_request = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, p_iov->vf2pf_request = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
sizeof(union vfpf_tlvs), sizeof(union vfpf_tlvs),
&p_iov->vf2pf_request_phys, &p_iov->vf2pf_request_phys,
GFP_KERNEL); GFP_KERNEL);
if (!p_iov->vf2pf_request) { if (!p_iov->vf2pf_request)
DP_NOTICE(p_hwfn,
"Failed to allocate `vf2pf_request' DMA memory\n");
goto free_p_iov; goto free_p_iov;
}
p_iov->pf2vf_reply = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, p_iov->pf2vf_reply = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
sizeof(union pfvf_tlvs), sizeof(union pfvf_tlvs),
&p_iov->pf2vf_reply_phys, &p_iov->pf2vf_reply_phys,
GFP_KERNEL); GFP_KERNEL);
if (!p_iov->pf2vf_reply) { if (!p_iov->pf2vf_reply)
DP_NOTICE(p_hwfn,
"Failed to allocate `pf2vf_reply' DMA memory\n");
goto free_vf2pf_request; goto free_vf2pf_request;
}
DP_VERBOSE(p_hwfn, DP_VERBOSE(p_hwfn,
QED_MSG_IOV, QED_MSG_IOV,
......
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