Date: Tue, 16 May 2017 21:46:30 +0000 (UTC) From: David C Somayajulu <davidcs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318383 - head/sys/dev/qlnx/qlnxe Message-ID: <201705162146.v4GLkUMQ047015@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: davidcs Date: Tue May 16 21:46:30 2017 New Revision: 318383 URL: https://svnweb.freebsd.org/changeset/base/318383 Log: QL_DPRINT macro modfied to handle multiple args; print line#. Submitted by:Shminderjit.Singh@cavium.com MFC after:3 days Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_def.h Tue May 16 21:34:40 2017 (r318382) +++ head/sys/dev/qlnx/qlnxe/qlnx_def.h Tue May 16 21:46:30 2017 (r318383) @@ -483,35 +483,141 @@ typedef struct qlnx_host qlnx_host_t; #ifdef QLNX_DEBUG -#define QL_DPRINT1(ha, x) if (ha->dbg_level & 0x0001) device_printf x -#define QL_DPRINT2(ha, x) if (ha->dbg_level & 0x0002) device_printf x -#define QL_DPRINT3(ha, x) if (ha->dbg_level & 0x0004) device_printf x -#define QL_DPRINT4(ha, x) if (ha->dbg_level & 0x0008) device_printf x -#define QL_DPRINT5(ha, x) if (ha->dbg_level & 0x0010) device_printf x -#define QL_DPRINT6(ha, x) if (ha->dbg_level & 0x0020) device_printf x -#define QL_DPRINT7(ha, x) if (ha->dbg_level & 0x0040) device_printf x -#define QL_DPRINT8(ha, x) if (ha->dbg_level & 0x0080) device_printf x -#define QL_DPRINT9(ha, x) if (ha->dbg_level & 0x0100) device_printf x -#define QL_DPRINT11(ha, x) if (ha->dbg_level & 0x0400) device_printf x -#define QL_DPRINT12(ha, x) if (ha->dbg_level & 0x0800) device_printf x -#define QL_DPRINT13(ha, x) if (ha->dbg_level & 0x1000) device_printf x -#define QL_DPRINT14(ha, x) if (ha->dbg_level & 0x2000) device_printf x +#define QL_DPRINT1(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0001) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT2(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0002) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT3(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0004) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT4(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0008) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT5(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0010) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT6(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0020) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT7(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0040) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT8(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0080) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT9(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0100) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT11(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0400) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT12(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x0800) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + +#define QL_DPRINT13(ha, x, ...) \ + do { \ + if ((ha)->dbg_level & 0x1000) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x, \ + __func__, __LINE__, \ + ## __VA_ARGS__); \ + } \ + } while (0) + #else -#define QL_DPRINT1(ha, x) -#define QL_DPRINT2(ha, x) -#define QL_DPRINT3(ha, x) -#define QL_DPRINT4(ha, x) -#define QL_DPRINT5(ha, x) -#define QL_DPRINT6(ha, x) -#define QL_DPRINT7(ha, x) -#define QL_DPRINT8(ha, x) -#define QL_DPRINT9(ha, x) -#define QL_DPRINT11(ha, x) -#define QL_DPRINT12(ha, x) -#define QL_DPRINT13(ha, x) -#define QL_DPRINT14(ha, x) +#define QL_DPRINT1(ha, x, ...) +#define QL_DPRINT2(ha, x, ...) +#define QL_DPRINT3(ha, x, ...) +#define QL_DPRINT4(ha, x, ...) +#define QL_DPRINT5(ha, x, ...) +#define QL_DPRINT6(ha, x, ...) +#define QL_DPRINT7(ha, x, ...) +#define QL_DPRINT8(ha, x, ...) +#define QL_DPRINT9(ha, x, ...) +#define QL_DPRINT11(ha, x, ...) +#define QL_DPRINT12(ha, x, ...) +#define QL_DPRINT13(ha, x, ...) #endif /* #ifdef QLNX_DEBUG */ Modified: head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c Tue May 16 21:34:40 2017 (r318382) +++ head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c Tue May 16 21:46:30 2017 (r318383) @@ -121,8 +121,7 @@ qlnx_grc_dump(qlnx_host_t *ha, uint32_t p_ptt = ecore_ptt_acquire(p_hwfn); if (!p_ptt) { - QL_DPRINT1(ha, (ha->pci_dev, "%s : ecore_ptt_acquire failed\n", - __func__)); + QL_DPRINT1(ha,"ecore_ptt_acquire failed\n"); return (rval); } @@ -133,9 +132,8 @@ qlnx_grc_dump(qlnx_host_t *ha, uint32_t rval = 0; ha->grcdump_taken = 1; } else - QL_DPRINT1(ha, (ha->pci_dev, - "%s : ecore_dbg_grc_dump failed [%d, 0x%x]\n", - __func__, hwfn_index, rval)); + QL_DPRINT1(ha,"ecore_dbg_grc_dump failed [%d, 0x%x]\n", + hwfn_index, rval); ecore_ptt_release(p_hwfn, p_ptt); @@ -177,8 +175,7 @@ qlnx_get_grc_dump(qlnx_host_t *ha, qlnx_ grcdump->grcdump_dwords[i] = dwords; - QL_DPRINT1(ha, (ha->pci_dev, "%s: grcdump_dwords[%d] = 0x%x\n", - __func__, i, dwords)); + QL_DPRINT1(ha,"grcdump_dwords[%d] = 0x%x\n", i, dwords); rval = copyout(ha->grcdump[i], grcdump->grcdump[i], ha->grcdump_size[i]); @@ -213,8 +210,7 @@ qlnx_idle_chk(qlnx_host_t *ha, uint32_t p_ptt = ecore_ptt_acquire(p_hwfn); if (!p_ptt) { - QL_DPRINT1(ha, (ha->pci_dev, - "%s : ecore_ptt_acquire failed\n", __func__)); + QL_DPRINT1(ha,"ecore_ptt_acquire failed\n"); return (rval); } @@ -225,9 +221,8 @@ qlnx_idle_chk(qlnx_host_t *ha, uint32_t rval = 0; ha->idle_chk_taken = 1; } else - QL_DPRINT1(ha, (ha->pci_dev, - "%s : ecore_dbg_idle_chk_dump failed [%d, 0x%x]\n", - __func__, hwfn_index, rval)); + QL_DPRINT1(ha,"ecore_dbg_idle_chk_dump failed [%d, 0x%x]\n", + hwfn_index, rval); ecore_ptt_release(p_hwfn, p_ptt); @@ -271,8 +266,7 @@ qlnx_get_idle_chk(qlnx_host_t *ha, qlnx_ idle_chk->idle_chk_dwords[i] = dwords; - QL_DPRINT1(ha, (ha->pci_dev, "%s: idle_chk_dwords[%d] = 0x%x\n", - __func__, i, dwords)); + QL_DPRINT1(ha,"idle_chk_dwords[%d] = 0x%x\n", i, dwords); rval = copyout(ha->idle_chk[i], idle_chk->idle_chk[i], ha->idle_chk_size[i]); @@ -299,9 +293,8 @@ qlnx_get_trace_cmd_size(qlnx_host_t *ha, p_ptt = ecore_ptt_acquire(p_hwfn); if (!p_ptt) { - QL_DPRINT1(ha, (ha->pci_dev, - "%s: ecore_ptt_acquire [%d, 0x%x]failed\n", - __func__, hwfn_index, cmd)); + QL_DPRINT1(ha, "ecore_ptt_acquire [%d, 0x%x]failed\n", + hwfn_index, cmd); return (0); } @@ -334,8 +327,7 @@ qlnx_get_trace_cmd_size(qlnx_host_t *ha, } if (rval != DBG_STATUS_OK) { - QL_DPRINT1(ha, (ha->pci_dev, "%s : cmd = 0x%x failed [0x%x]\n", - __func__, cmd, rval)); + QL_DPRINT1(ha,"cmd = 0x%x failed [0x%x]\n", cmd, rval); num_dwords = 0; } @@ -369,9 +361,8 @@ qlnx_get_trace(qlnx_host_t *ha, int hwfn buffer = qlnx_zalloc(trace->size[hwfn_index]); if (buffer == NULL) { - QL_DPRINT1(ha, (ha->pci_dev, - "%s: qlnx_zalloc [%d, 0x%x]failed\n", - __func__, hwfn_index, trace->cmd)); + QL_DPRINT1(ha,"qlnx_zalloc [%d, 0x%x]failed\n", + hwfn_index, trace->cmd); return (ENXIO); } ecore_dbg_set_app_ver(ecore_dbg_get_fw_func_ver()); @@ -380,9 +371,8 @@ qlnx_get_trace(qlnx_host_t *ha, int hwfn p_ptt = ecore_ptt_acquire(p_hwfn); if (!p_ptt) { - QL_DPRINT1(ha, (ha->pci_dev, - "%s: ecore_ptt_acquire [%d, 0x%x]failed\n", - __func__, hwfn_index, trace->cmd)); + QL_DPRINT1(ha, "ecore_ptt_acquire [%d, 0x%x]failed\n", + hwfn_index, trace->cmd); return (ENXIO); } @@ -420,8 +410,7 @@ qlnx_get_trace(qlnx_host_t *ha, int hwfn } if (rval != DBG_STATUS_OK) { - QL_DPRINT1(ha, (ha->pci_dev, "%s : cmd = 0x%x failed [0x%x]\n", - __func__, trace->cmd, rval)); + QL_DPRINT1(ha,"cmd = 0x%x failed [0x%x]\n", trace->cmd, rval); num_dwords = 0; } @@ -609,21 +598,18 @@ qlnx_write_nvram(qlnx_host_t *ha, qlnx_n ret = copyin(nvram->data, buf, nvram->data_len); - QL_DPRINT9(ha, - (ha->pci_dev, "%s: issue cmd = 0x%x data = %p " - " data_len = 0x%x ret = 0x%x exit\n", __func__, - cmd, nvram->data, nvram->data_len, ret)); + QL_DPRINT9(ha, "issue cmd = 0x%x data = %p \ + data_len = 0x%x ret = 0x%x exit\n", + cmd, nvram->data, nvram->data_len, ret); if (ret == 0) { ret = ecore_mcp_nvm_write(&ha->cdev, cmd, nvram->offset, buf, nvram->data_len); } - QL_DPRINT9(ha, - (ha->pci_dev, "%s: cmd = 0x%x data = %p " - " data_len = 0x%x resp = 0x%x ret = 0x%x exit\n", - __func__, cmd, nvram->data, nvram->data_len, - ha->cdev.mcp_nvm_resp, ret)); + QL_DPRINT9(ha, "cmd = 0x%x data = %p \ + data_len = 0x%x resp = 0x%x ret = 0x%x exit\n", + cmd, nvram->data, nvram->data_len, ha->cdev.mcp_nvm_resp, ret); free(buf, M_QLNXBUF); @@ -644,10 +630,9 @@ qlnx_read_nvram(qlnx_host_t *ha, qlnx_nv ret = ecore_mcp_nvm_read(&ha->cdev, nvram->offset, buf, nvram->data_len); - QL_DPRINT9(ha, (ha->pci_dev, "%s: data = %p data_len = 0x%x " - " resp = 0x%x ret = 0x%x exit\n", __func__, - nvram->data, nvram->data_len, - ha->cdev.mcp_nvm_resp, ret)); + QL_DPRINT9(ha, " data = %p data_len = 0x%x \ + resp = 0x%x ret = 0x%x exit\n", + nvram->data, nvram->data_len, ha->cdev.mcp_nvm_resp, ret); if (ret == 0) { ret = copyout(buf, nvram->data, nvram->data_len); @@ -672,10 +657,9 @@ qlnx_get_nvram_resp(qlnx_host_t *ha, qln ret = ecore_mcp_nvm_resp(&ha->cdev, buf); - QL_DPRINT9(ha, (ha->pci_dev, "%s: data = %p data_len = 0x%x " - " resp = 0x%x ret = 0x%x exit\n", __func__, - nvram->data, nvram->data_len, - ha->cdev.mcp_nvm_resp, ret)); + QL_DPRINT9(ha, "data = %p data_len = 0x%x \ + resp = 0x%x ret = 0x%x exit\n", + nvram->data, nvram->data_len, ha->cdev.mcp_nvm_resp, ret); if (ret == 0) { ret = copyout(buf, nvram->data, nvram->data_len); @@ -708,28 +692,25 @@ qlnx_nvram(qlnx_host_t *ha, qlnx_nvram_t case QLNX_NVRAM_CMD_SET_SECURE_MODE: ret = ecore_mcp_nvm_set_secure_mode(&ha->cdev, nvram->offset); - QL_DPRINT9(ha, (ha->pci_dev, - "%s: QLNX_NVRAM_CMD_SET_SECURE_MODE " - " resp = 0x%x ret = 0x%x exit\n", __func__, - ha->cdev.mcp_nvm_resp, ret)); + QL_DPRINT9(ha, "QLNX_NVRAM_CMD_SET_SECURE_MODE \ + resp = 0x%x ret = 0x%x exit\n", + ha->cdev.mcp_nvm_resp, ret); break; case QLNX_NVRAM_CMD_DEL_FILE: ret = ecore_mcp_nvm_del_file(&ha->cdev, nvram->offset); - QL_DPRINT9(ha, (ha->pci_dev, - "%s: QLNX_NVRAM_CMD_DEL_FILE " - " resp = 0x%x ret = 0x%x exit\n", __func__, - ha->cdev.mcp_nvm_resp, ret)); + QL_DPRINT9(ha, "QLNX_NVRAM_CMD_DEL_FILE \ + resp = 0x%x ret = 0x%x exit\n", + ha->cdev.mcp_nvm_resp, ret); break; case QLNX_NVRAM_CMD_PUT_FILE_BEGIN: ret = ecore_mcp_nvm_put_file_begin(&ha->cdev, nvram->offset); - QL_DPRINT9(ha, (ha->pci_dev, - "%s: QLNX_NVRAM_CMD_PUT_FILE_BEGIN " - " resp = 0x%x ret = 0x%x exit\n", __func__, - ha->cdev.mcp_nvm_resp, ret)); + QL_DPRINT9(ha, "QLNX_NVRAM_CMD_PUT_FILE_BEGIN \ + resp = 0x%x ret = 0x%x exit\n", + ha->cdev.mcp_nvm_resp, ret); break; case QLNX_NVRAM_CMD_GET_NVRAM_RESP: Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Tue May 16 21:34:40 2017 (r318382) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Tue May 16 21:46:30 2017 (r318383) @@ -303,7 +303,7 @@ qlnx_sp_intr(void *arg) ha = (qlnx_host_t *)p_hwfn->p_dev; - QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); + QL_DPRINT2(ha, "enter\n"); for (i = 0; i < ha->cdev.num_hwfns; i++) { if (&ha->cdev.hwfns[i] == p_hwfn) { @@ -311,7 +311,7 @@ qlnx_sp_intr(void *arg) break; } } - QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); + QL_DPRINT2(ha, "exit\n"); return; } @@ -353,8 +353,7 @@ qlnx_create_sp_taskqueues(qlnx_host_t *h taskqueue_start_threads(&ha->sp_taskqueue[i], 1, PI_NET, "%s", tq_name); - QL_DPRINT1(ha, (ha->pci_dev, "%s: %p\n", __func__, - ha->sp_taskqueue[i])); + QL_DPRINT1(ha, "%p\n", ha->sp_taskqueue[i]); } return (0); @@ -518,7 +517,7 @@ qlnx_fp_taskqueue_exit: ecore_sb_ack(fp->sb_info, IGU_INT_ENABLE, 1); } - QL_DPRINT2(ha, (ha->pci_dev, "%s: exit ret = %d\n", __func__, ret)); + QL_DPRINT2(ha, "exit ret = %d\n", ret); return; } @@ -548,8 +547,7 @@ qlnx_create_fp_taskqueues(qlnx_host_t *h taskqueue_start_threads(&fp->fp_taskqueue, 1, PI_NET, "%s", tq_name); - QL_DPRINT1(ha, (ha->pci_dev, "%s: %p\n", __func__, - fp->fp_taskqueue)); + QL_DPRINT1(ha, "%p\n",fp->fp_taskqueue); } return (0); @@ -711,15 +709,14 @@ qlnx_pci_attach(device_t dev) else ha->num_rss = ha->msix_count - ha->cdev.num_hwfns; - QL_DPRINT1(ha, (dev, "%s:\n\t\t\tpci_reg [%p, 0x%08x 0x%08x]" + QL_DPRINT1(ha, "\n\t\t\tpci_reg [%p, 0x%08x 0x%08x]" "\n\t\t\tdbells [%p, 0x%08x 0x%08x]" "\n\t\t\tmsix [%p, 0x%08x 0x%08x 0x%x 0x%x]" "\n\t\t\t[ncpus = %d][num_rss = 0x%x] [num_tc = 0x%x]\n", - __func__, ha->pci_reg, rsrc_len_reg, + ha->pci_reg, rsrc_len_reg, ha->reg_rid, ha->pci_dbells, rsrc_len_dbells, ha->dbells_rid, ha->msix_bar, rsrc_len_msix, ha->msix_rid, pci_msix_count(dev), - ha->msix_count, mp_ncpus, ha->num_rss, ha->num_tc)); - + ha->msix_count, mp_ncpus, ha->num_rss, ha->num_tc); if (pci_alloc_msix(dev, &ha->msix_count)) { device_printf(dev, "%s: pci_alloc_msix[%d] failed\n", __func__, ha->msix_count); @@ -755,9 +752,9 @@ qlnx_pci_attach(device_t dev) goto qlnx_pci_attach_err; } - QL_DPRINT1(ha, (dev, "%s: p_hwfn [%p] sp_irq_rid %d" - " sp_irq %p sp_handle %p\n", __func__, p_hwfn, - ha->sp_irq_rid[i], ha->sp_irq[i], ha->sp_handle[i])); + QL_DPRINT1(ha, "p_hwfn [%p] sp_irq_rid %d" + " sp_irq %p sp_handle %p\n", p_hwfn, + ha->sp_irq_rid[i], ha->sp_irq[i], ha->sp_handle[i]); } @@ -800,8 +797,8 @@ qlnx_pci_attach(device_t dev) goto qlnx_pci_attach_err; ha->grcdump_size[i] = ha->grcdump_size[i] << 2; - QL_DPRINT1(ha, (dev, "grcdump_size[%d] = 0x%08x\n", - i, ha->grcdump_size[i])); + QL_DPRINT1(ha, "grcdump_size[%d] = 0x%08x\n", + i, ha->grcdump_size[i]); ha->grcdump[i] = qlnx_zalloc(ha->grcdump_size[i]); if (ha->grcdump[i] == NULL) { @@ -815,8 +812,8 @@ qlnx_pci_attach(device_t dev) goto qlnx_pci_attach_err; ha->idle_chk_size[i] = ha->idle_chk_size[i] << 2; - QL_DPRINT1(ha, (dev, "idle_chk_size[%d] = 0x%08x\n", - i, ha->idle_chk_size[i])); + QL_DPRINT1(ha, "idle_chk_size[%d] = 0x%08x\n", + i, ha->idle_chk_size[i]); ha->idle_chk[i] = qlnx_zalloc(ha->idle_chk_size[i]); @@ -855,8 +852,8 @@ qlnx_pci_attach(device_t dev) FW_MAJOR_VERSION, FW_MINOR_VERSION, FW_REVISION_VERSION, FW_ENGINEERING_VERSION); - QL_DPRINT1(ha, (dev, "%s: STORM_FW version %s MFW version %s\n", - __func__, ha->stormfw_ver, ha->mfw_ver)); + QL_DPRINT1(ha, "STORM_FW version %s MFW version %s\n", + ha->stormfw_ver, ha->mfw_ver); qlnx_init_ifnet(dev, ha); @@ -874,7 +871,7 @@ qlnx_pci_attach_err0: goto qlnx_pci_attach_err; } - QL_DPRINT2(ha, (dev, "%s: success\n", __func__)); + QL_DPRINT2(ha, "success\n"); return (0); @@ -958,7 +955,7 @@ qlnx_release(qlnx_host_t *ha) dev = ha->pci_dev; - QL_DPRINT2(ha, (dev, "%s: enter\n", __func__)); + QL_DPRINT2(ha, "enter\n"); for (i = 0; i < QLNX_MAX_HW_FUNCS; i++) { if (ha->idle_chk[i] != NULL) { @@ -1041,7 +1038,7 @@ qlnx_release(qlnx_host_t *ha) (void) bus_release_resource(dev, SYS_RES_MEMORY, ha->msix_rid, ha->msix_bar); - QL_DPRINT2(ha, (dev, "%s: exit\n", __func__)); + QL_DPRINT2(ha, "exit\n"); return; } @@ -1053,14 +1050,14 @@ qlnx_trigger_dump(qlnx_host_t *ha) if (ha->ifp != NULL) ha->ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); - QL_DPRINT2(ha, (ha->pci_dev, "%s: start\n", __func__)); + QL_DPRINT2(ha, "enter\n"); for (i = 0; i < ha->cdev.num_hwfns; i++) { qlnx_grc_dump(ha, &ha->grcdump_dwords[i], i); qlnx_idle_chk(ha, &ha->idle_chk_dwords[i], i); } - QL_DPRINT2(ha, (ha->pci_dev, "%s: end\n", __func__)); + QL_DPRINT2(ha, "exit\n"); return; } @@ -1779,12 +1776,11 @@ qlnx_add_sysctls(qlnx_host_t *ha) "\tpersonality = 6 => Default in Shared Memory\n"); ha->dbg_level = 0; - SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "debug", CTLFLAG_RW, &ha->dbg_level, ha->dbg_level, "Debug Level"); - ha->dp_level = 0; + ha->dp_level = 0x01; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "dp_level", CTLFLAG_RW, &ha->dp_level, ha->dp_level, "DP Level"); @@ -1999,7 +1995,7 @@ qlnx_init_ifnet(device_t dev, qlnx_host_ ifmedia_set(&ha->media, (IFM_ETHER | IFM_AUTO)); - QL_DPRINT2(ha, (dev, "%s: exit\n", __func__)); + QL_DPRINT2(ha, "exit\n"); return; } @@ -2009,6 +2005,8 @@ qlnx_init_locked(qlnx_host_t *ha) { struct ifnet *ifp = ha->ifp; + QL_DPRINT1(ha, "Driver Initialization start \n"); + qlnx_stop(ha); if (qlnx_load(ha) == 0) { @@ -2026,13 +2024,13 @@ qlnx_init(void *arg) ha = (qlnx_host_t *)arg; - QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); + QL_DPRINT2(ha, "enter\n"); QLNX_LOCK(ha); qlnx_init_locked(ha); QLNX_UNLOCK(ha); - QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); + QL_DPRINT2(ha, "exit\n"); return; } @@ -2221,8 +2219,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd switch (cmd) { case SIOCSIFADDR: - QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFADDR (0x%lx)\n", - __func__, cmd)); + QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx)\n", cmd); if (ifa->ifa_addr->sa_family == AF_INET) { ifp->if_flags |= IFF_UP; @@ -2231,10 +2228,8 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd qlnx_init_locked(ha); QLNX_UNLOCK(ha); } - QL_DPRINT4(ha, (ha->pci_dev, - "%s: SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n", - __func__, cmd, - ntohl(IA_SIN(ifa)->sin_addr.s_addr))); + QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n", + cmd, ntohl(IA_SIN(ifa)->sin_addr.s_addr)); arp_ifinit(ifp, ifa); } else { @@ -2243,8 +2238,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd break; case SIOCSIFMTU: - QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFMTU (0x%lx)\n", - __func__, cmd)); + QL_DPRINT4(ha, "SIOCSIFMTU (0x%lx)\n", cmd); if (ifr->ifr_mtu > QLNX_MAX_MTU) { ret = EINVAL; @@ -2263,8 +2257,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd break; case SIOCSIFFLAGS: - QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFFLAGS (0x%lx)\n", - __func__, cmd)); + QL_DPRINT4(ha, "SIOCSIFFLAGS (0x%lx)\n", cmd); QLNX_LOCK(ha); @@ -2292,8 +2285,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd break; case SIOCADDMULTI: - QL_DPRINT4(ha, (ha->pci_dev, - "%s: %s (0x%lx)\n", __func__, "SIOCADDMULTI", cmd)); + QL_DPRINT4(ha, "%s (0x%lx)\n", "SIOCADDMULTI", cmd); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if (qlnx_set_multi(ha, 1)) @@ -2302,8 +2294,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd break; case SIOCDELMULTI: - QL_DPRINT4(ha, (ha->pci_dev, - "%s: %s (0x%lx)\n", __func__, "SIOCDELMULTI", cmd)); + QL_DPRINT4(ha, "%s (0x%lx)\n", "SIOCDELMULTI", cmd); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if (qlnx_set_multi(ha, 0)) @@ -2313,9 +2304,8 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd case SIOCSIFMEDIA: case SIOCGIFMEDIA: - QL_DPRINT4(ha, (ha->pci_dev, - "%s: SIOCSIFMEDIA/SIOCGIFMEDIA (0x%lx)\n", - __func__, cmd)); + QL_DPRINT4(ha, "SIOCSIFMEDIA/SIOCGIFMEDIA (0x%lx)\n", cmd); + ret = ifmedia_ioctl(ifp, ifr, &ha->media, cmd); break; @@ -2323,8 +2313,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd mask = ifr->ifr_reqcap ^ ifp->if_capenable; - QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFCAP (0x%lx)\n", - __func__, cmd)); + QL_DPRINT4(ha, "SIOCSIFCAP (0x%lx)\n", cmd); if (mask & IFCAP_HWCSUM) ifp->if_capenable ^= IFCAP_HWCSUM; @@ -2367,8 +2356,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd p_ptt = ecore_ptt_acquire(p_hwfn); if (!p_ptt) { - QL_DPRINT1(ha, (ha->pci_dev, "%s :" - " ecore_ptt_acquire failed\n", __func__)); + QL_DPRINT1(ha, "ecore_ptt_acquire failed\n"); ret = -1; break; } @@ -2386,20 +2374,19 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd ret = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); - QL_DPRINT8(ha, (ha->pci_dev, "SIOCGI2C copyout ret = %d" - " len = %d addr = 0x%02x offset = 0x%04x" - " data[0..7]=0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" - " 0x%02x 0x%02x 0x%02x\n", + QL_DPRINT8(ha, "SIOCGI2C copyout ret = %d \ + len = %d addr = 0x%02x offset = 0x%04x \ + data[0..7]=0x%02x 0x%02x 0x%02x 0x%02x 0x%02x \ + 0x%02x 0x%02x 0x%02x\n", ret, i2c.len, i2c.dev_addr, i2c.offset, i2c.data[0], i2c.data[1], i2c.data[2], i2c.data[3], - i2c.data[4], i2c.data[5], i2c.data[6], i2c.data[7])); + i2c.data[4], i2c.data[5], i2c.data[6], i2c.data[7]); break; } #endif /* #if (__FreeBSD_version >= 1100101) */ default: - QL_DPRINT4(ha, (ha->pci_dev, "%s: default (0x%lx)\n", - __func__, cmd)); + QL_DPRINT4(ha, "default (0x%lx)\n", cmd); ret = ether_ioctl(ifp, cmd, data); break; } @@ -2416,14 +2403,14 @@ qlnx_media_change(struct ifnet *ifp) ha = (qlnx_host_t *)ifp->if_softc; - QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); + QL_DPRINT2(ha, "enter\n"); ifm = &ha->media; if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) ret = EINVAL; - QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); + QL_DPRINT2(ha, "exit\n"); return (ret); } @@ -2435,7 +2422,7 @@ qlnx_media_status(struct ifnet *ifp, str ha = (qlnx_host_t *)ifp->if_softc; - QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); + QL_DPRINT2(ha, "enter\n"); ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; @@ -2451,8 +2438,7 @@ qlnx_media_status(struct ifnet *ifp, str (IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE); } - QL_DPRINT2(ha, (ha->pci_dev, "%s: exit (%s)\n", __func__, - (ha->link_up ? "link_up" : "link_down"))); + QL_DPRINT2(ha, "exit (%s)\n", (ha->link_up ? "link_up" : "link_down")); return; } @@ -2478,20 +2464,19 @@ qlnx_free_tx_pkt(qlnx_host_t *ha, struct QL_RESET_ERR_INJECT(ha, QL_ERR_INJCT_TX_INT_MBUF_NULL); - QL_DPRINT1(ha, (ha->pci_dev, "%s: (mp == NULL) " + QL_DPRINT1(ha, "(mp == NULL) " " tx_idx = 0x%x" " ecore_prod_idx = 0x%x" " ecore_cons_idx = 0x%x" " hw_bd_cons = 0x%x" " txq_db_last = 0x%x" " elem_left = 0x%x\n", - __func__, fp->rss_id, ecore_chain_get_prod_idx(&txq->tx_pbl), ecore_chain_get_cons_idx(&txq->tx_pbl), le16toh(*txq->hw_cons_ptr), txq->tx_db.raw, - ecore_chain_get_elem_left(&txq->tx_pbl))); + ecore_chain_get_elem_left(&txq->tx_pbl)); fp->err_tx_free_pkt_null++; @@ -2552,20 +2537,20 @@ qlnx_tx_int(qlnx_host_t *ha, struct qlnx QL_RESET_ERR_INJECT(ha, QL_ERR_INJCT_TX_INT_DIFF); - QL_DPRINT1(ha, (ha->pci_dev, "%s: (diff = 0x%x) " + QL_DPRINT1(ha, "(diff = 0x%x) " " tx_idx = 0x%x" " ecore_prod_idx = 0x%x" " ecore_cons_idx = 0x%x" " hw_bd_cons = 0x%x" " txq_db_last = 0x%x" " elem_left = 0x%x\n", - __func__, diff, + diff, fp->rss_id, ecore_chain_get_prod_idx(&txq->tx_pbl), ecore_chain_get_cons_idx(&txq->tx_pbl), le16toh(*txq->hw_cons_ptr), txq->tx_db.raw, - ecore_chain_get_elem_left(&txq->tx_pbl))); + ecore_chain_get_elem_left(&txq->tx_pbl)); fp->err_tx_cons_idx_conflict++; @@ -2587,7 +2572,7 @@ qlnx_transmit(struct ifnet *ifp, struct struct qlnx_fastpath *fp; int rss_id = 0, ret = 0; - QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); + QL_DPRINT2(ha, "enter\n"); #if __FreeBSD_version >= 1100000 if (M_HASHTYPE_GET(mp) != M_HASHTYPE_NONE) @@ -2615,7 +2600,7 @@ qlnx_transmit(struct ifnet *ifp, struct qlnx_transmit_exit: - QL_DPRINT2(ha, (ha->pci_dev, "%s: exit ret = %d\n", __func__, ret)); + QL_DPRINT2(ha, "exit ret = %d\n", ret); return ret; } @@ -2629,7 +2614,7 @@ qlnx_qflush(struct ifnet *ifp) ha = (qlnx_host_t *)ifp->if_softc; - QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); + QL_DPRINT2(ha, "enter\n"); for (rss_id = 0; rss_id < ha->num_rss; rss_id++) { @@ -2648,7 +2633,7 @@ qlnx_qflush(struct ifnet *ifp) mtx_unlock(&fp->tx_mtx); } } - QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); + QL_DPRINT2(ha, "exit\n"); return; } @@ -2792,7 +2777,7 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f uint32_t nbds_in_hdr = 0; uint32_t offset = 0; - QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); + QL_DPRINT8(ha, "enter\n"); if (!ha->link_up) return (-1); @@ -2844,8 +2829,7 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f struct mbuf *m; - QL_DPRINT8(ha, (ha->pci_dev, "%s: EFBIG [%d]\n", __func__, - m_head->m_pkthdr.len)); + QL_DPRINT8(ha, "EFBIG [%d]\n", m_head->m_pkthdr.len); fp->tx_defrag++; @@ -2855,9 +2839,7 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f fp->tx_pkts_freed++; m_freem(m_head); *m_headp = NULL; - QL_DPRINT1(ha, (ha->pci_dev, - "%s: m_defrag() = NULL [%d]\n", - __func__, ret)); + QL_DPRINT1(ha, "m_defrag() = NULL [%d]\n", ret); return (ENOBUFS); } @@ -2869,9 +2851,9 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f fp->err_tx_defrag_dmamap_load++; - QL_DPRINT1(ha, (ha->pci_dev, - "%s: bus_dmamap_load_mbuf_sg failed0[%d, %d]\n", - __func__, ret, m_head->m_pkthdr.len)); + QL_DPRINT1(ha, + "bus_dmamap_load_mbuf_sg failed0 [%d, %d]\n", + ret, m_head->m_pkthdr.len); fp->tx_pkts_freed++; m_freem(m_head); @@ -2885,9 +2867,9 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f fp->err_tx_non_tso_max_seg++; - QL_DPRINT1(ha, (ha->pci_dev, - "%s: (%d) nsegs too many for non-TSO[%d, %d]\n", - __func__, ret, nsegs, m_head->m_pkthdr.len)); + QL_DPRINT1(ha, + "(%d) nsegs too many for non-TSO [%d, %d]\n", + ret, nsegs, m_head->m_pkthdr.len); fp->tx_pkts_freed++; m_freem(m_head); @@ -2902,10 +2884,8 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f fp->err_tx_dmamap_load++; - QL_DPRINT1(ha, (ha->pci_dev, - "%s: bus_dmamap_load_mbuf_sg failed1[%d, %d]\n", - __func__, ret, m_head->m_pkthdr.len)); - + QL_DPRINT1(ha, "bus_dmamap_load_mbuf_sg failed1 [%d, %d]\n", + ret, m_head->m_pkthdr.len); fp->tx_pkts_freed++; m_freem(m_head); *m_headp = NULL; @@ -2924,9 +2904,9 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f if ((nsegs + QLNX_TX_ELEM_RESERVE) > (int)(elem_left = ecore_chain_get_elem_left(&txq->tx_pbl))) { - QL_DPRINT1(ha, (ha->pci_dev, "%s: (%d, 0x%x) insuffient BDs" - "in chain[%d] trying to free packets\n", - __func__, nsegs, elem_left, fp->rss_id)); + QL_DPRINT1(ha, "(%d, 0x%x) insuffient BDs" + " in chain[%d] trying to free packets\n", + nsegs, elem_left, fp->rss_id); fp->tx_nsegs_gt_elem_left++; @@ -2935,9 +2915,9 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f if ((nsegs + QLNX_TX_ELEM_RESERVE) > (int)(elem_left = ecore_chain_get_elem_left(&txq->tx_pbl))) { - QL_DPRINT1(ha, (ha->pci_dev, - "%s: (%d, 0x%x) insuffient BDs in chain[%d]\n", - __func__, nsegs, elem_left, fp->rss_id)); + QL_DPRINT1(ha, + "(%d, 0x%x) insuffient BDs in chain[%d]\n", + nsegs, elem_left, fp->rss_id); fp->err_tx_nsegs_gt_elem_left++; fp->tx_ring_full = 1; @@ -3165,7 +3145,7 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f qlnx_txq_doorbell_wr32(ha, txq->doorbell_addr, txq->tx_db.raw); - QL_DPRINT8(ha, (ha->pci_dev, "%s: exit\n", __func__)); + QL_DPRINT8(ha, "exit\n"); return (0); } @@ -3185,6 +3165,8 @@ qlnx_stop(qlnx_host_t *ha) * propagate the if_drv_flags * state to each tx thread */ + QL_DPRINT1(ha, "QLNX STATE = %d\n",ha->state); + if (ha->state == QLNX_STATE_OPEN) { for (i = 0; i < ha->num_rss; i++) { struct qlnx_fastpath *fp = &ha->fp_array[i]; @@ -3277,8 +3259,7 @@ qlnx_rx_jumbo_chain(qlnx_host_t *ha, str mp = sw_rx_data->data; if (mp == NULL) { - QL_DPRINT1(ha, (ha->pci_dev, "%s: mp = NULL\n", - __func__)); + QL_DPRINT1(ha, "mp = NULL\n"); fp->err_rx_mp_null++; rxq->sw_rx_cons = (rxq->sw_rx_cons + 1) & (RX_RING_SIZE - 1); @@ -3293,10 +3274,8 @@ qlnx_rx_jumbo_chain(qlnx_host_t *ha, str if (qlnx_alloc_rx_buffer(ha, rxq) != 0) { - QL_DPRINT1(ha, (ha->pci_dev, - "%s: New buffer allocation failed, dropping" - " incoming packet and reusing its buffer\n", - __func__)); + QL_DPRINT1(ha, "New buffer allocation failed, dropping" + " incoming packet and reusing its buffer\n"); qlnx_reuse_rx_data(rxq); fp->err_rx_alloc_errors++; @@ -3356,29 +3335,29 @@ qlnx_tpa_start(qlnx_host_t *ha, dev = ha->pci_dev; agg_index = cqe->tpa_agg_index; - QL_DPRINT7(ha, (dev, "%s[%d]: enter\n " - "\t type = 0x%x\n" - "\t bitfields = 0x%x\n" - "\t seg_len = 0x%x\n" - "\t pars_flags = 0x%x\n" - "\t vlan_tag = 0x%x\n" - "\t rss_hash = 0x%x\n" - "\t len_on_first_bd = 0x%x\n" - "\t placement_offset = 0x%x\n" - "\t tpa_agg_index = 0x%x\n" - "\t header_len = 0x%x\n" - "\t ext_bd_len_list[0] = 0x%x\n" - "\t ext_bd_len_list[1] = 0x%x\n" - "\t ext_bd_len_list[2] = 0x%x\n" - "\t ext_bd_len_list[3] = 0x%x\n" - "\t ext_bd_len_list[4] = 0x%x\n", - __func__, fp->rss_id, cqe->type, cqe->bitfields, cqe->seg_len, + QL_DPRINT7(ha, "[rss_id = %d]: enter\n \ + \t type = 0x%x\n \ + \t bitfields = 0x%x\n \ + \t seg_len = 0x%x\n \ + \t pars_flags = 0x%x\n \ + \t vlan_tag = 0x%x\n \ + \t rss_hash = 0x%x\n \ + \t len_on_first_bd = 0x%x\n \ + \t placement_offset = 0x%x\n \ + \t tpa_agg_index = 0x%x\n \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705162146.v4GLkUMQ047015>