Add the trace point of control message related with flow rule meta data.

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 | 12 ++++++++++++
 drivers/net/nfp/nfp_trace.c              |  6 ++++++
 drivers/net/nfp/nfp_trace.h              | 22 ++++++++++++++++++++++
 3 files changed, 40 insertions(+)

diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.c 
b/drivers/net/nfp/flower/nfp_flower_cmsg.c
index b07cea9921..9035a9df4f 100644
--- a/drivers/net/nfp/flower/nfp_flower_cmsg.c
+++ b/drivers/net/nfp/flower/nfp_flower_cmsg.c
@@ -189,6 +189,14 @@ nfp_flower_cmsg_port_mod(struct nfp_app_fw_flower 
*app_fw_flower,
        return 0;
 }
 
+static void
+nfp_flower_trace_cmsg_flow(const char *msg,
+               struct nfp_fl_payload *payload)
+{
+       rte_pmd_nfp_trace_cmsg_flow(msg);
+       rte_pmd_nfp_trace_cmsg_flow_meta(payload->meta);
+}
+
 int
 nfp_flower_cmsg_flow_delete(struct nfp_app_fw_flower *app_fw_flower,
                struct rte_flow *flow)
@@ -221,6 +229,8 @@ nfp_flower_cmsg_flow_delete(struct nfp_app_fw_flower 
*app_fw_flower,
                return -EIO;
        }
 
+       nfp_flower_trace_cmsg_flow("cmsg_flow_delete", &flow->payload);
+
        return 0;
 }
 
@@ -256,6 +266,8 @@ nfp_flower_cmsg_flow_add(struct nfp_app_fw_flower 
*app_fw_flower,
                return -EIO;
        }
 
+       nfp_flower_trace_cmsg_flow("cmsg_flow_add", &flow->payload);
+
        return 0;
 }
 
diff --git a/drivers/net/nfp/nfp_trace.c b/drivers/net/nfp/nfp_trace.c
index 529399e1a8..d49fb85259 100644
--- a/drivers/net/nfp/nfp_trace.c
+++ b/drivers/net/nfp/nfp_trace.c
@@ -36,3 +36,9 @@ RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_tun_mac,
 
 RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_qos_rule,
                pmd.net.nfp.cmsg.qos.rule)
+
+RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_meta,
+               pmd.net.nfp.cmsg.flow.meta)
+
+RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow,
+               pmd.net.nfp.cmsg.flow)
diff --git a/drivers/net/nfp/nfp_trace.h b/drivers/net/nfp/nfp_trace.h
index 5f8f3c373b..e0b8b0cee9 100644
--- a/drivers/net/nfp/nfp_trace.h
+++ b/drivers/net/nfp/nfp_trace.h
@@ -221,4 +221,26 @@ RTE_TRACE_POINT(
        rte_trace_point_emit_u32(cir);
 )
 
+RTE_TRACE_POINT(
+       rte_pmd_nfp_trace_cmsg_flow_meta,
+       RTE_TRACE_POINT_ARGS(void *cmsg),
+
+       struct nfp_fl_rule_metadata *meta = cmsg;
+       rte_trace_point_emit_u8(meta->key_len);
+       rte_trace_point_emit_u8(meta->mask_len);
+       rte_trace_point_emit_u8(meta->act_len);
+       rte_trace_point_emit_u8(meta->flags);
+       rte_trace_point_emit_u32(meta->host_ctx_id);
+       rte_trace_point_emit_u64(meta->host_cookie);
+       rte_trace_point_emit_u64(meta->flow_version);
+       rte_trace_point_emit_u32(meta->shortcut);
+)
+
+RTE_TRACE_POINT(
+       rte_pmd_nfp_trace_cmsg_flow,
+       RTE_TRACE_POINT_ARGS(const char *name),
+
+       rte_trace_point_emit_string(name);
+)
+
 #endif /* __NFP_TRACE_H__ */
-- 
2.39.1

Reply via email to