From: Rasesh Mody Date: Wed, 29 Mar 2017 20:36:40 +0000 (-0700) Subject: net/qede/base: change valloc to vzalloc X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a261b214b2444cf50bd0cdf4e3b97d25d80334ec;p=dpdk.git net/qede/base: change valloc to vzalloc Change OSAL_VALLOC() into OSAL_VZALLOC() which would also zero memory. Signed-off-by: Rasesh Mody --- diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h index 4c91dc057a..052a0cf89a 100644 --- a/drivers/net/qede/base/bcm_osal.h +++ b/drivers/net/qede/base/bcm_osal.h @@ -89,7 +89,7 @@ typedef int bool; #define OSAL_ALLOC(dev, GFP, size) rte_malloc("qede", size, 0) #define OSAL_ZALLOC(dev, GFP, size) rte_zmalloc("qede", size, 0) #define OSAL_CALLOC(dev, GFP, num, size) rte_calloc("qede", num, size, 0) -#define OSAL_VALLOC(dev, size) rte_malloc("qede", size, 0) +#define OSAL_VZALLOC(dev, size) rte_zmalloc("qede", size, 0) #define OSAL_FREE(dev, memory) \ do { \ rte_free((void *)memory); \ diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c index 0840d49fc1..6d75e60443 100644 --- a/drivers/net/qede/base/ecore_dev.c +++ b/drivers/net/qede/base/ecore_dev.c @@ -3717,13 +3717,12 @@ ecore_chain_alloc_pbl(struct ecore_dev *p_dev, u32 page_cnt = p_chain->page_cnt, size, i; size = page_cnt * sizeof(*pp_virt_addr_tbl); - pp_virt_addr_tbl = (void **)OSAL_VALLOC(p_dev, size); + pp_virt_addr_tbl = (void **)OSAL_VZALLOC(p_dev, size); if (!pp_virt_addr_tbl) { DP_NOTICE(p_dev, true, "Failed to allocate memory for the chain virtual addresses table\n"); return ECORE_NOMEM; } - OSAL_MEM_ZERO(pp_virt_addr_tbl, size); /* The allocation of the PBL table is done with its full size, since it * is expected to be successive. diff --git a/drivers/net/qede/base/ecore_l2.c b/drivers/net/qede/base/ecore_l2.c index 2635213acc..4d26e19979 100644 --- a/drivers/net/qede/base/ecore_l2.c +++ b/drivers/net/qede/base/ecore_l2.c @@ -50,10 +50,9 @@ _ecore_eth_queue_to_cid(struct ecore_hwfn *p_hwfn, struct ecore_queue_cid *p_cid; enum _ecore_status_t rc; - p_cid = OSAL_VALLOC(p_hwfn->p_dev, sizeof(*p_cid)); + p_cid = OSAL_VZALLOC(p_hwfn->p_dev, sizeof(*p_cid)); if (p_cid == OSAL_NULL) return OSAL_NULL; - OSAL_MEM_ZERO(p_cid, sizeof(*p_cid)); p_cid->opaque_fid = opaque_fid; p_cid->cid = cid; diff --git a/drivers/net/qede/base/ecore_mng_tlv.c b/drivers/net/qede/base/ecore_mng_tlv.c index 0065d12c3f..0bf1be883b 100644 --- a/drivers/net/qede/base/ecore_mng_tlv.c +++ b/drivers/net/qede/base/ecore_mng_tlv.c @@ -1413,11 +1413,10 @@ ecore_mfw_update_tlvs(u8 tlv_group, struct ecore_hwfn *p_hwfn, u32 offset; int len; - p_tlv_data = OSAL_VALLOC(p_hwfn->p_dev, sizeof(*p_tlv_data)); + p_tlv_data = OSAL_VZALLOC(p_hwfn->p_dev, sizeof(*p_tlv_data)); if (!p_tlv_data) return ECORE_NOMEM; - OSAL_MEMSET(p_tlv_data, 0, sizeof(*p_tlv_data)); if (OSAL_MFW_FILL_TLV_DATA(p_hwfn, tlv_group, p_tlv_data)) { OSAL_VFREE(p_hwfn->p_dev, p_tlv_data); return ECORE_INVAL; @@ -1487,7 +1486,7 @@ ecore_mfw_process_tlv_req(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt) goto drv_done; } - p_mfw_buf = (void *)OSAL_VALLOC(p_hwfn->p_dev, size); + p_mfw_buf = (void *)OSAL_VZALLOC(p_hwfn->p_dev, size); if (!p_mfw_buf) { DP_NOTICE(p_hwfn, false, "Failed allocate memory for p_mfw_buf\n"); diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c index 280c9924ea..aab99250fa 100644 --- a/drivers/net/qede/base/ecore_sriov.c +++ b/drivers/net/qede/base/ecore_sriov.c @@ -2845,7 +2845,7 @@ static void ecore_iov_vf_mbx_vport_update(struct ecore_hwfn *p_hwfn, goto out; } - p_rss_params = OSAL_VALLOC(p_hwfn->p_dev, sizeof(*p_rss_params)); + p_rss_params = OSAL_VZALLOC(p_hwfn->p_dev, sizeof(*p_rss_params)); if (p_rss_params == OSAL_NULL) { status = PFVF_STATUS_FAILURE; goto out;