Skip to content

Commit

Permalink
ethdev: add trace points to flow insertion by index
Browse files Browse the repository at this point in the history
Adds trace points for rte_flow rule insertion by index functions:
rte_flow_async_create_by_index and
rte_flow_async_create_by_index_with_pattern.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
  • Loading branch information
aleks-kozyrev authored and ferruhy committed Sep 27, 2024
1 parent 2aadac7 commit 61b2b31
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
44 changes: 44 additions & 0 deletions lib/ethdev/ethdev_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -2343,6 +2343,50 @@ RTE_TRACE_POINT_FP(
rte_trace_point_emit_ptr(flow);
)

RTE_TRACE_POINT_FP(
rte_flow_trace_async_create_by_index,
RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
const struct rte_flow_op_attr *op_attr,
const struct rte_flow_template_table *template_table,
uint32_t rule_index,
const struct rte_flow_action *actions,
uint8_t actions_template_index,
const void *user_data, const 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_u32(rule_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_FP(
rte_flow_trace_async_create_by_index_with_pattern,
RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
const struct rte_flow_op_attr *op_attr,
const struct rte_flow_template_table *template_table,
uint32_t rule_index,
const struct rte_flow_item *pattern,
uint8_t pattern_template_index,
const struct rte_flow_action *actions,
uint8_t actions_template_index,
const void *user_data, const 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_u32(rule_index);
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_FP(
rte_flow_trace_async_destroy,
RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id,
Expand Down
6 changes: 6 additions & 0 deletions lib/ethdev/ethdev_trace_points.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,12 @@ RTE_TRACE_POINT_REGISTER(rte_flow_trace_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_create_by_index,
lib.ethdev.flow.async_create_by_index)

RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create_by_index_with_pattern,
lib.ethdev.flow.async_create_by_index_with_pattern)

RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_destroy,
lib.ethdev.flow.async_destroy)

Expand Down
18 changes: 16 additions & 2 deletions lib/ethdev/rte_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,7 @@ rte_flow_async_create_by_index(uint16_t port_id,
struct rte_flow_error *error)
{
struct rte_eth_dev *dev = &rte_eth_devices[port_id];
struct rte_flow *flow;

#ifdef RTE_FLOW_DEBUG
if (!rte_eth_dev_is_valid_port(port_id)) {
Expand All @@ -2104,10 +2105,15 @@ rte_flow_async_create_by_index(uint16_t port_id,
}
#endif

return dev->flow_fp_ops->async_create_by_index(dev, queue_id,
flow = dev->flow_fp_ops->async_create_by_index(dev, queue_id,
op_attr, template_table, rule_index,
actions, actions_template_index,
user_data, error);

rte_flow_trace_async_create_by_index(port_id, queue_id, op_attr, template_table, rule_index,
actions, actions_template_index, user_data, flow);

return flow;
}

struct rte_flow *
Expand All @@ -2124,6 +2130,7 @@ rte_flow_async_create_by_index_with_pattern(uint16_t port_id,
struct rte_flow_error *error)
{
struct rte_eth_dev *dev = &rte_eth_devices[port_id];
struct rte_flow *flow;

#ifdef RTE_FLOW_DEBUG
if (!rte_eth_dev_is_valid_port(port_id)) {
Expand All @@ -2139,11 +2146,18 @@ rte_flow_async_create_by_index_with_pattern(uint16_t port_id,
}
#endif

return dev->flow_fp_ops->async_create_by_index_with_pattern(dev, queue_id, op_attr,
flow = dev->flow_fp_ops->async_create_by_index_with_pattern(dev, queue_id, op_attr,
template_table, rule_index,
pattern, pattern_template_index,
actions, actions_template_index,
user_data, error);

rte_flow_trace_async_create_by_index_with_pattern(port_id, queue_id, op_attr,
template_table, rule_index, pattern,
pattern_template_index, actions,
actions_template_index, user_data, flow);

return flow;
}

int
Expand Down

0 comments on commit 61b2b31

Please sign in to comment.