From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A728EA00C4; Thu, 29 Sep 2022 12:34:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 99FAB40E5A; Thu, 29 Sep 2022 12:34:17 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B86AE40694 for ; Thu, 29 Sep 2022 12:34:16 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T9kJNK014924; Thu, 29 Sep 2022 03:31:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=4mZ+XnipywDVOpPRFxEIOLWJh/NHorox7LKRTM8/coI=; b=jH6HFhhHOKdawssYEquPcXAOkIiTpbT8bFrBQEt4CkKdGgkj26YHcroJ6nXolExZilmc 0pXY7sLUdSydFT78Y4dSJuGHx/JugpCOgOoOEWpQS7Jpk5oRIHWPaXe0SdiFdcHB6emB rltaaUtdQdaxid4XxbKOyk24zom+ZllJnHXUmEgGFE1eNBfJ5QsLA3oh5GnbTgt5g44q Wwl+ljwQVUsPsyISrhcoQePuK6DDx/2VdZ7dli89Vkrpdl6eIvny/u5bH19YLjJsDpA/ OopSFy4O1ezomfxLnOMvfmd4Dv/hVekBwnFD3OuA0Cm0cqtpaE9A+x9n+vUWziqVPtJv PA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3jw913g4hu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 29 Sep 2022 03:31:36 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Sep 2022 03:31:34 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 29 Sep 2022 03:31:34 -0700 Received: from hyd1349.t110.caveonetworks.com.com (unknown [10.29.45.13]) by maili.marvell.com (Postfix) with ESMTP id A195A3F705C; Thu, 29 Sep 2022 03:31:11 -0700 (PDT) From: Ankur Dwivedi To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Ankur Dwivedi Subject: [PATCH v2 2/4] ethdev: add trace points for flow Date: Thu, 29 Sep 2022 15:59:34 +0530 Message-ID: <20220929102936.5490-3-adwivedi@marvell.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20220929102936.5490-1-adwivedi@marvell.com> References: <20220804134430.6192-1-adwivedi@marvell.com> <20220929102936.5490-1-adwivedi@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: cDEpKbrdxJFcY_p_1DMKBywvDgZ86OPH X-Proofpoint-ORIG-GUID: cDEpKbrdxJFcY_p_1DMKBywvDgZ86OPH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_06,2022-09-29_03,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Adds trace points for rte_flow specific functions in ethdev lib. Signed-off-by: Ankur Dwivedi --- lib/ethdev/ethdev_trace_points.c | 117 +++++++++ lib/ethdev/rte_ethdev_trace.h | 418 +++++++++++++++++++++++++++++++ lib/ethdev/rte_flow.c | 54 ++++ lib/ethdev/version.map | 39 +++ 4 files changed, 628 insertions(+) diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 2c06b47b7f..165be941a1 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -464,3 +464,120 @@ RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_query, RTE_TRACE_POINT_REGISTER(rte_eth_trace_rx_avail_thresh_set, lib.ethdev.rx_avail_thresh_set) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_copy, + lib.ethdev.flow.copy) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_create, + lib.ethdev.flow.create) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_destroy, + lib.ethdev.flow.destroy) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_error_set, + lib.ethdev.flow.error_set) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_flush, + lib.ethdev.flow.flush) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_isolate, + lib.ethdev.flow.isolate) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_query, + lib.ethdev.flow.query) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_validate, + lib.ethdev.flow.validate) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_conv, + lib.ethdev.flow.conv) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_dynf_metadata_register, + lib.ethdev.dynf_metadata_register) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_dev_dump, + lib.ethdev.flow.dev_dump) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_aged_flows, + lib.ethdev.flow.get_aged_flows) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_decap_set, + lib.ethdev.flow.tunnel_decap_set) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_match, + lib.ethdev.flow.tunnel_match) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_get_restore_info, + lib.ethdev.flow.get_restore_info) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_action_decap_release, + lib.ethdev.flow.tunnel_action_decap_release) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_tunnel_item_release, + lib.ethdev.flow.tunnel_item_release) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_create, + lib.ethdev.flow.action_handle_create) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_destroy, + lib.ethdev.flow.action_handle_destroy) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_update, + lib.ethdev.flow.action_handle_update) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_action_handle_query, + lib.ethdev.flow.action_handle_query) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_create, + lib.ethdev.flow.flex_item_create) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_flex_item_release, + lib.ethdev.flow.flex_item_release) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_pick_transfer_proxy, + lib.ethdev.flow.pick_transfer_proxy) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_info_get, + lib.ethdev.flow.info_get) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_configure, + lib.ethdev.flow.configure) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_create, + lib.ethdev.flow.pattern_template_create) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_pattern_template_destroy, + lib.ethdev.flow.pattern_template_destroy) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_create, + lib.ethdev.flow.actions_template_create) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_actions_template_destroy, + lib.ethdev.flow.actions_template_destroy) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_create, + lib.ethdev.flow.template_table_create) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_destroy, + lib.ethdev.flow.template_table_destroy) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create, + lib.ethdev.flow.async_create) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_destroy, + lib.ethdev.flow.async_destroy) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_push, + lib.ethdev.flow.push) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_pull, + lib.ethdev.flow.pull) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_create, + lib.ethdev.flow.async_action_handle_create) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_destroy, + lib.ethdev.flow.async_action_handle_destroy) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_action_handle_update, + lib.ethdev.flow.async_action_handle_update) diff --git a/lib/ethdev/rte_ethdev_trace.h b/lib/ethdev/rte_ethdev_trace.h index be0383c839..d3b514372a 100644 --- a/lib/ethdev/rte_ethdev_trace.h +++ b/lib/ethdev/rte_ethdev_trace.h @@ -1273,6 +1273,424 @@ RTE_TRACE_POINT( rte_trace_point_emit_u8(avail_thresh); ) +RTE_TRACE_POINT( + rte_flow_trace_copy, + RTE_TRACE_POINT_ARGS(struct rte_flow_desc *fd, size_t len, + const struct rte_flow_attr *attr, + const struct rte_flow_item *items, + const struct rte_flow_action *actions, int ret), + rte_trace_point_emit_ptr(fd); + rte_trace_point_emit_size_t(len); + rte_trace_point_emit_u32(attr->group); + rte_trace_point_emit_u32(attr->priority); + rte_trace_point_emit_ptr(items); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_flow_trace_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_flow_attr *attr, + const struct rte_flow_item *pattern, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(attr->group); + rte_trace_point_emit_u32(attr->priority); + rte_trace_point_emit_ptr(pattern); + rte_trace_point_emit_ptr(actions); +) + +RTE_TRACE_POINT( + rte_flow_trace_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_error_set, + RTE_TRACE_POINT_ARGS(struct rte_flow_error *err_p, + int code, enum rte_flow_error_type type, + const void *cause, const char *message), + rte_trace_point_emit_ptr(err_p); + rte_trace_point_emit_int(code); + rte_trace_point_emit_int(type); + rte_trace_point_emit_ptr(cause); + rte_trace_point_emit_string(message); +) + +RTE_TRACE_POINT( + rte_flow_trace_flush, + RTE_TRACE_POINT_ARGS(uint16_t port_id), + rte_trace_point_emit_u16(port_id); +) + +RTE_TRACE_POINT( + rte_flow_trace_isolate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int set), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_int(set); +) + +RTE_TRACE_POINT( + rte_flow_trace_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow, + const struct rte_flow_action *action, void *data), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(flow); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_ptr(data); +) + +RTE_TRACE_POINT( + rte_flow_trace_validate, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_attr *attr, + const struct rte_flow_item *pattern, + const struct rte_flow_action *actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(attr->group); + rte_trace_point_emit_u32(attr->priority); + rte_trace_point_emit_ptr(pattern); + rte_trace_point_emit_ptr(actions); +) + +RTE_TRACE_POINT( + rte_flow_trace_conv, + RTE_TRACE_POINT_ARGS(enum rte_flow_conv_op op, void *dst, + size_t size, const void *src), + rte_trace_point_emit_int(op); + rte_trace_point_emit_ptr(dst); + rte_trace_point_emit_size_t(size); + rte_trace_point_emit_ptr(src); +) + +RTE_TRACE_POINT( + rte_flow_trace_dynf_metadata_register, + RTE_TRACE_POINT_ARGS(int offset, uint64_t flag), + rte_trace_point_emit_int(offset); + rte_trace_point_emit_u64(flag); +) + +RTE_TRACE_POINT( + rte_flow_trace_dev_dump, + RTE_TRACE_POINT_ARGS(uint16_t port_id, struct rte_flow *flow), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_get_aged_flows, + RTE_TRACE_POINT_ARGS(uint16_t port_id, void **contexts, + uint32_t nb_contexts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(contexts); + rte_trace_point_emit_u32(nb_contexts); +) + +RTE_TRACE_POINT( + rte_flow_trace_tunnel_decap_set, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_tunnel *tunnel, + struct rte_flow_action **actions, + uint32_t *num_of_actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(tunnel); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(num_of_actions); +) + +RTE_TRACE_POINT( + rte_flow_trace_tunnel_match, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_tunnel *tunnel, + struct rte_flow_item **items, + uint32_t *num_of_items), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(tunnel); + rte_trace_point_emit_ptr(items); + rte_trace_point_emit_ptr(num_of_items); +) + +RTE_TRACE_POINT( + rte_flow_trace_get_restore_info, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_mbuf *m, + struct rte_flow_restore_info *info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(m); + rte_trace_point_emit_ptr(info); +) + +RTE_TRACE_POINT( + rte_flow_trace_tunnel_action_decap_release, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_action *actions, + uint32_t num_of_actions), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_u32(num_of_actions); +) + +RTE_TRACE_POINT( + rte_flow_trace_tunnel_item_release, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_item *items, + uint32_t num_of_items), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(items); + rte_trace_point_emit_u32(num_of_items); +) + +RTE_TRACE_POINT( + rte_flow_trace_action_handle_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_indir_action_conf *conf, + const struct rte_flow_action *action, + struct rte_flow_action_handle *handle), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + rte_flow_trace_action_handle_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_action_handle *handle, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(handle); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_flow_trace_action_handle_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_action_handle *handle, + const void *update, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(handle); + rte_trace_point_emit_ptr(update); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_flow_trace_action_handle_query, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_action_handle *handle, + void *data, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(handle); + rte_trace_point_emit_ptr(data); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_flow_trace_flex_item_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_item_flex_conf *conf, + struct rte_flow_item_flex_handle *handle), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(conf); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + rte_flow_trace_flex_item_release, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_item_flex_handle *handle, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(handle); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_flow_trace_pick_transfer_proxy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t *proxy_port_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(proxy_port_id); +) + +RTE_TRACE_POINT( + rte_flow_trace_info_get, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_port_info *port_info, + struct rte_flow_queue_info *queue_info), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(port_info); + rte_trace_point_emit_ptr(queue_info); +) + +RTE_TRACE_POINT( + rte_flow_trace_configure, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_port_attr *port_attr, + uint16_t nb_queue, + const struct rte_flow_queue_attr **queue_attr), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(port_attr); + rte_trace_point_emit_u16(nb_queue); + rte_trace_point_emit_ptr(queue_attr); +) + +RTE_TRACE_POINT( + rte_flow_trace_pattern_template_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_pattern_template_attr *template_attr, + const struct rte_flow_item *pattern), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_attr); + rte_trace_point_emit_ptr(pattern); +) + +RTE_TRACE_POINT( + rte_flow_trace_pattern_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_pattern_template *pattern_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(pattern_template); +) + +RTE_TRACE_POINT( + rte_flow_trace_actions_template_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_actions_template_attr *template_attr, + const struct rte_flow_action *actions, + const struct rte_flow_action *masks), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_attr); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_ptr(masks); +) + +RTE_TRACE_POINT( + rte_flow_trace_actions_template_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_actions_template *actions_template), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(actions_template); +) + +RTE_TRACE_POINT( + rte_flow_trace_template_table_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + const struct rte_flow_template_table_attr *table_attr, + struct rte_flow_pattern_template **pattern_templates, + uint8_t nb_pattern_templates, + struct rte_flow_actions_template **actions_templates, + uint8_t nb_actions_templates), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(table_attr); + rte_trace_point_emit_ptr(pattern_templates); + rte_trace_point_emit_u8(nb_pattern_templates); + rte_trace_point_emit_ptr(actions_templates); + rte_trace_point_emit_u8(nb_actions_templates); +) + +RTE_TRACE_POINT( + rte_flow_trace_template_table_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, + struct rte_flow_template_table *template_table), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_ptr(template_table); +) + +RTE_TRACE_POINT( + rte_flow_trace_async_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + struct rte_flow_template_table *template_table, + const struct rte_flow_item *pattern, + uint8_t pattern_template_index, + const struct rte_flow_action *actions, + uint8_t actions_template_index, + void *user_data, struct rte_flow *flow), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); + rte_trace_point_emit_ptr(op_attr); + rte_trace_point_emit_ptr(template_table); + rte_trace_point_emit_ptr(pattern); + rte_trace_point_emit_u8(pattern_template_index); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_u8(actions_template_index); + rte_trace_point_emit_ptr(user_data); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT( + rte_flow_trace_async_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + struct rte_flow *flow, void *user_data), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); + rte_trace_point_emit_ptr(op_attr); + rte_trace_point_emit_ptr(flow); + rte_trace_point_emit_ptr(user_data); +) + +RTE_TRACE_POINT( + rte_flow_trace_push, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); +) + +RTE_TRACE_POINT( + rte_flow_trace_pull, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, + struct rte_flow_op_result *res, uint16_t n_res, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); + rte_trace_point_emit_ptr(res); + rte_trace_point_emit_u16(n_res); + rte_trace_point_emit_int(ret); +) + +RTE_TRACE_POINT( + rte_flow_trace_async_action_handle_create, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + const struct rte_flow_indir_action_conf *indir_action_conf, + const struct rte_flow_action *action, + void *user_data, struct rte_flow_action_handle *handle), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); + rte_trace_point_emit_ptr(op_attr); + rte_trace_point_emit_ptr(indir_action_conf); + rte_trace_point_emit_ptr(action); + rte_trace_point_emit_ptr(user_data); + rte_trace_point_emit_ptr(handle); +) + +RTE_TRACE_POINT( + rte_flow_trace_async_action_handle_destroy, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + struct rte_flow_action_handle *action_handle, + void *user_data), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); + rte_trace_point_emit_ptr(op_attr); + rte_trace_point_emit_ptr(action_handle); + rte_trace_point_emit_ptr(user_data); +) + +RTE_TRACE_POINT( + rte_flow_trace_async_action_handle_update, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + struct rte_flow_action_handle *action_handle, + const void *update, void *user_data, int ret), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); + rte_trace_point_emit_ptr(op_attr); + rte_trace_point_emit_ptr(action_handle); + rte_trace_point_emit_ptr(update); + rte_trace_point_emit_ptr(user_data); + rte_trace_point_emit_int(ret); +) + #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index af0eb9619c..00fd1e5f54 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -13,6 +13,7 @@ #include #include #include "rte_ethdev.h" +#include "rte_ethdev_trace.h" #include "rte_flow_driver.h" #include "rte_flow.h" @@ -280,6 +281,7 @@ rte_flow_dynf_metadata_register(void) goto error; rte_flow_dynf_metadata_offs = offset; rte_flow_dynf_metadata_mask = RTE_BIT64(flag); + rte_flow_trace_dynf_metadata_register(offset, RTE_BIT64(flag)); return 0; error: @@ -353,6 +355,7 @@ rte_flow_validate(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; int ret; + rte_flow_trace_validate(port_id, attr, pattern, actions); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->validate)) { @@ -378,6 +381,7 @@ rte_flow_create(uint16_t port_id, struct rte_flow *flow; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_create(port_id, attr, pattern, actions); if (unlikely(!ops)) return NULL; if (likely(!!ops->create)) { @@ -403,6 +407,7 @@ rte_flow_destroy(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_destroy(port_id, flow); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->destroy)) { @@ -425,6 +430,7 @@ rte_flow_flush(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_flush(port_id); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->flush)) { @@ -450,6 +456,7 @@ rte_flow_query(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_query(port_id, flow, action, data); if (!ops) return -rte_errno; if (likely(!!ops->query)) { @@ -473,6 +480,7 @@ rte_flow_isolate(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_isolate(port_id, set); if (!ops) return -rte_errno; if (likely(!!ops->isolate)) { @@ -502,6 +510,7 @@ rte_flow_error_set(struct rte_flow_error *error, }; } rte_errno = code; + rte_flow_trace_error_set(error, code, type, cause, message); return -code; } @@ -1000,6 +1009,7 @@ rte_flow_conv(enum rte_flow_conv_op op, const void *src, struct rte_flow_error *error) { + rte_flow_trace_conv(op, dst, size, src); switch (op) { const struct rte_flow_attr *attr; @@ -1084,6 +1094,7 @@ rte_flow_copy(struct rte_flow_desc *desc, size_t len, .actions = dst_size ? dst->actions : NULL, }), len > sizeof(*desc) ? sizeof(*desc) : len); + rte_flow_trace_copy(desc, len, attr, items, actions, ret); return ret; } @@ -1095,6 +1106,7 @@ rte_flow_dev_dump(uint16_t port_id, struct rte_flow *flow, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_dev_dump(port_id, flow); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->dev_dump)) { @@ -1116,6 +1128,7 @@ rte_flow_get_aged_flows(uint16_t port_id, void **contexts, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_get_aged_flows(port_id, contexts, nb_contexts); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->get_aged_flows)) { @@ -1150,6 +1163,7 @@ rte_flow_action_handle_create(uint16_t port_id, conf, action, error); if (handle == NULL) flow_err(port_id, -rte_errno, error); + rte_flow_trace_action_handle_create(port_id, conf, action, handle); return handle; } @@ -1169,6 +1183,7 @@ rte_flow_action_handle_destroy(uint16_t port_id, NULL, rte_strerror(ENOSYS)); ret = ops->action_handle_destroy(&rte_eth_devices[port_id], handle, error); + rte_flow_trace_action_handle_destroy(port_id, handle, ret); return flow_err(port_id, ret, error); } @@ -1189,6 +1204,7 @@ rte_flow_action_handle_update(uint16_t port_id, NULL, rte_strerror(ENOSYS)); ret = ops->action_handle_update(&rte_eth_devices[port_id], handle, update, error); + rte_flow_trace_action_handle_update(port_id, handle, update, ret); return flow_err(port_id, ret, error); } @@ -1209,6 +1225,7 @@ rte_flow_action_handle_query(uint16_t port_id, NULL, rte_strerror(ENOSYS)); ret = ops->action_handle_query(&rte_eth_devices[port_id], handle, data, error); + rte_flow_trace_action_handle_query(port_id, handle, data, ret); return flow_err(port_id, ret, error); } @@ -1222,6 +1239,7 @@ rte_flow_tunnel_decap_set(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_tunnel_decap_set(port_id, tunnel, actions, num_of_actions); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_decap_set)) { @@ -1245,6 +1263,7 @@ rte_flow_tunnel_match(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_tunnel_match(port_id, tunnel, items, num_of_items); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_match)) { @@ -1267,6 +1286,7 @@ rte_flow_get_restore_info(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_get_restore_info(port_id, m, restore_info); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->get_restore_info)) { @@ -1289,6 +1309,7 @@ rte_flow_tunnel_action_decap_release(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_tunnel_action_decap_release(port_id, actions, num_of_actions); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_action_decap_release)) { @@ -1312,6 +1333,7 @@ rte_flow_tunnel_item_release(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_tunnel_item_release(port_id, items, num_of_items); if (unlikely(!ops)) return -rte_errno; if (likely(!!ops->tunnel_item_release)) { @@ -1332,6 +1354,7 @@ rte_flow_pick_transfer_proxy(uint16_t port_id, uint16_t *proxy_port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_eth_dev *dev; + rte_flow_trace_pick_transfer_proxy(port_id, proxy_port_id); if (unlikely(ops == NULL)) return -rte_errno; @@ -1367,6 +1390,7 @@ rte_flow_flex_item_create(uint16_t port_id, handle = ops->flex_item_create(dev, conf, error); if (handle == NULL) flow_err(port_id, -rte_errno, error); + rte_flow_trace_flex_item_create(port_id, conf, handle); return handle; } @@ -1384,6 +1408,7 @@ rte_flow_flex_item_release(uint16_t port_id, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, rte_strerror(ENOTSUP)); ret = ops->flex_item_release(dev, handle, error); + rte_flow_trace_flex_item_release(port_id, handle, ret); return flow_err(port_id, ret, error); } @@ -1396,6 +1421,7 @@ rte_flow_info_get(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_info_get(port_id, port_info, queue_info); if (unlikely(!ops)) return -rte_errno; if (dev->data->dev_configured == 0) { @@ -1429,6 +1455,7 @@ rte_flow_configure(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_configure(port_id, port_attr, nb_queue, queue_attr); if (unlikely(!ops)) return -rte_errno; if (dev->data->dev_configured == 0) { @@ -1472,6 +1499,8 @@ rte_flow_pattern_template_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_pattern_template *template; + rte_flow_trace_pattern_template_create(port_id, template_attr, + pattern); if (unlikely(!ops)) return NULL; if (dev->data->flow_configured == 0) { @@ -1522,6 +1551,7 @@ rte_flow_pattern_template_destroy(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_pattern_template_destroy(port_id, pattern_template); if (unlikely(!ops)) return -rte_errno; if (unlikely(pattern_template == NULL)) @@ -1549,6 +1579,8 @@ rte_flow_actions_template_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_actions_template *template; + rte_flow_trace_actions_template_create(port_id, template_attr, actions, + masks); if (unlikely(!ops)) return NULL; if (dev->data->flow_configured == 0) { @@ -1608,6 +1640,7 @@ rte_flow_actions_template_destroy(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_actions_template_destroy(port_id, actions_template); if (unlikely(!ops)) return -rte_errno; if (unlikely(actions_template == NULL)) @@ -1637,6 +1670,11 @@ rte_flow_template_table_create(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); struct rte_flow_template_table *table; + rte_flow_trace_template_table_create(port_id, table_attr, + pattern_templates, + nb_pattern_templates, + actions_templates, + nb_actions_templates); if (unlikely(!ops)) return NULL; if (dev->data->flow_configured == 0) { @@ -1698,6 +1736,7 @@ rte_flow_template_table_destroy(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_template_table_destroy(port_id, template_table); if (unlikely(!ops)) return -rte_errno; if (unlikely(template_table == NULL)) @@ -1737,6 +1776,9 @@ rte_flow_async_create(uint16_t port_id, user_data, error); if (flow == NULL) flow_err(port_id, -rte_errno, error); + rte_flow_trace_async_create(port_id, queue_id, op_attr, template_table, + pattern, pattern_template_index, actions, + actions_template_index, user_data, flow); return flow; } @@ -1751,6 +1793,8 @@ rte_flow_async_destroy(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_async_destroy(port_id, queue_id, op_attr, flow, + user_data); return flow_err(port_id, ops->async_destroy(dev, queue_id, op_attr, flow, @@ -1766,6 +1810,7 @@ rte_flow_push(uint16_t port_id, struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); + rte_flow_trace_push(port_id, queue_id); return flow_err(port_id, ops->push(dev, queue_id, error), error); @@ -1783,6 +1828,7 @@ rte_flow_pull(uint16_t port_id, int ret; ret = ops->pull(dev, queue_id, res, n_res, error); + rte_flow_trace_pull(port_id, queue_id, res, n_res, ret); return ret ? ret : flow_err(port_id, ret, error); } @@ -1803,6 +1849,9 @@ rte_flow_async_action_handle_create(uint16_t port_id, indir_action_conf, action, user_data, error); if (handle == NULL) flow_err(port_id, -rte_errno, error); + rte_flow_trace_async_action_handle_create(port_id, queue_id, op_attr, + indir_action_conf, action, + user_data, handle); return handle; } @@ -1818,6 +1867,8 @@ rte_flow_async_action_handle_destroy(uint16_t port_id, const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); int ret; + rte_flow_trace_async_action_handle_destroy(port_id, queue_id, op_attr, + action_handle, user_data); ret = ops->async_action_handle_destroy(dev, queue_id, op_attr, action_handle, user_data, error); return flow_err(port_id, ret, error); @@ -1838,6 +1889,9 @@ rte_flow_async_action_handle_update(uint16_t port_id, ret = ops->async_action_handle_update(dev, queue_id, op_attr, action_handle, update, user_data, error); + rte_flow_trace_async_action_handle_update(port_id, queue_id, op_attr, + action_handle, update, + user_data, ret); return flow_err(port_id, ret, error); } diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index e3d603cc9a..5aab81dcbd 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -432,6 +432,45 @@ EXPERIMENTAL { __rte_eth_trace_ip_reassembly_conf_set; __rte_eth_trace_rx_avail_thresh_query; __rte_eth_trace_rx_avail_thresh_set; + __rte_flow_trace_action_handle_create; + __rte_flow_trace_action_handle_destroy; + __rte_flow_trace_action_handle_query; + __rte_flow_trace_action_handle_update; + __rte_flow_trace_actions_template_create; + __rte_flow_trace_actions_template_destroy; + __rte_flow_trace_async_action_handle_create; + __rte_flow_trace_async_action_handle_destroy; + __rte_flow_trace_async_action_handle_update; + __rte_flow_trace_async_create; + __rte_flow_trace_async_destroy; + __rte_flow_trace_conv; + __rte_flow_trace_configure; + __rte_flow_trace_copy; + __rte_flow_trace_create; + __rte_flow_trace_destroy; + __rte_flow_trace_dev_dump; + __rte_flow_trace_dynf_metadata_register; + __rte_flow_trace_error_set; + __rte_flow_trace_flex_item_create; + __rte_flow_trace_flex_item_release; + __rte_flow_trace_flush; + __rte_flow_trace_get_aged_flows; + __rte_flow_trace_get_restore_info; + __rte_flow_trace_info_get; + __rte_flow_trace_isolate; + __rte_flow_trace_pattern_template_create; + __rte_flow_trace_pattern_template_destroy; + __rte_flow_trace_pick_transfer_proxy; + __rte_flow_trace_push; + __rte_flow_trace_pull; + __rte_flow_trace_query; + __rte_flow_trace_template_table_create; + __rte_flow_trace_template_table_destroy; + __rte_flow_trace_tunnel_action_decap_release; + __rte_flow_trace_tunnel_decap_set; + __rte_flow_trace_tunnel_item_release; + __rte_flow_trace_tunnel_match; + __rte_flow_trace_validate; }; INTERNAL { -- 2.28.0