Add 1 trace point of control message related with Qos.

Signed-off-by: Chaoyong He <chaoyong...@corigine.com>
Reviewed-by: Long Wu <long...@corigine.com>
Reviewed-by: Peng Zhang <peng.zh...@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_cmsg.c |  4 ++++
 drivers/net/nfp/nfp_trace.c              |  3 +++
 drivers/net/nfp/nfp_trace.h              | 29 ++++++++++++++++++++++++
 3 files changed, 36 insertions(+)

diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.c 
b/drivers/net/nfp/flower/nfp_flower_cmsg.c
index 30ce68b42d..b07cea9921 100644
--- a/drivers/net/nfp/flower/nfp_flower_cmsg.c
+++ b/drivers/net/nfp/flower/nfp_flower_cmsg.c
@@ -528,6 +528,8 @@ nfp_flower_cmsg_qos_add(struct nfp_app_fw_flower 
*app_fw_flower,
                return -EIO;
        }
 
+       rte_pmd_nfp_trace_cmsg_qos_rule("cmsg_qos_add", msg);
+
        return 0;
 }
 
@@ -558,6 +560,8 @@ nfp_flower_cmsg_qos_delete(struct nfp_app_fw_flower 
*app_fw_flower,
                return -EIO;
        }
 
+       rte_pmd_nfp_trace_cmsg_qos_rule("cmsg_qos_delete", msg);
+
        return 0;
 }
 
diff --git a/drivers/net/nfp/nfp_trace.c b/drivers/net/nfp/nfp_trace.c
index 730ffaa32e..529399e1a8 100644
--- a/drivers/net/nfp/nfp_trace.c
+++ b/drivers/net/nfp/nfp_trace.c
@@ -33,3 +33,6 @@ RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_pre_tun,
 
 RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_tun_mac,
                pmd.net.nfp.cmsg.tun.mac_rule)
+
+RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_qos_rule,
+               pmd.net.nfp.cmsg.qos.rule)
diff --git a/drivers/net/nfp/nfp_trace.h b/drivers/net/nfp/nfp_trace.h
index 48a14efd3a..5f8f3c373b 100644
--- a/drivers/net/nfp/nfp_trace.h
+++ b/drivers/net/nfp/nfp_trace.h
@@ -192,4 +192,33 @@ RTE_TRACE_POINT(
        rte_trace_point_emit_blob(addr_bytes, len);
 )
 
+RTE_TRACE_POINT(
+       rte_pmd_nfp_trace_cmsg_qos_rule,
+       RTE_TRACE_POINT_ARGS(const char *name, void *cmsg),
+
+       rte_trace_point_emit_string(name);
+
+       struct nfp_profile_conf *msg = cmsg;
+       uint32_t bkt_tkn_p = rte_be_to_cpu_32(msg->bkt_tkn_p);
+       uint32_t bkt_tkn_c = rte_be_to_cpu_32(msg->bkt_tkn_c);
+       uint32_t pbs = rte_be_to_cpu_32(msg->pbs);
+       uint32_t cbs = rte_be_to_cpu_32(msg->cbs);
+       uint32_t pir = rte_be_to_cpu_32(msg->pir);
+       uint32_t cir = rte_be_to_cpu_32(msg->cir);
+
+       struct nfp_cfg_head *head = &msg->head;
+       uint32_t flags_opts = rte_be_to_cpu_32(head->flags_opts);
+       uint32_t profile_id = rte_be_to_cpu_32(head->profile_id);
+
+       rte_trace_point_emit_u32(flags_opts);
+       rte_trace_point_emit_u32(profile_id);
+
+       rte_trace_point_emit_u32(bkt_tkn_p);
+       rte_trace_point_emit_u32(bkt_tkn_c);
+       rte_trace_point_emit_u32(pbs);
+       rte_trace_point_emit_u32(cbs);
+       rte_trace_point_emit_u32(pir);
+       rte_trace_point_emit_u32(cir);
+)
+
 #endif /* __NFP_TRACE_H__ */
-- 
2.39.1

Reply via email to