From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CE47356AB for ; Fri, 8 May 2015 05:25:25 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 07 May 2015 20:25:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,387,1427785200"; d="scan'208";a="691753609" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga001.jf.intel.com with ESMTP; 07 May 2015 20:25:24 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 8 May 2015 11:24:11 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.162]) by SHSMSX101.ccr.corp.intel.com ([10.239.4.153]) with mapi id 14.03.0224.002; Fri, 8 May 2015 11:24:10 +0800 From: "Wu, Jingjing" To: "Zhang, Helin" , "dev@dpdk.org" Thread-Topic: [PATCH v2 15/33] i40e/base: replacement of DEBUGOUT() with i40e_debug() Thread-Index: AQHQg1bzOSGaXpfT80yJCbC42wras51xdjAQ Date: Fri, 8 May 2015 03:24:10 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8C1839C@SHSMSX104.ccr.corp.intel.com> References: <1429518150-28098-1-git-send-email-helin.zhang@intel.com> <1430406219-23901-1-git-send-email-helin.zhang@intel.com> <1430406219-23901-16-git-send-email-helin.zhang@intel.com> In-Reply-To: <1430406219-23901-16-git-send-email-helin.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "Kenguva, Monica" , "Murray, Steven J" , "Nelson, Shannon" Subject: Re: [dpdk-dev] [PATCH v2 15/33] i40e/base: replacement of DEBUGOUT() with i40e_debug() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 03:25:26 -0000 Acked-by: Jingjing Wu > -----Original Message----- > From: Zhang, Helin > Sent: Thursday, April 30, 2015 11:03 PM > To: dev@dpdk.org > Cc: Cao, Min; Xu, Qian Q; Wu, Jingjing; Liu, Jijiang; Kenguva, Monica; Pa= tel, > Rashmin N; Murray, Steven J; Nelson, Shannon; Zhang, Helin > Subject: [PATCH v2 15/33] i40e/base: replacement of DEBUGOUT() with > i40e_debug() >=20 > To support better debug information printing, all DEBUGOUT() are replaced > by i40e_debug(). In addition, the NVM update state strings are added in > debug information. >=20 > Signed-off-by: Helin Zhang > --- > lib/librte_pmd_i40e/Makefile | 1 + > lib/librte_pmd_i40e/i40e/i40e_nvm.c | 77 > ++++++++++++++++++++++++++++--------- > 2 files changed, 59 insertions(+), 19 deletions(-) >=20 > diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile > index 75b5120..22f0716 100644 > --- a/lib/librte_pmd_i40e/Makefile > +++ b/lib/librte_pmd_i40e/Makefile > @@ -68,6 +68,7 @@ CFLAGS_BASE_DRIVER +=3D -Wno-missing-field- > initializers CFLAGS_BASE_DRIVER +=3D -Wno-pointer-to-int-cast > CFLAGS_BASE_DRIVER +=3D -Wno-format-nonliteral CFLAGS_BASE_DRIVER +=3D > -Wno-format-security > +CFLAGS_BASE_DRIVER +=3D -Wno-unused-variable >=20 > ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) > CFLAGS_BASE_DRIVER +=3D -Wno-unused-but-set-variable diff --git > a/lib/librte_pmd_i40e/i40e/i40e_nvm.c > b/lib/librte_pmd_i40e/i40e/i40e_nvm.c > index 55d0bed..f1a1e88 100644 > --- a/lib/librte_pmd_i40e/i40e/i40e_nvm.c > +++ b/lib/librte_pmd_i40e/i40e/i40e_nvm.c > @@ -82,7 +82,7 @@ enum i40e_status_code i40e_init_nvm(struct i40e_hw > *hw) > } else { /* Blank programming mode */ > nvm->blank_nvm_mode =3D true; > ret_code =3D I40E_ERR_NVM_BLANK_MODE; > - DEBUGOUT("NVM init error: unsupported blank mode.\n"); > + i40e_debug(hw, I40E_DEBUG_NVM, "NVM init error: > unsupported blank > +mode.\n"); > } >=20 > return ret_code; > @@ -186,7 +186,7 @@ static enum i40e_status_code > i40e_poll_sr_srctl_done_bit(struct i40e_hw *hw) > i40e_usec_delay(5); > } > if (ret_code =3D=3D I40E_ERR_TIMEOUT) > - DEBUGOUT("Done bit in GLNVM_SRCTL not set"); > + i40e_debug(hw, I40E_DEBUG_NVM, "Done bit in > GLNVM_SRCTL not set"); > return ret_code; > } >=20 > @@ -705,6 +705,22 @@ STATIC inline u8 > i40e_nvmupd_get_transaction(u32 val) > return (u8)((val & I40E_NVM_TRANS_MASK) >> > I40E_NVM_TRANS_SHIFT); } >=20 > +STATIC const char *i40e_nvm_update_state_str[] =3D { > + "I40E_NVMUPD_INVALID", > + "I40E_NVMUPD_READ_CON", > + "I40E_NVMUPD_READ_SNT", > + "I40E_NVMUPD_READ_LCB", > + "I40E_NVMUPD_READ_SA", > + "I40E_NVMUPD_WRITE_ERA", > + "I40E_NVMUPD_WRITE_CON", > + "I40E_NVMUPD_WRITE_SNT", > + "I40E_NVMUPD_WRITE_LCB", > + "I40E_NVMUPD_WRITE_SA", > + "I40E_NVMUPD_CSUM_CON", > + "I40E_NVMUPD_CSUM_SA", > + "I40E_NVMUPD_CSUM_LCB", > +}; > + > /** > * i40e_nvmupd_command - Process an NVM update command > * @hw: pointer to hardware structure > @@ -740,6 +756,8 @@ enum i40e_status_code > i40e_nvmupd_command(struct i40e_hw *hw, >=20 > default: > /* invalid state, should never happen */ > + i40e_debug(hw, I40E_DEBUG_NVM, > + "NVMUPD: no such state %d\n", hw- > >nvmupd_state); > status =3D I40E_NOT_SUPPORTED; > *perrno =3D -ESRCH; > break; > @@ -900,6 +918,9 @@ STATIC enum i40e_status_code > i40e_nvmupd_state_reading(struct i40e_hw *hw, > break; >=20 > default: > + i40e_debug(hw, I40E_DEBUG_NVM, > + "NVMUPD: bad cmd %s in reading state.\n", > + i40e_nvm_update_state_str[upd_cmd]); > status =3D I40E_NOT_SUPPORTED; > *perrno =3D -ESRCH; > break; > @@ -1035,8 +1056,9 @@ STATIC enum i40e_nvmupd_cmd > i40e_nvmupd_validate_command(struct i40e_hw *hw, > /* limits on data size */ > if ((cmd->data_size < 1) || > (cmd->data_size > I40E_NVMUPD_MAX_DATA)) { > - DEBUGOUT1("i40e_nvmupd_validate_command > data_size %d\n", > - cmd->data_size); > + i40e_debug(hw, I40E_DEBUG_NVM, > + "i40e_nvmupd_validate_command > data_size %d\n", > + cmd->data_size); > *perrno =3D -EFAULT; > return I40E_NVMUPD_INVALID; > } > @@ -1088,12 +1110,16 @@ STATIC enum i40e_nvmupd_cmd > i40e_nvmupd_validate_command(struct i40e_hw *hw, > } > break; > } > + i40e_debug(hw, I40E_DEBUG_NVM, "%s state %d > nvm_release_on_hold %d\n", > + i40e_nvm_update_state_str[upd_cmd], > + hw->nvmupd_state, > + hw->aq.nvm_release_on_done); >=20 > if (upd_cmd =3D=3D I40E_NVMUPD_INVALID) { > *perrno =3D -EFAULT; > - DEBUGOUT2( > - "i40e_nvmupd_validate_command returns %d > perrno: %d\n", > - upd_cmd, *perrno); > + i40e_debug(hw, I40E_DEBUG_NVM, > + "i40e_nvmupd_validate_command returns %d > perrno %d\n", > + upd_cmd, *perrno); > } > return upd_cmd; > } > @@ -1118,14 +1144,18 @@ STATIC enum i40e_status_code > i40e_nvmupd_nvm_read(struct i40e_hw *hw, > transaction =3D i40e_nvmupd_get_transaction(cmd->config); > module =3D i40e_nvmupd_get_module(cmd->config); > last =3D (transaction =3D=3D I40E_NVM_LCB) || (transaction =3D=3D > I40E_NVM_SA); > - DEBUGOUT3("i40e_nvmupd_nvm_read mod 0x%x off 0x%x len > 0x%x\n", > - module, cmd->offset, cmd->data_size); >=20 > status =3D i40e_aq_read_nvm(hw, module, cmd->offset, (u16)cmd- > >data_size, > bytes, last, NULL); > - DEBUGOUT1("i40e_nvmupd_nvm_read status %d\n", status); > - if (status !=3D I40E_SUCCESS) > + if (status) { > + i40e_debug(hw, I40E_DEBUG_NVM, > + "i40e_nvmupd_nvm_read mod 0x%x off 0x%x len > 0x%x\n", > + module, cmd->offset, cmd->data_size); > + i40e_debug(hw, I40E_DEBUG_NVM, > + "i40e_nvmupd_nvm_read status %d aq %d\n", > + status, hw->aq.asq_last_status); > *perrno =3D i40e_aq_rc_to_posix(status, hw- > >aq.asq_last_status); > + } >=20 > return status; > } > @@ -1149,13 +1179,17 @@ STATIC enum i40e_status_code > i40e_nvmupd_nvm_erase(struct i40e_hw *hw, > transaction =3D i40e_nvmupd_get_transaction(cmd->config); > module =3D i40e_nvmupd_get_module(cmd->config); > last =3D (transaction & I40E_NVM_LCB); > - DEBUGOUT3("i40e_nvmupd_nvm_erase mod 0x%x off 0x%x len > 0x%x\n", > - module, cmd->offset, cmd->data_size); > status =3D i40e_aq_erase_nvm(hw, module, cmd->offset, (u16)cmd- > >data_size, > last, NULL); > - DEBUGOUT1("i40e_nvmupd_nvm_erase status %d\n", status); > - if (status !=3D I40E_SUCCESS) > + if (status) { > + i40e_debug(hw, I40E_DEBUG_NVM, > + "i40e_nvmupd_nvm_erase mod 0x%x off 0x%x len > 0x%x\n", > + module, cmd->offset, cmd->data_size); > + i40e_debug(hw, I40E_DEBUG_NVM, > + "i40e_nvmupd_nvm_erase status %d aq %d\n", > + status, hw->aq.asq_last_status); > *perrno =3D i40e_aq_rc_to_posix(status, hw- > >aq.asq_last_status); > + } >=20 > return status; > } > @@ -1180,13 +1214,18 @@ STATIC enum i40e_status_code > i40e_nvmupd_nvm_write(struct i40e_hw *hw, > transaction =3D i40e_nvmupd_get_transaction(cmd->config); > module =3D i40e_nvmupd_get_module(cmd->config); > last =3D (transaction & I40E_NVM_LCB); > - DEBUGOUT3("i40e_nvmupd_nvm_write mod 0x%x off 0x%x len > 0x%x\n", > - module, cmd->offset, cmd->data_size); > + > status =3D i40e_aq_update_nvm(hw, module, cmd->offset, > (u16)cmd->data_size, bytes, last, NULL); > - DEBUGOUT1("i40e_nvmupd_nvm_write status %d\n", status); > - if (status !=3D I40E_SUCCESS) > + if (status) { > + i40e_debug(hw, I40E_DEBUG_NVM, > + "i40e_nvmupd_nvm_write mod 0x%x off 0x%x len > 0x%x\n", > + module, cmd->offset, cmd->data_size); > + i40e_debug(hw, I40E_DEBUG_NVM, > + "i40e_nvmupd_nvm_write status %d aq %d\n", > + status, hw->aq.asq_last_status); > *perrno =3D i40e_aq_rc_to_posix(status, hw- > >aq.asq_last_status); > + } >=20 > return status; > } > -- > 1.8.1.4