DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	Long Wu <long.wu@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH 5/7] net/nfp: add trace point about flow rule
Date: Wed, 19 Jun 2024 18:07:52 +0800	[thread overview]
Message-ID: <20240619100754.3480077-6-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240619100754.3480077-1-chaoyong.he@corigine.com>

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

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@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


  parent reply	other threads:[~2024-06-19 10:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 10:07 [PATCH 0/7] add trace support for control message Chaoyong He
2024-06-19 10:07 ` [PATCH 1/7] net/nfp: add trace points about port Chaoyong He
2024-06-19 10:07 ` [PATCH 2/7] net/nfp: add trace point about tunnel Chaoyong He
2024-06-19 10:07 ` [PATCH 3/7] net/nfp: add trace point about Qos Chaoyong He
2024-06-19 10:07 ` [PATCH 4/7] net/nfp: refactor to prepare for add flow trace point Chaoyong He
2024-06-19 10:07 ` Chaoyong He [this message]
2024-06-19 10:07 ` [PATCH 6/7] net/nfp: add trace point about flow rule pattern Chaoyong He
2024-06-19 10:07 ` [PATCH 7/7] net/nfp: add trace point about flow rule action Chaoyong He
2024-07-07 22:43 ` [PATCH 0/7] add trace support for control message Ferruh Yigit
2024-07-08  1:42   ` Chaoyong He
2024-07-08  2:45 ` [PATCH v2 " Chaoyong He
2024-07-08  2:45   ` [PATCH v2 1/7] net/nfp: add trace points about port Chaoyong He
2024-07-08  2:45   ` [PATCH v2 2/7] net/nfp: add trace point about tunnel Chaoyong He
2024-07-08  2:45   ` [PATCH v2 3/7] net/nfp: add trace point about Qos Chaoyong He
2024-07-08  2:45   ` [PATCH v2 4/7] net/nfp: refactor to prepare for add flow trace point Chaoyong He
2024-07-08  2:45   ` [PATCH v2 5/7] net/nfp: add trace point about flow rule Chaoyong He
2024-07-08  2:45   ` [PATCH v2 6/7] net/nfp: add trace point about flow rule pattern Chaoyong He
2024-07-08  2:45   ` [PATCH v2 7/7] net/nfp: add trace point about flow rule action Chaoyong He
2024-07-08 11:45   ` [PATCH v2 0/7] add trace support for control message Ferruh Yigit
2024-07-09  1:15     ` Chaoyong He
2024-07-09  3:16     ` Chaoyong He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240619100754.3480077-6-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).