From 5b0632191a963f5d934735aba0fb069781edbd18 Mon Sep 17 00:00:00 2001 From: Jiantao Xiao Date: Wed, 22 Nov 2023 20:43:46 +0800 Subject: [PATCH] Revert "net: hns3: add command queue trace for hns3" driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8IP6H CVE: NA ---------------------------------------------------------------------- This reverts commit 7906c655c7b6e8bd68a7e7ee2455d9a8d8622fa9. Signed-off-by: Jiantao Xiao --- .../hns3/hns3_common/hclge_comm_cmd.c | 4 - .../hns3/hns3_common/hclge_comm_cmd.h | 6 -- .../hisilicon/hns3/hns3pf/hclge_main.c | 39 -------- .../hisilicon/hns3/hns3pf/hclge_trace.h | 94 ------------------- .../hisilicon/hns3/hns3vf/hclgevf_main.c | 32 ------- .../hisilicon/hns3/hns3vf/hclgevf_trace.h | 50 ---------- 6 files changed, 225 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c index 519e5bc0baf8..046cd5229c3c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c @@ -474,8 +474,6 @@ int hclge_comm_cmd_send(struct hclge_comm_hw *hw, struct hclge_desc *desc, struct hclge_comm_cmq_ring *csq = &hw->cmq.csq; int ret; int ntc; - trace_hclge_comm_cmd_send(hw, desc, num, - hclge_comm_is_special_opcode(desc->opcode)); spin_lock_bh(&hw->cmq.csq.lock); @@ -510,8 +508,6 @@ int hclge_comm_cmd_send(struct hclge_comm_hw *hw, struct hclge_desc *desc, spin_unlock_bh(&hw->cmq.csq.lock); - trace_hclge_comm_cmd_get(hw, desc, num, - hclge_comm_is_special_opcode(desc->opcode)); return ret; } diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h index 699cdb7d7f7a..09f2a6b74e8a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h @@ -491,11 +491,5 @@ int hclge_comm_cmd_queue_init(struct pci_dev *pdev, struct hclge_comm_hw *hw); int hclge_comm_cmd_init(struct hnae3_ae_dev *ae_dev, struct hclge_comm_hw *hw, u32 *fw_version, bool is_pf, unsigned long reset_pending); -void trace_hclge_comm_cmd_send(struct hclge_comm_hw *hw, - struct hclge_desc *desc, - int num, int is_special); -void trace_hclge_comm_cmd_get(struct hclge_comm_hw *hw, - struct hclge_desc *desc, - int num, int is_special); #endif diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 3b6278eafc0c..fe34070a03f6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -35,8 +35,6 @@ #include "hclge_unic_guid.h" #include "hclge_unic_addr.h" -#include "hclge_trace.h" - #define HCLGE_NAME "hclge" #define HCLGE_BUF_SIZE_UNIT 256U @@ -410,43 +408,6 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num) return hclge_comm_cmd_send(&hw->hw, desc, num); } -void trace_hclge_comm_cmd_send(struct hclge_comm_hw *hw, struct hclge_desc *desc, - int num, int is_special) -{ - int i; - - trace_hclge_pf_cmd_send(hw, desc, 0, num); - - if (!is_special) { - for (i = 1; i < num; i++) - trace_hclge_pf_cmd_send(hw, &desc[i], i, num); - } else { - for (i = 1; i < num; i++) - trace_hclge_pf_special_cmd_send(hw, (u32 *)&desc[i], - i, num); - } -} - -void trace_hclge_comm_cmd_get(struct hclge_comm_hw *hw, struct hclge_desc *desc, - int num, int is_special) -{ - int i; - - if (!HCLGE_COMM_SEND_SYNC(le16_to_cpu(desc->flag))) - return; - - trace_hclge_pf_cmd_get(hw, desc, 0, num); - - if (!is_special) { - for (i = 1; i < num; i++) - trace_hclge_pf_cmd_get(hw, &desc[i], i, num); - } else { - for (i = 1; i < num; i++) - trace_hclge_pf_special_cmd_get(hw, (u32 *)&desc[i], - i, num); - } -} - static int hclge_mac_update_stats_defective(struct hclge_dev *hdev) { #define HCLGE_MAC_CMD_NUM 21 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h index 116ac3a5ffc5..8510b88d4982 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h @@ -10,7 +10,6 @@ #include -#define PF_DESC_LEN (sizeof(struct hclge_desc) / sizeof(u32)) #define PF_GET_MBX_LEN (sizeof(struct hclge_mbx_vf_to_pf_cmd) / sizeof(u32)) #define PF_SEND_MBX_LEN (sizeof(struct hclge_mbx_pf_to_vf_cmd) / sizeof(u32)) @@ -78,99 +77,6 @@ TRACE_EVENT(hclge_pf_mbx_send, ) ); -DECLARE_EVENT_CLASS(hclge_pf_cmd_template, - TP_PROTO(struct hclge_comm_hw *hw, - struct hclge_desc *desc, - int index, - int num), - TP_ARGS(hw, desc, index, num), - - TP_STRUCT__entry(__field(u16, opcode) - __field(u16, flag) - __field(u16, retval) - __field(u16, rsv) - __field(int, index) - __field(int, num) - __string(pciname, pci_name(hw->cmq.csq.pdev)) - __array(u32, data, HCLGE_DESC_DATA_LEN)), - - TP_fast_assign(int i; - __entry->opcode = le16_to_cpu(desc->opcode); - __entry->flag = le16_to_cpu(desc->flag); - __entry->retval = le16_to_cpu(desc->retval); - __entry->rsv = le16_to_cpu(desc->rsv); - __entry->index = index; - __entry->num = num; - __assign_str(pciname, pci_name(hw->cmq.csq.pdev)); - for (i = 0; i < HCLGE_DESC_DATA_LEN; i++) - __entry->data[i] = le32_to_cpu(desc->data[i]);), - - TP_printk("%s opcode:0x%04x %d-%d flag:0x%04x retval:0x%04x rsv:0x%04x data:%s", - __get_str(pciname), __entry->opcode, - __entry->index, __entry->num, - __entry->flag, __entry->retval, __entry->rsv, - __print_array(__entry->data, - HCLGE_DESC_DATA_LEN, sizeof(u32))) -); - -DEFINE_EVENT(hclge_pf_cmd_template, hclge_pf_cmd_send, - TP_PROTO(struct hclge_comm_hw *hw, - struct hclge_desc *desc, - int index, - int num), - TP_ARGS(hw, desc, index, num) -); - -DEFINE_EVENT(hclge_pf_cmd_template, hclge_pf_cmd_get, - TP_PROTO(struct hclge_comm_hw *hw, - struct hclge_desc *desc, - int index, - int num), - TP_ARGS(hw, desc, index, num) -); - -DECLARE_EVENT_CLASS(hclge_pf_special_cmd_template, - TP_PROTO(struct hclge_comm_hw *hw, - u32 *data, - int index, - int num), - TP_ARGS(hw, data, index, num), - - TP_STRUCT__entry(__field(int, index) - __field(int, num) - __string(pciname, pci_name(hw->cmq.csq.pdev)) - __array(u32, data, PF_DESC_LEN)), - - TP_fast_assign(int i; - __entry->index = index; - __entry->num = num; - __assign_str(pciname, pci_name(hw->cmq.csq.pdev)); - for (i = 0; i < PF_DESC_LEN; i++) - __entry->data[i] = le32_to_cpu(data[i]); - ), - - TP_printk("%s %d-%d data:%s", - __get_str(pciname), - __entry->index, __entry->num, - __print_array(__entry->data, - PF_DESC_LEN, sizeof(u32))) -); - -DEFINE_EVENT(hclge_pf_special_cmd_template, hclge_pf_special_cmd_send, - TP_PROTO(struct hclge_comm_hw *hw, - u32 *desc, - int index, - int num), - TP_ARGS(hw, desc, index, num)); - -DEFINE_EVENT(hclge_pf_special_cmd_template, hclge_pf_special_cmd_get, - TP_PROTO(struct hclge_comm_hw *hw, - u32 *desc, - int index, - int num), - TP_ARGS(hw, desc, index, num) -); - #endif /* _HCLGE_TRACE_H_ */ /* This must be outside ifdef _HCLGE_TRACE_H */ diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 34dcaf4f1bda..8791ddf362b0 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -16,7 +16,6 @@ #include "hclgevf_unic_ip.h" #include "hclgevf_unic_guid.h" #include "hclgevf_unic_addr.h" -#include "hclgevf_trace.h" #define HCLGEVF_NAME "hclgevf" @@ -61,37 +60,6 @@ int hclgevf_cmd_send(struct hclgevf_hw *hw, struct hclge_desc *desc, int num) return hclge_comm_cmd_send(&hw->hw, desc, num); } -void trace_hclge_comm_cmd_send(struct hclge_comm_hw *hw, struct hclge_desc *desc, - int num, int is_special) -{ - int i; - - trace_hclge_vf_cmd_send(hw, desc, 0, num); - - if (is_special) - return; - - for (i = 1; i < num; i++) - trace_hclge_vf_cmd_send(hw, &desc[i], i, num); -} - -void trace_hclge_comm_cmd_get(struct hclge_comm_hw *hw, struct hclge_desc *desc, - int num, int is_special) -{ - int i; - - if (!HCLGE_COMM_SEND_SYNC(le16_to_cpu(desc->flag))) - return; - - trace_hclge_vf_cmd_get(hw, desc, 0, num); - - if (is_special) - return; - - for (i = 1; i < num; i++) - trace_hclge_vf_cmd_get(hw, &desc[i], i, num); -} - void hclgevf_arq_init(struct hclgevf_dev *hdev) { struct hclge_comm_cmq *cmdq = &hdev->hw.hw.cmq; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h index 82263cb5e47b..5d4895bb57a1 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h @@ -77,56 +77,6 @@ TRACE_EVENT(hclge_vf_mbx_send, ) ); -DECLARE_EVENT_CLASS(hclge_vf_cmd_template, - TP_PROTO(struct hclge_comm_hw *hw, - struct hclge_desc *desc, - int index, - int num), - - TP_ARGS(hw, desc, index, num), - - TP_STRUCT__entry(__field(u16, opcode) - __field(u16, flag) - __field(u16, retval) - __field(u16, rsv) - __field(int, index) - __field(int, num) - __string(pciname, pci_name(hw->cmq.csq.pdev)) - __array(u32, data, HCLGE_DESC_DATA_LEN)), - - TP_fast_assign(int i; - __entry->opcode = le16_to_cpu(desc->opcode); - __entry->flag = le16_to_cpu(desc->flag); - __entry->retval = le16_to_cpu(desc->retval); - __entry->rsv = le16_to_cpu(desc->rsv); - __entry->index = index; - __entry->num = num; - __assign_str(pciname, pci_name(hw->cmq.csq.pdev)); - for (i = 0; i < HCLGE_DESC_DATA_LEN; i++) - __entry->data[i] = le32_to_cpu(desc->data[i]);), - - TP_printk("%s opcode:0x%04x %d-%d flag:0x%04x retval:0x%04x rsv:0x%04x data:%s", - __get_str(pciname), __entry->opcode, - __entry->index, __entry->num, - __entry->flag, __entry->retval, __entry->rsv, - __print_array(__entry->data, - HCLGE_DESC_DATA_LEN, sizeof(u32))) -); - -DEFINE_EVENT(hclge_vf_cmd_template, hclge_vf_cmd_send, - TP_PROTO(struct hclge_comm_hw *hw, - struct hclge_desc *desc, - int index, - int num), - TP_ARGS(hw, desc, index, num)); - -DEFINE_EVENT(hclge_vf_cmd_template, hclge_vf_cmd_get, - TP_PROTO(struct hclge_comm_hw *hw, - struct hclge_desc *desc, - int index, - int num), - TP_ARGS(hw, desc, index, num)); - #endif /* _HCLGEVF_TRACE_H_ */ /* This must be outside ifdef _HCLGEVF_TRACE_H */ -- Gitee