Adding missing debuglogs and fixing existing debuglogs.

Signed-off-by: Marta Plantykow <marta.a.planty...@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell...@intel.com>
Signed-off-by: Leyi Rong <leyi.r...@intel.com>
---
 drivers/net/ice/base/ice_common.c    | 16 +++----
 drivers/net/ice/base/ice_controlq.c  | 19 ++++++++
 drivers/net/ice/base/ice_flex_pipe.c | 70 ++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_flex_pipe.h |  1 +
 drivers/net/ice/base/ice_nvm.c       | 14 +++---
 5 files changed, 105 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ice/base/ice_common.c 
b/drivers/net/ice/base/ice_common.c
index 7f7f4dad0..da72434d3 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -833,7 +833,7 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
        u16 mac_buf_len;
        void *mac_buf;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_init_hw");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
 
        /* Set MAC type based on DeviceID */
@@ -1623,7 +1623,7 @@ ice_aq_req_res(struct ice_hw *hw, enum ice_aq_res_ids res,
        struct ice_aq_desc desc;
        enum ice_status status;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_aq_req_res");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        cmd_resp = &desc.params.res_owner;
 
@@ -1692,7 +1692,7 @@ ice_aq_release_res(struct ice_hw *hw, enum ice_aq_res_ids 
res, u8 sdp_number,
        struct ice_aqc_req_res *cmd;
        struct ice_aq_desc desc;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_aq_release_res");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        cmd = &desc.params.res_owner;
 
@@ -1722,7 +1722,7 @@ ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids 
res,
        u32 time_left = timeout;
        enum ice_status status;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_acquire_res");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        status = ice_aq_req_res(hw, res, access, 0, &time_left, NULL);
 
@@ -1780,7 +1780,7 @@ void ice_release_res(struct ice_hw *hw, enum 
ice_aq_res_ids res)
        enum ice_status status;
        u32 total_delay = 0;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_release_res");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        status = ice_aq_release_res(hw, res, 0, NULL);
 
@@ -1814,7 +1814,7 @@ ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries,
        struct ice_aqc_alloc_free_res_cmd *cmd;
        struct ice_aq_desc desc;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_aq_alloc_free_res");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        cmd = &desc.params.sw_res_ctrl;
 
@@ -3189,7 +3189,7 @@ ice_aq_add_lan_txq(struct ice_hw *hw, u8 num_qgrps,
        struct ice_aqc_add_txqs *cmd;
        struct ice_aq_desc desc;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_aq_add_lan_txq");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        cmd = &desc.params.add_txqs;
 
@@ -3245,7 +3245,7 @@ ice_aq_dis_lan_txq(struct ice_hw *hw, u8 num_qgrps,
        enum ice_status status;
        u16 i, sz = 0;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_aq_dis_lan_txq");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
        cmd = &desc.params.dis_txqs;
        ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_dis_txqs);
 
diff --git a/drivers/net/ice/base/ice_controlq.c 
b/drivers/net/ice/base/ice_controlq.c
index 6d893e2f2..4cb6df113 100644
--- a/drivers/net/ice/base/ice_controlq.c
+++ b/drivers/net/ice/base/ice_controlq.c
@@ -35,6 +35,8 @@ static void ice_adminq_init_regs(struct ice_hw *hw)
 {
        struct ice_ctl_q_info *cq = &hw->adminq;
 
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
+
        ICE_CQ_INIT_REGS(cq, PF_FW);
 }
 
@@ -295,6 +297,8 @@ static enum ice_status ice_init_sq(struct ice_hw *hw, 
struct ice_ctl_q_info *cq)
 {
        enum ice_status ret_code;
 
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
+
        if (cq->sq.count > 0) {
                /* queue already initialized */
                ret_code = ICE_ERR_NOT_READY;
@@ -354,6 +358,8 @@ static enum ice_status ice_init_rq(struct ice_hw *hw, 
struct ice_ctl_q_info *cq)
 {
        enum ice_status ret_code;
 
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
+
        if (cq->rq.count > 0) {
                /* queue already initialized */
                ret_code = ICE_ERR_NOT_READY;
@@ -422,6 +428,8 @@ ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info 
*cq)
 {
        enum ice_status ret_code = ICE_SUCCESS;
 
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
+
        ice_acquire_lock(&cq->sq_lock);
 
        if (!cq->sq.count) {
@@ -485,6 +493,8 @@ ice_shutdown_rq(struct ice_hw *hw, struct ice_ctl_q_info 
*cq)
 {
        enum ice_status ret_code = ICE_SUCCESS;
 
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
+
        ice_acquire_lock(&cq->rq_lock);
 
        if (!cq->rq.count) {
@@ -521,6 +531,8 @@ static enum ice_status ice_init_check_adminq(struct ice_hw 
*hw)
        struct ice_ctl_q_info *cq = &hw->adminq;
        enum ice_status status;
 
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
+
 
        status = ice_aq_get_fw_ver(hw, NULL);
        if (status)
@@ -559,6 +571,8 @@ static enum ice_status ice_init_ctrlq(struct ice_hw *hw, 
enum ice_ctl_q q_type)
        struct ice_ctl_q_info *cq;
        enum ice_status ret_code;
 
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
+
        switch (q_type) {
        case ICE_CTL_Q_ADMIN:
                ice_adminq_init_regs(hw);
@@ -617,6 +631,8 @@ enum ice_status ice_init_all_ctrlq(struct ice_hw *hw)
 {
        enum ice_status ret_code;
 
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
+
 
        /* Init FW admin queue */
        ret_code = ice_init_ctrlq(hw, ICE_CTL_Q_ADMIN);
@@ -677,6 +693,8 @@ static void ice_shutdown_ctrlq(struct ice_hw *hw, enum 
ice_ctl_q q_type)
 {
        struct ice_ctl_q_info *cq;
 
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
+
        switch (q_type) {
        case ICE_CTL_Q_ADMIN:
                cq = &hw->adminq;
@@ -704,6 +722,7 @@ static void ice_shutdown_ctrlq(struct ice_hw *hw, enum 
ice_ctl_q q_type)
  */
 void ice_shutdown_all_ctrlq(struct ice_hw *hw)
 {
+       ice_debug(hw, ICE_DBG_TRACE, "ice_shutdown_all_ctrlq\n");
        /* Shutdown FW admin queue */
        ice_shutdown_ctrlq(hw, ICE_CTL_Q_ADMIN);
        /* Shutdown PF-VF Mailbox */
diff --git a/drivers/net/ice/base/ice_flex_pipe.c 
b/drivers/net/ice/base/ice_flex_pipe.c
index b569b91a7..e7e349298 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -2417,6 +2417,11 @@ ice_vsig_free(struct ice_hw *hw, enum ice_block blk, u16 
vsig)
                ice_free(hw, del);
        }
 
+       /* if VSIG characteristic list was cleared for reset
+        * re-initialize the list head
+        */
+       INIT_LIST_HEAD(&hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst);
+
        return ICE_SUCCESS;
 }
 
@@ -3138,6 +3143,71 @@ static void ice_init_flow_profs(struct ice_hw *hw, u8 
blk_idx)
        INIT_LIST_HEAD(&hw->fl_profs[blk_idx]);
 }
 
+/**
+ * ice_clear_hw_tbls - clear HW tables and flow profiles
+ * @hw: pointer to the hardware structure
+ */
+void ice_clear_hw_tbls(struct ice_hw *hw)
+{
+       u8 i;
+
+       for (i = 0; i < ICE_BLK_COUNT; i++) {
+               struct ice_prof_redir *prof_redir = &hw->blk[i].prof_redir;
+               struct ice_prof_tcam *prof = &hw->blk[i].prof;
+               struct ice_xlt1 *xlt1 = &hw->blk[i].xlt1;
+               struct ice_xlt2 *xlt2 = &hw->blk[i].xlt2;
+               struct ice_es *es = &hw->blk[i].es;
+
+               if (hw->blk[i].is_list_init) {
+                       struct ice_prof_map *del, *tmp;
+
+                       ice_acquire_lock(&es->prof_map_lock);
+                       LIST_FOR_EACH_ENTRY_SAFE(del, tmp, &es->prof_map,
+                                                ice_prof_map, list) {
+                               LIST_DEL(&del->list);
+                               ice_free(hw, del);
+                       }
+                       INIT_LIST_HEAD(&es->prof_map);
+                       ice_release_lock(&es->prof_map_lock);
+
+                       ice_acquire_lock(&hw->fl_profs_locks[i]);
+                       ice_free_flow_profs(hw, i);
+                       ice_release_lock(&hw->fl_profs_locks[i]);
+               }
+
+               ice_free_vsig_tbl(hw, (enum ice_block)i);
+
+               ice_memset(xlt1->ptypes, 0, xlt1->count * sizeof(*xlt1->ptypes),
+                          ICE_NONDMA_MEM);
+               ice_memset(xlt1->ptg_tbl, 0,
+                          ICE_MAX_PTGS * sizeof(*xlt1->ptg_tbl),
+                          ICE_NONDMA_MEM);
+               ice_memset(xlt1->t, 0, xlt1->count * sizeof(*xlt1->t),
+                          ICE_NONDMA_MEM);
+
+               ice_memset(xlt2->vsis, 0, xlt2->count * sizeof(*xlt2->vsis),
+                          ICE_NONDMA_MEM);
+               ice_memset(xlt2->vsig_tbl, 0,
+                          xlt2->count * sizeof(*xlt2->vsig_tbl),
+                          ICE_NONDMA_MEM);
+               ice_memset(xlt2->t, 0, xlt2->count * sizeof(*xlt2->t),
+                          ICE_NONDMA_MEM);
+
+               ice_memset(prof->t, 0, prof->count * sizeof(*prof->t),
+                          ICE_NONDMA_MEM);
+               ice_memset(prof_redir->t, 0,
+                          prof_redir->count * sizeof(*prof_redir->t),
+                          ICE_NONDMA_MEM);
+
+               ice_memset(es->t, 0, es->count * sizeof(*es->t),
+                          ICE_NONDMA_MEM);
+               ice_memset(es->ref_count, 0, es->count * sizeof(*es->ref_count),
+                          ICE_NONDMA_MEM);
+               ice_memset(es->written, 0, es->count * sizeof(*es->written),
+                          ICE_NONDMA_MEM);
+       }
+}
+
 /**
  * ice_init_hw_tbls - init hardware table memory
  * @hw: pointer to the hardware structure
diff --git a/drivers/net/ice/base/ice_flex_pipe.h 
b/drivers/net/ice/base/ice_flex_pipe.h
index 375758c8d..df8eac05b 100644
--- a/drivers/net/ice/base/ice_flex_pipe.h
+++ b/drivers/net/ice/base/ice_flex_pipe.h
@@ -107,6 +107,7 @@ ice_copy_and_init_pkg(struct ice_hw *hw, const u8 *buf, u32 
len);
 enum ice_status ice_init_hw_tbls(struct ice_hw *hw);
 void ice_free_seg(struct ice_hw *hw);
 void ice_fill_blk_tbls(struct ice_hw *hw);
+void ice_clear_hw_tbls(struct ice_hw *hw);
 void ice_free_hw_tbls(struct ice_hw *hw);
 enum ice_status
 ice_add_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi[], u8 count,
diff --git a/drivers/net/ice/base/ice_nvm.c b/drivers/net/ice/base/ice_nvm.c
index b770abfd0..fa9c348ce 100644
--- a/drivers/net/ice/base/ice_nvm.c
+++ b/drivers/net/ice/base/ice_nvm.c
@@ -24,7 +24,7 @@ ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 
offset, u16 length,
        struct ice_aq_desc desc;
        struct ice_aqc_nvm *cmd;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_aq_read_nvm");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        cmd = &desc.params.nvm;
 
@@ -95,7 +95,7 @@ ice_read_sr_aq(struct ice_hw *hw, u32 offset, u16 words, u16 
*data,
 {
        enum ice_status status;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_read_sr_aq");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        status = ice_check_sr_access_params(hw, offset, words);
 
@@ -123,7 +123,7 @@ ice_read_sr_word_aq(struct ice_hw *hw, u16 offset, u16 
*data)
 {
        enum ice_status status;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_read_sr_word_aq");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        status = ice_read_sr_aq(hw, offset, 1, data, true);
        if (!status)
@@ -152,7 +152,7 @@ ice_read_sr_buf_aq(struct ice_hw *hw, u16 offset, u16 
*words, u16 *data)
        u16 words_read = 0;
        u16 i = 0;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_read_sr_buf_aq");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        do {
                u16 read_size, off_w;
@@ -202,7 +202,7 @@ ice_read_sr_buf_aq(struct ice_hw *hw, u16 offset, u16 
*words, u16 *data)
 static enum ice_status
 ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access)
 {
-       ice_debug(hw, ICE_DBG_TRACE, "ice_acquire_nvm");
+       ice_debug(hw, ICE_DBG_TRACE, "ice_acquire_nvm\n");
 
        if (hw->nvm.blank_nvm_mode)
                return ICE_SUCCESS;
@@ -218,7 +218,7 @@ ice_acquire_nvm(struct ice_hw *hw, enum 
ice_aq_res_access_type access)
  */
 static void ice_release_nvm(struct ice_hw *hw)
 {
-       ice_debug(hw, ICE_DBG_TRACE, "ice_release_nvm");
+       ice_debug(hw, ICE_DBG_TRACE, "ice_release_nvm\n");
 
        if (hw->nvm.blank_nvm_mode)
                return;
@@ -263,7 +263,7 @@ enum ice_status ice_init_nvm(struct ice_hw *hw)
        u32 fla, gens_stat;
        u8 sr_size;
 
-       ice_debug(hw, ICE_DBG_TRACE, "ice_init_nvm");
+       ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
        /* The SR size is stored regardless of the NVM programming mode
         * as the blank mode may be used in the factory line.
-- 
2.17.1

Reply via email to