* [PATCH v1 1/4] net/ixgbe: implement flow dump
@ 2026-04-30 10:31 Anatoly Burakov
2026-04-30 10:31 ` [PATCH v1 2/4] net/i40e: " Anatoly Burakov
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Anatoly Burakov @ 2026-04-30 10:31 UTC (permalink / raw)
To: dev, Vladimir Medvedkin
Implement flow dumping API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ixgbe/ixgbe_flow.c | 127 +++++++++++++++++++++++++++
1 file changed, 127 insertions(+)
diff --git a/drivers/net/intel/ixgbe/ixgbe_flow.c b/drivers/net/intel/ixgbe/ixgbe_flow.c
index 01cd4f9bde..30e9ad9010 100644
--- a/drivers/net/intel/ixgbe/ixgbe_flow.c
+++ b/drivers/net/intel/ixgbe/ixgbe_flow.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
+#include <stddef.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
@@ -29,6 +30,7 @@
#include <dev_driver.h>
#include <rte_hash_crc.h>
#include <rte_flow.h>
+#include <rte_hexdump.h>
#include <rte_flow_driver.h>
#include "ixgbe_logs.h"
@@ -3581,9 +3583,134 @@ ixgbe_flow_flush(struct rte_eth_dev *dev,
return 0;
}
+#define IXGBE_FLOW_DUMP_CHUNK_BYTES 32
+
+static const char *
+ixgbe_flow_rule_engine_name(const struct rte_flow *flow)
+{
+ if (flow->is_security)
+ return "security";
+
+ switch (flow->filter_type) {
+ case RTE_ETH_FILTER_NTUPLE:
+ return "ntuple";
+ case RTE_ETH_FILTER_ETHERTYPE:
+ return "ethertype";
+ case RTE_ETH_FILTER_SYN:
+ return "syn";
+ case RTE_ETH_FILTER_FDIR:
+ return "fdir";
+ case RTE_ETH_FILTER_L2_TUNNEL:
+ return "l2_tunnel";
+ case RTE_ETH_FILTER_HASH:
+ return "hash";
+ default:
+ return "unknown";
+ }
+}
+
+static size_t
+ixgbe_flow_rule_size(const struct rte_flow *flow)
+{
+ if (flow->is_security)
+ return 0;
+
+ switch (flow->filter_type) {
+ case RTE_ETH_FILTER_NTUPLE:
+ return sizeof(struct rte_eth_ntuple_filter);
+ case RTE_ETH_FILTER_ETHERTYPE:
+ return sizeof(struct rte_eth_ethertype_filter);
+ case RTE_ETH_FILTER_SYN:
+ return sizeof(struct rte_eth_syn_filter);
+ case RTE_ETH_FILTER_FDIR:
+ return sizeof(struct ixgbe_fdir_rule);
+ case RTE_ETH_FILTER_L2_TUNNEL:
+ return sizeof(struct ixgbe_l2_tunnel_conf);
+ case RTE_ETH_FILTER_HASH:
+ return sizeof(struct ixgbe_rte_flow_rss_conf);
+ default:
+ return 0;
+ }
+}
+
+static const void *
+ixgbe_flow_rule_data(const struct rte_flow *flow)
+{
+ if (flow->is_security || flow->rule == NULL)
+ return NULL;
+
+ return RTE_PTR_ADD(flow->rule, sizeof(struct ixgbe_filter_ele_base));
+}
+
+static void
+ixgbe_flow_dump_blob(FILE *file, const char *engine,
+ const void *data, size_t data_len)
+{
+ const uint8_t *raw = (const uint8_t *)data;
+ const size_t nchunks =
+ (data_len + IXGBE_FLOW_DUMP_CHUNK_BYTES - 1) /
+ IXGBE_FLOW_DUMP_CHUNK_BYTES;
+ char title[64];
+ size_t ci;
+
+ fprintf(file, "FLOW DUMP: driver=ixgbe engine=%s\n", engine);
+ fprintf(file, "FLOW DUMP: DATA size=%zu chunks=%zu chunk_bytes=%d\n",
+ data_len, nchunks, IXGBE_FLOW_DUMP_CHUNK_BYTES);
+
+ for (ci = 0; ci < nchunks; ci++) {
+ const size_t off = ci * IXGBE_FLOW_DUMP_CHUNK_BYTES;
+ const size_t clen =
+ RTE_MIN((size_t)IXGBE_FLOW_DUMP_CHUNK_BYTES, data_len - off);
+
+ snprintf(title, sizeof(title), "FLOW DUMP: chunk %03zu/%03zu",
+ ci + 1, nchunks);
+ rte_memdump(file, title, raw + off, clen);
+ }
+}
+
+static int
+ixgbe_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error)
+{
+ struct ixgbe_adapter *ad = IXGBE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+ struct ixgbe_filter_ele_base *flow_mem_base;
+ bool found = false;
+
+ TAILQ_FOREACH(flow_mem_base, &ad->flow_list, entries) {
+ struct ixgbe_flow_mem *ixgbe_flow_mem_ptr =
+ (struct ixgbe_flow_mem *)flow_mem_base;
+ struct rte_flow *p_flow = ixgbe_flow_mem_ptr->flow;
+ const void *rule_data = NULL;
+ const char *engine_name;
+ size_t rule_size = 0;
+
+ if (flow != NULL && p_flow != flow)
+ continue;
+
+ found = true;
+ if (p_flow->rule != NULL) {
+ rule_data = ixgbe_flow_rule_data(p_flow);
+ rule_size = ixgbe_flow_rule_size(p_flow);
+ }
+ engine_name = ixgbe_flow_rule_engine_name(p_flow);
+ ixgbe_flow_dump_blob(file, engine_name,
+ rule_data, rule_size);
+ }
+
+ if (flow != NULL && !found)
+ return rte_flow_error_set(error, ENOENT,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Flow not found");
+
+ return 0;
+}
+
const struct rte_flow_ops ixgbe_flow_ops = {
.validate = ixgbe_flow_validate,
.create = ixgbe_flow_create,
.destroy = ixgbe_flow_destroy,
.flush = ixgbe_flow_flush,
+ .dev_dump = ixgbe_flow_dev_dump,
};
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v1 2/4] net/i40e: implement flow dump
2026-04-30 10:31 [PATCH v1 1/4] net/ixgbe: implement flow dump Anatoly Burakov
@ 2026-04-30 10:31 ` Anatoly Burakov
2026-04-30 10:31 ` [PATCH v1 3/4] net/iavf: " Anatoly Burakov
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: Anatoly Burakov @ 2026-04-30 10:31 UTC (permalink / raw)
To: dev, Bruce Richardson
Implement flow dumping API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/i40e/i40e_flow.c | 103 +++++++++++++++++++++++++++++
1 file changed, 103 insertions(+)
diff --git a/drivers/net/intel/i40e/i40e_flow.c b/drivers/net/intel/i40e/i40e_flow.c
index 967af052ff..cb246da780 100644
--- a/drivers/net/intel/i40e/i40e_flow.c
+++ b/drivers/net/intel/i40e/i40e_flow.c
@@ -17,6 +17,7 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_tailq.h>
+#include <rte_hexdump.h>
#include <rte_flow_driver.h>
#include <rte_bitmap.h>
@@ -50,6 +51,10 @@ static int i40e_flow_query(struct rte_eth_dev *dev,
struct rte_flow *flow,
const struct rte_flow_action *actions,
void *data, struct rte_flow_error *error);
+static int i40e_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error);
static int
i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,
const struct rte_flow_item *pattern,
@@ -141,6 +146,7 @@ const struct rte_flow_ops i40e_flow_ops = {
.destroy = i40e_flow_destroy,
.flush = i40e_flow_flush,
.query = i40e_flow_query,
+ .dev_dump = i40e_flow_dev_dump,
};
/* Pattern matched ethertype filter */
@@ -1256,6 +1262,103 @@ i40e_flow_parse_attr(const struct rte_flow_attr *attr,
return 0;
}
+#define I40E_FLOW_DUMP_CHUNK_BYTES 32
+
+static const char *
+i40e_flow_rule_name(enum rte_filter_type filter_type)
+{
+ switch (filter_type) {
+ case RTE_ETH_FILTER_ETHERTYPE:
+ return "ethertype";
+ case RTE_ETH_FILTER_FDIR:
+ return "fdir";
+ case RTE_ETH_FILTER_TUNNEL:
+ return "tunnel";
+ case RTE_ETH_FILTER_HASH:
+ return "hash";
+ default:
+ return "unknown";
+ }
+}
+
+static size_t
+i40e_flow_rule_size(enum rte_filter_type filter_type)
+{
+ switch (filter_type) {
+ case RTE_ETH_FILTER_ETHERTYPE:
+ return sizeof(struct i40e_ethertype_filter);
+ case RTE_ETH_FILTER_FDIR:
+ return sizeof(struct i40e_fdir_filter);
+ case RTE_ETH_FILTER_TUNNEL:
+ return sizeof(struct i40e_tunnel_filter);
+ case RTE_ETH_FILTER_HASH:
+ return sizeof(struct i40e_rss_filter);
+ default:
+ return 0;
+ }
+}
+
+static void
+i40e_flow_dump_blob(FILE *file, const char *engine,
+ const void *data, size_t data_len)
+{
+ const uint8_t *raw = (const uint8_t *)data;
+ const size_t nchunks =
+ (data_len + I40E_FLOW_DUMP_CHUNK_BYTES - 1) /
+ I40E_FLOW_DUMP_CHUNK_BYTES;
+ char title[64];
+ size_t ci;
+
+ fprintf(file, "FLOW DUMP: driver=i40e engine=%s\n", engine);
+ fprintf(file, "FLOW DUMP: DATA size=%zu chunks=%zu chunk_bytes=%d\n",
+ data_len, nchunks, I40E_FLOW_DUMP_CHUNK_BYTES);
+
+ for (ci = 0; ci < nchunks; ci++) {
+ const size_t off = ci * I40E_FLOW_DUMP_CHUNK_BYTES;
+ const size_t clen =
+ RTE_MIN((size_t)I40E_FLOW_DUMP_CHUNK_BYTES, data_len - off);
+
+ snprintf(title, sizeof(title), "FLOW DUMP: chunk %03zu/%03zu",
+ ci + 1, nchunks);
+ rte_memdump(file, title, raw + off, clen);
+ }
+}
+
+static int
+i40e_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error)
+{
+ struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+ struct rte_flow *p_flow;
+ bool found = false;
+
+ TAILQ_FOREACH(p_flow, &pf->flow_list, node) {
+ size_t rule_size = 0;
+ const void *rule_data = NULL;
+
+ if (flow != NULL && p_flow != flow)
+ continue;
+
+ found = true;
+ if (p_flow->rule != NULL) {
+ rule_size = i40e_flow_rule_size(p_flow->filter_type);
+ rule_data = p_flow->rule;
+ }
+ i40e_flow_dump_blob(file,
+ i40e_flow_rule_name(p_flow->filter_type),
+ rule_data, rule_size);
+ }
+
+ if (flow != NULL && !found)
+ return rte_flow_error_set(error, ENOENT,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Flow not found");
+
+ return 0;
+}
+
static int
i40e_get_outer_vlan(struct rte_eth_dev *dev, uint16_t *tpid)
{
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v1 3/4] net/iavf: implement flow dump
2026-04-30 10:31 [PATCH v1 1/4] net/ixgbe: implement flow dump Anatoly Burakov
2026-04-30 10:31 ` [PATCH v1 2/4] net/i40e: " Anatoly Burakov
@ 2026-04-30 10:31 ` Anatoly Burakov
2026-04-30 10:31 ` [PATCH v1 4/4] net/ice: " Anatoly Burakov
2026-04-30 11:00 ` [PATCH v2 1/4] net/ixgbe: " Anatoly Burakov
3 siblings, 0 replies; 13+ messages in thread
From: Anatoly Burakov @ 2026-04-30 10:31 UTC (permalink / raw)
To: dev, Vladimir Medvedkin
Implement flow dumping API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/iavf/iavf_fdir.c | 2 +
drivers/net/intel/iavf/iavf_fsub.c | 2 +
drivers/net/intel/iavf/iavf_generic_flow.c | 77 ++++++++++++++++++++++
drivers/net/intel/iavf/iavf_generic_flow.h | 2 +
drivers/net/intel/iavf/iavf_hash.c | 2 +
drivers/net/intel/iavf/iavf_ipsec_crypto.c | 2 +
6 files changed, 87 insertions(+)
diff --git a/drivers/net/intel/iavf/iavf_fdir.c b/drivers/net/intel/iavf/iavf_fdir.c
index 9eae874800..ee63d082d0 100644
--- a/drivers/net/intel/iavf/iavf_fdir.c
+++ b/drivers/net/intel/iavf/iavf_fdir.c
@@ -437,7 +437,9 @@ static struct iavf_flow_engine iavf_fdir_engine = {
.create = iavf_fdir_create,
.destroy = iavf_fdir_destroy,
.validation = iavf_fdir_validation,
+ .name = "fdir",
.type = IAVF_FLOW_ENGINE_FDIR,
+ .rule_size = sizeof(struct iavf_fdir_conf),
};
static int
diff --git a/drivers/net/intel/iavf/iavf_fsub.c b/drivers/net/intel/iavf/iavf_fsub.c
index a00d02ded5..f08a8ae726 100644
--- a/drivers/net/intel/iavf/iavf_fsub.c
+++ b/drivers/net/intel/iavf/iavf_fsub.c
@@ -730,7 +730,9 @@ iavf_flow_engine iavf_fsub_engine = {
.create = iavf_fsub_create,
.destroy = iavf_fsub_destroy,
.validation = iavf_fsub_validation,
+ .name = "fsub",
.type = IAVF_FLOW_ENGINE_FSUB,
+ .rule_size = sizeof(struct iavf_fsub_conf),
};
static struct
diff --git a/drivers/net/intel/iavf/iavf_generic_flow.c b/drivers/net/intel/iavf/iavf_generic_flow.c
index 42ecc90d1d..803bc913bd 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.c
+++ b/drivers/net/intel/iavf/iavf_generic_flow.c
@@ -17,6 +17,7 @@
#include "iavf.h"
#include "iavf_generic_flow.h"
+#include <rte_hexdump.h>
static struct iavf_engine_list engine_list =
TAILQ_HEAD_INITIALIZER(engine_list);
@@ -39,6 +40,10 @@ static int iavf_flow_query(struct rte_eth_dev *dev,
const struct rte_flow_action *actions,
void *data,
struct rte_flow_error *error);
+static int iavf_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error);
const struct rte_flow_ops iavf_flow_ops = {
.validate = iavf_flow_validate,
@@ -46,6 +51,7 @@ const struct rte_flow_ops iavf_flow_ops = {
.destroy = iavf_flow_destroy,
.flush = iavf_flow_flush,
.query = iavf_flow_query,
+ .dev_dump = iavf_flow_dev_dump,
};
/* raw */
@@ -2418,3 +2424,74 @@ iavf_flow_query(struct rte_eth_dev *dev,
}
return ret;
}
+
+#define IAVF_FLOW_DUMP_CHUNK_BYTES 32
+
+static void
+iavf_flow_dump_blob(FILE *file, const char *engine,
+ const void *data, size_t data_len)
+{
+ const uint8_t *raw = (const uint8_t *)data;
+ const size_t nchunks =
+ (data_len + IAVF_FLOW_DUMP_CHUNK_BYTES - 1) /
+ IAVF_FLOW_DUMP_CHUNK_BYTES;
+ char title[64];
+ size_t ci;
+
+ fprintf(file, "FLOW DUMP: driver=iavf engine=%s\n", engine);
+ fprintf(file, "FLOW DUMP: DATA size=%zu chunks=%zu chunk_bytes=%d\n",
+ data_len, nchunks, IAVF_FLOW_DUMP_CHUNK_BYTES);
+
+ for (ci = 0; ci < nchunks; ci++) {
+ const size_t off = ci * IAVF_FLOW_DUMP_CHUNK_BYTES;
+ const size_t clen =
+ RTE_MIN((size_t)IAVF_FLOW_DUMP_CHUNK_BYTES,
+ data_len - off);
+ snprintf(title, sizeof(title), "FLOW DUMP: chunk %03zu/%03zu",
+ ci + 1, nchunks);
+ rte_memdump(file, title, raw + off, clen);
+ }
+}
+
+static int
+iavf_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error)
+{
+ struct iavf_adapter *ad =
+ IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+ struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
+ struct rte_flow *f;
+ bool found = false;
+
+ rte_spinlock_lock(&vf->flow_ops_lock);
+ TAILQ_FOREACH(f, &vf->flow_list, node) {
+ size_t rule_size = 0;
+ const void *rule_data = NULL;
+
+ if (flow != NULL && f != flow)
+ continue;
+
+ found = true;
+ if (f->engine != NULL) {
+ rule_size = f->engine->rule_size;
+ if (f->rule != NULL)
+ rule_data = f->rule;
+ }
+
+ if (f->engine != NULL)
+ iavf_flow_dump_blob(file,
+ f->engine->name != NULL ?
+ f->engine->name : "unknown",
+ rule_data, rule_size);
+ }
+ rte_spinlock_unlock(&vf->flow_ops_lock);
+
+ if (flow != NULL && !found)
+ return rte_flow_error_set(error, ENOENT,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Flow not found");
+
+ return 0;
+}
diff --git a/drivers/net/intel/iavf/iavf_generic_flow.h b/drivers/net/intel/iavf/iavf_generic_flow.h
index b97cf8b7ff..1b87c486d5 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.h
+++ b/drivers/net/intel/iavf/iavf_generic_flow.h
@@ -495,7 +495,9 @@ struct iavf_flow_engine {
engine_destroy_t destroy;
engine_query_t query_count;
engine_free_t free;
+ const char *name;
enum iavf_flow_engine_type type;
+ size_t rule_size;
};
TAILQ_HEAD(iavf_engine_list, iavf_flow_engine);
diff --git a/drivers/net/intel/iavf/iavf_hash.c b/drivers/net/intel/iavf/iavf_hash.c
index cb10eeab78..8bf5d106b1 100644
--- a/drivers/net/intel/iavf/iavf_hash.c
+++ b/drivers/net/intel/iavf/iavf_hash.c
@@ -682,7 +682,9 @@ static struct iavf_flow_engine iavf_hash_engine = {
.destroy = iavf_hash_destroy,
.uninit = iavf_hash_uninit_parser,
.free = iavf_hash_free,
+ .name = "hash",
.type = IAVF_FLOW_ENGINE_HASH,
+ .rule_size = sizeof(struct virtchnl_rss_cfg),
};
/* Register parser for comms package. */
diff --git a/drivers/net/intel/iavf/iavf_ipsec_crypto.c b/drivers/net/intel/iavf/iavf_ipsec_crypto.c
index 47102e75f2..75da9f6413 100644
--- a/drivers/net/intel/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/intel/iavf/iavf_ipsec_crypto.c
@@ -1942,7 +1942,9 @@ static struct iavf_flow_engine iavf_ipsec_flow_engine = {
.uninit = iavf_ipsec_flow_uninit,
.create = iavf_ipsec_flow_create,
.destroy = iavf_ipsec_flow_destroy,
+ .name = "ipsec_crypto",
.type = IAVF_FLOW_ENGINE_IPSEC_CRYPTO,
+ .rule_size = sizeof(struct iavf_ipsec_flow_item),
};
static int
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v1 4/4] net/ice: implement flow dump
2026-04-30 10:31 [PATCH v1 1/4] net/ixgbe: implement flow dump Anatoly Burakov
2026-04-30 10:31 ` [PATCH v1 2/4] net/i40e: " Anatoly Burakov
2026-04-30 10:31 ` [PATCH v1 3/4] net/iavf: " Anatoly Burakov
@ 2026-04-30 10:31 ` Anatoly Burakov
2026-04-30 11:00 ` [PATCH v2 1/4] net/ixgbe: " Anatoly Burakov
3 siblings, 0 replies; 13+ messages in thread
From: Anatoly Burakov @ 2026-04-30 10:31 UTC (permalink / raw)
To: dev, Bruce Richardson
Implement flow dumping API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ice/ice_acl_filter.c | 2 +
drivers/net/intel/ice/ice_fdir_filter.c | 2 +
drivers/net/intel/ice/ice_generic_flow.c | 77 +++++++++++++++++++++++
drivers/net/intel/ice/ice_generic_flow.h | 2 +
drivers/net/intel/ice/ice_hash.c | 2 +
drivers/net/intel/ice/ice_switch_filter.c | 2 +
6 files changed, 87 insertions(+)
diff --git a/drivers/net/intel/ice/ice_acl_filter.c b/drivers/net/intel/ice/ice_acl_filter.c
index 6754a40044..3939579598 100644
--- a/drivers/net/intel/ice/ice_acl_filter.c
+++ b/drivers/net/intel/ice/ice_acl_filter.c
@@ -1099,7 +1099,9 @@ ice_flow_engine ice_acl_engine = {
.create = ice_acl_create_filter,
.destroy = ice_acl_destroy_filter,
.free = ice_acl_filter_free,
+ .name = "acl",
.type = ICE_FLOW_ENGINE_ACL,
+ .rule_size = sizeof(struct acl_rule),
};
struct
diff --git a/drivers/net/intel/ice/ice_fdir_filter.c b/drivers/net/intel/ice/ice_fdir_filter.c
index ce80213429..f2b1a3a841 100644
--- a/drivers/net/intel/ice/ice_fdir_filter.c
+++ b/drivers/net/intel/ice/ice_fdir_filter.c
@@ -1688,7 +1688,9 @@ static struct ice_flow_engine ice_fdir_engine = {
.create = ice_fdir_create_filter,
.destroy = ice_fdir_destroy_filter,
.query_count = ice_fdir_query_count,
+ .name = "fdir",
.type = ICE_FLOW_ENGINE_FDIR,
+ .rule_size = sizeof(struct ice_fdir_filter_conf),
};
static int
diff --git a/drivers/net/intel/ice/ice_generic_flow.c b/drivers/net/intel/ice/ice_generic_flow.c
index 62f0c334a1..924caca94b 100644
--- a/drivers/net/intel/ice/ice_generic_flow.c
+++ b/drivers/net/intel/ice/ice_generic_flow.c
@@ -13,6 +13,7 @@
#include <rte_ether.h>
#include <ethdev_driver.h>
+#include <rte_hexdump.h>
#include <rte_malloc.h>
#include <rte_tailq.h>
@@ -46,6 +47,10 @@ static int ice_flow_query(struct rte_eth_dev *dev,
const struct rte_flow_action *actions,
void *data,
struct rte_flow_error *error);
+static int ice_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error);
const struct rte_flow_ops ice_flow_ops = {
.validate = ice_flow_validate,
@@ -53,6 +58,7 @@ const struct rte_flow_ops ice_flow_ops = {
.destroy = ice_flow_destroy,
.flush = ice_flow_flush,
.query = ice_flow_query,
+ .dev_dump = ice_flow_dev_dump,
};
/* empty */
@@ -2649,6 +2655,77 @@ ice_flow_query(struct rte_eth_dev *dev,
return ret;
}
+#define ICE_FLOW_DUMP_CHUNK_BYTES 32
+
+static void
+ice_flow_dump_blob(FILE *file, const char *engine,
+ const void *data, size_t data_len)
+{
+ const uint8_t *raw = (const uint8_t *)data;
+ const size_t nchunks =
+ (data_len + ICE_FLOW_DUMP_CHUNK_BYTES - 1) /
+ ICE_FLOW_DUMP_CHUNK_BYTES;
+ char title[64];
+ size_t ci;
+
+ fprintf(file, "FLOW DUMP: driver=ice engine=%s\n", engine);
+ fprintf(file, "FLOW DUMP: DATA size=%zu chunks=%zu chunk_bytes=%d\n",
+ data_len, nchunks, ICE_FLOW_DUMP_CHUNK_BYTES);
+
+ for (ci = 0; ci < nchunks; ci++) {
+ const size_t off = ci * ICE_FLOW_DUMP_CHUNK_BYTES;
+ const size_t clen =
+ RTE_MIN((size_t)ICE_FLOW_DUMP_CHUNK_BYTES, data_len - off);
+
+ snprintf(title, sizeof(title), "FLOW DUMP: chunk %03zu/%03zu",
+ ci + 1, nchunks);
+ rte_memdump(file, title, raw + off, clen);
+ }
+}
+
+static int
+ice_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error)
+{
+ struct ice_adapter *ad =
+ ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+ struct ice_pf *pf = &ad->pf;
+ struct rte_flow *p_flow;
+ bool found = false;
+
+ rte_spinlock_lock(&pf->flow_ops_lock);
+ TAILQ_FOREACH(p_flow, &pf->flow_list, node) {
+ size_t rule_size = 0;
+ const void *rule_data = NULL;
+
+ if (flow != NULL && p_flow != flow)
+ continue;
+
+ found = true;
+ if (p_flow->engine != NULL) {
+ rule_size = p_flow->engine->rule_size;
+ if (p_flow->rule != NULL)
+ rule_data = p_flow->rule;
+ }
+
+ if (p_flow->engine != NULL)
+ ice_flow_dump_blob(file,
+ p_flow->engine->name != NULL ?
+ p_flow->engine->name : "unknown",
+ rule_data, rule_size);
+ }
+ rte_spinlock_unlock(&pf->flow_ops_lock);
+
+ if (flow != NULL && !found)
+ return rte_flow_error_set(error, ENOENT,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Flow not found");
+
+ return 0;
+}
+
int
ice_flow_redirect(struct ice_adapter *ad,
struct ice_flow_redirect *rd)
diff --git a/drivers/net/intel/ice/ice_generic_flow.h b/drivers/net/intel/ice/ice_generic_flow.h
index c0eed84610..dbb21c47ab 100644
--- a/drivers/net/intel/ice/ice_generic_flow.h
+++ b/drivers/net/intel/ice/ice_generic_flow.h
@@ -539,7 +539,9 @@ struct ice_flow_engine {
engine_query_t query_count;
engine_redirect_t redirect;
engine_free_t free;
+ const char *name;
enum ice_flow_engine_type type;
+ size_t rule_size;
};
TAILQ_HEAD(ice_engine_list, ice_flow_engine);
diff --git a/drivers/net/intel/ice/ice_hash.c b/drivers/net/intel/ice/ice_hash.c
index 77829e607b..835f113e82 100644
--- a/drivers/net/intel/ice/ice_hash.c
+++ b/drivers/net/intel/ice/ice_hash.c
@@ -589,7 +589,9 @@ static struct ice_flow_engine ice_hash_engine = {
.destroy = ice_hash_destroy,
.uninit = ice_hash_uninit,
.free = ice_hash_free,
+ .name = "hash",
.type = ICE_FLOW_ENGINE_HASH,
+ .rule_size = sizeof(struct ice_hash_flow_cfg),
};
/* Register parser for os package. */
diff --git a/drivers/net/intel/ice/ice_switch_filter.c b/drivers/net/intel/ice/ice_switch_filter.c
index b25e5eaad3..2da8c5c3c8 100644
--- a/drivers/net/intel/ice/ice_switch_filter.c
+++ b/drivers/net/intel/ice/ice_switch_filter.c
@@ -2070,7 +2070,9 @@ ice_flow_engine ice_switch_engine = {
.query_count = ice_switch_query,
.redirect = ice_switch_redirect,
.free = ice_switch_filter_rule_free,
+ .name = "switch",
.type = ICE_FLOW_ENGINE_SWITCH,
+ .rule_size = sizeof(struct ice_switch_filter_conf),
};
struct
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 1/4] net/ixgbe: implement flow dump
2026-04-30 10:31 [PATCH v1 1/4] net/ixgbe: implement flow dump Anatoly Burakov
` (2 preceding siblings ...)
2026-04-30 10:31 ` [PATCH v1 4/4] net/ice: " Anatoly Burakov
@ 2026-04-30 11:00 ` Anatoly Burakov
2026-04-30 11:00 ` [PATCH v2 2/4] net/i40e: " Anatoly Burakov
` (4 more replies)
3 siblings, 5 replies; 13+ messages in thread
From: Anatoly Burakov @ 2026-04-30 11:00 UTC (permalink / raw)
To: dev, Vladimir Medvedkin
Implement flow dumping API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ixgbe/ixgbe_ethdev.h | 3 +
drivers/net/intel/ixgbe/ixgbe_flow.c | 141 +++++++++++++++++++++++++
2 files changed, 144 insertions(+)
diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.h b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
index 32d7b98ed1..3f00896943 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
@@ -515,6 +515,9 @@ uint16_t ixgbe_vf_representor_tx_burst(void *tx_queue, struct rte_mbuf **tx_pkts
#define IXGBE_DEV_FDIR_CONF(dev) \
(&((struct ixgbe_adapter *)(dev)->data->dev_private)->fdir_conf)
+#define IXGBE_DEV_PRIVATE_TO_ADAPTER(adapter) \
+ ((struct ixgbe_adapter *)adapter)
+
#define IXGBE_DEV_PRIVATE_TO_HW(adapter)\
(&((struct ixgbe_adapter *)adapter)->hw)
diff --git a/drivers/net/intel/ixgbe/ixgbe_flow.c b/drivers/net/intel/ixgbe/ixgbe_flow.c
index 01cd4f9bde..e40ece9755 100644
--- a/drivers/net/intel/ixgbe/ixgbe_flow.c
+++ b/drivers/net/intel/ixgbe/ixgbe_flow.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
+#include <stddef.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
@@ -29,6 +30,7 @@
#include <dev_driver.h>
#include <rte_hash_crc.h>
#include <rte_flow.h>
+#include <rte_hexdump.h>
#include <rte_flow_driver.h>
#include "ixgbe_logs.h"
@@ -3581,9 +3583,148 @@ ixgbe_flow_flush(struct rte_eth_dev *dev,
return 0;
}
+#define IXGBE_FLOW_DUMP_CHUNK_BYTES 32
+
+static const char *
+ixgbe_flow_rule_engine_name(const struct rte_flow *flow)
+{
+ if (flow->is_security)
+ return "security";
+
+ switch (flow->filter_type) {
+ case RTE_ETH_FILTER_NTUPLE:
+ return "ntuple";
+ case RTE_ETH_FILTER_ETHERTYPE:
+ return "ethertype";
+ case RTE_ETH_FILTER_SYN:
+ return "syn";
+ case RTE_ETH_FILTER_FDIR:
+ return "fdir";
+ case RTE_ETH_FILTER_L2_TUNNEL:
+ return "l2_tunnel";
+ case RTE_ETH_FILTER_HASH:
+ return "hash";
+ default:
+ return "unknown";
+ }
+}
+
+static size_t
+ixgbe_flow_rule_size(const struct rte_flow *flow)
+{
+ if (flow->is_security)
+ return 0;
+
+ switch (flow->filter_type) {
+ case RTE_ETH_FILTER_NTUPLE:
+ return sizeof(struct rte_eth_ntuple_filter);
+ case RTE_ETH_FILTER_ETHERTYPE:
+ return sizeof(struct rte_eth_ethertype_filter);
+ case RTE_ETH_FILTER_SYN:
+ return sizeof(struct rte_eth_syn_filter);
+ case RTE_ETH_FILTER_FDIR:
+ return sizeof(struct ixgbe_fdir_rule);
+ case RTE_ETH_FILTER_L2_TUNNEL:
+ return sizeof(struct ixgbe_l2_tunnel_conf);
+ case RTE_ETH_FILTER_HASH:
+ return sizeof(struct ixgbe_rte_flow_rss_conf);
+ default:
+ return 0;
+ }
+}
+
+static const void *
+ixgbe_flow_rule_data(const struct rte_flow *flow)
+{
+ if (flow->is_security || flow->rule == NULL)
+ return NULL;
+
+ switch (flow->filter_type) {
+ case RTE_ETH_FILTER_NTUPLE:
+ return RTE_PTR_ADD(flow->rule, sizeof(TAILQ_ENTRY(ixgbe_ntuple_filter_ele)));
+ case RTE_ETH_FILTER_ETHERTYPE:
+ return RTE_PTR_ADD(flow->rule, sizeof(TAILQ_ENTRY(ixgbe_ethertype_filter_ele)));
+ case RTE_ETH_FILTER_SYN:
+ return RTE_PTR_ADD(flow->rule, sizeof(TAILQ_ENTRY(ixgbe_eth_syn_filter_ele)));
+ case RTE_ETH_FILTER_FDIR:
+ return RTE_PTR_ADD(flow->rule, sizeof(TAILQ_ENTRY(ixgbe_fdir_rule_ele)));
+ case RTE_ETH_FILTER_L2_TUNNEL:
+ return RTE_PTR_ADD(flow->rule, sizeof(TAILQ_ENTRY(ixgbe_eth_l2_tunnel_conf_ele)));
+ case RTE_ETH_FILTER_HASH:
+ return RTE_PTR_ADD(flow->rule, sizeof(TAILQ_ENTRY(ixgbe_rss_conf_ele)));
+ default:
+ return NULL;
+ }
+}
+
+static void
+ixgbe_flow_dump_blob(FILE *file, const char *engine,
+ const void *data, size_t data_len)
+{
+ const uint8_t *raw = (const uint8_t *)data;
+ const size_t nchunks =
+ (data_len + IXGBE_FLOW_DUMP_CHUNK_BYTES - 1) /
+ IXGBE_FLOW_DUMP_CHUNK_BYTES;
+ char title[64];
+ size_t ci;
+
+ fprintf(file, "FLOW DUMP: driver=ixgbe engine=%s\n", engine);
+ fprintf(file, "FLOW DUMP: DATA size=%zu chunks=%zu chunk_bytes=%d\n",
+ data_len, nchunks, IXGBE_FLOW_DUMP_CHUNK_BYTES);
+
+ for (ci = 0; ci < nchunks; ci++) {
+ const size_t off = ci * IXGBE_FLOW_DUMP_CHUNK_BYTES;
+ const size_t clen =
+ RTE_MIN((size_t)IXGBE_FLOW_DUMP_CHUNK_BYTES, data_len - off);
+
+ snprintf(title, sizeof(title), "FLOW DUMP: chunk %03zu/%03zu",
+ ci + 1, nchunks);
+ rte_memdump(file, title, raw + off, clen);
+ }
+}
+
+static int
+ixgbe_flow_dev_dump(struct rte_eth_dev *dev __rte_unused,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error)
+{
+ struct ixgbe_flow_mem *flow_mem_base;
+ bool found = false;
+
+ TAILQ_FOREACH(flow_mem_base, &ixgbe_flow_list, entries) {
+ struct ixgbe_flow_mem *ixgbe_flow_mem_ptr =
+ (struct ixgbe_flow_mem *)flow_mem_base;
+ struct rte_flow *p_flow = ixgbe_flow_mem_ptr->flow;
+ const void *rule_data = NULL;
+ const char *engine_name;
+ size_t rule_size = 0;
+
+ if (flow != NULL && p_flow != flow)
+ continue;
+
+ found = true;
+ if (p_flow->rule != NULL) {
+ rule_data = ixgbe_flow_rule_data(p_flow);
+ rule_size = ixgbe_flow_rule_size(p_flow);
+ }
+ engine_name = ixgbe_flow_rule_engine_name(p_flow);
+ ixgbe_flow_dump_blob(file, engine_name,
+ rule_data, rule_size);
+ }
+
+ if (flow != NULL && !found)
+ return rte_flow_error_set(error, ENOENT,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Flow not found");
+
+ return 0;
+}
+
const struct rte_flow_ops ixgbe_flow_ops = {
.validate = ixgbe_flow_validate,
.create = ixgbe_flow_create,
.destroy = ixgbe_flow_destroy,
.flush = ixgbe_flow_flush,
+ .dev_dump = ixgbe_flow_dev_dump,
};
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 2/4] net/i40e: implement flow dump
2026-04-30 11:00 ` [PATCH v2 1/4] net/ixgbe: " Anatoly Burakov
@ 2026-04-30 11:00 ` Anatoly Burakov
2026-05-05 16:30 ` Bruce Richardson
2026-04-30 11:00 ` [PATCH v2 3/4] net/iavf: " Anatoly Burakov
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Anatoly Burakov @ 2026-04-30 11:00 UTC (permalink / raw)
To: dev, Bruce Richardson
Implement flow dumping API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/i40e/i40e_flow.c | 103 +++++++++++++++++++++++++++++
1 file changed, 103 insertions(+)
diff --git a/drivers/net/intel/i40e/i40e_flow.c b/drivers/net/intel/i40e/i40e_flow.c
index 967af052ff..cb246da780 100644
--- a/drivers/net/intel/i40e/i40e_flow.c
+++ b/drivers/net/intel/i40e/i40e_flow.c
@@ -17,6 +17,7 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_tailq.h>
+#include <rte_hexdump.h>
#include <rte_flow_driver.h>
#include <rte_bitmap.h>
@@ -50,6 +51,10 @@ static int i40e_flow_query(struct rte_eth_dev *dev,
struct rte_flow *flow,
const struct rte_flow_action *actions,
void *data, struct rte_flow_error *error);
+static int i40e_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error);
static int
i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,
const struct rte_flow_item *pattern,
@@ -141,6 +146,7 @@ const struct rte_flow_ops i40e_flow_ops = {
.destroy = i40e_flow_destroy,
.flush = i40e_flow_flush,
.query = i40e_flow_query,
+ .dev_dump = i40e_flow_dev_dump,
};
/* Pattern matched ethertype filter */
@@ -1256,6 +1262,103 @@ i40e_flow_parse_attr(const struct rte_flow_attr *attr,
return 0;
}
+#define I40E_FLOW_DUMP_CHUNK_BYTES 32
+
+static const char *
+i40e_flow_rule_name(enum rte_filter_type filter_type)
+{
+ switch (filter_type) {
+ case RTE_ETH_FILTER_ETHERTYPE:
+ return "ethertype";
+ case RTE_ETH_FILTER_FDIR:
+ return "fdir";
+ case RTE_ETH_FILTER_TUNNEL:
+ return "tunnel";
+ case RTE_ETH_FILTER_HASH:
+ return "hash";
+ default:
+ return "unknown";
+ }
+}
+
+static size_t
+i40e_flow_rule_size(enum rte_filter_type filter_type)
+{
+ switch (filter_type) {
+ case RTE_ETH_FILTER_ETHERTYPE:
+ return sizeof(struct i40e_ethertype_filter);
+ case RTE_ETH_FILTER_FDIR:
+ return sizeof(struct i40e_fdir_filter);
+ case RTE_ETH_FILTER_TUNNEL:
+ return sizeof(struct i40e_tunnel_filter);
+ case RTE_ETH_FILTER_HASH:
+ return sizeof(struct i40e_rss_filter);
+ default:
+ return 0;
+ }
+}
+
+static void
+i40e_flow_dump_blob(FILE *file, const char *engine,
+ const void *data, size_t data_len)
+{
+ const uint8_t *raw = (const uint8_t *)data;
+ const size_t nchunks =
+ (data_len + I40E_FLOW_DUMP_CHUNK_BYTES - 1) /
+ I40E_FLOW_DUMP_CHUNK_BYTES;
+ char title[64];
+ size_t ci;
+
+ fprintf(file, "FLOW DUMP: driver=i40e engine=%s\n", engine);
+ fprintf(file, "FLOW DUMP: DATA size=%zu chunks=%zu chunk_bytes=%d\n",
+ data_len, nchunks, I40E_FLOW_DUMP_CHUNK_BYTES);
+
+ for (ci = 0; ci < nchunks; ci++) {
+ const size_t off = ci * I40E_FLOW_DUMP_CHUNK_BYTES;
+ const size_t clen =
+ RTE_MIN((size_t)I40E_FLOW_DUMP_CHUNK_BYTES, data_len - off);
+
+ snprintf(title, sizeof(title), "FLOW DUMP: chunk %03zu/%03zu",
+ ci + 1, nchunks);
+ rte_memdump(file, title, raw + off, clen);
+ }
+}
+
+static int
+i40e_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error)
+{
+ struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+ struct rte_flow *p_flow;
+ bool found = false;
+
+ TAILQ_FOREACH(p_flow, &pf->flow_list, node) {
+ size_t rule_size = 0;
+ const void *rule_data = NULL;
+
+ if (flow != NULL && p_flow != flow)
+ continue;
+
+ found = true;
+ if (p_flow->rule != NULL) {
+ rule_size = i40e_flow_rule_size(p_flow->filter_type);
+ rule_data = p_flow->rule;
+ }
+ i40e_flow_dump_blob(file,
+ i40e_flow_rule_name(p_flow->filter_type),
+ rule_data, rule_size);
+ }
+
+ if (flow != NULL && !found)
+ return rte_flow_error_set(error, ENOENT,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Flow not found");
+
+ return 0;
+}
+
static int
i40e_get_outer_vlan(struct rte_eth_dev *dev, uint16_t *tpid)
{
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 3/4] net/iavf: implement flow dump
2026-04-30 11:00 ` [PATCH v2 1/4] net/ixgbe: " Anatoly Burakov
2026-04-30 11:00 ` [PATCH v2 2/4] net/i40e: " Anatoly Burakov
@ 2026-04-30 11:00 ` Anatoly Burakov
2026-05-05 16:33 ` Bruce Richardson
2026-04-30 11:00 ` [PATCH v2 4/4] net/ice: " Anatoly Burakov
` (2 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Anatoly Burakov @ 2026-04-30 11:00 UTC (permalink / raw)
To: dev, Vladimir Medvedkin
Implement flow dumping API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/iavf/iavf_fdir.c | 2 +
drivers/net/intel/iavf/iavf_fsub.c | 2 +
drivers/net/intel/iavf/iavf_generic_flow.c | 77 ++++++++++++++++++++++
drivers/net/intel/iavf/iavf_generic_flow.h | 2 +
drivers/net/intel/iavf/iavf_hash.c | 2 +
drivers/net/intel/iavf/iavf_ipsec_crypto.c | 2 +
6 files changed, 87 insertions(+)
diff --git a/drivers/net/intel/iavf/iavf_fdir.c b/drivers/net/intel/iavf/iavf_fdir.c
index 9eae874800..ee63d082d0 100644
--- a/drivers/net/intel/iavf/iavf_fdir.c
+++ b/drivers/net/intel/iavf/iavf_fdir.c
@@ -437,7 +437,9 @@ static struct iavf_flow_engine iavf_fdir_engine = {
.create = iavf_fdir_create,
.destroy = iavf_fdir_destroy,
.validation = iavf_fdir_validation,
+ .name = "fdir",
.type = IAVF_FLOW_ENGINE_FDIR,
+ .rule_size = sizeof(struct iavf_fdir_conf),
};
static int
diff --git a/drivers/net/intel/iavf/iavf_fsub.c b/drivers/net/intel/iavf/iavf_fsub.c
index a00d02ded5..f08a8ae726 100644
--- a/drivers/net/intel/iavf/iavf_fsub.c
+++ b/drivers/net/intel/iavf/iavf_fsub.c
@@ -730,7 +730,9 @@ iavf_flow_engine iavf_fsub_engine = {
.create = iavf_fsub_create,
.destroy = iavf_fsub_destroy,
.validation = iavf_fsub_validation,
+ .name = "fsub",
.type = IAVF_FLOW_ENGINE_FSUB,
+ .rule_size = sizeof(struct iavf_fsub_conf),
};
static struct
diff --git a/drivers/net/intel/iavf/iavf_generic_flow.c b/drivers/net/intel/iavf/iavf_generic_flow.c
index 42ecc90d1d..803bc913bd 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.c
+++ b/drivers/net/intel/iavf/iavf_generic_flow.c
@@ -17,6 +17,7 @@
#include "iavf.h"
#include "iavf_generic_flow.h"
+#include <rte_hexdump.h>
static struct iavf_engine_list engine_list =
TAILQ_HEAD_INITIALIZER(engine_list);
@@ -39,6 +40,10 @@ static int iavf_flow_query(struct rte_eth_dev *dev,
const struct rte_flow_action *actions,
void *data,
struct rte_flow_error *error);
+static int iavf_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error);
const struct rte_flow_ops iavf_flow_ops = {
.validate = iavf_flow_validate,
@@ -46,6 +51,7 @@ const struct rte_flow_ops iavf_flow_ops = {
.destroy = iavf_flow_destroy,
.flush = iavf_flow_flush,
.query = iavf_flow_query,
+ .dev_dump = iavf_flow_dev_dump,
};
/* raw */
@@ -2418,3 +2424,74 @@ iavf_flow_query(struct rte_eth_dev *dev,
}
return ret;
}
+
+#define IAVF_FLOW_DUMP_CHUNK_BYTES 32
+
+static void
+iavf_flow_dump_blob(FILE *file, const char *engine,
+ const void *data, size_t data_len)
+{
+ const uint8_t *raw = (const uint8_t *)data;
+ const size_t nchunks =
+ (data_len + IAVF_FLOW_DUMP_CHUNK_BYTES - 1) /
+ IAVF_FLOW_DUMP_CHUNK_BYTES;
+ char title[64];
+ size_t ci;
+
+ fprintf(file, "FLOW DUMP: driver=iavf engine=%s\n", engine);
+ fprintf(file, "FLOW DUMP: DATA size=%zu chunks=%zu chunk_bytes=%d\n",
+ data_len, nchunks, IAVF_FLOW_DUMP_CHUNK_BYTES);
+
+ for (ci = 0; ci < nchunks; ci++) {
+ const size_t off = ci * IAVF_FLOW_DUMP_CHUNK_BYTES;
+ const size_t clen =
+ RTE_MIN((size_t)IAVF_FLOW_DUMP_CHUNK_BYTES,
+ data_len - off);
+ snprintf(title, sizeof(title), "FLOW DUMP: chunk %03zu/%03zu",
+ ci + 1, nchunks);
+ rte_memdump(file, title, raw + off, clen);
+ }
+}
+
+static int
+iavf_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error)
+{
+ struct iavf_adapter *ad =
+ IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+ struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
+ struct rte_flow *f;
+ bool found = false;
+
+ rte_spinlock_lock(&vf->flow_ops_lock);
+ TAILQ_FOREACH(f, &vf->flow_list, node) {
+ size_t rule_size = 0;
+ const void *rule_data = NULL;
+
+ if (flow != NULL && f != flow)
+ continue;
+
+ found = true;
+ if (f->engine != NULL) {
+ rule_size = f->engine->rule_size;
+ if (f->rule != NULL)
+ rule_data = f->rule;
+ }
+
+ if (f->engine != NULL)
+ iavf_flow_dump_blob(file,
+ f->engine->name != NULL ?
+ f->engine->name : "unknown",
+ rule_data, rule_size);
+ }
+ rte_spinlock_unlock(&vf->flow_ops_lock);
+
+ if (flow != NULL && !found)
+ return rte_flow_error_set(error, ENOENT,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Flow not found");
+
+ return 0;
+}
diff --git a/drivers/net/intel/iavf/iavf_generic_flow.h b/drivers/net/intel/iavf/iavf_generic_flow.h
index b97cf8b7ff..1b87c486d5 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.h
+++ b/drivers/net/intel/iavf/iavf_generic_flow.h
@@ -495,7 +495,9 @@ struct iavf_flow_engine {
engine_destroy_t destroy;
engine_query_t query_count;
engine_free_t free;
+ const char *name;
enum iavf_flow_engine_type type;
+ size_t rule_size;
};
TAILQ_HEAD(iavf_engine_list, iavf_flow_engine);
diff --git a/drivers/net/intel/iavf/iavf_hash.c b/drivers/net/intel/iavf/iavf_hash.c
index cb10eeab78..8bf5d106b1 100644
--- a/drivers/net/intel/iavf/iavf_hash.c
+++ b/drivers/net/intel/iavf/iavf_hash.c
@@ -682,7 +682,9 @@ static struct iavf_flow_engine iavf_hash_engine = {
.destroy = iavf_hash_destroy,
.uninit = iavf_hash_uninit_parser,
.free = iavf_hash_free,
+ .name = "hash",
.type = IAVF_FLOW_ENGINE_HASH,
+ .rule_size = sizeof(struct virtchnl_rss_cfg),
};
/* Register parser for comms package. */
diff --git a/drivers/net/intel/iavf/iavf_ipsec_crypto.c b/drivers/net/intel/iavf/iavf_ipsec_crypto.c
index 47102e75f2..75da9f6413 100644
--- a/drivers/net/intel/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/intel/iavf/iavf_ipsec_crypto.c
@@ -1942,7 +1942,9 @@ static struct iavf_flow_engine iavf_ipsec_flow_engine = {
.uninit = iavf_ipsec_flow_uninit,
.create = iavf_ipsec_flow_create,
.destroy = iavf_ipsec_flow_destroy,
+ .name = "ipsec_crypto",
.type = IAVF_FLOW_ENGINE_IPSEC_CRYPTO,
+ .rule_size = sizeof(struct iavf_ipsec_flow_item),
};
static int
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 4/4] net/ice: implement flow dump
2026-04-30 11:00 ` [PATCH v2 1/4] net/ixgbe: " Anatoly Burakov
2026-04-30 11:00 ` [PATCH v2 2/4] net/i40e: " Anatoly Burakov
2026-04-30 11:00 ` [PATCH v2 3/4] net/iavf: " Anatoly Burakov
@ 2026-04-30 11:00 ` Anatoly Burakov
2026-05-05 16:34 ` Bruce Richardson
2026-05-05 16:30 ` [PATCH v2 1/4] net/ixgbe: " Bruce Richardson
2026-05-05 16:51 ` Bruce Richardson
4 siblings, 1 reply; 13+ messages in thread
From: Anatoly Burakov @ 2026-04-30 11:00 UTC (permalink / raw)
To: dev, Bruce Richardson
Implement flow dumping API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ice/ice_acl_filter.c | 2 +
drivers/net/intel/ice/ice_fdir_filter.c | 2 +
drivers/net/intel/ice/ice_generic_flow.c | 77 +++++++++++++++++++++++
drivers/net/intel/ice/ice_generic_flow.h | 2 +
drivers/net/intel/ice/ice_hash.c | 2 +
drivers/net/intel/ice/ice_switch_filter.c | 2 +
6 files changed, 87 insertions(+)
diff --git a/drivers/net/intel/ice/ice_acl_filter.c b/drivers/net/intel/ice/ice_acl_filter.c
index 6754a40044..3939579598 100644
--- a/drivers/net/intel/ice/ice_acl_filter.c
+++ b/drivers/net/intel/ice/ice_acl_filter.c
@@ -1099,7 +1099,9 @@ ice_flow_engine ice_acl_engine = {
.create = ice_acl_create_filter,
.destroy = ice_acl_destroy_filter,
.free = ice_acl_filter_free,
+ .name = "acl",
.type = ICE_FLOW_ENGINE_ACL,
+ .rule_size = sizeof(struct acl_rule),
};
struct
diff --git a/drivers/net/intel/ice/ice_fdir_filter.c b/drivers/net/intel/ice/ice_fdir_filter.c
index ce80213429..f2b1a3a841 100644
--- a/drivers/net/intel/ice/ice_fdir_filter.c
+++ b/drivers/net/intel/ice/ice_fdir_filter.c
@@ -1688,7 +1688,9 @@ static struct ice_flow_engine ice_fdir_engine = {
.create = ice_fdir_create_filter,
.destroy = ice_fdir_destroy_filter,
.query_count = ice_fdir_query_count,
+ .name = "fdir",
.type = ICE_FLOW_ENGINE_FDIR,
+ .rule_size = sizeof(struct ice_fdir_filter_conf),
};
static int
diff --git a/drivers/net/intel/ice/ice_generic_flow.c b/drivers/net/intel/ice/ice_generic_flow.c
index 62f0c334a1..924caca94b 100644
--- a/drivers/net/intel/ice/ice_generic_flow.c
+++ b/drivers/net/intel/ice/ice_generic_flow.c
@@ -13,6 +13,7 @@
#include <rte_ether.h>
#include <ethdev_driver.h>
+#include <rte_hexdump.h>
#include <rte_malloc.h>
#include <rte_tailq.h>
@@ -46,6 +47,10 @@ static int ice_flow_query(struct rte_eth_dev *dev,
const struct rte_flow_action *actions,
void *data,
struct rte_flow_error *error);
+static int ice_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error);
const struct rte_flow_ops ice_flow_ops = {
.validate = ice_flow_validate,
@@ -53,6 +58,7 @@ const struct rte_flow_ops ice_flow_ops = {
.destroy = ice_flow_destroy,
.flush = ice_flow_flush,
.query = ice_flow_query,
+ .dev_dump = ice_flow_dev_dump,
};
/* empty */
@@ -2649,6 +2655,77 @@ ice_flow_query(struct rte_eth_dev *dev,
return ret;
}
+#define ICE_FLOW_DUMP_CHUNK_BYTES 32
+
+static void
+ice_flow_dump_blob(FILE *file, const char *engine,
+ const void *data, size_t data_len)
+{
+ const uint8_t *raw = (const uint8_t *)data;
+ const size_t nchunks =
+ (data_len + ICE_FLOW_DUMP_CHUNK_BYTES - 1) /
+ ICE_FLOW_DUMP_CHUNK_BYTES;
+ char title[64];
+ size_t ci;
+
+ fprintf(file, "FLOW DUMP: driver=ice engine=%s\n", engine);
+ fprintf(file, "FLOW DUMP: DATA size=%zu chunks=%zu chunk_bytes=%d\n",
+ data_len, nchunks, ICE_FLOW_DUMP_CHUNK_BYTES);
+
+ for (ci = 0; ci < nchunks; ci++) {
+ const size_t off = ci * ICE_FLOW_DUMP_CHUNK_BYTES;
+ const size_t clen =
+ RTE_MIN((size_t)ICE_FLOW_DUMP_CHUNK_BYTES, data_len - off);
+
+ snprintf(title, sizeof(title), "FLOW DUMP: chunk %03zu/%03zu",
+ ci + 1, nchunks);
+ rte_memdump(file, title, raw + off, clen);
+ }
+}
+
+static int
+ice_flow_dev_dump(struct rte_eth_dev *dev,
+ struct rte_flow *flow,
+ FILE *file,
+ struct rte_flow_error *error)
+{
+ struct ice_adapter *ad =
+ ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+ struct ice_pf *pf = &ad->pf;
+ struct rte_flow *p_flow;
+ bool found = false;
+
+ rte_spinlock_lock(&pf->flow_ops_lock);
+ TAILQ_FOREACH(p_flow, &pf->flow_list, node) {
+ size_t rule_size = 0;
+ const void *rule_data = NULL;
+
+ if (flow != NULL && p_flow != flow)
+ continue;
+
+ found = true;
+ if (p_flow->engine != NULL) {
+ rule_size = p_flow->engine->rule_size;
+ if (p_flow->rule != NULL)
+ rule_data = p_flow->rule;
+ }
+
+ if (p_flow->engine != NULL)
+ ice_flow_dump_blob(file,
+ p_flow->engine->name != NULL ?
+ p_flow->engine->name : "unknown",
+ rule_data, rule_size);
+ }
+ rte_spinlock_unlock(&pf->flow_ops_lock);
+
+ if (flow != NULL && !found)
+ return rte_flow_error_set(error, ENOENT,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Flow not found");
+
+ return 0;
+}
+
int
ice_flow_redirect(struct ice_adapter *ad,
struct ice_flow_redirect *rd)
diff --git a/drivers/net/intel/ice/ice_generic_flow.h b/drivers/net/intel/ice/ice_generic_flow.h
index c0eed84610..dbb21c47ab 100644
--- a/drivers/net/intel/ice/ice_generic_flow.h
+++ b/drivers/net/intel/ice/ice_generic_flow.h
@@ -539,7 +539,9 @@ struct ice_flow_engine {
engine_query_t query_count;
engine_redirect_t redirect;
engine_free_t free;
+ const char *name;
enum ice_flow_engine_type type;
+ size_t rule_size;
};
TAILQ_HEAD(ice_engine_list, ice_flow_engine);
diff --git a/drivers/net/intel/ice/ice_hash.c b/drivers/net/intel/ice/ice_hash.c
index 77829e607b..835f113e82 100644
--- a/drivers/net/intel/ice/ice_hash.c
+++ b/drivers/net/intel/ice/ice_hash.c
@@ -589,7 +589,9 @@ static struct ice_flow_engine ice_hash_engine = {
.destroy = ice_hash_destroy,
.uninit = ice_hash_uninit,
.free = ice_hash_free,
+ .name = "hash",
.type = ICE_FLOW_ENGINE_HASH,
+ .rule_size = sizeof(struct ice_hash_flow_cfg),
};
/* Register parser for os package. */
diff --git a/drivers/net/intel/ice/ice_switch_filter.c b/drivers/net/intel/ice/ice_switch_filter.c
index b25e5eaad3..2da8c5c3c8 100644
--- a/drivers/net/intel/ice/ice_switch_filter.c
+++ b/drivers/net/intel/ice/ice_switch_filter.c
@@ -2070,7 +2070,9 @@ ice_flow_engine ice_switch_engine = {
.query_count = ice_switch_query,
.redirect = ice_switch_redirect,
.free = ice_switch_filter_rule_free,
+ .name = "switch",
.type = ICE_FLOW_ENGINE_SWITCH,
+ .rule_size = sizeof(struct ice_switch_filter_conf),
};
struct
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] net/ixgbe: implement flow dump
2026-04-30 11:00 ` [PATCH v2 1/4] net/ixgbe: " Anatoly Burakov
` (2 preceding siblings ...)
2026-04-30 11:00 ` [PATCH v2 4/4] net/ice: " Anatoly Burakov
@ 2026-05-05 16:30 ` Bruce Richardson
2026-05-05 16:51 ` Bruce Richardson
4 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2026-05-05 16:30 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: dev, Vladimir Medvedkin
On Thu, Apr 30, 2026 at 12:00:44PM +0100, Anatoly Burakov wrote:
> Implement flow dumping API.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 2/4] net/i40e: implement flow dump
2026-04-30 11:00 ` [PATCH v2 2/4] net/i40e: " Anatoly Burakov
@ 2026-05-05 16:30 ` Bruce Richardson
0 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2026-05-05 16:30 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: dev
On Thu, Apr 30, 2026 at 12:00:45PM +0100, Anatoly Burakov wrote:
> Implement flow dumping API.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
> drivers/net/intel/i40e/i40e_flow.c | 103 +++++++++++++++++++++++++++++
> 1 file changed, 103 insertions(+)
>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 3/4] net/iavf: implement flow dump
2026-04-30 11:00 ` [PATCH v2 3/4] net/iavf: " Anatoly Burakov
@ 2026-05-05 16:33 ` Bruce Richardson
0 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2026-05-05 16:33 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: dev, Vladimir Medvedkin
On Thu, Apr 30, 2026 at 12:00:46PM +0100, Anatoly Burakov wrote:
> Implement flow dumping API.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 4/4] net/ice: implement flow dump
2026-04-30 11:00 ` [PATCH v2 4/4] net/ice: " Anatoly Burakov
@ 2026-05-05 16:34 ` Bruce Richardson
0 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2026-05-05 16:34 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: dev
On Thu, Apr 30, 2026 at 12:00:47PM +0100, Anatoly Burakov wrote:
> Implement flow dumping API.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] net/ixgbe: implement flow dump
2026-04-30 11:00 ` [PATCH v2 1/4] net/ixgbe: " Anatoly Burakov
` (3 preceding siblings ...)
2026-05-05 16:30 ` [PATCH v2 1/4] net/ixgbe: " Bruce Richardson
@ 2026-05-05 16:51 ` Bruce Richardson
4 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2026-05-05 16:51 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: dev, Vladimir Medvedkin
On Thu, Apr 30, 2026 at 12:00:44PM +0100, Anatoly Burakov wrote:
> Implement flow dumping API.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
> drivers/net/intel/ixgbe/ixgbe_ethdev.h | 3 +
> drivers/net/intel/ixgbe/ixgbe_flow.c | 141 +++++++++++++++++++++++++
> 2 files changed, 144 insertions(+)
>
Series applied to dpdk-next-net-intel.
Thanks,
/Bruce
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-05-05 16:51 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-30 10:31 [PATCH v1 1/4] net/ixgbe: implement flow dump Anatoly Burakov
2026-04-30 10:31 ` [PATCH v1 2/4] net/i40e: " Anatoly Burakov
2026-04-30 10:31 ` [PATCH v1 3/4] net/iavf: " Anatoly Burakov
2026-04-30 10:31 ` [PATCH v1 4/4] net/ice: " Anatoly Burakov
2026-04-30 11:00 ` [PATCH v2 1/4] net/ixgbe: " Anatoly Burakov
2026-04-30 11:00 ` [PATCH v2 2/4] net/i40e: " Anatoly Burakov
2026-05-05 16:30 ` Bruce Richardson
2026-04-30 11:00 ` [PATCH v2 3/4] net/iavf: " Anatoly Burakov
2026-05-05 16:33 ` Bruce Richardson
2026-04-30 11:00 ` [PATCH v2 4/4] net/ice: " Anatoly Burakov
2026-05-05 16:34 ` Bruce Richardson
2026-05-05 16:30 ` [PATCH v2 1/4] net/ixgbe: " Bruce Richardson
2026-05-05 16:51 ` Bruce Richardson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox