net/mlx5: enhancement for flow dump value
PATCH 1/1 net/mlx5: enhancement for flow dump value
Multiple rules could use the same encap_decap/modify_hdr/counter action. The flow dump data could be duplicated.
To avoid redundancy, flow dump value is based on the actions' pointer instead of previous rules' pointer.
For counter, the data is stored in cmng of priv->sh.
For encap_decap/modify_hdr, the data stored in encaps_decaps/modify_cmds. Traverse the fields and get action's pointer and information.
Formats are same for information in the dump except "id" stands for actions' pointer:
Counter: rec_type,id,hits,bytes
Modify_hdr: rec_type,id,actions_number,actions
Encap_decap: rec_type,id,buf
--- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_flow.c | 161 ++++++++++++++++++++++++++++++++++------ drivers/net/mlx5/mlx5_flow.h | 5 ++ drivers/net/mlx5/mlx5_flow_dv.c | 44 ++++++++++- 4 files changed, 188 insertions(+), 24 deletions(-)
drivers/net/mlx5/mlx5.h +1 -1
@@ -1685,7 +1685,7 @@ int mlx5_counter_query(struct rte_eth_dev *dev, uint32_t cnt,int mlx5_flow_dev_dump (struct rte_eth_dev *dev,struct rte_flow *flow,FILE *file,struct rte_flow_error *error);int save_dump_file (const unsigned char *data,uint32_t size, -uint32_t type,uint32_t id,void *arg,FILE *file); +uint32_t type,uint64_t id,void *arg,FILE *file);int mlx5_flow_query_counter (struct rte_eth_dev *dev,struct rte_flow *flow,struct rte_flow_query_count *count,struct rte_flow_error *error);#ifdef HAVE_IBV_FLOW_DV_SUPPORT
drivers/net/mlx5/mlx5_flow.c +139 -22
237 lines not on this page · raw message
drivers/net/mlx5/mlx5_flow.h +5 -0
@@ -1674,6 +1674,11 @@ struct mlx5_list_entry *flow_dv_dest_array_clone_cb(void *tool_ctx, struct mlx5_list_entry *entry, void *cb_ctx);void flow_dv_dest_array_clone_free_cb (void *tool_ctx,struct mlx5_list_entry *entry); +int flow_dv_query_count_ptr (struct rte_eth_dev *dev,uint32_t cnt_idx, +void **action,struct rte_flow_error *error); +int +flow_dv_query_count (struct rte_eth_dev *dev,uint32_t cnt_idx,void *data, +struct rte_flow_error *error);struct mlx5_aso_age_action *flow_aso_age_get_by_idx (struct rte_eth_dev *dev,uint32_t age_idx);
drivers/net/mlx5/mlx5_flow_dv.c +43 -1
56 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Hi,
Quoted 26 lines
-----Original Message-----
From: Haifei Luo <[email protected]>
Sent: Tuesday, October 26, 2021 6:57 AM
To: Matan Azrad <[email protected]>; Ori Kam <[email protected]>; Slava Ovsiienko <[email protected]>; [email protected]
Cc: [email protected]; NBU-Contact-Thomas Monjalon <[email protected]>; Raslan Darawsheh <[email protected]>
Subject: [PATCH] net/mlx5: enhancement for flow dump valueMultiple rules could use the same encap_decap/modify_hdr/counter action. The flow dump data could be duplicated.
To avoid redundancy, flow dump value is based on the actions' pointer instead of previous rules' pointer.
For counter, the data is stored in cmng of
priv->sh. For encap_decap/modify_hdr, the data stored in encaps_decaps/modify_cmds.
Traverse the fields and get action's pointer and information.Formats are same for information in the dump except "id" stands for actions' pointer:
Counter: rec_type,id,hits,bytes
Modify_hdr: rec_type,id,actions_number,actions
Encap_decap: rec_type,id,buf
Quoted 3 lines
Signed-off-by Haifei Luo <[email protected]>---
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh