DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [v6 0/2] net/hinic3: Fix the hinic3 driver issue
From: Stephen Hemminger @ 2026-05-28 21:00 UTC (permalink / raw)
  To: Feifei Wang; +Cc: dev
In-Reply-To: <20260528130122.1213-1-wff_light@vip.163.com>

On Thu, 28 May 2026 21:01:18 +0800
Feifei Wang <wff_light@vip.163.com> wrote:

> v1: The RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO flag is added to support the VXLAN TSO function
> 
> v2: Modify the commit information issue and supplement the commit information
> 
> v3: Revise review comments. First, deterine whether the hardware supports it, then add the flag bit
> 
> v4: Fix the compilation error caused by leading spaces
> 
> v5: Add fix tag
> 
> v6: MOdify SP230 NIC vf device id
> 
> Feifei Wang (2):
>   net/hinic3: Fix VXLAN TSO issue
>   net/hinic3: Modify SP230 VF device id
> 
>  drivers/net/hinic3/base/hinic3_csr.h | 2 +-
>  drivers/net/hinic3/hinic3_ethdev.c   | 8 ++++++--
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 

Applied to next-net.
Needed to add Fixes, and fix the Signed-off-by mail address on second patch.

^ permalink raw reply

* Re: [PATCH] examples: Fix vm_power_manager scratch area to /run/dpdk/powermanager
From: Stephen Hemminger @ 2026-05-28 21:10 UTC (permalink / raw)
  To: Sudheendra Sampath; +Cc: dev, Anatoly Burakov, Sivaprasad Tummala
In-Reply-To: <20260528190449.66254-1-giveback4fun@gmail.com>

On Thu, 28 May 2026 19:04:48 +0000
Sudheendra Sampath <giveback4fun@gmail.com> wrote:

> This patch for bug 1832 will do the following:
> 1.  If /run/dpdk is not present, it will create it first with and
>     then create powermanager directory underneath it.
> 2.  If /run/dpdk is present, it will verify it is actually a directory
>     before creating subdirectory, powermanager.
> 
> All directory permissions are 0700.
> 
> Signed-off-by: Sudheendra Sampath <giveback4fun@gmail.com>
> ---

Lots of issues with hardcoding the path here.
Longer explanation from AI review.


Thanks for the patch. A few issues to address before this can be merged:

Two correctness bugs in the new recovery block:

- After creating the directories, d is still NULL but the code falls through to readdir(d). The recovery path must call opendir() again (and return -1 if that also fails) before the readdir loop.

- path_stat is only populated when stat() succeeds. The S_ISDIR(path_stat.st_mode) check runs on uninitialised memory when stat() returned an error and mkdir() was used. Restructure as if (stat(...) == 0) { check S_ISDIR } else { mkdir }.

Other items:

- doc/guides/sample_app_ug/vm_power_management.rst still references /tmp/powermonitor/ in several places; code and docs need to change together.

- Hardcoding /run/dpdk does not follow the DPDK runtime-dir convention and breaks non-root usage. 
  Please consider using rte_eal_get_runtime_dir() (or at least the same getuid() / RUNTIME_DIRECTORY logic as eal_create_runtime_dir()) instead.

- Subject says "powermanager" but the path is "powermonitor".

- The two new RTE_LOG messages are missing trailing "\n".

- Please add a proper Fixes: tag (12-char hash) for the commit that introduced /tmp/powermonitor.

Stephen

^ permalink raw reply

* [RFC 0/8] retire legacy flow director API
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The flow director (fdir) configuration API in <rte_eth_ctrl.h> was
superseded by rte_flow in 17.05 but never removed. This series
finishes the job: 26.07 retires the user-facing surface and
decouples driver internals from the public ABI; the 26.11
deprecation notice covers the public ABI removal itself.

User-visible changes in 26.07:

  - testpmd commands gone: `show port fdir`, `clear port fdir`,
    `flow_director_filter`, `port config ... pctype mapping ...`,
    and `port config ... hash_inset|fdir_inset|fdir_flx_inset ...`.
    Use the `flow` command instead.

  - Experimental functions gone:
    rte_pmd_{i40e,ixgbe}_get_fdir_info() and
    rte_pmd_{i40e,ixgbe}_get_fdir_stats(). Removed early to give
    out-of-tree callers a build-time signal ahead of 26.11.

  - <rte_pmd_i40e.h> filter configuration entry points are marked
    __rte_deprecated. -Werror sources will need
    -Wno-deprecated-declarations, or migration to rte_flow, before
    26.11.

Scheduled for 26.11 (announced in deprecation.rst):

  - Flow director types in <rte_eth_ctrl.h> and the driver-facing
    definitions in <ethdev_driver.h>.

  - PMD-private filter API in <rte_pmd_i40e.h>.

The ixgbe and txgbe patches at the tail privatize internals that
still used the legacy types — mechanical rename, no behavior
change, so the 26.11 struct removal can proceed without further
per-driver coupling.

The mbuf-side fdir metadata (RTE_MBUF_F_RX_FDIR* flags and the
hash.fdir field) is unaffected — it is used by the rte_flow MARK
and FLAG actions, not part of the legacy filter API.

Stephen Hemminger (8):
  app/testpmd: remove support for flow director
  net/i40e: remove testpmd flow filter commands
  net/i40e: deprecate legacy flow filter API
  net/i40e: remove experimental FDIR API
  net/ixgbe: remove experimental FDIR API
  doc: announce legacy flow director deprecation
  net/ixgbe: privatize legacy flow director types
  net/txgbe: privatize legacy flow director types

 app/test-pmd/cmdline.c                        |  21 +-
 app/test-pmd/config.c                         | 163 -----
 app/test-pmd/testpmd.h                        |   3 -
 doc/guides/nics/i40e.rst                      |  70 +-
 doc/guides/rel_notes/deprecation.rst          |  10 +
 doc/guides/rel_notes/release_26_07.rst        |  14 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |  36 -
 drivers/net/intel/i40e/i40e_ethdev.c          |   4 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |   4 -
 drivers/net/intel/i40e/i40e_fdir.c            | 140 ----
 drivers/net/intel/i40e/i40e_flow.c            |   3 +-
 drivers/net/intel/i40e/i40e_testpmd.c         | 642 ------------------
 drivers/net/intel/i40e/rte_pmd_i40e.c         |  34 -
 drivers/net/intel/i40e/rte_pmd_i40e.h         | 113 ++-
 drivers/net/intel/ixgbe/ixgbe_ethdev.c        |  12 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        | 100 ++-
 drivers/net/intel/ixgbe/ixgbe_fdir.c          | 241 ++-----
 drivers/net/intel/ixgbe/ixgbe_flow.c          |  28 +-
 .../net/intel/ixgbe/ixgbe_rxtx_vec_common.c   |   4 +-
 drivers/net/intel/ixgbe/rte_pmd_ixgbe.c       |  34 -
 drivers/net/intel/ixgbe/rte_pmd_ixgbe.h       |  32 -
 drivers/net/txgbe/txgbe_ethdev.c              |   6 +-
 drivers/net/txgbe/txgbe_ethdev.h              | 101 ++-
 drivers/net/txgbe/txgbe_fdir.c                |  78 +--
 drivers/net/txgbe/txgbe_flow.c                |  24 +-
 drivers/net/txgbe/txgbe_rxtx_vec_common.h     |   4 +-
 26 files changed, 448 insertions(+), 1473 deletions(-)

-- 
2.53.0


^ permalink raw reply

* [RFC 1/8] app/testpmd: remove support for flow director
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Aman Singh
In-Reply-To: <20260528213816.562910-1-stephen@networkplumber.org>

The flow director API is deprecated and will be removed in 26.11.
Remove it from testpmd now since testpmd CLI is not a stable API.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-pmd/cmdline.c                      |  21 +--
 app/test-pmd/config.c                       | 163 --------------------
 app/test-pmd/testpmd.h                      |   3 -
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  36 -----
 4 files changed, 6 insertions(+), 217 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index cc9c462498..a5022bde04 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -163,7 +163,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"Display:\n"
 			"--------\n\n"
 
-			"show port (info|stats|summary|xstats|fdir|dcb_tc) (port_id|all)\n"
+			"show port (info|stats|summary|xstats|dcb_tc) (port_id|all)\n"
 			"    Display information for port_id, or all.\n\n"
 
 			"show port info (port_id) representor\n"
@@ -189,7 +189,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"show port (port_id) rss-hash [key | algorithm]\n"
 			"    Display the RSS hash functions, RSS hash key and RSS hash algorithms of port\n\n"
 
-			"clear port (info|stats|xstats|fdir) (port_id|all)\n"
+			"clear port (info|stats|xstats) (port_id|all)\n"
 			"    Clear information for port_id, or all.\n\n"
 
 			"show (rxq|txq) info (port_id) (queue_id)\n"
@@ -7510,11 +7510,6 @@ static void cmd_showportall_parsed(void *parsed_result,
 	else if (!strcmp(res->what, "xstats"))
 		RTE_ETH_FOREACH_DEV(i)
 			nic_xstats_display(i);
-#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE)
-	else if (!strcmp(res->what, "fdir"))
-		RTE_ETH_FOREACH_DEV(i)
-			fdir_get_infos(i);
-#endif
 	else if (!strcmp(res->what, "dcb_tc"))
 		RTE_ETH_FOREACH_DEV(i)
 			port_dcb_info_display(i);
@@ -7527,14 +7522,14 @@ static cmdline_parse_token_string_t cmd_showportall_port =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, port, "port");
 static cmdline_parse_token_string_t cmd_showportall_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, what,
-				 "info#summary#stats#xstats#fdir#dcb_tc");
+				 "info#summary#stats#xstats#dcb_tc");
 static cmdline_parse_token_string_t cmd_showportall_all =
 	TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, all, "all");
 static cmdline_parse_inst_t cmd_showportall = {
 	.f = cmd_showportall_parsed,
 	.data = NULL,
 	.help_str = "show|clear port "
-		"info|summary|stats|xstats|fdir|dcb_tc all",
+		"info|summary|stats|xstats|dcb_tc all",
 	.tokens = {
 		(void *)&cmd_showportall_show,
 		(void *)&cmd_showportall_port,
@@ -7572,10 +7567,6 @@ static void cmd_showport_parsed(void *parsed_result,
 		nic_stats_display(res->portnum);
 	else if (!strcmp(res->what, "xstats"))
 		nic_xstats_display(res->portnum);
-#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE)
-	else if (!strcmp(res->what, "fdir"))
-		 fdir_get_infos(res->portnum);
-#endif
 	else if (!strcmp(res->what, "dcb_tc"))
 		port_dcb_info_display(res->portnum);
 }
@@ -7587,7 +7578,7 @@ static cmdline_parse_token_string_t cmd_showport_port =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, port, "port");
 static cmdline_parse_token_string_t cmd_showport_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
-				 "info#summary#stats#xstats#fdir#dcb_tc");
+				 "info#summary#stats#xstats#dcb_tc");
 static cmdline_parse_token_num_t cmd_showport_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, RTE_UINT16);
 
@@ -7595,7 +7586,7 @@ static cmdline_parse_inst_t cmd_showport = {
 	.f = cmd_showport_parsed,
 	.data = NULL,
 	.help_str = "show|clear port "
-		"info|summary|stats|xstats|fdir|dcb_tc "
+		"info|summary|stats|xstats|dcb_tc "
 		"<port_id>",
 	.tokens = {
 		(void *)&cmd_showport_show,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index c950793aaf..12fc679250 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -7041,169 +7041,6 @@ flowtype_to_str(uint16_t flow_type)
 	return NULL;
 }
 
-#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE)
-
-static inline void
-print_fdir_flex_payload(struct rte_eth_fdir_flex_conf *flex_conf, uint32_t num)
-{
-	struct rte_eth_flex_payload_cfg *cfg;
-	uint32_t i, j;
-
-	for (i = 0; i < flex_conf->nb_payloads; i++) {
-		cfg = &flex_conf->flex_set[i];
-		if (cfg->type == RTE_ETH_RAW_PAYLOAD)
-			printf("\n    RAW:  ");
-		else if (cfg->type == RTE_ETH_L2_PAYLOAD)
-			printf("\n    L2_PAYLOAD:  ");
-		else if (cfg->type == RTE_ETH_L3_PAYLOAD)
-			printf("\n    L3_PAYLOAD:  ");
-		else if (cfg->type == RTE_ETH_L4_PAYLOAD)
-			printf("\n    L4_PAYLOAD:  ");
-		else
-			printf("\n    UNKNOWN PAYLOAD(%u):  ", cfg->type);
-		for (j = 0; j < num; j++)
-			printf("  %-5u", cfg->src_offset[j]);
-	}
-	printf("\n");
-}
-
-static inline void
-print_fdir_flex_mask(struct rte_eth_fdir_flex_conf *flex_conf, uint32_t num)
-{
-	struct rte_eth_fdir_flex_mask *mask;
-	uint32_t i, j;
-	const char *p;
-
-	for (i = 0; i < flex_conf->nb_flexmasks; i++) {
-		mask = &flex_conf->flex_mask[i];
-		p = flowtype_to_str(mask->flow_type);
-		printf("\n    %s:\t", p ? p : "unknown");
-		for (j = 0; j < num; j++)
-			printf(" %02x", mask->mask[j]);
-	}
-	printf("\n");
-}
-
-static inline void
-print_fdir_flow_type(uint32_t flow_types_mask)
-{
-	int i;
-	const char *p;
-
-	for (i = RTE_ETH_FLOW_UNKNOWN; i < RTE_ETH_FLOW_MAX; i++) {
-		if (!(flow_types_mask & (1 << i)))
-			continue;
-		p = flowtype_to_str(i);
-		if (p)
-			printf(" %s", p);
-		else
-			printf(" unknown");
-	}
-	printf("\n");
-}
-
-static int
-get_fdir_info(portid_t port_id, struct rte_eth_fdir_info *fdir_info,
-		    struct rte_eth_fdir_stats *fdir_stat)
-{
-	int ret = -ENOTSUP;
-
-#ifdef RTE_NET_I40E
-	if (ret == -ENOTSUP) {
-		ret = rte_pmd_i40e_get_fdir_info(port_id, fdir_info);
-		if (!ret)
-			ret = rte_pmd_i40e_get_fdir_stats(port_id, fdir_stat);
-	}
-#endif
-#ifdef RTE_NET_IXGBE
-	if (ret == -ENOTSUP) {
-		ret = rte_pmd_ixgbe_get_fdir_info(port_id, fdir_info);
-		if (!ret)
-			ret = rte_pmd_ixgbe_get_fdir_stats(port_id, fdir_stat);
-	}
-#endif
-	switch (ret) {
-	case 0:
-		break;
-	case -ENOTSUP:
-		fprintf(stderr, "\n FDIR is not supported on port %-2d\n",
-			port_id);
-		break;
-	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
-		break;
-	}
-	return ret;
-}
-
-void
-fdir_get_infos(portid_t port_id)
-{
-	struct rte_eth_fdir_stats fdir_stat;
-	struct rte_eth_fdir_info fdir_info;
-
-	static const char *fdir_stats_border = "########################";
-
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return;
-
-	memset(&fdir_info, 0, sizeof(fdir_info));
-	memset(&fdir_stat, 0, sizeof(fdir_stat));
-	if (get_fdir_info(port_id, &fdir_info, &fdir_stat))
-		return;
-
-	printf("\n  %s FDIR infos for port %-2d     %s\n",
-	       fdir_stats_border, port_id, fdir_stats_border);
-	printf("  MODE: ");
-	if (fdir_info.mode == RTE_FDIR_MODE_PERFECT)
-		printf("  PERFECT\n");
-	else if (fdir_info.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN)
-		printf("  PERFECT-MAC-VLAN\n");
-	else if (fdir_info.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
-		printf("  PERFECT-TUNNEL\n");
-	else if (fdir_info.mode == RTE_FDIR_MODE_SIGNATURE)
-		printf("  SIGNATURE\n");
-	else
-		printf("  DISABLE\n");
-	if (fdir_info.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN
-		&& fdir_info.mode != RTE_FDIR_MODE_PERFECT_TUNNEL) {
-		printf("  SUPPORTED FLOW TYPE: ");
-		print_fdir_flow_type(fdir_info.flow_types_mask[0]);
-	}
-	printf("  FLEX PAYLOAD INFO:\n");
-	printf("  max_len:       %-10"PRIu32"  payload_limit: %-10"PRIu32"\n"
-	       "  payload_unit:  %-10"PRIu32"  payload_seg:   %-10"PRIu32"\n"
-	       "  bitmask_unit:  %-10"PRIu32"  bitmask_num:   %-10"PRIu32"\n",
-		fdir_info.max_flexpayload, fdir_info.flex_payload_limit,
-		fdir_info.flex_payload_unit,
-		fdir_info.max_flex_payload_segment_num,
-		fdir_info.flex_bitmask_unit, fdir_info.max_flex_bitmask_num);
-	if (fdir_info.flex_conf.nb_payloads > 0) {
-		printf("  FLEX PAYLOAD SRC OFFSET:");
-		print_fdir_flex_payload(&fdir_info.flex_conf, fdir_info.max_flexpayload);
-	}
-	if (fdir_info.flex_conf.nb_flexmasks > 0) {
-		printf("  FLEX MASK CFG:");
-		print_fdir_flex_mask(&fdir_info.flex_conf, fdir_info.max_flexpayload);
-	}
-	printf("  guarant_count: %-10"PRIu32"  best_count:    %"PRIu32"\n",
-	       fdir_stat.guarant_cnt, fdir_stat.best_cnt);
-	printf("  guarant_space: %-10"PRIu32"  best_space:    %"PRIu32"\n",
-	       fdir_info.guarant_spc, fdir_info.best_spc);
-	printf("  collision:     %-10"PRIu32"  free:          %"PRIu32"\n"
-	       "  maxhash:       %-10"PRIu32"  maxlen:        %"PRIu32"\n"
-	       "  add:	         %-10"PRIu64"  remove:        %"PRIu64"\n"
-	       "  f_add:         %-10"PRIu64"  f_remove:      %"PRIu64"\n",
-	       fdir_stat.collision, fdir_stat.free,
-	       fdir_stat.maxhash, fdir_stat.maxlen,
-	       fdir_stat.add, fdir_stat.remove,
-	       fdir_stat.f_add, fdir_stat.f_remove);
-	printf("  %s############################%s\n",
-	       fdir_stats_border, fdir_stats_border);
-}
-
-#endif /* RTE_NET_I40E || RTE_NET_IXGBE */
-
 void
 set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 {
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 1a54535470..0a4ab188bb 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -1185,9 +1185,6 @@ int all_ports_stopped(void);
 int port_is_stopped(portid_t port_id);
 int port_is_started(portid_t port_id);
 void pmd_test_exit(void);
-#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE)
-void fdir_get_infos(portid_t port_id);
-#endif
 void port_rss_reta_info(portid_t port_id,
 			struct rte_eth_rss_reta_entry64 *reta_conf,
 			uint16_t nb_entries);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f99b29b423..1d079f521a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -2266,42 +2266,6 @@ Where the threshold type can be:
 
 These threshold options are also available from the command-line.
 
-port config pctype mapping
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Reset pctype mapping table::
-
-   testpmd> port config (port_id) pctype mapping reset
-
-Update hardware defined pctype to software defined flow type mapping table::
-
-   testpmd> port config (port_id) pctype mapping update (pctype_id_0[,pctype_id_1]*) (flow_type_id)
-
-where:
-
-* ``pctype_id_x``: hardware pctype id as index of bit in bitmask value of the pctype mapping table.
-
-* ``flow_type_id``: software flow type id as the index of the pctype mapping table.
-
-port config input set
-~~~~~~~~~~~~~~~~~~~~~
-
-Config RSS/FDIR/FDIR flexible payload input set for some pctype::
-
-   testpmd> port config (port_id) pctype (pctype_id) \
-            (hash_inset|fdir_inset|fdir_flx_inset) \
-	    (get|set|clear) field (field_idx)
-
-Clear RSS/FDIR/FDIR flexible payload input set for some pctype::
-
-   testpmd> port config (port_id) pctype (pctype_id) \
-            (hash_inset|fdir_inset|fdir_flx_inset) clear all
-
-where:
-
-* ``pctype_id``: hardware packet classification types.
-* ``field_idx``: hardware field index.
-
 port config udp_tunnel_port
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.53.0


^ permalink raw reply related

* [RFC 2/8] net/i40e: remove testpmd flow filter commands
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Bruce Richardson
In-Reply-To: <20260528213816.562910-1-stephen@networkplumber.org>

Remove the testpmd commands that drive the i40e PMD-private legacy
flow filter API, which is being deprecated in DPDK 26.07 and removed
in 26.11.

  flow_director_filter
        Drove rte_pmd_i40e_flow_add_del_packet_template().

  port config <port_id> pctype <pctype_id>
        hash_inset|fdir_inset|fdir_flx_inset get|set|clear field
  port config <port_id> pctype <pctype_id>
        hash_inset|fdir_inset|fdir_flx_inset clear all
        Drove the rte_pmd_i40e_inset_get/set and inset_field_*
        helpers.

  show port <port_id> pctype mapping
  port config <port_id> pctype mapping reset
  port config <port_id> pctype mapping update ...
        Drove rte_pmd_i40e_flow_type_mapping_get/reset/update().

The visually-similar "ptype mapping" commands (ptype mapping
get/replace/reset/update) are preserved — they drive the unrelated
rte_pmd_i40e_ptype_mapping_* DDP packet-type mapping API, which is
not in scope for this series. The naming collision between "pctype
mapping" (legacy flow-type mapping, removed here) and "ptype mapping"
(DDP packet-type mapping, kept) was a long-standing source of
confusion.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/nics/i40e.rst              |  70 +--
 drivers/net/intel/i40e/i40e_testpmd.c | 642 --------------------------
 2 files changed, 4 insertions(+), 708 deletions(-)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index e67498aef4..0aae5b4d82 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -399,52 +399,6 @@ Add a rule to direct ``ipv4-udp`` packet whose ``dst_ip=2.2.2.5, src_ip=2.2.2.3,
             dst is 2.2.2.5 / udp src is 32 dst is 32 / end \
             actions mark id 1 / queue index 1 / end
 
-Check the flow director status:
-
-.. code-block:: console
-
-   testpmd> show port fdir 0
-
-   ######################## FDIR infos for port 0      ####################
-     MODE:   PERFECT
-     SUPPORTED FLOW TYPE:  ipv4-frag ipv4-tcp ipv4-udp ipv4-sctp ipv4-other
-                           ipv6-frag ipv6-tcp ipv6-udp ipv6-sctp ipv6-other
-			   l2_payload
-     FLEX PAYLOAD INFO:
-     max_len:	    16	        payload_limit: 480
-     payload_unit:  2	        payload_seg:   3
-     bitmask_unit:  2	        bitmask_num:   2
-     MASK:
-       vlan_tci: 0x0000,
-       src_ipv4: 0x00000000,
-       dst_ipv4: 0x00000000,
-       src_port: 0x0000,
-       dst_port: 0x0000
-       src_ipv6: 0x00000000,0x00000000,0x00000000,0x00000000,
-       dst_ipv6: 0x00000000,0x00000000,0x00000000,0x00000000
-     FLEX PAYLOAD SRC OFFSET:
-       L2_PAYLOAD:    0      1	    2	   3	  4	 5	6  ...
-       L3_PAYLOAD:    0      1	    2	   3	  4	 5	6  ...
-       L4_PAYLOAD:    0      1	    2	   3	  4	 5	6  ...
-     FLEX MASK CFG:
-       ipv4-udp:    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       ipv4-tcp:    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       ipv4-sctp:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       ipv4-other:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       ipv4-frag:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       ipv6-udp:    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       ipv6-tcp:    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       ipv6-sctp:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       ipv6-other:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       ipv6-frag:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-       l2_payload:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-     guarant_count: 1	        best_count:    0
-     guarant_space: 512         best_space:    7168
-     collision:     0	        free:	       0
-     maxhash:	    0	        maxlen:        0
-     add:	    0	        remove:        0
-     f_add:	    0	        f_remove:      0
-
 
 Floating VEB
 ~~~~~~~~~~~~~
@@ -613,19 +567,10 @@ Limitations or Known issues
 MPLS packet classification
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-For firmware versions prior to 5.0, MPLS packets are not recognized by the NIC.
-The L2 Payload flow type in flow director can be used to classify MPLS packet
-by using a command in testpmd like:
-
-   testpmd> flow_director_filter 0 mode IP add flow l2_payload ether \
-            0x8847 flexbytes () fwd pf queue <N> fd_id <M>
-
-With the NIC firmware version 5.0 or greater, some limited MPLS support
-is added: Native MPLS (MPLS in Ethernet) skip is implemented, while no
-new packet type, no classification or offload are possible. With this change,
-L2 Payload flow type in flow director cannot be used to classify MPLS packet
-as with previous firmware versions. Meanwhile, the Ethertype filter can be
-used to classify MPLS packet by using a command in testpmd like:
+With NIC firmware version 5.0 or greater, native MPLS (MPLS in
+Ethernet) skip is implemented, although no new packet type, no
+classification, and no offload are possible.
+The Ethertype filter can be used to classify MPLS packets via testpmd::
 
    testpmd> flow create 0 ingress pattern eth type is 0x8847 / end \
             actions queue index <M> / end
@@ -878,13 +823,6 @@ Reset ptype mapping table::
 
    testpmd> ptype mapping reset (port_id)
 
-show port pctype mapping
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-List all items from the pctype mapping table::
-
-   testpmd> show port (port_id) pctype mapping
-
 High Performance of Small Packets on 40GbE NIC
 ----------------------------------------------
 
diff --git a/drivers/net/intel/i40e/i40e_testpmd.c b/drivers/net/intel/i40e/i40e_testpmd.c
index 21f596297b..3943287ca9 100644
--- a/drivers/net/intel/i40e/i40e_testpmd.c
+++ b/drivers/net/intel/i40e/i40e_testpmd.c
@@ -464,149 +464,6 @@ static cmdline_parse_inst_t cmd_show_queue_region_info_all = {
 	},
 };
 
-/* *** deal with flow director filter *** */
-struct cmd_flow_director_result {
-	cmdline_fixed_string_t flow_director_filter;
-	portid_t port_id;
-	cmdline_fixed_string_t mode;
-	cmdline_fixed_string_t mode_value;
-	cmdline_fixed_string_t ops;
-	cmdline_fixed_string_t flow;
-	cmdline_fixed_string_t flow_type;
-	cmdline_fixed_string_t drop;
-	cmdline_fixed_string_t queue;
-	uint16_t queue_id;
-	cmdline_fixed_string_t fd_id;
-	uint32_t fd_id_value;
-	cmdline_fixed_string_t packet;
-	char filepath[];
-};
-
-static void
-cmd_flow_director_filter_parsed(void *parsed_result,
-	__rte_unused struct cmdline *cl, __rte_unused void *data)
-{
-	struct cmd_flow_director_result *res = parsed_result;
-	int ret = 0;
-	struct rte_pmd_i40e_flow_type_mapping
-			mapping[RTE_PMD_I40E_FLOW_TYPE_MAX];
-	struct rte_pmd_i40e_pkt_template_conf conf;
-	uint16_t flow_type = str_to_flowtype(res->flow_type);
-	uint16_t i, port = res->port_id;
-	uint8_t add;
-
-	memset(&conf, 0, sizeof(conf));
-
-	if (flow_type == RTE_ETH_FLOW_UNKNOWN) {
-		fprintf(stderr, "Invalid flow type specified.\n");
-		return;
-	}
-	ret = rte_pmd_i40e_flow_type_mapping_get(res->port_id,
-						 mapping);
-	if (ret)
-		return;
-	if (mapping[flow_type].pctype == 0ULL) {
-		fprintf(stderr, "Invalid flow type specified.\n");
-		return;
-	}
-	for (i = 0; i < RTE_PMD_I40E_PCTYPE_MAX; i++) {
-		if (mapping[flow_type].pctype & (1ULL << i)) {
-			conf.input.pctype = i;
-			break;
-		}
-	}
-
-	conf.input.packet = open_file(res->filepath,
-				&conf.input.length);
-	if (!conf.input.packet)
-		return;
-	if (!strcmp(res->drop, "drop"))
-		conf.action.behavior =
-			RTE_PMD_I40E_PKT_TEMPLATE_REJECT;
-	else
-		conf.action.behavior =
-			RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT;
-	conf.action.report_status =
-			RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID;
-	conf.action.rx_queue = res->queue_id;
-	conf.soft_id = res->fd_id_value;
-	add = strcmp(res->ops, "del") ? 1 : 0;
-	ret = rte_pmd_i40e_flow_add_del_packet_template(port,
-							&conf,
-							add);
-	if (ret < 0)
-		fprintf(stderr, "flow director config error: (%s)\n",
-			strerror(-ret));
-	close_file(conf.input.packet);
-}
-
-static cmdline_parse_token_string_t cmd_flow_director_filter =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		flow_director_filter, "flow_director_filter");
-static cmdline_parse_token_num_t cmd_flow_director_port_id =
-	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
-		port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_flow_director_ops =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		ops, "add#del#update");
-static cmdline_parse_token_string_t cmd_flow_director_flow =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		flow, "flow");
-static cmdline_parse_token_string_t cmd_flow_director_flow_type =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		flow_type, NULL);
-static cmdline_parse_token_string_t cmd_flow_director_drop =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		drop, "drop#fwd");
-static cmdline_parse_token_string_t cmd_flow_director_queue =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		queue, "queue");
-static cmdline_parse_token_num_t cmd_flow_director_queue_id =
-	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
-		queue_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_flow_director_fd_id =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		fd_id, "fd_id");
-static cmdline_parse_token_num_t cmd_flow_director_fd_id_value =
-	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
-		fd_id_value, RTE_UINT32);
-static cmdline_parse_token_string_t cmd_flow_director_mode =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		mode, "mode");
-static cmdline_parse_token_string_t cmd_flow_director_mode_raw =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		mode_value, "raw");
-static cmdline_parse_token_string_t cmd_flow_director_packet =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		packet, "packet");
-static cmdline_parse_token_string_t cmd_flow_director_filepath =
-	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-		filepath, NULL);
-
-static cmdline_parse_inst_t cmd_add_del_raw_flow_director = {
-	.f = cmd_flow_director_filter_parsed,
-	.data = NULL,
-	.help_str = "flow_director_filter ... : Add or delete a raw flow "
-		"director entry on NIC",
-	.tokens = {
-		(void *)&cmd_flow_director_filter,
-		(void *)&cmd_flow_director_port_id,
-		(void *)&cmd_flow_director_mode,
-		(void *)&cmd_flow_director_mode_raw,
-		(void *)&cmd_flow_director_ops,
-		(void *)&cmd_flow_director_flow,
-		(void *)&cmd_flow_director_flow_type,
-		(void *)&cmd_flow_director_drop,
-		(void *)&cmd_flow_director_queue,
-		(void *)&cmd_flow_director_queue_id,
-		(void *)&cmd_flow_director_fd_id,
-		(void *)&cmd_flow_director_fd_id_value,
-		(void *)&cmd_flow_director_packet,
-		(void *)&cmd_flow_director_filepath,
-		NULL,
-	},
-};
-
 /* VF unicast promiscuous mode configuration */
 
 /* Common result structure for VF unicast promiscuous mode */
@@ -1670,469 +1527,6 @@ static cmdline_parse_inst_t cmd_ddp_get_list = {
 	},
 };
 
-/* Configure input set */
-struct cmd_cfg_input_set_result {
-	cmdline_fixed_string_t port;
-	cmdline_fixed_string_t cfg;
-	portid_t port_id;
-	cmdline_fixed_string_t pctype;
-	uint8_t pctype_id;
-	cmdline_fixed_string_t inset_type;
-	cmdline_fixed_string_t opt;
-	cmdline_fixed_string_t field;
-	uint8_t field_idx;
-};
-
-static void
-cmd_cfg_input_set_parsed(__rte_unused void *parsed_result,
-	__rte_unused struct cmdline *cl,
-	__rte_unused void *data)
-{
-	struct cmd_cfg_input_set_result *res = parsed_result;
-	enum rte_pmd_i40e_inset_type inset_type = INSET_NONE;
-	struct rte_pmd_i40e_inset inset;
-	int ret = -ENOTSUP;
-
-	if (!all_ports_stopped()) {
-		fprintf(stderr, "Please stop all ports first\n");
-		return;
-	}
-
-	if (!strcmp(res->inset_type, "hash_inset"))
-		inset_type = INSET_HASH;
-	else if (!strcmp(res->inset_type, "fdir_inset"))
-		inset_type = INSET_FDIR;
-	else if (!strcmp(res->inset_type, "fdir_flx_inset"))
-		inset_type = INSET_FDIR_FLX;
-	ret = rte_pmd_i40e_inset_get(res->port_id, res->pctype_id, &inset, inset_type);
-	if (ret) {
-		fprintf(stderr, "Failed to get input set.\n");
-		return;
-	}
-
-	if (!strcmp(res->opt, "get")) {
-		ret = rte_pmd_i40e_inset_field_get(inset.inset, res->field_idx);
-		if (ret)
-			printf("Field index %d is enabled.\n", res->field_idx);
-		else
-			printf("Field index %d is disabled.\n", res->field_idx);
-		return;
-	}
-
-	if (!strcmp(res->opt, "set"))
-		ret = rte_pmd_i40e_inset_field_set(&inset.inset, res->field_idx);
-	else if (!strcmp(res->opt, "clear"))
-		ret = rte_pmd_i40e_inset_field_clear(&inset.inset, res->field_idx);
-	if (ret) {
-		fprintf(stderr, "Failed to configure input set field.\n");
-		return;
-	}
-
-	ret = rte_pmd_i40e_inset_set(res->port_id, res->pctype_id, &inset, inset_type);
-	if (ret) {
-		fprintf(stderr, "Failed to set input set.\n");
-		return;
-	}
-
-	if (ret == -ENOTSUP)
-		fprintf(stderr, "Function not supported\n");
-}
-
-static cmdline_parse_token_string_t cmd_cfg_input_set_port =
-	TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
-		port, "port");
-static cmdline_parse_token_string_t cmd_cfg_input_set_cfg =
-	TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
-		cfg, "config");
-static cmdline_parse_token_num_t cmd_cfg_input_set_port_id =
-	TOKEN_NUM_INITIALIZER(struct cmd_cfg_input_set_result,
-		port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_cfg_input_set_pctype =
-	TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
-		pctype, "pctype");
-static cmdline_parse_token_num_t cmd_cfg_input_set_pctype_id =
-	TOKEN_NUM_INITIALIZER(struct cmd_cfg_input_set_result,
-		pctype_id, RTE_UINT8);
-static cmdline_parse_token_string_t cmd_cfg_input_set_inset_type =
-	TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
-		inset_type, "hash_inset#fdir_inset#fdir_flx_inset");
-static cmdline_parse_token_string_t cmd_cfg_input_set_opt =
-	TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
-		opt, "get#set#clear");
-static cmdline_parse_token_string_t cmd_cfg_input_set_field =
-	TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
-		field, "field");
-static cmdline_parse_token_num_t cmd_cfg_input_set_field_idx =
-	TOKEN_NUM_INITIALIZER(struct cmd_cfg_input_set_result,
-		field_idx, RTE_UINT8);
-
-static cmdline_parse_inst_t cmd_cfg_input_set = {
-	.f = cmd_cfg_input_set_parsed,
-	.data = NULL,
-	.help_str = "port config <port_id> pctype <pctype_id> hash_inset|"
-		"fdir_inset|fdir_flx_inset get|set|clear field <field_idx>",
-	.tokens = {
-		(void *)&cmd_cfg_input_set_port,
-		(void *)&cmd_cfg_input_set_cfg,
-		(void *)&cmd_cfg_input_set_port_id,
-		(void *)&cmd_cfg_input_set_pctype,
-		(void *)&cmd_cfg_input_set_pctype_id,
-		(void *)&cmd_cfg_input_set_inset_type,
-		(void *)&cmd_cfg_input_set_opt,
-		(void *)&cmd_cfg_input_set_field,
-		(void *)&cmd_cfg_input_set_field_idx,
-		NULL,
-	},
-};
-
-/* Clear input set */
-struct cmd_clear_input_set_result {
-	cmdline_fixed_string_t port;
-	cmdline_fixed_string_t cfg;
-	portid_t port_id;
-	cmdline_fixed_string_t pctype;
-	uint8_t pctype_id;
-	cmdline_fixed_string_t inset_type;
-	cmdline_fixed_string_t clear;
-	cmdline_fixed_string_t all;
-};
-
-static void
-cmd_clear_input_set_parsed(__rte_unused void *parsed_result,
-	__rte_unused struct cmdline *cl,
-	__rte_unused void *data)
-{
-	struct cmd_clear_input_set_result *res = parsed_result;
-	enum rte_pmd_i40e_inset_type inset_type = INSET_NONE;
-	struct rte_pmd_i40e_inset inset;
-	int ret = -ENOTSUP;
-
-	if (!all_ports_stopped()) {
-		fprintf(stderr, "Please stop all ports first\n");
-		return;
-	}
-
-	if (!strcmp(res->inset_type, "hash_inset"))
-		inset_type = INSET_HASH;
-	else if (!strcmp(res->inset_type, "fdir_inset"))
-		inset_type = INSET_FDIR;
-	else if (!strcmp(res->inset_type, "fdir_flx_inset"))
-		inset_type = INSET_FDIR_FLX;
-
-	memset(&inset, 0, sizeof(inset));
-
-	ret = rte_pmd_i40e_inset_set(res->port_id, res->pctype_id, &inset, inset_type);
-	if (ret) {
-		fprintf(stderr, "Failed to clear input set.\n");
-		return;
-	}
-
-	if (ret == -ENOTSUP)
-		fprintf(stderr, "Function not supported\n");
-}
-
-static cmdline_parse_token_string_t cmd_clear_input_set_port =
-	TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
-		port, "port");
-static cmdline_parse_token_string_t cmd_clear_input_set_cfg =
-	TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
-		cfg, "config");
-static cmdline_parse_token_num_t cmd_clear_input_set_port_id =
-	TOKEN_NUM_INITIALIZER(struct cmd_clear_input_set_result,
-		port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_clear_input_set_pctype =
-	TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
-		pctype, "pctype");
-static cmdline_parse_token_num_t cmd_clear_input_set_pctype_id =
-	TOKEN_NUM_INITIALIZER(struct cmd_clear_input_set_result,
-		pctype_id, RTE_UINT8);
-static cmdline_parse_token_string_t cmd_clear_input_set_inset_type =
-	TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
-		inset_type, "hash_inset#fdir_inset#fdir_flx_inset");
-static cmdline_parse_token_string_t cmd_clear_input_set_clear =
-	TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
-		clear, "clear");
-static cmdline_parse_token_string_t cmd_clear_input_set_all =
-	TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
-		all, "all");
-
-static cmdline_parse_inst_t cmd_clear_input_set = {
-	.f = cmd_clear_input_set_parsed,
-	.data = NULL,
-	.help_str = "port config <port_id> pctype <pctype_id> hash_inset|"
-		"fdir_inset|fdir_flx_inset clear all",
-	.tokens = {
-		(void *)&cmd_clear_input_set_port,
-		(void *)&cmd_clear_input_set_cfg,
-		(void *)&cmd_clear_input_set_port_id,
-		(void *)&cmd_clear_input_set_pctype,
-		(void *)&cmd_clear_input_set_pctype_id,
-		(void *)&cmd_clear_input_set_inset_type,
-		(void *)&cmd_clear_input_set_clear,
-		(void *)&cmd_clear_input_set_all,
-		NULL,
-	},
-};
-
-/* port config pctype mapping reset */
-
-/* Common result structure for port config pctype mapping reset */
-struct cmd_pctype_mapping_reset_result {
-	cmdline_fixed_string_t port;
-	cmdline_fixed_string_t config;
-	portid_t port_id;
-	cmdline_fixed_string_t pctype;
-	cmdline_fixed_string_t mapping;
-	cmdline_fixed_string_t reset;
-};
-
-/* Common CLI fields for port config pctype mapping reset*/
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_port =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
-		port, "port");
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_config =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
-		config, "config");
-static cmdline_parse_token_num_t cmd_pctype_mapping_reset_port_id =
-	TOKEN_NUM_INITIALIZER(struct cmd_pctype_mapping_reset_result,
-		port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_pctype =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
-		pctype, "pctype");
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_mapping =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
-		mapping, "mapping");
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_reset =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
-		reset, "reset");
-
-static void
-cmd_pctype_mapping_reset_parsed(void *parsed_result,
-	__rte_unused struct cmdline *cl,
-	__rte_unused void *data)
-{
-	struct cmd_pctype_mapping_reset_result *res = parsed_result;
-	int ret = -ENOTSUP;
-
-	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
-		return;
-
-	ret = rte_pmd_i40e_flow_type_mapping_reset(res->port_id);
-	switch (ret) {
-	case 0:
-		break;
-	case -ENODEV:
-		fprintf(stderr, "invalid port_id %d\n", res->port_id);
-		break;
-	case -ENOTSUP:
-		fprintf(stderr, "function not implemented\n");
-		break;
-	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
-	}
-}
-
-static cmdline_parse_inst_t cmd_pctype_mapping_reset = {
-	.f = cmd_pctype_mapping_reset_parsed,
-	.data = NULL,
-	.help_str = "port config <port_id> pctype mapping reset",
-	.tokens = {
-		(void *)&cmd_pctype_mapping_reset_port,
-		(void *)&cmd_pctype_mapping_reset_config,
-		(void *)&cmd_pctype_mapping_reset_port_id,
-		(void *)&cmd_pctype_mapping_reset_pctype,
-		(void *)&cmd_pctype_mapping_reset_mapping,
-		(void *)&cmd_pctype_mapping_reset_reset,
-		NULL,
-	},
-};
-
-/* show port pctype mapping */
-
-/* Common result structure for show port pctype mapping */
-struct cmd_pctype_mapping_get_result {
-	cmdline_fixed_string_t show;
-	cmdline_fixed_string_t port;
-	portid_t port_id;
-	cmdline_fixed_string_t pctype;
-	cmdline_fixed_string_t mapping;
-};
-
-/* Common CLI fields for pctype mapping get */
-static cmdline_parse_token_string_t cmd_pctype_mapping_get_show =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_get_result,
-		show, "show");
-static cmdline_parse_token_string_t cmd_pctype_mapping_get_port =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_get_result,
-		port, "port");
-static cmdline_parse_token_num_t cmd_pctype_mapping_get_port_id =
-	TOKEN_NUM_INITIALIZER(struct cmd_pctype_mapping_get_result,
-		port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_pctype_mapping_get_pctype =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_get_result,
-		pctype, "pctype");
-static cmdline_parse_token_string_t cmd_pctype_mapping_get_mapping =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_get_result,
-		mapping, "mapping");
-
-static void
-cmd_pctype_mapping_get_parsed(void *parsed_result,
-	__rte_unused struct cmdline *cl,
-	__rte_unused void *data)
-{
-	struct cmd_pctype_mapping_get_result *res = parsed_result;
-	int ret = -ENOTSUP;
-	struct rte_pmd_i40e_flow_type_mapping
-				mapping[RTE_PMD_I40E_FLOW_TYPE_MAX];
-	int i, j, first_pctype;
-
-	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
-		return;
-
-	ret = rte_pmd_i40e_flow_type_mapping_get(res->port_id, mapping);
-	switch (ret) {
-	case 0:
-		break;
-	case -ENODEV:
-		fprintf(stderr, "invalid port_id %d\n", res->port_id);
-		return;
-	case -ENOTSUP:
-		fprintf(stderr, "function not implemented\n");
-		return;
-	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
-		return;
-	}
-
-	for (i = 0; i < RTE_PMD_I40E_FLOW_TYPE_MAX; i++) {
-		if (mapping[i].pctype != 0ULL) {
-			first_pctype = 1;
-
-			printf("pctype: ");
-			for (j = 0; j < RTE_PMD_I40E_PCTYPE_MAX; j++) {
-				if (mapping[i].pctype & (1ULL << j)) {
-					printf(first_pctype ?  "%02d" : ",%02d", j);
-					first_pctype = 0;
-				}
-			}
-			printf("  ->  flowtype: %02d\n", mapping[i].flow_type);
-		}
-	}
-}
-
-static cmdline_parse_inst_t cmd_pctype_mapping_get = {
-	.f = cmd_pctype_mapping_get_parsed,
-	.data = NULL,
-	.help_str = "show port <port_id> pctype mapping",
-	.tokens = {
-		(void *)&cmd_pctype_mapping_get_show,
-		(void *)&cmd_pctype_mapping_get_port,
-		(void *)&cmd_pctype_mapping_get_port_id,
-		(void *)&cmd_pctype_mapping_get_pctype,
-		(void *)&cmd_pctype_mapping_get_mapping,
-		NULL,
-	},
-};
-
-/* port config pctype mapping update */
-
-/* Common result structure for port config pctype mapping update */
-struct cmd_pctype_mapping_update_result {
-	cmdline_fixed_string_t port;
-	cmdline_fixed_string_t config;
-	portid_t port_id;
-	cmdline_fixed_string_t pctype;
-	cmdline_fixed_string_t mapping;
-	cmdline_fixed_string_t update;
-	cmdline_fixed_string_t pctype_list;
-	uint16_t flow_type;
-};
-
-/* Common CLI fields for pctype mapping update*/
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_port =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
-		port, "port");
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_config =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
-		config, "config");
-static cmdline_parse_token_num_t cmd_pctype_mapping_update_port_id =
-	TOKEN_NUM_INITIALIZER(struct cmd_pctype_mapping_update_result,
-		port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_pctype =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
-		pctype, "pctype");
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_mapping =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
-		mapping, "mapping");
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_update =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
-		update, "update");
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_pc_type =
-	TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
-		pctype_list, NULL);
-static cmdline_parse_token_num_t cmd_pctype_mapping_update_flow_type =
-	TOKEN_NUM_INITIALIZER(struct cmd_pctype_mapping_update_result,
-		flow_type, RTE_UINT16);
-
-static void
-cmd_pctype_mapping_update_parsed(void *parsed_result,
-	__rte_unused struct cmdline *cl,
-	__rte_unused void *data)
-{
-	struct cmd_pctype_mapping_update_result *res = parsed_result;
-	int ret = -ENOTSUP;
-	struct rte_pmd_i40e_flow_type_mapping mapping;
-	unsigned int i;
-	unsigned int nb_item;
-	unsigned int pctype_list[RTE_PMD_I40E_PCTYPE_MAX];
-
-	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
-		return;
-
-	nb_item = parse_item_list(res->pctype_list, "pctypes", RTE_PMD_I40E_PCTYPE_MAX,
-		pctype_list, 1);
-	mapping.flow_type = res->flow_type;
-	for (i = 0, mapping.pctype = 0ULL; i < nb_item; i++)
-		mapping.pctype |= (1ULL << pctype_list[i]);
-	ret = rte_pmd_i40e_flow_type_mapping_update(res->port_id,
-						&mapping,
-						1,
-						0);
-	switch (ret) {
-	case 0:
-		break;
-	case -EINVAL:
-		fprintf(stderr, "invalid pctype or flow type\n");
-		break;
-	case -ENODEV:
-		fprintf(stderr, "invalid port_id %d\n", res->port_id);
-		break;
-	case -ENOTSUP:
-		fprintf(stderr, "function not implemented\n");
-		break;
-	default:
-		fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
-	}
-}
-
-static cmdline_parse_inst_t cmd_pctype_mapping_update = {
-	.f = cmd_pctype_mapping_update_parsed,
-	.data = NULL,
-	.help_str = "port config <port_id> pctype mapping update"
-	" <pctype_id_0,[pctype_id_1]*> <flowtype_id>",
-	.tokens = {
-		(void *)&cmd_pctype_mapping_update_port,
-		(void *)&cmd_pctype_mapping_update_config,
-		(void *)&cmd_pctype_mapping_update_port_id,
-		(void *)&cmd_pctype_mapping_update_pctype,
-		(void *)&cmd_pctype_mapping_update_mapping,
-		(void *)&cmd_pctype_mapping_update_update,
-		(void *)&cmd_pctype_mapping_update_pc_type,
-		(void *)&cmd_pctype_mapping_update_flow_type,
-		NULL,
-	},
-};
-
 /* ptype mapping get */
 
 /* Common result structure for ptype mapping get */
@@ -2553,13 +1947,6 @@ static struct testpmd_driver_commands i40e_cmds = {
 		"show port (port_id) queue-region\n"
 		"    show all queue region related configuration info\n",
 	},
-	{
-		&cmd_add_del_raw_flow_director,
-		"flow_director_filter (port_id) mode raw (add|del|update)"
-		" flow (flow_id) (drop|fwd) queue (queue_id)"
-		" fd_id (fd_id_value) packet (packet file name)\n"
-		"    Add/Del a raw type flow director filter.\n",
-	},
 	{
 		&cmd_set_vf_promisc,
 		"set vf promisc (port_id) (vf_id) (on|off)\n"
@@ -2620,19 +2007,6 @@ static struct testpmd_driver_commands i40e_cmds = {
 		"ddp get info (profile_path)\n"
 		"    Get ddp profile information.\n",
 	},
-	{
-		&cmd_cfg_input_set,
-		"port config (port_id) pctype (pctype_id) hash_inset|"
-		"fdir_inset|fdir_flx_inset get|set|clear field\n"
-		" (field_idx)\n"
-		"    Configure RSS|FDIR|FDIR_FLX input set for some pctype\n",
-	},
-	{
-		&cmd_clear_input_set,
-		"port config (port_id) pctype (pctype_id) hash_inset|"
-		"fdir_inset|fdir_flx_inset clear all\n"
-		"    Clear RSS|FDIR|FDIR_FLX input set completely for some pctype\n",
-	},
 	{
 		&cmd_ptype_mapping_get,
 		"ptype mapping get (port_id) (valid_only)\n"
@@ -2653,22 +2027,6 @@ static struct testpmd_driver_commands i40e_cmds = {
 		"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
 		"    Update a ptype mapping item on a port\n",
 	},
-	{
-		&cmd_pctype_mapping_get,
-		"show port (port_id) pctype mapping\n"
-		"    Get flow ptype to pctype mapping on a port\n",
-	},
-	{
-		&cmd_pctype_mapping_reset,
-		"port config (port_id) pctype mapping reset\n"
-		"    Reset flow type to pctype mapping on a port\n",
-	},
-	{
-		&cmd_pctype_mapping_update,
-		"port config (port_id) pctype mapping update"
-		" (pctype_id_0[,pctype_id_1]*) (flow_type_id)\n"
-		"    Update a flow type to pctype mapping item on a port\n",
-	},
 	{
 		&cmd_config_src_prune_all,
 		"port config all i40e_src_prune (on|off)\n"
-- 
2.53.0


^ permalink raw reply related

* [RFC 3/8] net/i40e: deprecate legacy flow filter API
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Bruce Richardson
In-Reply-To: <20260528213816.562910-1-stephen@networkplumber.org>

The i40e PMD-private filter configuration API in rte_pmd_i40e.h predates
the rte_flow API and duplicates functionality now expressed as rte_flow
rules. Mark the legacy entry points as deprecated so they can be removed
in DPDK 26.11.

The two functions taking public rte_eth_fdir_* types
(rte_pmd_i40e_get_fdir_info, rte_pmd_i40e_get_fdir_stats) are already
marked __rte_experimental and will be removed alongside the ethdev
fdir struct family in 26.11; they need no separate deprecation notice.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/rel_notes/deprecation.rst  |  3 +
 drivers/net/intel/i40e/rte_pmd_i40e.h | 80 ++++++++++++++++++++++++++-
 2 files changed, 82 insertions(+), 1 deletion(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 17f90a6352..d152e76fdc 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -158,3 +158,6 @@ Deprecation Notices
 * net/iavf: The dynamic mbuf field used to detect LLDP packets on the
   transmit path in the iavf PMD will be removed in a future release.
   After removal, only packet type-based detection will be supported.
+
+* net/i40e: The legacy filter configuration API in ``rte_pmd_i40e.h``,
+  superseded by the ``rte_flow`` API, will be removed in DPDK 26.11.
diff --git a/drivers/net/intel/i40e/rte_pmd_i40e.h b/drivers/net/intel/i40e/rte_pmd_i40e.h
index 5af7e2330f..5dcca91264 100644
--- a/drivers/net/intel/i40e/rte_pmd_i40e.h
+++ b/drivers/net/intel/i40e/rte_pmd_i40e.h
@@ -229,6 +229,9 @@ struct rte_pmd_i40e_queue_regions {
 };
 
 /**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
  * Behavior will be taken if raw packet template is matched.
  */
 enum rte_pmd_i40e_pkt_template_behavior {
@@ -238,7 +241,10 @@ enum rte_pmd_i40e_pkt_template_behavior {
 };
 
 /**
- * Flow director report status
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
+ * Flow director report status.
  * It defines what will be reported if raw packet template is matched.
  */
 enum rte_pmd_i40e_pkt_template_status {
@@ -253,6 +259,9 @@ enum rte_pmd_i40e_pkt_template_status {
 };
 
 /**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
  * A structure used to define an action when raw packet template is matched.
  */
 struct rte_pmd_i40e_pkt_template_action {
@@ -271,6 +280,9 @@ struct rte_pmd_i40e_pkt_template_action {
 };
 
 /**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
  * A structure used to define the input for raw packet template.
  */
 struct rte_pmd_i40e_pkt_template_input {
@@ -283,6 +295,9 @@ struct rte_pmd_i40e_pkt_template_input {
 };
 
 /**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
  * A structure used to define the configuration parameters
  * for raw packet template.
  */
@@ -295,6 +310,10 @@ struct rte_pmd_i40e_pkt_template_conf {
 	uint32_t soft_id;
 };
 
+/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ */
 enum rte_pmd_i40e_inset_type {
 	INSET_NONE = 0,
 	INSET_HASH,
@@ -307,6 +326,10 @@ struct  rte_pmd_i40e_inset_mask {
 	uint16_t mask;
 };
 
+/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ */
 struct rte_pmd_i40e_inset {
 	uint64_t inset;
 	struct rte_pmd_i40e_inset_mask mask[2];
@@ -326,7 +349,12 @@ struct rte_pmd_i40e_inset {
  *   - (-ENODEV) if *port* invalid.
  *   - (-EINVAL) if *conf* invalid.
  *   - (-ENOTSUP) not supported by firmware.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
  */
+__rte_deprecated
 int rte_pmd_i40e_flow_add_del_packet_template(
 			uint16_t port,
 			const struct rte_pmd_i40e_pkt_template_conf *conf,
@@ -865,6 +893,10 @@ int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
 #define RTE_PMD_I40E_PCTYPE_MAX		64
 #define RTE_PMD_I40E_FLOW_TYPE_MAX	64
 
+/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ */
 struct rte_pmd_i40e_flow_type_mapping {
 	uint16_t flow_type; /**< software defined flow type*/
 	uint64_t pctype;    /**< hardware defined pctype */
@@ -886,7 +918,12 @@ struct rte_pmd_i40e_flow_type_mapping {
  *	keep other PCTYPEs mapping unchanged.
  *    -(!0) overwrite referred PCTYPE mapping,
  *	set other PCTYPEs maps to PCTYPE_INVALID.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
  */
+__rte_deprecated
 int rte_pmd_i40e_flow_type_mapping_update(
 			uint16_t port,
 			struct rte_pmd_i40e_flow_type_mapping *mapping_items,
@@ -903,7 +940,12 @@ int rte_pmd_i40e_flow_type_mapping_update(
  *    the base address of the array to store returned items.
  *    array should be allocated by caller with minimum size of
  *    RTE_PMD_I40E_FLOW_TYPE_MAX items
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
  */
+__rte_deprecated
 int rte_pmd_i40e_flow_type_mapping_get(
 			uint16_t port,
 			struct rte_pmd_i40e_flow_type_mapping *mapping_items);
@@ -914,7 +956,12 @@ int rte_pmd_i40e_flow_type_mapping_get(
  *
  * @param port
  *    pointer to port identifier of the device
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
  */
+__rte_deprecated
 int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port);
 
 /**
@@ -946,6 +993,12 @@ int rte_pmd_i40e_query_vfid_by_mac(uint16_t port,
 int rte_pmd_i40e_rss_queue_region_conf(uint16_t port_id,
 			enum rte_pmd_i40e_queue_region_op op_type, void *arg);
 
+/**
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
+ */
+__rte_deprecated
 int rte_pmd_i40e_cfg_hash_inset(uint16_t port,
 				uint64_t pctype, uint64_t inset);
 
@@ -965,7 +1018,12 @@ int rte_pmd_i40e_cfg_hash_inset(uint16_t port,
  *   - (-ENODEV) if *port* invalid.
  *   - (-EINVAL) if bad parameter.
  *   - (-ENOTSUP) if operation not supported.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
  */
+__rte_deprecated
 int rte_pmd_i40e_inset_get(uint16_t port, uint8_t pctype,
 			   struct rte_pmd_i40e_inset *inset,
 			   enum rte_pmd_i40e_inset_type inset_type);
@@ -986,7 +1044,12 @@ int rte_pmd_i40e_inset_get(uint16_t port, uint8_t pctype,
  *   - (-ENODEV) if *port* invalid.
  *   - (-EINVAL) if bad parameter.
  *   - (-ENOTSUP) if operation not supported.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
  */
+__rte_deprecated
 int rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
 			   struct rte_pmd_i40e_inset *inset,
 			   enum rte_pmd_i40e_inset_type inset_type);
@@ -1001,7 +1064,12 @@ int rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
  * @return
  *   - (1) if set.
  *   - (0) if cleared.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
  */
+__rte_deprecated
 static inline int
 rte_pmd_i40e_inset_field_get(uint64_t inset, uint8_t field_idx)
 {
@@ -1027,7 +1095,12 @@ rte_pmd_i40e_inset_field_get(uint64_t inset, uint8_t field_idx)
  * @return
  *   - (-1) if failed.
  *   - (0) if success.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
  */
+__rte_deprecated
 static inline int
 rte_pmd_i40e_inset_field_set(uint64_t *inset, uint8_t field_idx)
 {
@@ -1052,7 +1125,12 @@ rte_pmd_i40e_inset_field_set(uint64_t *inset, uint8_t field_idx)
  * @return
  *   - (-1) if failed.
  *   - (0) if success.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
  */
+__rte_deprecated
 static inline int
 rte_pmd_i40e_inset_field_clear(uint64_t *inset, uint8_t field_idx)
 {
-- 
2.53.0


^ permalink raw reply related

* [RFC 4/8] net/i40e: remove experimental FDIR API
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Bruce Richardson
In-Reply-To: <20260528213816.562910-1-stephen@networkplumber.org>

Remove the flow director related private APIs in i40e.

These APIs are experimental, therefore they can be removed
without deprecation warning.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/intel/i40e/i40e_ethdev.c  |   4 +-
 drivers/net/intel/i40e/i40e_ethdev.h  |   4 -
 drivers/net/intel/i40e/i40e_fdir.c    | 140 --------------------------
 drivers/net/intel/i40e/i40e_flow.c    |   3 +-
 drivers/net/intel/i40e/rte_pmd_i40e.c |  34 -------
 drivers/net/intel/i40e/rte_pmd_i40e.h |  33 ------
 6 files changed, 3 insertions(+), 215 deletions(-)

diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index e818b6fc7c..207339cc8d 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -9309,8 +9309,8 @@ i40e_get_valid_input_set(enum i40e_filter_pctype pctype,
 	};
 
 	/**
-	 * Flow director supports only fields defined in
-	 * union rte_eth_fdir_flow.
+	 * Flow director supports only fields reachable through
+	 * rte_flow item patterns.
 	 */
 	static const uint64_t valid_fdir_inset_table[] = {
 		[I40E_FILTER_PCTYPE_FRAG_IPV4] =
diff --git a/drivers/net/intel/i40e/i40e_ethdev.h b/drivers/net/intel/i40e/i40e_ethdev.h
index d57c53f661..fecbd67f15 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.h
+++ b/drivers/net/intel/i40e/i40e_ethdev.h
@@ -1366,10 +1366,6 @@ enum i40e_filter_pctype
 uint16_t i40e_pctype_to_flowtype(const struct i40e_adapter *adapter,
 				 enum i40e_filter_pctype pctype);
 int i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len);
-void i40e_fdir_info_get(struct rte_eth_dev *dev,
-			struct rte_eth_fdir_info *fdir);
-void i40e_fdir_stats_get(struct rte_eth_dev *dev,
-			 struct rte_eth_fdir_stats *stat);
 int i40e_select_filter_input_set(struct i40e_hw *hw,
 				 struct rte_eth_input_set_conf *conf,
 				 enum rte_filter_type filter);
diff --git a/drivers/net/intel/i40e/i40e_fdir.c b/drivers/net/intel/i40e/i40e_fdir.c
index ad256a5a11..c1acf389bf 100644
--- a/drivers/net/intel/i40e/i40e_fdir.c
+++ b/drivers/net/intel/i40e/i40e_fdir.c
@@ -1793,146 +1793,6 @@ i40e_fdir_flush(struct rte_eth_dev *dev)
 	return 0;
 }
 
-static inline void
-i40e_fdir_info_get_flex_set(struct i40e_pf *pf,
-			struct rte_eth_flex_payload_cfg *flex_set,
-			uint16_t *num)
-{
-	struct i40e_fdir_flex_pit *flex_pit;
-	struct rte_eth_flex_payload_cfg *ptr = flex_set;
-	uint16_t src, dst, size, j, k;
-	uint8_t i, layer_idx;
-
-	for (layer_idx = I40E_FLXPLD_L2_IDX;
-	     layer_idx <= I40E_FLXPLD_L4_IDX;
-	     layer_idx++) {
-		if (layer_idx == I40E_FLXPLD_L2_IDX)
-			ptr->type = RTE_ETH_L2_PAYLOAD;
-		else if (layer_idx == I40E_FLXPLD_L3_IDX)
-			ptr->type = RTE_ETH_L3_PAYLOAD;
-		else if (layer_idx == I40E_FLXPLD_L4_IDX)
-			ptr->type = RTE_ETH_L4_PAYLOAD;
-
-		for (i = 0; i < I40E_MAX_FLXPLD_FIED; i++) {
-			flex_pit = &pf->fdir.flex_set[layer_idx *
-				I40E_MAX_FLXPLD_FIED + i];
-			if (flex_pit->size == 0)
-				continue;
-			src = flex_pit->src_offset * sizeof(uint16_t);
-			dst = flex_pit->dst_offset * sizeof(uint16_t);
-			size = flex_pit->size * sizeof(uint16_t);
-			for (j = src, k = dst; j < src + size; j++, k++)
-				ptr->src_offset[k] = j;
-		}
-		(*num)++;
-		ptr++;
-	}
-}
-
-static inline void
-i40e_fdir_info_get_flex_mask(struct i40e_pf *pf,
-			struct rte_eth_fdir_flex_mask *flex_mask,
-			uint16_t *num)
-{
-	struct i40e_fdir_flex_mask *mask;
-	struct rte_eth_fdir_flex_mask *ptr = flex_mask;
-	uint16_t flow_type;
-	uint8_t i, j;
-	uint16_t off_bytes, mask_tmp;
-
-	for (i = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
-	     i <= I40E_FILTER_PCTYPE_L2_PAYLOAD;
-	     i++) {
-		mask =  &pf->fdir.flex_mask[i];
-		flow_type = i40e_pctype_to_flowtype(pf->adapter,
-						    (enum i40e_filter_pctype)i);
-		if (flow_type == RTE_ETH_FLOW_UNKNOWN)
-			continue;
-
-		for (j = 0; j < I40E_FDIR_MAX_FLEXWORD_NUM; j++) {
-			if (mask->word_mask & I40E_FLEX_WORD_MASK(j)) {
-				ptr->mask[j * sizeof(uint16_t)] = UINT8_MAX;
-				ptr->mask[j * sizeof(uint16_t) + 1] = UINT8_MAX;
-			} else {
-				ptr->mask[j * sizeof(uint16_t)] = 0x0;
-				ptr->mask[j * sizeof(uint16_t) + 1] = 0x0;
-			}
-		}
-		for (j = 0; j < I40E_FDIR_BITMASK_NUM_WORD; j++) {
-			off_bytes = mask->bitmask[j].offset * sizeof(uint16_t);
-			mask_tmp = ~mask->bitmask[j].mask;
-			ptr->mask[off_bytes] &= I40E_HI_BYTE(mask_tmp);
-			ptr->mask[off_bytes + 1] &= I40E_LO_BYTE(mask_tmp);
-		}
-		ptr->flow_type = flow_type;
-		ptr++;
-		(*num)++;
-	}
-}
-
-/*
- * i40e_fdir_info_get - get information of Flow Director
- * @pf: ethernet device to get info from
- * @fdir: a pointer to a structure of type *rte_eth_fdir_info* to be filled with
- *    the flow director information.
- */
-void
-i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir)
-{
-	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
-	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
-	uint16_t num_flex_set = 0;
-	uint16_t num_flex_mask = 0;
-	uint16_t i;
-
-	fdir->mode = RTE_FDIR_MODE_NONE;
-
-	fdir->guarant_spc =
-		(uint32_t)hw->func_caps.fd_filters_guaranteed;
-	fdir->best_spc =
-		(uint32_t)hw->func_caps.fd_filters_best_effort;
-	fdir->max_flexpayload = I40E_FDIR_MAX_FLEX_LEN;
-	fdir->flow_types_mask[0] = I40E_FDIR_FLOWS;
-	for (i = 1; i < RTE_FLOW_MASK_ARRAY_SIZE; i++)
-		fdir->flow_types_mask[i] = 0ULL;
-	fdir->flex_payload_unit = sizeof(uint16_t);
-	fdir->flex_bitmask_unit = sizeof(uint16_t);
-	fdir->max_flex_payload_segment_num = I40E_MAX_FLXPLD_FIED;
-	fdir->flex_payload_limit = I40E_MAX_FLX_SOURCE_OFF;
-	fdir->max_flex_bitmask_num = I40E_FDIR_BITMASK_NUM_WORD;
-
-	i40e_fdir_info_get_flex_set(pf,
-				fdir->flex_conf.flex_set,
-				&num_flex_set);
-	i40e_fdir_info_get_flex_mask(pf,
-				fdir->flex_conf.flex_mask,
-				&num_flex_mask);
-
-	fdir->flex_conf.nb_payloads = num_flex_set;
-	fdir->flex_conf.nb_flexmasks = num_flex_mask;
-}
-
-/*
- * i40e_fdir_stat_get - get statistics of Flow Director
- * @pf: ethernet device to get info from
- * @stat: a pointer to a structure of type *rte_eth_fdir_stats* to be filled with
- *    the flow director statistics.
- */
-void
-i40e_fdir_stats_get(struct rte_eth_dev *dev, struct rte_eth_fdir_stats *stat)
-{
-	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
-	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
-	uint32_t fdstat;
-
-	fdstat = I40E_READ_REG(hw, I40E_PFQF_FDSTAT);
-	stat->guarant_cnt =
-		(uint32_t)((fdstat & I40E_PFQF_FDSTAT_GUARANT_CNT_MASK) >>
-			    I40E_PFQF_FDSTAT_GUARANT_CNT_SHIFT);
-	stat->best_cnt =
-		(uint32_t)((fdstat & I40E_PFQF_FDSTAT_BEST_CNT_MASK) >>
-			    I40E_PFQF_FDSTAT_BEST_CNT_SHIFT);
-}
 
 /* Restore flow director filter */
 void
diff --git a/drivers/net/intel/i40e/i40e_flow.c b/drivers/net/intel/i40e/i40e_flow.c
index c8eaa2b2e5..1ebc3e8fef 100644
--- a/drivers/net/intel/i40e/i40e_flow.c
+++ b/drivers/net/intel/i40e/i40e_flow.c
@@ -2461,8 +2461,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 
 			for (i = 0; i < raw_spec->length; i++) {
 				j = i + next_dst_off;
-				if (j >= RTE_ETH_FDIR_MAX_FLEXLEN ||
-						j >= I40E_FDIR_MAX_FLEX_LEN)
+				if (j >= I40E_FDIR_MAX_FLEX_LEN)
 					break;
 				filter->input.flow_ext.flexbytes[j] =
 					raw_spec->pattern[i];
diff --git a/drivers/net/intel/i40e/rte_pmd_i40e.c b/drivers/net/intel/i40e/rte_pmd_i40e.c
index 2e7943ef8b..e47c1aa9d7 100644
--- a/drivers/net/intel/i40e/rte_pmd_i40e.c
+++ b/drivers/net/intel/i40e/rte_pmd_i40e.c
@@ -3219,40 +3219,6 @@ rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
 	return 0;
 }
 
-RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_i40e_get_fdir_info, 20.08)
-int
-rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info)
-{
-	struct rte_eth_dev *dev;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
-
-	dev = &rte_eth_devices[port];
-	if (!is_i40e_supported(dev))
-		return -ENOTSUP;
-
-	i40e_fdir_info_get(dev, fdir_info);
-
-	return 0;
-}
-
-RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_i40e_get_fdir_stats, 20.08)
-int
-rte_pmd_i40e_get_fdir_stats(uint16_t port, struct rte_eth_fdir_stats *fdir_stat)
-{
-	struct rte_eth_dev *dev;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
-
-	dev = &rte_eth_devices[port];
-	if (!is_i40e_supported(dev))
-		return -ENOTSUP;
-
-	i40e_fdir_stats_get(dev, fdir_stat);
-
-	return 0;
-}
-
 RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_i40e_set_gre_key_len, 20.08)
 int
 rte_pmd_i40e_set_gre_key_len(uint16_t port, uint8_t len)
diff --git a/drivers/net/intel/i40e/rte_pmd_i40e.h b/drivers/net/intel/i40e/rte_pmd_i40e.h
index 5dcca91264..097ff4b58d 100644
--- a/drivers/net/intel/i40e/rte_pmd_i40e.h
+++ b/drivers/net/intel/i40e/rte_pmd_i40e.h
@@ -1145,39 +1145,6 @@ rte_pmd_i40e_inset_field_clear(uint64_t *inset, uint8_t field_idx)
 	return 0;
 }
 
-/**
- * Get port fdir info
- *
- * @param port
- *   The port identifier of the Ethernet device.
- * @param fdir_info
- *   The fdir info of the port
- * @return
- *   - (0) if successful.
- *   - (-ENODEV) if *port* invalid.
- *   - (-ENOTSUP) if operation not supported.
- */
-__rte_experimental
-int
-rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
-
-/**
- * Get port fdir status
- *
- * @param port
- *   The port identifier of the Ethernet device.
- * @param fdir_stat
- *   The fdir status of the port
- * @return
- *   - (0) if successful.
- *   - (-ENODEV) if *port* invalid.
- *   - (-ENOTSUP) if operation not supported.
- */
-__rte_experimental
-int
-rte_pmd_i40e_get_fdir_stats(uint16_t port,
-			    struct rte_eth_fdir_stats *fdir_stat);
-
 /**
  * Set GRE key length
  *
-- 
2.53.0


^ permalink raw reply related

* [RFC 5/8] net/ixgbe: remove experimental FDIR API
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Anatoly Burakov, Vladimir Medvedkin
In-Reply-To: <20260528213816.562910-1-stephen@networkplumber.org>

Remove the flow director related private APIs in ixgbe.

These APIs are experimental therefore they can be removed
without deprecation warning.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/intel/ixgbe/ixgbe_ethdev.h  |   5 -
 drivers/net/intel/ixgbe/ixgbe_fdir.c    | 117 ------------------------
 drivers/net/intel/ixgbe/rte_pmd_ixgbe.c |  34 -------
 drivers/net/intel/ixgbe/rte_pmd_ixgbe.h |  32 -------
 4 files changed, 188 deletions(-)

diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.h b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
index 5d3243cb4d..c290f04611 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
@@ -717,11 +717,6 @@ int ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
 		struct rte_eth_fdir_conf *fdir_conf,
 		struct ixgbe_fdir_rule *rule,
 		bool del, bool update);
-void ixgbe_fdir_info_get(struct rte_eth_dev *dev,
-			 struct rte_eth_fdir_info *fdir_info);
-void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
-			  struct rte_eth_fdir_stats *fdir_stats);
-
 void ixgbe_configure_dcb(struct rte_eth_dev *dev);
 
 int
diff --git a/drivers/net/intel/ixgbe/ixgbe_fdir.c b/drivers/net/intel/ixgbe/ixgbe_fdir.c
index b32dc54287..20cc72ffcd 100644
--- a/drivers/net/intel/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/intel/ixgbe/ixgbe_fdir.c
@@ -1202,123 +1202,6 @@ ixgbe_fdir_flush(struct rte_eth_dev *dev)
 	return ret;
 }
 
-#define FDIRENTRIES_NUM_SHIFT 10
-void
-ixgbe_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir_info)
-{
-	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
-	struct ixgbe_hw_fdir_info *info =
-			IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
-	uint32_t fdirctrl, max_num;
-	uint8_t offset;
-
-	fdirctrl = IXGBE_READ_REG(hw, IXGBE_FDIRCTRL);
-	offset = ((fdirctrl & IXGBE_FDIRCTRL_FLEX_MASK) >>
-			IXGBE_FDIRCTRL_FLEX_SHIFT) * sizeof(uint16_t);
-
-	fdir_info->mode = fdir_conf->mode;
-	max_num = (1 << (FDIRENTRIES_NUM_SHIFT +
-			(fdirctrl & FDIRCTRL_PBALLOC_MASK)));
-	if (fdir_info->mode >= RTE_FDIR_MODE_PERFECT &&
-	    fdir_info->mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
-		fdir_info->guarant_spc = max_num;
-	else if (fdir_info->mode == RTE_FDIR_MODE_SIGNATURE)
-		fdir_info->guarant_spc = max_num * 4;
-
-	fdir_info->mask.vlan_tci_mask = info->mask.vlan_tci_mask;
-	fdir_info->mask.ipv4_mask.src_ip = info->mask.src_ipv4_mask;
-	fdir_info->mask.ipv4_mask.dst_ip = info->mask.dst_ipv4_mask;
-	IPV6_MASK_TO_ADDR(info->mask.src_ipv6_mask,
-			fdir_info->mask.ipv6_mask.src_ip);
-	IPV6_MASK_TO_ADDR(info->mask.dst_ipv6_mask,
-			fdir_info->mask.ipv6_mask.dst_ip);
-	fdir_info->mask.src_port_mask = info->mask.src_port_mask;
-	fdir_info->mask.dst_port_mask = info->mask.dst_port_mask;
-	fdir_info->mask.mac_addr_byte_mask = info->mask.mac_addr_byte_mask;
-	fdir_info->mask.tunnel_id_mask = info->mask.tunnel_id_mask;
-	fdir_info->mask.tunnel_type_mask = info->mask.tunnel_type_mask;
-	fdir_info->max_flexpayload = IXGBE_FDIR_MAX_FLEX_LEN;
-
-	if (fdir_info->mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN ||
-	    fdir_info->mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
-		fdir_info->flow_types_mask[0] = 0ULL;
-	else
-		fdir_info->flow_types_mask[0] = IXGBE_FDIR_FLOW_TYPES;
-	for (uint32_t i = 1; i < RTE_FLOW_MASK_ARRAY_SIZE; i++)
-		fdir_info->flow_types_mask[i] = 0ULL;
-
-	fdir_info->flex_payload_unit = sizeof(uint16_t);
-	fdir_info->max_flex_payload_segment_num = 1;
-	fdir_info->flex_payload_limit = IXGBE_MAX_FLX_SOURCE_OFF;
-	fdir_info->flex_conf.nb_payloads = 1;
-	fdir_info->flex_conf.flex_set[0].type = RTE_ETH_RAW_PAYLOAD;
-	fdir_info->flex_conf.flex_set[0].src_offset[0] = offset;
-	fdir_info->flex_conf.flex_set[0].src_offset[1] = offset + 1;
-	fdir_info->flex_conf.nb_flexmasks = 1;
-	fdir_info->flex_conf.flex_mask[0].flow_type = RTE_ETH_FLOW_UNKNOWN;
-	fdir_info->flex_conf.flex_mask[0].mask[0] =
-			(uint8_t)(info->mask.flex_bytes_mask & 0x00FF);
-	fdir_info->flex_conf.flex_mask[0].mask[1] =
-			(uint8_t)((info->mask.flex_bytes_mask & 0xFF00) >> 8);
-}
-
-void
-ixgbe_fdir_stats_get(struct rte_eth_dev *dev, struct rte_eth_fdir_stats *fdir_stats)
-{
-	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
-	struct ixgbe_hw_fdir_info *info =
-		IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
-	uint32_t reg, max_num;
-	enum rte_fdir_mode fdir_mode = fdir_conf->mode;
-
-	/* Get the information from registers */
-	reg = IXGBE_READ_REG(hw, IXGBE_FDIRFREE);
-	info->collision = (uint16_t)((reg & IXGBE_FDIRFREE_COLL_MASK) >>
-				     IXGBE_FDIRFREE_COLL_SHIFT);
-	info->free = (uint16_t)((reg & IXGBE_FDIRFREE_FREE_MASK) >>
-				IXGBE_FDIRFREE_FREE_SHIFT);
-
-	reg = IXGBE_READ_REG(hw, IXGBE_FDIRLEN);
-	info->maxhash = (uint16_t)((reg & IXGBE_FDIRLEN_MAXHASH_MASK) >>
-				   IXGBE_FDIRLEN_MAXHASH_SHIFT);
-	info->maxlen  = (uint8_t)((reg & IXGBE_FDIRLEN_MAXLEN_MASK) >>
-				  IXGBE_FDIRLEN_MAXLEN_SHIFT);
-
-	reg = IXGBE_READ_REG(hw, IXGBE_FDIRUSTAT);
-	info->remove += (reg & IXGBE_FDIRUSTAT_REMOVE_MASK) >>
-		IXGBE_FDIRUSTAT_REMOVE_SHIFT;
-	info->add += (reg & IXGBE_FDIRUSTAT_ADD_MASK) >>
-		IXGBE_FDIRUSTAT_ADD_SHIFT;
-
-	reg = IXGBE_READ_REG(hw, IXGBE_FDIRFSTAT) & 0xFFFF;
-	info->f_remove += (reg & IXGBE_FDIRFSTAT_FREMOVE_MASK) >>
-		IXGBE_FDIRFSTAT_FREMOVE_SHIFT;
-	info->f_add += (reg & IXGBE_FDIRFSTAT_FADD_MASK) >>
-		IXGBE_FDIRFSTAT_FADD_SHIFT;
-
-	/*  Copy the new information in the fdir parameter */
-	fdir_stats->collision = info->collision;
-	fdir_stats->free = info->free;
-	fdir_stats->maxhash = info->maxhash;
-	fdir_stats->maxlen = info->maxlen;
-	fdir_stats->remove = info->remove;
-	fdir_stats->add = info->add;
-	fdir_stats->f_remove = info->f_remove;
-	fdir_stats->f_add = info->f_add;
-
-	reg = IXGBE_READ_REG(hw, IXGBE_FDIRCTRL);
-	max_num = (1 << (FDIRENTRIES_NUM_SHIFT +
-			 (reg & FDIRCTRL_PBALLOC_MASK)));
-	if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
-	    fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
-		fdir_stats->guarant_cnt = max_num - fdir_stats->free;
-	else if (fdir_mode == RTE_FDIR_MODE_SIGNATURE)
-		fdir_stats->guarant_cnt = max_num * 4 - fdir_stats->free;
-
-}
-
 /* restore flow director filter */
 void
 ixgbe_fdir_filter_restore(struct rte_eth_dev *dev)
diff --git a/drivers/net/intel/ixgbe/rte_pmd_ixgbe.c b/drivers/net/intel/ixgbe/rte_pmd_ixgbe.c
index 30dec57be8..c1f923b100 100644
--- a/drivers/net/intel/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/intel/ixgbe/rte_pmd_ixgbe.c
@@ -1176,37 +1176,3 @@ rte_pmd_ixgbe_mdio_unlocked_write(uint16_t port, uint32_t reg_addr,
 	return 0;
 }
 
-RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_ixgbe_get_fdir_info, 20.08)
-int
-rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info)
-{
-	struct rte_eth_dev *dev;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
-
-	dev = &rte_eth_devices[port];
-	if (!is_ixgbe_supported(dev))
-		return -ENOTSUP;
-
-	ixgbe_fdir_info_get(dev, fdir_info);
-
-	return 0;
-}
-
-RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_ixgbe_get_fdir_stats, 20.08)
-int
-rte_pmd_ixgbe_get_fdir_stats(uint16_t port,
-			     struct rte_eth_fdir_stats *fdir_stats)
-{
-	struct rte_eth_dev *dev;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
-
-	dev = &rte_eth_devices[port];
-	if (!is_ixgbe_supported(dev))
-		return -ENOTSUP;
-
-	ixgbe_fdir_stats_get(dev, fdir_stats);
-
-	return 0;
-}
diff --git a/drivers/net/intel/ixgbe/rte_pmd_ixgbe.h b/drivers/net/intel/ixgbe/rte_pmd_ixgbe.h
index 7ca1126cfb..74bb5aa140 100644
--- a/drivers/net/intel/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/intel/ixgbe/rte_pmd_ixgbe.h
@@ -724,36 +724,4 @@ enum {
 int
 rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable);
 
-/**
- * Get port fdir info
- *
- * @param port
- *   The port identifier of the Ethernet device.
- * @param fdir_info
- *   The fdir info of the port
- * @return
- *   - (0) if successful.
- *   - (-ENODEV) if *port* invalid.
- *   - (-ENOTSUP) if operation not supported.
- */
-__rte_experimental
-int
-rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
-
-/**
- * Get port fdir status
- *
- * @param port
- *   The port identifier of the Ethernet device.
- * @param fdir_stats
- *   The fdir status of the port
- * @return
- *   - (0) if successful.
- *   - (-ENODEV) if *port* invalid.
- *   - (-ENOTSUP) if operation not supported.
- */
-__rte_experimental
-int
-rte_pmd_ixgbe_get_fdir_stats(uint16_t port,
-			     struct rte_eth_fdir_stats *fdir_stats);
 #endif /* _PMD_IXGBE_H_ */
-- 
2.53.0


^ permalink raw reply related

* [RFC 6/8] doc: announce legacy flow director deprecation
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger
In-Reply-To: <20260528213816.562910-1-stephen@networkplumber.org>

Add the formal deprecation notice for the legacy flow director API
and the matching 26.07 release note.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/rel_notes/deprecation.rst   |  7 +++++++
 doc/guides/rel_notes/release_26_07.rst | 14 ++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index d152e76fdc..5e2949d153 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -131,6 +131,13 @@ Deprecation Notices
   The legacy actions should be removed
   once ``MODIFY_FIELD`` alternative is implemented in drivers.
 
+* ethdev: Legacy flow director API will be removed in DPDK 26.11.
+  This affects: flow director data structures in ``rte_eth_ctrl.h``
+  (``rte_eth_fdir_*`` and ``rte_fdir_*`` types and the associated
+  ``RTE_ETH_FDIR_*`` / ``RTE_FDIR_*`` macros) and the driver-facing
+  definitions in ``ethdev_driver.h`` (``struct rte_eth_fdir_conf``,
+  ``enum rte_eth_fdir_pballoc_type``, ``enum rte_fdir_status_mode``).
+
 * cryptodev: Support for OpenSSL versions earlier than 3.0 is deprecated
   and will be removed. OpenSSL 1.1.1 reached end-of-life in September 2023.
   The minimum supported OpenSSL version will be 3.0,
diff --git a/doc/guides/rel_notes/release_26_07.rst b/doc/guides/rel_notes/release_26_07.rst
index 8b4f8401e2..06689cdcca 100644
--- a/doc/guides/rel_notes/release_26_07.rst
+++ b/doc/guides/rel_notes/release_26_07.rst
@@ -100,6 +100,18 @@ Removed Items
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* Removed legacy flow director artifacts that depended on deprecated API.
+  Users should use ``rte_flow`` API and testpmd ``flow``
+  command instead.
+
+  * app/testpmd: ``show port fdir``, ``clear port fdir``,
+    ``flow_director_filter``, ``port config ... pctype mapping ...``,
+    and ``port config ... hash_inset|fdir_inset|fdir_flx_inset ...``.
+
+  * net/i40e, net/ixgbe: the experimental
+    ``rte_pmd_{i40e,ixgbe}_get_fdir_info()`` and
+    ``rte_pmd_{i40e,ixgbe}_get_fdir_stats()`` functions.
+
 
 API Changes
 -----------
@@ -116,6 +128,8 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* Deprecated the legacy flow director API; removal scheduled for
+  DPDK 26.11. Use the ``rte_flow`` API instead.
 
 ABI Changes
 -----------
-- 
2.53.0


^ permalink raw reply related

* [RFC 7/8] net/ixgbe: privatize legacy flow director types
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Anatoly Burakov, Vladimir Medvedkin
In-Reply-To: <20260528213816.562910-1-stephen@networkplumber.org>

The ixgbe driver uses several legacy ethdev flow director types
(struct rte_eth_fdir_conf, enum rte_fdir_mode, and related) from
<rte_eth_ctrl.h> and <ethdev_driver.h> as its internal IR for
translating rte_flow rules into hardware programming state. These
types are scheduled for removal from ethdev in DPDK 26.11.

Clone the relevant types into ixgbe_ethdev.h with an ixgbe-private
prefix so the driver no longer depends on the legacy ABI. The
embedded rte_eth_ipv4_flow / rte_eth_ipv6_flow types are cloned
too since they live in the same removal candidate set.

enum ixgbe_fdir_pballoc_type already exists in the Intel base
driver (drivers/net/intel/ixgbe/base/ixgbe_type.h) and is reused
as-is. Its values are NONE=0, 64K=1, 128K=2, 256K=3, whereas the
ethdev enum started at 64K=0. The adapter's pballoc field was
previously zero-initialized and relied on the ethdev convention
that 0 means 64K; initialize it explicitly in eth_ixgbe_dev_init()
to preserve that behavior under the base enum.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/intel/ixgbe/ixgbe_ethdev.c        |  12 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |  95 +++++++++++++-
 drivers/net/intel/ixgbe/ixgbe_fdir.c          | 124 +++++++++---------
 drivers/net/intel/ixgbe/ixgbe_flow.c          |  28 ++--
 .../net/intel/ixgbe/ixgbe_rxtx_vec_common.c   |   4 +-
 5 files changed, 177 insertions(+), 86 deletions(-)

diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
index 9dc015dfff..20b7b91cc3 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
@@ -1471,6 +1471,14 @@ static int ixgbe_fdir_filter_init(struct rte_eth_dev *eth_dev)
 	/* drop queue is always fixed */
 	IXGBE_DEV_FDIR_CONF(eth_dev)->drop_queue = IXGBE_FDIR_DROP_QUEUE;
 
+	/*
+	 * Initialize pballoc to 64K. The base driver's
+	 * enum ixgbe_fdir_pballoc_type uses NONE=0, 64K=1, ... so an
+	 * uninitialized (zero) pballoc would be rejected by
+	 * configure_fdir_flags(); set it explicitly here.
+	 */
+	IXGBE_DEV_FDIR_CONF(eth_dev)->pballoc = IXGBE_FDIR_PBALLOC_64K;
+
 	return 0;
 }
 
@@ -2618,7 +2626,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 	struct ixgbe_adapter *adapter =
 		IXGBE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
-	struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+	struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
 	struct ixgbe_vf_info *vfinfo =
 		*IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
@@ -2723,7 +2731,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 	/* Configure DCB hw */
 	ixgbe_configure_dcb(dev);
 
-	if (fdir_conf->mode != RTE_FDIR_MODE_NONE) {
+	if (fdir_conf->mode != IXGBE_FDIR_MODE_NONE) {
 		struct ixgbe_hw_fdir_info *info =
 			IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
 		err = ixgbe_fdir_configure(adapter, fdir_conf, &info->mask);
diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.h b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
index c290f04611..2fc9f8433e 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
@@ -143,8 +143,91 @@
 					 IXGBE_LINK_SPEED_10GB_FULL)
 
 /*
- * Information about the fdir mode.
+ * Privatized flow director configuration types.
+ *
+ * These were cloned from <rte_eth_ctrl.h> and <ethdev_driver.h> so that
+ * ixgbe no longer depends on the legacy ethdev flow director ABI, which
+ * is scheduled for removal in DPDK 26.11. The semantics are unchanged;
+ * only the names are ixgbe-private.
  */
+#define IXGBE_FDIR_MAX_FLEXLEN 16  /**< Max length of flexbytes. */
+
+struct ixgbe_ipv4_flow {
+	uint32_t src_ip;
+	uint32_t dst_ip;
+	uint8_t  tos;
+	uint8_t  ttl;
+	uint8_t  proto;
+};
+
+struct ixgbe_ipv6_flow {
+	uint32_t src_ip[4];
+	uint32_t dst_ip[4];
+	uint8_t  tc;
+	uint8_t  proto;
+	uint8_t  hop_limits;
+};
+
+struct ixgbe_fdir_masks {
+	uint16_t vlan_tci_mask;
+	struct ixgbe_ipv4_flow ipv4_mask;
+	struct ixgbe_ipv6_flow ipv6_mask;
+	uint16_t src_port_mask;
+	uint16_t dst_port_mask;
+	uint8_t  mac_addr_byte_mask;
+	uint32_t tunnel_id_mask;
+	uint8_t  tunnel_type_mask;
+};
+
+enum ixgbe_payload_type {
+	IXGBE_PAYLOAD_UNKNOWN = 0,
+	IXGBE_RAW_PAYLOAD,
+	IXGBE_L2_PAYLOAD,
+	IXGBE_L3_PAYLOAD,
+	IXGBE_L4_PAYLOAD,
+	IXGBE_PAYLOAD_MAX = 8,
+};
+
+struct ixgbe_flex_payload_cfg {
+	enum ixgbe_payload_type type;
+	uint16_t src_offset[IXGBE_FDIR_MAX_FLEXLEN];
+};
+
+struct ixgbe_fdir_flex_mask {
+	uint16_t flow_type;
+	uint8_t  mask[IXGBE_FDIR_MAX_FLEXLEN];
+};
+
+struct ixgbe_fdir_flex_conf {
+	uint16_t nb_payloads;
+	uint16_t nb_flexmasks;
+	struct ixgbe_flex_payload_cfg flex_set[IXGBE_PAYLOAD_MAX];
+	struct ixgbe_fdir_flex_mask flex_mask[RTE_ETH_FLOW_MAX];
+};
+
+enum ixgbe_fdir_mode {
+	IXGBE_FDIR_MODE_NONE = 0,
+	IXGBE_FDIR_MODE_SIGNATURE,
+	IXGBE_FDIR_MODE_PERFECT,
+	IXGBE_FDIR_MODE_PERFECT_MAC_VLAN,
+	IXGBE_FDIR_MODE_PERFECT_TUNNEL,
+};
+
+enum ixgbe_fdir_status_mode {
+	IXGBE_FDIR_NO_REPORT_STATUS = 0,
+	IXGBE_FDIR_REPORT_STATUS,
+	IXGBE_FDIR_REPORT_STATUS_ALWAYS,
+};
+
+struct ixgbe_fdir_conf {
+	enum ixgbe_fdir_mode mode;
+	enum ixgbe_fdir_pballoc_type pballoc;
+	enum ixgbe_fdir_status_mode status;
+	uint8_t drop_queue;
+	struct ixgbe_fdir_masks mask;
+	struct ixgbe_fdir_flex_conf flex_conf;
+};
+
 struct ixgbe_hw_fdir_mask {
 	uint16_t vlan_tci_mask;
 	uint32_t src_ipv4_mask;
@@ -176,7 +259,7 @@ struct ixgbe_fdir_rule {
 	union ixgbe_atr_input ixgbe_fdir; /* key of fdir filter*/
 	bool b_spec; /* If TRUE, ixgbe_fdir, fdirflags, queue have meaning. */
 	bool b_mask; /* If TRUE, mask has meaning. */
-	enum rte_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
+	enum ixgbe_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
 	uint32_t fdirflags; /* drop or forward */
 	uint32_t soft_id; /* an unique value for this rule */
 	uint8_t queue; /* assigned rx queue */
@@ -468,7 +551,7 @@ struct ixgbe_adapter {
 	struct ixgbe_hw_stats       stats;
 	struct ixgbe_macsec_stats   macsec_stats;
 	struct ixgbe_macsec_setting	macsec_setting;
-	struct rte_eth_fdir_conf    fdir_conf;
+	struct ixgbe_fdir_conf    fdir_conf;
 	struct ixgbe_hw_fdir_info   fdir;
 	struct ixgbe_interrupt      intr;
 	struct ixgbe_stat_mapping_registers stat_mappings;
@@ -706,15 +789,15 @@ void ixgbe_filterlist_flush(struct rte_eth_dev *dev);
  * Flow director function prototypes
  */
 int ixgbe_fdir_configure(struct ixgbe_adapter *adapter,
-			 const struct rte_eth_fdir_conf *fdir_conf,
+			 const struct ixgbe_fdir_conf *fdir_conf,
 			 const struct ixgbe_hw_fdir_mask *fdir_mask);
 int ixgbe_fdir_set_input_mask(struct ixgbe_adapter *adapter,
 			      const struct ixgbe_hw_fdir_mask *mask,
-			      enum rte_fdir_mode mode);
+			      enum ixgbe_fdir_mode mode);
 int ixgbe_fdir_set_flexbytes_offset(struct ixgbe_adapter *adapter,
 				    uint16_t offset);
 int ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
-		struct rte_eth_fdir_conf *fdir_conf,
+		struct ixgbe_fdir_conf *fdir_conf,
 		struct ixgbe_fdir_rule *rule,
 		bool del, bool update);
 void ixgbe_configure_dcb(struct rte_eth_dev *dev);
diff --git a/drivers/net/intel/ixgbe/ixgbe_fdir.c b/drivers/net/intel/ixgbe/ixgbe_fdir.c
index 20cc72ffcd..69fd8c674c 100644
--- a/drivers/net/intel/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/intel/ixgbe/ixgbe_fdir.c
@@ -81,23 +81,23 @@
 static int fdir_erase_filter_82599(struct ixgbe_hw *hw, uint32_t fdirhash);
 static int fdir_set_input_mask_82599(struct ixgbe_adapter *adapter,
 		const struct ixgbe_hw_fdir_mask *mask,
-		enum rte_fdir_mode mode);
+		enum ixgbe_fdir_mode mode);
 static int fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
 		const struct ixgbe_hw_fdir_mask *mask,
-		enum rte_fdir_mode mode);
+		enum ixgbe_fdir_mode mode);
 static int ixgbe_set_fdir_flex_conf(struct ixgbe_adapter *adapter,
-		const struct rte_eth_fdir_flex_conf *conf, uint32_t *fdirctrl);
+		const struct ixgbe_fdir_flex_conf *conf, uint32_t *fdirctrl);
 static int fdir_enable_82599(struct ixgbe_hw *hw, uint32_t fdirctrl);
 static uint32_t ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input,
 				 uint32_t key);
 static uint32_t atr_compute_sig_hash_82599(union ixgbe_atr_input *input,
-		enum rte_eth_fdir_pballoc_type pballoc);
+		enum ixgbe_fdir_pballoc_type pballoc);
 static uint32_t atr_compute_perfect_hash_82599(union ixgbe_atr_input *input,
-		enum rte_eth_fdir_pballoc_type pballoc);
+		enum ixgbe_fdir_pballoc_type pballoc);
 static int fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
 			union ixgbe_atr_input *input, uint8_t queue,
 			uint32_t fdircmd, uint32_t fdirhash,
-			enum rte_fdir_mode mode);
+			enum ixgbe_fdir_mode mode);
 static int fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
 		union ixgbe_atr_input *input, u8 queue, uint32_t fdircmd,
 		uint32_t fdirhash);
@@ -164,20 +164,20 @@ fdir_enable_82599(struct ixgbe_hw *hw, uint32_t fdirctrl)
  * flexbytes matching field, and drop queue (only for perfect matching mode).
  */
 static inline int
-configure_fdir_flags(const struct rte_eth_fdir_conf *conf, uint32_t *fdirctrl)
+configure_fdir_flags(const struct ixgbe_fdir_conf *conf, uint32_t *fdirctrl)
 {
 	*fdirctrl = 0;
 
 	switch (conf->pballoc) {
-	case RTE_ETH_FDIR_PBALLOC_64K:
+	case IXGBE_FDIR_PBALLOC_64K:
 		/* 8k - 1 signature filters */
 		*fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_64K;
 		break;
-	case RTE_ETH_FDIR_PBALLOC_128K:
+	case IXGBE_FDIR_PBALLOC_128K:
 		/* 16k - 1 signature filters */
 		*fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_128K;
 		break;
-	case RTE_ETH_FDIR_PBALLOC_256K:
+	case IXGBE_FDIR_PBALLOC_256K:
 		/* 32k - 1 signature filters */
 		*fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_256K;
 		break;
@@ -189,14 +189,14 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf, uint32_t *fdirctrl)
 
 	/* status flags: write hash & swindex in the rx descriptor */
 	switch (conf->status) {
-	case RTE_FDIR_NO_REPORT_STATUS:
+	case IXGBE_FDIR_NO_REPORT_STATUS:
 		/* do nothing, default mode */
 		break;
-	case RTE_FDIR_REPORT_STATUS:
+	case IXGBE_FDIR_REPORT_STATUS:
 		/* report status when the packet matches a fdir rule */
 		*fdirctrl |= IXGBE_FDIRCTRL_REPORT_STATUS;
 		break;
-	case RTE_FDIR_REPORT_STATUS_ALWAYS:
+	case IXGBE_FDIR_REPORT_STATUS_ALWAYS:
 		/* always report status */
 		*fdirctrl |= IXGBE_FDIRCTRL_REPORT_STATUS_ALWAYS;
 		break;
@@ -209,14 +209,14 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf, uint32_t *fdirctrl)
 	*fdirctrl |= (IXGBE_DEFAULT_FLEXBYTES_OFFSET / sizeof(uint16_t)) <<
 		     IXGBE_FDIRCTRL_FLEX_SHIFT;
 
-	if (conf->mode >= RTE_FDIR_MODE_PERFECT &&
-	    conf->mode <= RTE_FDIR_MODE_PERFECT_TUNNEL) {
+	if (conf->mode >= IXGBE_FDIR_MODE_PERFECT &&
+	    conf->mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL) {
 		*fdirctrl |= IXGBE_FDIRCTRL_PERFECT_MATCH;
 		*fdirctrl |= (conf->drop_queue << IXGBE_FDIRCTRL_DROP_Q_SHIFT);
-		if (conf->mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN)
+		if (conf->mode == IXGBE_FDIR_MODE_PERFECT_MAC_VLAN)
 			*fdirctrl |= (IXGBE_FDIRCTRL_FILTERMODE_MACVLAN
 					<< IXGBE_FDIRCTRL_FILTERMODE_SHIFT);
-		else if (conf->mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
+		else if (conf->mode == IXGBE_FDIR_MODE_PERFECT_TUNNEL)
 			*fdirctrl |= (IXGBE_FDIRCTRL_FILTERMODE_CLOUD
 					<< IXGBE_FDIRCTRL_FILTERMODE_SHIFT);
 	}
@@ -249,12 +249,12 @@ reverse_fdir_bitmasks(uint16_t hi_dword, uint16_t lo_dword)
 
 /*
  * This references ixgbe_fdir_set_input_mask_82599() in base/ixgbe_82599.c,
- * but makes use of the rte_fdir_masks structure to see which bits to set.
+ * but makes use of the ixgbe_fdir_masks structure to see which bits to set.
  */
 static int
 fdir_set_input_mask_82599(struct ixgbe_adapter *adapter,
 		const struct ixgbe_hw_fdir_mask *mask,
-		enum rte_fdir_mode mode)
+		enum ixgbe_fdir_mode mode)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
 	/*
@@ -317,7 +317,7 @@ fdir_set_input_mask_82599(struct ixgbe_adapter *adapter,
 	reg = IXGBE_PCI_REG_ADDR(hw, IXGBE_FDIRDIP4M);
 	*reg = ~(mask->dst_ipv4_mask);
 
-	if (mode == RTE_FDIR_MODE_SIGNATURE) {
+	if (mode == IXGBE_FDIR_MODE_SIGNATURE) {
 		/*
 		 * Store source and destination IPv6 masks (bit reversed)
 		 */
@@ -332,12 +332,12 @@ fdir_set_input_mask_82599(struct ixgbe_adapter *adapter,
 
 /*
  * This references ixgbe_fdir_set_input_mask_82599() in base/ixgbe_82599.c,
- * but makes use of the rte_fdir_masks structure to see which bits to set.
+ * but makes use of the ixgbe_fdir_masks structure to see which bits to set.
  */
 static int
 fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
 		const struct ixgbe_hw_fdir_mask *mask,
-		enum rte_fdir_mode mode)
+		enum ixgbe_fdir_mode mode)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
 	/* mask VM pool and DIPv6 since there are currently not supported
@@ -351,7 +351,7 @@ fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
 	PMD_INIT_FUNC_TRACE();
 
 	/* set the default UDP port for VxLAN */
-	if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
+	if (mode == IXGBE_FDIR_MODE_PERFECT_TUNNEL)
 		IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, RTE_VXLAN_DEFAULT_PORT);
 
 	/* some bits must be set for mac vlan or tunnel mode */
@@ -375,11 +375,11 @@ fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
 
 	fdiripv6m = ((u32)0xFFFFU << IXGBE_FDIRIP6M_DIPM_SHIFT);
 	fdiripv6m |= IXGBE_FDIRIP6M_ALWAYS_MASK;
-	if (mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN)
+	if (mode == IXGBE_FDIR_MODE_PERFECT_MAC_VLAN)
 		fdiripv6m |= IXGBE_FDIRIP6M_TUNNEL_TYPE |
 				IXGBE_FDIRIP6M_TNI_VNI;
 
-	if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
+	if (mode == IXGBE_FDIR_MODE_PERFECT_TUNNEL) {
 		fdiripv6m |= IXGBE_FDIRIP6M_INNER_MAC;
 		mac_mask = mask->mac_addr_byte_mask &
 			(IXGBE_FDIRIP6M_INNER_MAC >>
@@ -428,13 +428,13 @@ fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
 int
 ixgbe_fdir_set_input_mask(struct ixgbe_adapter *adapter,
 		const struct ixgbe_hw_fdir_mask *mask,
-		enum rte_fdir_mode mode)
+		enum ixgbe_fdir_mode mode)
 {
-	if (mode >= RTE_FDIR_MODE_SIGNATURE &&
-	    mode <= RTE_FDIR_MODE_PERFECT)
+	if (mode >= IXGBE_FDIR_MODE_SIGNATURE &&
+	    mode <= IXGBE_FDIR_MODE_PERFECT)
 		return fdir_set_input_mask_82599(adapter, mask, mode);
-	else if (mode >= RTE_FDIR_MODE_PERFECT_MAC_VLAN &&
-		 mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
+	else if (mode >= IXGBE_FDIR_MODE_PERFECT_MAC_VLAN &&
+		 mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL)
 		return fdir_set_input_mask_x550(adapter, mask, mode);
 
 	PMD_DRV_LOG(ERR, "Not supported fdir mode - %d!", mode);
@@ -493,13 +493,13 @@ ixgbe_fdir_set_flexbytes_offset(struct ixgbe_adapter *adapter, uint16_t offset)
  */
 static int
 ixgbe_set_fdir_flex_conf(struct ixgbe_adapter *adapter,
-		const struct rte_eth_fdir_flex_conf *conf, uint32_t *fdirctrl)
+		const struct ixgbe_fdir_flex_conf *conf, uint32_t *fdirctrl)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
 	struct ixgbe_hw_fdir_info *info =
 			IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
-	const struct rte_eth_flex_payload_cfg *flex_cfg;
-	const struct rte_eth_fdir_flex_mask *flex_mask;
+	const struct ixgbe_flex_payload_cfg *flex_cfg;
+	const struct ixgbe_fdir_flex_mask *flex_mask;
 	uint32_t fdirm;
 	uint16_t flexbytes = 0;
 	uint16_t i;
@@ -513,7 +513,7 @@ ixgbe_set_fdir_flex_conf(struct ixgbe_adapter *adapter,
 
 	for (i = 0; i < conf->nb_payloads; i++) {
 		flex_cfg = &conf->flex_set[i];
-		if (flex_cfg->type != RTE_ETH_RAW_PAYLOAD) {
+		if (flex_cfg->type != IXGBE_RAW_PAYLOAD) {
 			PMD_DRV_LOG(ERR, "unsupported payload type.");
 			return -EINVAL;
 		}
@@ -556,14 +556,14 @@ ixgbe_set_fdir_flex_conf(struct ixgbe_adapter *adapter,
 
 int
 ixgbe_fdir_configure(struct ixgbe_adapter *adapter,
-		const struct rte_eth_fdir_conf *fdir_conf,
+		const struct ixgbe_fdir_conf *fdir_conf,
 		const struct ixgbe_hw_fdir_mask *fdir_mask)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
 	int err;
 	uint32_t fdirctrl, pbsize;
 	int i;
-	enum rte_fdir_mode mode = fdir_conf->mode;
+	enum ixgbe_fdir_mode mode = fdir_conf->mode;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -580,8 +580,8 @@ ixgbe_fdir_configure(struct ixgbe_adapter *adapter,
 	    hw->mac.type != ixgbe_mac_X550EM_x &&
 	    hw->mac.type != ixgbe_mac_X550EM_a &&
 	    hw->mac.type != ixgbe_mac_E610 &&
-	    mode != RTE_FDIR_MODE_SIGNATURE &&
-	    mode != RTE_FDIR_MODE_PERFECT)
+	    mode != IXGBE_FDIR_MODE_SIGNATURE &&
+	    mode != IXGBE_FDIR_MODE_PERFECT)
 		return -ENOSYS;
 
 	err = configure_fdir_flags(fdir_conf, &fdirctrl);
@@ -733,13 +733,13 @@ ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input,
 
 static uint32_t
 atr_compute_perfect_hash_82599(union ixgbe_atr_input *input,
-		enum rte_eth_fdir_pballoc_type pballoc)
+		enum ixgbe_fdir_pballoc_type pballoc)
 {
-	if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
+	if (pballoc == IXGBE_FDIR_PBALLOC_256K)
 		return ixgbe_atr_compute_hash_82599(input,
 				IXGBE_ATR_BUCKET_HASH_KEY) &
 				PERFECT_BUCKET_256KB_HASH_MASK;
-	else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
+	else if (pballoc == IXGBE_FDIR_PBALLOC_128K)
 		return ixgbe_atr_compute_hash_82599(input,
 				IXGBE_ATR_BUCKET_HASH_KEY) &
 				PERFECT_BUCKET_128KB_HASH_MASK;
@@ -776,15 +776,15 @@ ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw, uint32_t *fdircmd)
  */
 static uint32_t
 atr_compute_sig_hash_82599(union ixgbe_atr_input *input,
-		enum rte_eth_fdir_pballoc_type pballoc)
+		enum ixgbe_fdir_pballoc_type pballoc)
 {
 	uint32_t bucket_hash, sig_hash;
 
-	if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
+	if (pballoc == IXGBE_FDIR_PBALLOC_256K)
 		bucket_hash = ixgbe_atr_compute_hash_82599(input,
 				IXGBE_ATR_BUCKET_HASH_KEY) &
 				SIG_BUCKET_256KB_HASH_MASK;
-	else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
+	else if (pballoc == IXGBE_FDIR_PBALLOC_128K)
 		bucket_hash = ixgbe_atr_compute_hash_82599(input,
 				IXGBE_ATR_BUCKET_HASH_KEY) &
 				SIG_BUCKET_128KB_HASH_MASK;
@@ -809,7 +809,7 @@ static int
 fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
 			union ixgbe_atr_input *input, uint8_t queue,
 			uint32_t fdircmd, uint32_t fdirhash,
-			enum rte_fdir_mode mode)
+			enum ixgbe_fdir_mode mode)
 {
 	uint32_t fdirport, fdirvlan;
 	u32 addr_low, addr_high;
@@ -817,7 +817,7 @@ fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
 	int err = 0;
 	volatile uint32_t *reg;
 
-	if (mode == RTE_FDIR_MODE_PERFECT) {
+	if (mode == IXGBE_FDIR_MODE_PERFECT) {
 		/* record the IPv4 address (big-endian)
 		 * can not use IXGBE_WRITE_REG.
 		 */
@@ -831,8 +831,8 @@ fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
 		fdirport <<= IXGBE_FDIRPORT_DESTINATION_SHIFT;
 		fdirport |= IXGBE_NTOHS(input->formatted.src_port);
 		IXGBE_WRITE_REG(hw, IXGBE_FDIRPORT, fdirport);
-	} else if (mode >= RTE_FDIR_MODE_PERFECT_MAC_VLAN &&
-		   mode <= RTE_FDIR_MODE_PERFECT_TUNNEL) {
+	} else if (mode >= IXGBE_FDIR_MODE_PERFECT_MAC_VLAN &&
+		   mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL) {
 		/* for mac vlan and tunnel modes */
 		addr_low = ((u32)input->formatted.inner_mac[0] |
 			    ((u32)input->formatted.inner_mac[1] << 8) |
@@ -841,7 +841,7 @@ fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
 		addr_high = ((u32)input->formatted.inner_mac[4] |
 			     ((u32)input->formatted.inner_mac[5] << 8));
 
-		if (mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
+		if (mode == IXGBE_FDIR_MODE_PERFECT_MAC_VLAN) {
 			IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(0), addr_low);
 			IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(1), addr_high);
 			IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(2), 0);
@@ -1035,7 +1035,7 @@ ixgbe_remove_fdir_filter(struct ixgbe_hw_fdir_info *fdir_info,
 
 int
 ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
-		struct rte_eth_fdir_conf *fdir_conf,
+		struct ixgbe_fdir_conf *fdir_conf,
 		struct ixgbe_fdir_rule *rule,
 		bool del,
 		bool update)
@@ -1048,11 +1048,11 @@ ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
 	int err;
 	struct ixgbe_hw_fdir_info *info =
 		IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
-	enum rte_fdir_mode fdir_mode = fdir_conf->mode;
+	enum ixgbe_fdir_mode fdir_mode = fdir_conf->mode;
 	struct ixgbe_fdir_filter *node;
 	bool add_node = FALSE;
 
-	if (fdir_mode == RTE_FDIR_MODE_NONE ||
+	if (fdir_mode == IXGBE_FDIR_MODE_NONE ||
 	    fdir_mode != rule->mode)
 		return -ENOTSUP;
 
@@ -1073,16 +1073,16 @@ ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
 	     IXGBE_ATR_FLOW_TYPE_IPV6) &&
 	    (info->mask.src_port_mask != 0 ||
 	     info->mask.dst_port_mask != 0) &&
-	    (rule->mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN &&
-	     rule->mode != RTE_FDIR_MODE_PERFECT_TUNNEL)) {
+	    (rule->mode != IXGBE_FDIR_MODE_PERFECT_MAC_VLAN &&
+	     rule->mode != IXGBE_FDIR_MODE_PERFECT_TUNNEL)) {
 		PMD_DRV_LOG(ERR, "By this device,"
 			    " IPv4 is not supported without"
 			    " L4 protocol and ports masked!");
 		return -ENOTSUP;
 	}
 
-	if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
-	    fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
+	if (fdir_mode >= IXGBE_FDIR_MODE_PERFECT &&
+	    fdir_mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL)
 		is_perfect = TRUE;
 
 	if (is_perfect) {
@@ -1207,15 +1207,15 @@ void
 ixgbe_fdir_filter_restore(struct rte_eth_dev *dev)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+	struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
 	struct ixgbe_hw_fdir_info *fdir_info =
 		IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
 	struct ixgbe_fdir_filter *node;
 	bool is_perfect = FALSE;
-	enum rte_fdir_mode fdir_mode = fdir_conf->mode;
+	enum ixgbe_fdir_mode fdir_mode = fdir_conf->mode;
 
-	if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
-	    fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
+	if (fdir_mode >= IXGBE_FDIR_MODE_PERFECT &&
+	    fdir_mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL)
 		is_perfect = TRUE;
 
 	if (is_perfect) {
@@ -1242,7 +1242,7 @@ ixgbe_fdir_filter_restore(struct rte_eth_dev *dev)
 int
 ixgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
 {
-	struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+	struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
 	struct ixgbe_hw_fdir_info *fdir_info =
 		IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
 	struct ixgbe_fdir_filter *fdir_filter;
@@ -1267,7 +1267,7 @@ ixgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
 	fdir_info->mask = (struct ixgbe_hw_fdir_mask){0};
 	fdir_info->flex_bytes_offset = 0;
 	fdir_info->mask_added = FALSE;
-	fdir_conf->mode = RTE_FDIR_MODE_NONE;
+	fdir_conf->mode = IXGBE_FDIR_MODE_NONE;
 
 	if (had_flows)
 		ret = ixgbe_fdir_flush(dev);
diff --git a/drivers/net/intel/ixgbe/ixgbe_flow.c b/drivers/net/intel/ixgbe/ixgbe_flow.c
index 9038aae001..e990126b5f 100644
--- a/drivers/net/intel/ixgbe/ixgbe_flow.c
+++ b/drivers/net/intel/ixgbe/ixgbe_flow.c
@@ -1501,7 +1501,7 @@ ixgbe_parse_fdir_act_attr(const struct rte_flow_attr *attr,
 		rule->queue = act_q->index;
 	} else { /* drop */
 		/* signature mode does not support drop action. */
-		if (rule->mode == RTE_FDIR_MODE_SIGNATURE) {
+		if (rule->mode == IXGBE_FDIR_MODE_SIGNATURE) {
 			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 			rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION,
@@ -1727,9 +1727,9 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 	}
 
 	if (signature_match(pattern))
-		rule->mode = RTE_FDIR_MODE_SIGNATURE;
+		rule->mode = IXGBE_FDIR_MODE_SIGNATURE;
 	else
-		rule->mode = RTE_FDIR_MODE_PERFECT;
+		rule->mode = IXGBE_FDIR_MODE_PERFECT;
 
 	/*Not supported last point for range*/
 	if (item->last) {
@@ -1772,7 +1772,7 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 
 			/* Ether type should be masked. */
 			if (eth_mask->hdr.ether_type ||
-			    rule->mode == RTE_FDIR_MODE_SIGNATURE) {
+			    rule->mode == IXGBE_FDIR_MODE_SIGNATURE) {
 				memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1781,7 +1781,7 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 			}
 
 			/* If ethernet has meaning, it means MAC VLAN mode. */
-			rule->mode = RTE_FDIR_MODE_PERFECT_MAC_VLAN;
+			rule->mode = IXGBE_FDIR_MODE_PERFECT_MAC_VLAN;
 
 			/**
 			 * src MAC address must be masked,
@@ -1812,7 +1812,7 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 		 * IPv6 is not supported.
 		 */
 		item = next_no_fuzzy_pattern(pattern, item);
-		if (rule->mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
+		if (rule->mode == IXGBE_FDIR_MODE_PERFECT_MAC_VLAN) {
 			if (item->type != RTE_FLOW_ITEM_TYPE_VLAN) {
 				memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
@@ -1955,7 +1955,7 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 		 * 2. not support last
 		 * 3. mask must not null
 		 */
-		if (rule->mode != RTE_FDIR_MODE_SIGNATURE ||
+		if (rule->mode != IXGBE_FDIR_MODE_SIGNATURE ||
 		    item->last ||
 		    !item->mask) {
 			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
@@ -2432,7 +2432,7 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
 		return -rte_errno;
 	}
 
-	rule->mode = RTE_FDIR_MODE_PERFECT_TUNNEL;
+	rule->mode = IXGBE_FDIR_MODE_PERFECT_TUNNEL;
 
 	/* Skip MAC. */
 	if (item->type == RTE_FLOW_ITEM_TYPE_ETH) {
@@ -2920,8 +2920,8 @@ ixgbe_fdir_flow_program(struct rte_eth_dev *dev,
 		bool *first_mask,
 		struct rte_flow_error *error)
 {
-	struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
-	struct rte_eth_fdir_conf local_fdir_conf = *fdir_conf;
+	struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+	struct ixgbe_fdir_conf local_fdir_conf = *fdir_conf;
 	struct ixgbe_hw_fdir_info *fdir_info =
 			IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
 	int ret;
@@ -2935,7 +2935,7 @@ ixgbe_fdir_flow_program(struct rte_eth_dev *dev,
 	local_fdir_conf.mode = fdir_rule->mode;
 
 	/* Configure FDIR mode if this is the first filter */
-	if (fdir_conf->mode == RTE_FDIR_MODE_NONE) {
+	if (fdir_conf->mode == IXGBE_FDIR_MODE_NONE) {
 		ret = ixgbe_fdir_configure(adapter, &local_fdir_conf, &fdir_rule->mask);
 		if (ret) {
 			return rte_flow_error_set(error, EINVAL,
@@ -3249,7 +3249,7 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
 	ret = ixgbe_parse_fdir_filter(dev, attr, pattern,
 				actions, &fdir_rule, error);
 	if (!ret) {
-		struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+		struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
 		bool first_mask = false;
 
 		ret = ixgbe_fdir_flow_program(dev, adapter, &fdir_rule,
@@ -3420,7 +3420,7 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
 	struct ixgbe_filter_ele_base *flow_mem_base;
 	struct ixgbe_hw_fdir_info *fdir_info =
 		IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
-	struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+	struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
 	struct ixgbe_rss_conf_ele *rss_filter_ptr;
 
 	/* Validate ownership before touching HW/SW state. */
@@ -3487,7 +3487,7 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
 				fdir_info->mask_added = false;
 				fdir_info->mask = (struct ixgbe_hw_fdir_mask){0};
 				fdir_info->flex_bytes_offset = 0;
-				fdir_conf->mode = RTE_FDIR_MODE_NONE;
+				fdir_conf->mode = IXGBE_FDIR_MODE_NONE;
 			}
 		}
 		break;
diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c b/drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c
index c42b8fc96b..d2dd640893 100644
--- a/drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c
+++ b/drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c
@@ -120,10 +120,10 @@ int __rte_cold
 ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev)
 {
 #ifndef RTE_LIBRTE_IEEE1588
-	struct rte_eth_fdir_conf *fconf = IXGBE_DEV_FDIR_CONF(dev);
+	struct ixgbe_fdir_conf *fconf = IXGBE_DEV_FDIR_CONF(dev);
 
 	/* no fdir support */
-	if (fconf->mode != RTE_FDIR_MODE_NONE)
+	if (fconf->mode != IXGBE_FDIR_MODE_NONE)
 		return -1;
 
 	for (uint16_t i = 0; i < dev->data->nb_rx_queues; i++) {
-- 
2.53.0


^ permalink raw reply related

* [RFC 8/8] net/txgbe: privatize legacy flow director types
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Jiawen Wu, Zaiyu Wang
In-Reply-To: <20260528213816.562910-1-stephen@networkplumber.org>

The txgbe driver inherited its flow director representation from
ixgbe (it derives from the same hardware lineage) and uses the
same legacy ethdev types (struct rte_eth_fdir_conf, enum
rte_fdir_mode, and related) as its internal IR for translating
rte_flow rules into hardware programming state. These types are
scheduled for removal from ethdev in DPDK 26.11.

Clone the relevant types into txgbe_ethdev.h with a txgbe-private
prefix so the driver no longer depends on the legacy ABI. The
embedded rte_eth_ipv4_flow / rte_eth_ipv6_flow types are cloned
too since they live in the same removal candidate set.

Unlike ixgbe, txgbe base/ does not pre-declare an
enum txgbe_fdir_pballoc_type, so the cloned one is defined here.
txgbe uses the integer value of pballoc directly in the table-
size calculation

    (1024 << (fdir_conf->pballoc + 1)) - 2

so the enum values match the original ethdev numbering
(64K=0, 128K=1, 256K=2). pballoc is set explicitly from devargs
in txgbe_handle_devarg(), so no extra initialization is required.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/txgbe/txgbe_ethdev.c          |   6 +-
 drivers/net/txgbe/txgbe_ethdev.h          | 101 +++++++++++++++++++++-
 drivers/net/txgbe/txgbe_fdir.c            |  78 ++++++++---------
 drivers/net/txgbe/txgbe_flow.c            |  24 ++---
 drivers/net/txgbe/txgbe_rxtx_vec_common.h |   4 +-
 5 files changed, 155 insertions(+), 58 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 5d360f8305..258ec4d97c 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -524,7 +524,7 @@ txgbe_handle_devarg(__rte_unused const char *key, const char *value,
 static void
 txgbe_parse_devargs(struct rte_eth_dev *dev)
 {
-	struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
+	struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_devargs *devargs = pci_dev->device.devargs;
 	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
@@ -934,7 +934,7 @@ static int txgbe_l2_tn_filter_uninit(struct rte_eth_dev *eth_dev)
 
 int txgbe_fdir_filter_init(struct rte_eth_dev *eth_dev)
 {
-	struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(eth_dev);
+	struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(eth_dev);
 	struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(eth_dev);
 	char fdir_hash_name[RTE_HASH_NAMESIZE];
 	u16 max_fdir_num = (1024 << (fdir_conf->pballoc + 1)) - 2;
@@ -1834,7 +1834,7 @@ txgbe_dev_start(struct rte_eth_dev *dev)
 	txgbe_configure_port(dev);
 	txgbe_configure_dcb(dev);
 
-	if (TXGBE_DEV_FDIR_CONF(dev)->mode != RTE_FDIR_MODE_NONE) {
+	if (TXGBE_DEV_FDIR_CONF(dev)->mode != TXGBE_FDIR_MODE_NONE) {
 		err = txgbe_fdir_configure(dev);
 		if (err)
 			goto error;
diff --git a/drivers/net/txgbe/txgbe_ethdev.h b/drivers/net/txgbe/txgbe_ethdev.h
index 189fbac541..1f4ce4f3b8 100644
--- a/drivers/net/txgbe/txgbe_ethdev.h
+++ b/drivers/net/txgbe/txgbe_ethdev.h
@@ -83,6 +83,103 @@
 /*
  * Information about the fdir mode.
  */
+/*
+ * Privatized flow director configuration types.
+ *
+ * Cloned from <rte_eth_ctrl.h> and <ethdev_driver.h> so that txgbe no
+ * longer depends on the legacy ethdev flow director ABI, which is
+ * scheduled for removal in DPDK 26.11. Semantics unchanged; only the
+ * names are txgbe-private.
+ *
+ * NB: txgbe uses the integer value of pballoc directly in
+ *     (1024 << (fdir_conf->pballoc + 1)) - 2
+ * to size the HW filter table. The enum values therefore match the
+ * original ethdev numbering (64K=0, 128K=1, 256K=2).
+ */
+#define TXGBE_FDIR_MAX_FLEXLEN 16  /**< Max length of flexbytes. */
+
+struct txgbe_ipv4_flow {
+	uint32_t src_ip;
+	uint32_t dst_ip;
+	uint8_t  tos;
+	uint8_t  ttl;
+	uint8_t  proto;
+};
+
+struct txgbe_ipv6_flow {
+	uint32_t src_ip[4];
+	uint32_t dst_ip[4];
+	uint8_t  tc;
+	uint8_t  proto;
+	uint8_t  hop_limits;
+};
+
+struct txgbe_fdir_masks {
+	uint16_t vlan_tci_mask;
+	struct txgbe_ipv4_flow ipv4_mask;
+	struct txgbe_ipv6_flow ipv6_mask;
+	uint16_t src_port_mask;
+	uint16_t dst_port_mask;
+	uint8_t  mac_addr_byte_mask;
+	uint32_t tunnel_id_mask;
+	uint8_t  tunnel_type_mask;
+};
+
+enum txgbe_payload_type {
+	TXGBE_PAYLOAD_UNKNOWN = 0,
+	TXGBE_RAW_PAYLOAD,
+	TXGBE_L2_PAYLOAD,
+	TXGBE_L3_PAYLOAD,
+	TXGBE_L4_PAYLOAD,
+	TXGBE_PAYLOAD_MAX = 8,
+};
+
+struct txgbe_flex_payload_cfg {
+	enum txgbe_payload_type type;
+	uint16_t src_offset[TXGBE_FDIR_MAX_FLEXLEN];
+};
+
+struct txgbe_fdir_flex_mask {
+	uint16_t flow_type;
+	uint8_t  mask[TXGBE_FDIR_MAX_FLEXLEN];
+};
+
+struct txgbe_fdir_flex_conf {
+	uint16_t nb_payloads;
+	uint16_t nb_flexmasks;
+	struct txgbe_flex_payload_cfg flex_set[TXGBE_PAYLOAD_MAX];
+	struct txgbe_fdir_flex_mask flex_mask[RTE_ETH_FLOW_MAX];
+};
+
+enum txgbe_fdir_mode {
+	TXGBE_FDIR_MODE_NONE = 0,
+	TXGBE_FDIR_MODE_SIGNATURE,
+	TXGBE_FDIR_MODE_PERFECT,
+	TXGBE_FDIR_MODE_PERFECT_MAC_VLAN,
+	TXGBE_FDIR_MODE_PERFECT_TUNNEL,
+};
+
+enum txgbe_fdir_pballoc_type {
+	TXGBE_FDIR_PBALLOC_64K = 0,
+	TXGBE_FDIR_PBALLOC_128K,
+	TXGBE_FDIR_PBALLOC_256K,
+};
+
+enum txgbe_fdir_status_mode {
+	TXGBE_FDIR_NO_REPORT_STATUS = 0,
+	TXGBE_FDIR_REPORT_STATUS,
+	TXGBE_FDIR_REPORT_STATUS_ALWAYS,
+};
+
+struct txgbe_fdir_conf {
+	enum txgbe_fdir_mode mode;
+	enum txgbe_fdir_pballoc_type pballoc;
+	enum txgbe_fdir_status_mode status;
+	uint8_t drop_queue;
+	struct txgbe_fdir_masks mask;
+	struct txgbe_fdir_flex_conf flex_conf;
+};
+
 struct txgbe_hw_fdir_mask {
 	uint16_t vlan_tci_mask;
 	uint32_t src_ipv4_mask;
@@ -111,7 +208,7 @@ struct txgbe_fdir_rule {
 	struct txgbe_atr_input input; /* key of fdir filter */
 	bool b_spec; /* If TRUE, input, fdirflags, queue have meaning. */
 	bool b_mask; /* If TRUE, mask has meaning. */
-	enum rte_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
+	enum txgbe_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
 	uint32_t fdirflags; /* drop or forward */
 	uint32_t soft_id; /* an unique value for this rule */
 	uint8_t queue; /* assigned rx queue */
@@ -352,7 +449,7 @@ struct txgbe_tm_conf {
 struct txgbe_adapter {
 	struct txgbe_hw             hw;
 	struct txgbe_hw_stats       stats;
-	struct rte_eth_fdir_conf    fdir_conf;
+	struct txgbe_fdir_conf    fdir_conf;
 	struct txgbe_hw_fdir_info   fdir;
 	struct txgbe_interrupt      intr;
 	struct txgbe_stat_mappings  stat_mappings;
diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
index 67f586ffc7..ded01341a4 100644
--- a/drivers/net/txgbe/txgbe_fdir.c
+++ b/drivers/net/txgbe/txgbe_fdir.c
@@ -102,22 +102,22 @@ txgbe_fdir_enable(struct txgbe_hw *hw, uint32_t fdirctrl)
  * flexbytes matching field, and drop queue (only for perfect matching mode).
  */
 static inline int
-configure_fdir_flags(const struct rte_eth_fdir_conf *conf,
+configure_fdir_flags(const struct txgbe_fdir_conf *conf,
 		     uint32_t *fdirctrl, uint32_t *flex)
 {
 	*fdirctrl = 0;
 	*flex = 0;
 
 	switch (conf->pballoc) {
-	case RTE_ETH_FDIR_PBALLOC_64K:
+	case TXGBE_FDIR_PBALLOC_64K:
 		/* 8k - 1 signature filters */
 		*fdirctrl |= TXGBE_FDIRCTL_BUF_64K;
 		break;
-	case RTE_ETH_FDIR_PBALLOC_128K:
+	case TXGBE_FDIR_PBALLOC_128K:
 		/* 16k - 1 signature filters */
 		*fdirctrl |= TXGBE_FDIRCTL_BUF_128K;
 		break;
-	case RTE_ETH_FDIR_PBALLOC_256K:
+	case TXGBE_FDIR_PBALLOC_256K:
 		/* 32k - 1 signature filters */
 		*fdirctrl |= TXGBE_FDIRCTL_BUF_256K;
 		break;
@@ -129,14 +129,14 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf,
 
 	/* status flags: write hash & swindex in the rx descriptor */
 	switch (conf->status) {
-	case RTE_FDIR_NO_REPORT_STATUS:
+	case TXGBE_FDIR_NO_REPORT_STATUS:
 		/* do nothing, default mode */
 		break;
-	case RTE_FDIR_REPORT_STATUS:
+	case TXGBE_FDIR_REPORT_STATUS:
 		/* report status when the packet matches a fdir rule */
 		*fdirctrl |= TXGBE_FDIRCTL_REPORT_MATCH;
 		break;
-	case RTE_FDIR_REPORT_STATUS_ALWAYS:
+	case TXGBE_FDIR_REPORT_STATUS_ALWAYS:
 		/* always report status */
 		*fdirctrl |= TXGBE_FDIRCTL_REPORT_ALWAYS;
 		break;
@@ -150,9 +150,9 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf,
 	*flex |= TXGBE_FDIRFLEXCFG_OFST(TXGBE_DEFAULT_FLEXBYTES_OFFSET / 2);
 
 	switch (conf->mode) {
-	case RTE_FDIR_MODE_SIGNATURE:
+	case TXGBE_FDIR_MODE_SIGNATURE:
 		break;
-	case RTE_FDIR_MODE_PERFECT:
+	case TXGBE_FDIR_MODE_PERFECT:
 		*fdirctrl |= TXGBE_FDIRCTL_PERFECT;
 		*fdirctrl |= TXGBE_FDIRCTL_DROPQP(conf->drop_queue);
 		break;
@@ -179,7 +179,7 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
 {
 	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
 	struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
-	enum rte_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+	enum txgbe_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
 	/*
 	 * mask VM pool and DIPv6 since there are currently not supported
 	 * mask FLEX byte, it will be set in flex_conf
@@ -190,8 +190,8 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
-	if (mode != RTE_FDIR_MODE_SIGNATURE &&
-	    mode != RTE_FDIR_MODE_PERFECT) {
+	if (mode != TXGBE_FDIR_MODE_SIGNATURE &&
+	    mode != TXGBE_FDIR_MODE_PERFECT) {
 		PMD_DRV_LOG(ERR, "Not supported fdir mode - %d!", mode);
 		return -ENOTSUP;
 	}
@@ -232,14 +232,14 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
 static int
 txgbe_fdir_store_input_mask(struct rte_eth_dev *dev)
 {
-	struct rte_eth_fdir_masks *input_mask = &TXGBE_DEV_FDIR_CONF(dev)->mask;
-	enum rte_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+	struct txgbe_fdir_masks *input_mask = &TXGBE_DEV_FDIR_CONF(dev)->mask;
+	enum txgbe_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
 	struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
 	uint16_t dst_ipv6m = 0;
 	uint16_t src_ipv6m = 0;
 
-	if (mode != RTE_FDIR_MODE_SIGNATURE &&
-	    mode != RTE_FDIR_MODE_PERFECT) {
+	if (mode != TXGBE_FDIR_MODE_SIGNATURE &&
+	    mode != TXGBE_FDIR_MODE_PERFECT) {
 		PMD_DRV_LOG(ERR, "Not supported fdir mode - %d!", mode);
 		return -ENOTSUP;
 	}
@@ -304,12 +304,12 @@ txgbe_fdir_set_flexbytes_offset(struct rte_eth_dev *dev,
 static int
 txgbe_set_fdir_flex_conf(struct rte_eth_dev *dev, uint32_t flex)
 {
-	const struct rte_eth_fdir_flex_conf *conf =
+	const struct txgbe_fdir_flex_conf *conf =
 				&TXGBE_DEV_FDIR_CONF(dev)->flex_conf;
 	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
 	struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
-	const struct rte_eth_flex_payload_cfg *flex_cfg;
-	const struct rte_eth_fdir_flex_mask *flex_mask;
+	const struct txgbe_flex_payload_cfg *flex_cfg;
+	const struct txgbe_fdir_flex_mask *flex_mask;
 	uint16_t flexbytes = 0;
 	uint16_t i;
 
@@ -322,7 +322,7 @@ txgbe_set_fdir_flex_conf(struct rte_eth_dev *dev, uint32_t flex)
 
 	for (i = 0; i < conf->nb_payloads; i++) {
 		flex_cfg = &conf->flex_set[i];
-		if (flex_cfg->type != RTE_ETH_RAW_PAYLOAD) {
+		if (flex_cfg->type != TXGBE_RAW_PAYLOAD) {
 			PMD_DRV_LOG(ERR, "unsupported payload type.");
 			return -EINVAL;
 		}
@@ -375,13 +375,13 @@ txgbe_fdir_configure(struct rte_eth_dev *dev)
 	int err;
 	uint32_t fdirctrl, flex, pbsize;
 	int i;
-	enum rte_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+	enum txgbe_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
 
 	PMD_INIT_FUNC_TRACE();
 
 	/* supports mac-vlan and tunnel mode */
-	if (mode != RTE_FDIR_MODE_SIGNATURE &&
-	    mode != RTE_FDIR_MODE_PERFECT)
+	if (mode != TXGBE_FDIR_MODE_SIGNATURE &&
+	    mode != TXGBE_FDIR_MODE_PERFECT)
 		return -ENOSYS;
 
 	err = configure_fdir_flags(TXGBE_DEV_FDIR_CONF(dev), &fdirctrl, &flex);
@@ -531,15 +531,15 @@ txgbe_atr_compute_hash(struct txgbe_atr_input *atr_input,
 
 static uint32_t
 atr_compute_perfect_hash(struct txgbe_atr_input *input,
-		enum rte_eth_fdir_pballoc_type pballoc)
+		enum txgbe_fdir_pballoc_type pballoc)
 {
 	uint32_t bucket_hash;
 
 	bucket_hash = txgbe_atr_compute_hash(input,
 				TXGBE_ATR_BUCKET_HASH_KEY);
-	if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
+	if (pballoc == TXGBE_FDIR_PBALLOC_256K)
 		bucket_hash &= PERFECT_BUCKET_256KB_HASH_MASK;
-	else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
+	else if (pballoc == TXGBE_FDIR_PBALLOC_128K)
 		bucket_hash &= PERFECT_BUCKET_128KB_HASH_MASK;
 	else
 		bucket_hash &= PERFECT_BUCKET_64KB_HASH_MASK;
@@ -574,15 +574,15 @@ txgbe_fdir_check_cmd_complete(struct txgbe_hw *hw, uint32_t *fdircmd)
  */
 static uint32_t
 atr_compute_signature_hash(struct txgbe_atr_input *input,
-		enum rte_eth_fdir_pballoc_type pballoc)
+		enum txgbe_fdir_pballoc_type pballoc)
 {
 	uint32_t bucket_hash, sig_hash;
 
 	bucket_hash = txgbe_atr_compute_hash(input,
 				TXGBE_ATR_BUCKET_HASH_KEY);
-	if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
+	if (pballoc == TXGBE_FDIR_PBALLOC_256K)
 		bucket_hash &= SIG_BUCKET_256KB_HASH_MASK;
-	else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
+	else if (pballoc == TXGBE_FDIR_PBALLOC_128K)
 		bucket_hash &= SIG_BUCKET_128KB_HASH_MASK;
 	else
 		bucket_hash &= SIG_BUCKET_64KB_HASH_MASK;
@@ -603,7 +603,7 @@ static int
 fdir_write_perfect_filter(struct txgbe_hw *hw,
 			struct txgbe_atr_input *input, uint8_t queue,
 			uint32_t fdircmd, uint32_t fdirhash,
-			enum rte_fdir_mode mode)
+			enum txgbe_fdir_mode mode)
 {
 	uint32_t fdirport, fdirflex;
 	int err = 0;
@@ -830,14 +830,14 @@ txgbe_fdir_filter_program(struct rte_eth_dev *dev,
 	bool is_perfect = FALSE;
 	int err;
 	struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
-	enum rte_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+	enum txgbe_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
 	struct txgbe_fdir_filter *node;
 
-	if (fdir_mode == RTE_FDIR_MODE_NONE ||
+	if (fdir_mode == TXGBE_FDIR_MODE_NONE ||
 	    fdir_mode != rule->mode)
 		return -ENOTSUP;
 
-	if (fdir_mode >= RTE_FDIR_MODE_PERFECT)
+	if (fdir_mode >= TXGBE_FDIR_MODE_PERFECT)
 		is_perfect = TRUE;
 
 	txgbe_fdir_mask_input(&info->mask, &rule->input);
@@ -1021,7 +1021,7 @@ txgbevf_fdir_filter_program(struct rte_eth_dev *dev,
 	uint32_t fdirhash;
 	int ret;
 
-	if (rule->mode != RTE_FDIR_MODE_PERFECT ||
+	if (rule->mode != TXGBE_FDIR_MODE_PERFECT ||
 	    rule->fdirflags == TXGBE_FDIRPICMD_DROP)
 		return -ENOTSUP;
 
@@ -1109,10 +1109,10 @@ txgbe_fdir_filter_restore(struct rte_eth_dev *dev)
 	struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(dev);
 	struct txgbe_fdir_filter *node;
 	bool is_perfect = FALSE;
-	enum rte_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+	enum txgbe_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
 
-	if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
-	    fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
+	if (fdir_mode >= TXGBE_FDIR_MODE_PERFECT &&
+	    fdir_mode <= TXGBE_FDIR_MODE_PERFECT_TUNNEL)
 		is_perfect = TRUE;
 
 	if (is_perfect) {
@@ -1139,7 +1139,7 @@ txgbe_fdir_filter_restore(struct rte_eth_dev *dev)
 int
 txgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
 {
-	struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
+	struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
 	struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(dev);
 	struct txgbe_fdir_filter *fdir_filter;
 	struct txgbe_fdir_filter *filter_flag;
@@ -1150,7 +1150,7 @@ txgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
 	memset(fdir_info->hash_map, 0,
 	       sizeof(struct txgbe_fdir_filter *) *
 	       ((1024 << (fdir_conf->pballoc + 1)) - 2));
-	fdir_conf->mode = RTE_FDIR_MODE_NONE;
+	fdir_conf->mode = TXGBE_FDIR_MODE_NONE;
 	filter_flag = TAILQ_FIRST(&fdir_info->fdir_list);
 	while ((fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list))) {
 		TAILQ_REMOVE(&fdir_info->fdir_list,
diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
index a97588e57a..8470bf78af 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -1412,7 +1412,7 @@ txgbe_parse_fdir_act_attr(const struct rte_flow_attr *attr,
 		rule->queue = act_q->index;
 	} else { /* drop */
 		/* signature mode does not support drop action. */
-		if (rule->mode == RTE_FDIR_MODE_SIGNATURE) {
+		if (rule->mode == TXGBE_FDIR_MODE_SIGNATURE) {
 			memset(rule, 0, sizeof(struct txgbe_fdir_rule));
 			rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION,
@@ -1646,9 +1646,9 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
 	}
 
 	if (signature_match(pattern))
-		rule->mode = RTE_FDIR_MODE_SIGNATURE;
+		rule->mode = TXGBE_FDIR_MODE_SIGNATURE;
 	else
-		rule->mode = RTE_FDIR_MODE_PERFECT;
+		rule->mode = TXGBE_FDIR_MODE_PERFECT;
 
 	/*Not supported last point for range*/
 	if (item->last) {
@@ -1678,7 +1678,7 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
 
 			/* Ether type should be masked. */
 			if (eth_mask->hdr.ether_type ||
-			    rule->mode == RTE_FDIR_MODE_SIGNATURE) {
+			    rule->mode == TXGBE_FDIR_MODE_SIGNATURE) {
 				memset(rule, 0, sizeof(struct txgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1687,7 +1687,7 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
 			}
 
 			/* If ethernet has meaning, it means MAC VLAN mode. */
-			rule->mode = RTE_FDIR_MODE_PERFECT_MAC_VLAN;
+			rule->mode = TXGBE_FDIR_MODE_PERFECT_MAC_VLAN;
 
 			/**
 			 * src MAC address must be masked,
@@ -1718,7 +1718,7 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
 		 * IPv6 is not supported.
 		 */
 		item = next_no_fuzzy_pattern(pattern, item);
-		if (rule->mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
+		if (rule->mode == TXGBE_FDIR_MODE_PERFECT_MAC_VLAN) {
 			if (item->type != RTE_FLOW_ITEM_TYPE_VLAN) {
 				memset(rule, 0, sizeof(struct txgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
@@ -2282,7 +2282,7 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
 		return -rte_errno;
 	}
 
-	rule->mode = RTE_FDIR_MODE_PERFECT;
+	rule->mode = TXGBE_FDIR_MODE_PERFECT;
 	ptid = TXGBE_PTID_PKT_TUN;
 
 	/* Skip MAC. */
@@ -2949,7 +2949,7 @@ txgbe_parse_fdir_filter(struct rte_eth_dev *dev,
 			struct rte_flow_error *error)
 {
 	int ret;
-	struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
+	struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
 
 	ret = txgbe_parse_fdir_filter_normal(dev, attr, pattern,
 					actions, rule, error);
@@ -2965,11 +2965,11 @@ txgbe_parse_fdir_filter(struct rte_eth_dev *dev,
 	if (!txgbe_is_pf(TXGBE_DEV_HW(dev)))
 		return ret;
 
-	if (fdir_conf->mode == RTE_FDIR_MODE_NONE) {
+	if (fdir_conf->mode == TXGBE_FDIR_MODE_NONE) {
 		fdir_conf->mode = rule->mode;
 		ret = txgbe_fdir_configure(dev);
 		if (ret) {
-			fdir_conf->mode = RTE_FDIR_MODE_NONE;
+			fdir_conf->mode = TXGBE_FDIR_MODE_NONE;
 			return ret;
 		}
 	} else if (fdir_conf->mode != rule->mode) {
@@ -3562,7 +3562,7 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
 	struct txgbe_fdir_rule_ele *fdir_rule_ptr;
 	struct txgbe_flow_mem *txgbe_flow_mem_ptr;
 	struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(dev);
-	struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
+	struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
 	struct txgbe_rss_conf_ele *rss_filter_ptr;
 
 	switch (filter_type) {
@@ -3625,7 +3625,7 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
 				fdir_info->mask_added = false;
 				fdir_info->flex_relative = false;
 				fdir_info->flex_bytes_offset = 0;
-				fdir_conf->mode = RTE_FDIR_MODE_NONE;
+				fdir_conf->mode = TXGBE_FDIR_MODE_NONE;
 			}
 		}
 		break;
diff --git a/drivers/net/txgbe/txgbe_rxtx_vec_common.h b/drivers/net/txgbe/txgbe_rxtx_vec_common.h
index 00847d087b..c6144cad70 100644
--- a/drivers/net/txgbe/txgbe_rxtx_vec_common.h
+++ b/drivers/net/txgbe/txgbe_rxtx_vec_common.h
@@ -299,10 +299,10 @@ static inline int
 txgbe_rx_vec_dev_conf_condition_check_default(struct rte_eth_dev *dev)
 {
 #ifndef RTE_LIBRTE_IEEE1588
-	struct rte_eth_fdir_conf *fconf = TXGBE_DEV_FDIR_CONF(dev);
+	struct txgbe_fdir_conf *fconf = TXGBE_DEV_FDIR_CONF(dev);
 
 	/* no fdir support */
-	if (fconf->mode != RTE_FDIR_MODE_NONE)
+	if (fconf->mode != TXGBE_FDIR_MODE_NONE)
 		return -1;
 
 	return 0;
-- 
2.53.0


^ permalink raw reply related

* RE: [RFC] doc, devtools: discourage new __rte_always_inline
From: Morten Brørup @ 2026-05-28 21:39 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Thomas Monjalon
In-Reply-To: <20260527163734.599602-1-stephen@networkplumber.org>

> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Wednesday, 27 May 2026 18.38
> 
> Modern compilers at -O2 make good inlining decisions for small
> static inline functions; forced inlining via __rte_always_inline
> should be reserved for cases where it is required for correctness
> or for documented measured performance reasons.
> 
> Document the policy in the coding style guide and add a
> checkpatches.sh entry that warns when new uses of the attribute
> are introduced.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Plenty of code in DPDK is based on ancient compiler behavior; let's not add new code based on old compiler behavior.
I guess developers keep blindly adding __rte_always_inline, only because it's already everywhere.

Good initiative to stop that bad habit.
Slightly extreme forbidding it in checkpatches.sh, but it's probably the only way to force people to stop and think.

> ---
>  devtools/checkpatches.sh                 |  8 ++++++++
>  doc/guides/contributing/coding_style.rst | 25 +++++++++++++++++++++++-
>  2 files changed, 32 insertions(+), 1 deletion(-)
> 
> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> index f5dd77443f..2a3d364178 100755
> --- a/devtools/checkpatches.sh
> +++ b/devtools/checkpatches.sh
> @@ -137,6 +137,14 @@ check_forbidden_additions() { # <patch>
>  		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk
> \
>  		"$1" || res=1
> 
> +	# forbid new use of __rte_always_inline
> +	awk -v FOLDERS="lib drivers app examples" \
> +		-v EXPRESSIONS='\\<__rte_always_inline\\>' \
> +		-v RET_ON_FAIL=1 \
> +		-v MESSAGE='Adding __rte_always_inline; prefer plain
> inline' \
> +		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk
> \
> +		"$1" || res=1
> +
>  	# refrain from using compiler __rte_atomic_thread_fence()
>  	# It should be avoided on x86 for SMP case.
>  	awk -v FOLDERS="lib drivers app examples" \
> diff --git a/doc/guides/contributing/coding_style.rst
> b/doc/guides/contributing/coding_style.rst
> index 243a3c2959..97e459853c 100644
> --- a/doc/guides/contributing/coding_style.rst
> +++ b/doc/guides/contributing/coding_style.rst
> @@ -747,11 +747,34 @@ Static Variables and Functions
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
>  * All functions and variables that are local to a file must be
> declared as ``static`` because it can often help the compiler to do
> some optimizations (such as, inlining the code).
> -* Functions that should be inlined should to be declared as ``static
> inline`` and can be defined in a .c or a .h file.
> +* Functions that should be inlined should be declared as ``static
> inline`` and can be defined in a .c or a .h file.
> 
>  .. note::
>  	Static functions defined in a header file must be declared as
> ``static inline`` in order to prevent compiler warnings about the
> function being unused.
> 
> +Use of ``__rte_always_inline``
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +The ``__rte_always_inline`` attribute forces the compiler to inline a
> function regardless of its size or call-graph heuristics.
> +Prefer plain ``inline`` (or no annotation at all for static functions)
> and let the compiler decide.
> +Modern compilers at ``-O2`` make good inlining decisions for small
> ``static inline`` functions in headers,
> +and forced inlining can hurt performance by inflating function bodies,
> increasing register pressure, and overriding profile-guided
> optimization.
> +
> +``__rte_always_inline`` should only be used when one of the following
> applies:
> +
> +* The function contains ``__builtin_constant_p`` checks that gate a

__builtin_constant_p -> __rte_constant

> constant-folded fast path, and the optimization is lost if the function
> is not inlined into the caller.
> +  Examples include byte-order helpers and length-dispatched
> copy/compare routines.
> +
> +* The function wraps inline assembly or a compiler intrinsic whose
> correctness depends on being inlined into the caller's register context
> (for example, intrinsics requiring a compile-time constant argument).
> +
> +* Measurement on a representative workload shows that the annotation
> is required to retain performance, and the reason is documented in the
> commit message that introduces it.
> +
> +Each use must be justified at the point it is introduced. Adding
> ``__rte_always_inline`` because nearby code uses it is not a
> justification;
> +if the constant or intrinsic that requires inlining is several call
> levels up the call chain,
> +restructure the code rather than annotating the entire chain.

Please add something similar to the description of the macro in rte_common.h.

> +
> +The complementary attribute ``__rte_noinline`` is useful for
> explicitly marking cold paths (error handling, initialization, slow-
> path fallbacks) where outlining the function can reduce instruction-
> cache pressure on the hot path.

Same comment:
Please add something similar to the description of the macro in rte_common.h.

<feature creep>
Many macros in rte_common.h have insufficient descriptions.
</feature creep>

> +
>  Const Attribute
>  ~~~~~~~~~~~~~~~
> 
> --
> 2.53.0

With comments above fixed,
Acked-by: Morten Brørup <mb@smartsharesystems.com>

^ permalink raw reply

* [PATCH v2 0/4] net/bond: fixes and cleanup
From: Stephen Hemminger @ 2026-05-28 23:59 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger
In-Reply-To: <20260417165530.653328-1-stephen@networkplumber.org>

Automated analysis of the bonding found a few minor things.
The bug fix is in patch 3 for secondary process crash does rx/tx. 

The cleanups are in handling of 8023ad mode setting
and the logging macros.

v2 - feedback about the mode setting and log messages

Stephen Hemminger (4):
  net/bonding: make 8023ad enable function void
  net/bonding: check mode before setting dedicated queues
  net/bonding: prevent crash on Rx/Tx from secondary process
  net/bonding: remove redundant function names from log

 drivers/net/bonding/eth_bond_8023ad_private.h | 17 +----
 drivers/net/bonding/rte_eth_bond_8023ad.c     | 16 ++--
 drivers/net/bonding/rte_eth_bond_api.c        |  4 +-
 drivers/net/bonding/rte_eth_bond_pmd.c        | 73 ++++++++++++++-----
 4 files changed, 67 insertions(+), 43 deletions(-)

-- 
2.53.0


^ permalink raw reply

* [PATCH v2 1/4] net/bonding: make 8023ad enable function void
From: Stephen Hemminger @ 2026-05-28 23:59 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Chas Williams, Min Hu (Connor)
In-Reply-To: <20260529000157.235931-1-stephen@networkplumber.org>

The function never returns an error. Cleanup the call sites.

The 8023ad disable function was never implemented,
remove prototype.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bonding/eth_bond_8023ad_private.h | 17 +----------------
 drivers/net/bonding/rte_eth_bond_8023ad.c     |  4 +---
 drivers/net/bonding/rte_eth_bond_pmd.c        |  7 +++----
 3 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bonding/eth_bond_8023ad_private.h
index ab7d15f81a..bd7a5848de 100644
--- a/drivers/net/bonding/eth_bond_8023ad_private.h
+++ b/drivers/net/bonding/eth_bond_8023ad_private.h
@@ -209,25 +209,10 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev,
  * @internal
  *
  * Enables 802.1AX mode and all active members on bonding interface.
- *
- * @param dev Bonding interface
- * @return
- *  0 on success, negative value otherwise.
  */
-int
+void
 bond_mode_8023ad_enable(struct rte_eth_dev *dev);
 
-/**
- * @internal
- *
- * Disables 802.1AX mode of the bonding interface and members.
- *
- * @param dev Bonding interface
- * @return
- *   0 on success, negative value otherwise.
- */
-int bond_mode_8023ad_disable(struct rte_eth_dev *dev);
-
 /**
  * @internal
  *
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index ba88f6d261..eba713e381 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -1287,7 +1287,7 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev,
 		bond_mode_8023ad_start(dev);
 }
 
-int
+void
 bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev)
 {
 	struct bond_dev_private *internals = bond_dev->data->dev_private;
@@ -1296,8 +1296,6 @@ bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev)
 	for (i = 0; i < internals->active_member_count; i++)
 		bond_mode_8023ad_activate_member(bond_dev,
 				internals->active_members[i]);
-
-	return 0;
 }
 
 int
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 96725071da..7fcb3ec7d7 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1619,8 +1619,7 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode)
 		eth_dev->rx_pkt_burst = bond_ethdev_rx_burst;
 		break;
 	case BONDING_MODE_8023AD:
-		if (bond_mode_8023ad_enable(eth_dev) != 0)
-			return -1;
+		bond_mode_8023ad_enable(eth_dev);
 
 		if (internals->mode4.dedicated_queues.enabled == 0) {
 			eth_dev->rx_pkt_burst = bond_ethdev_rx_burst_8023ad;
@@ -1641,13 +1640,13 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode)
 		eth_dev->rx_pkt_burst = bond_ethdev_rx_burst_active_backup;
 		break;
 	case BONDING_MODE_ALB:
-		if (bond_mode_alb_enable(eth_dev) != 0)
-			return -1;
+		bond_mode_alb_enable(eth_dev);
 
 		eth_dev->tx_pkt_burst = bond_ethdev_tx_burst_alb;
 		eth_dev->rx_pkt_burst = bond_ethdev_rx_burst_alb;
 		break;
 	default:
+		RTE_BOND_LOG(ERR, "Invalid mode %#x", mode);
 		return -1;
 	}
 
-- 
2.53.0


^ permalink raw reply related

* [PATCH v2 2/4] net/bonding: check mode before setting dedicated queues
From: Stephen Hemminger @ 2026-05-28 23:59 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, stable, Chas Williams, Min Hu (Connor),
	Declan Doherty, Tomasz Kulasek
In-Reply-To: <20260529000157.235931-1-stephen@networkplumber.org>

The calls to enable and disable dedicated queues are missing
check for mode.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index eba713e381..d1f30229d0 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -1725,7 +1725,6 @@ RTE_EXPORT_SYMBOL(rte_eth_bond_8023ad_dedicated_queues_enable)
 int
 rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port)
 {
-	int retval = 0;
 	struct rte_eth_dev *dev;
 	struct bond_dev_private *internals;
 
@@ -1742,17 +1741,19 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port)
 	if (dev->data->dev_started)
 		return -1;
 
+	if (internals->mode != BONDING_MODE_8023AD)
+		return -1;
+
 	internals->mode4.dedicated_queues.enabled = 1;
 
 	bond_ethdev_mode_set(dev, internals->mode);
-	return retval;
+	return 0;
 }
 
 RTE_EXPORT_SYMBOL(rte_eth_bond_8023ad_dedicated_queues_disable)
 int
 rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port)
 {
-	int retval = 0;
 	struct rte_eth_dev *dev;
 	struct bond_dev_private *internals;
 
@@ -1766,9 +1767,12 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port)
 	if (dev->data->dev_started)
 		return -1;
 
+	if (internals->mode != BONDING_MODE_8023AD)
+		return -1;
+
 	internals->mode4.dedicated_queues.enabled = 0;
 
 	bond_ethdev_mode_set(dev, internals->mode);
 
-	return retval;
+	return 0;
 }
-- 
2.53.0


^ permalink raw reply related

* [PATCH v2 3/4] net/bonding: prevent crash on Rx/Tx from secondary process
From: Stephen Hemminger @ 2026-05-28 23:59 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, stable, Chas Williams, Min Hu (Connor),
	Anatoly Burakov, Qi Zhang
In-Reply-To: <20260529000157.235931-1-stephen@networkplumber.org>

The bonding PMD's secondary process attach path registered the
ethdev but never installed rx_pkt_burst or tx_pkt_burst, leaving
both as NULL. Any rx_burst or tx_burst call from a secondary
process therefore crashed with a NULL pointer dereference.

Fully sharing bonding state across processes would be
overly complex. Instead, install blackhole burst functions
in the secondary so the data path is safe by default. Rx returns 0
and Tx frees the mbufs and reports them as transmitted,
matching /dev/null semantics so applications do not spin
retrying. Each stub logs once at NOTICE level on first use.

Also reject bond mode changes from a secondary process.
rte_eth_bond_mode_set() is callable from secondary, and
without this guard it would overwrite the secondary's safe
burst stubs with real per-mode functions whose internal
state is not valid outside the primary, reintroducing the
crash by another path.

This keeps secondary support available for the more
common use cases of procinfo and packet capture.

Bugzilla ID: 1698
Fixes: 4852aa8f6e21 ("drivers/net: enable hotplug on secondary process")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 43 +++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 7fcb3ec7d7..8a9c329fb8 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -56,6 +56,33 @@ get_vlan_offset(struct rte_ether_hdr *eth_hdr, uint16_t *proto)
 	return vlan_offset;
 }
 
+static uint16_t
+bond_ethdev_rx_secondary(void *queue __rte_unused,
+			 struct rte_mbuf **bufs __rte_unused, uint16_t nb_pkts __rte_unused)
+{
+	static bool once = true;
+
+	if (once) {
+		/* once per process is enough of a notice */
+		RTE_BOND_LOG(ERR, "receive not supported in secondary");
+		once = false;
+	}
+	return 0;
+}
+
+static uint16_t
+bond_ethdev_tx_secondary(void *queue __rte_unused, struct rte_mbuf **bufs, uint16_t nb_pkts)
+{
+	static bool once = true;
+
+	if (once) {
+		RTE_BOND_LOG(ERR, "transmit not supported in secondary");
+		once = false;
+	}
+	rte_pktmbuf_free_bulk(bufs, nb_pkts);
+	return nb_pkts;
+}
+
 static uint16_t
 bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 {
@@ -1599,6 +1626,11 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode)
 {
 	struct bond_dev_private *internals;
 
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+		RTE_BOND_LOG(ERR, "Setting mode in secondary not allowed");
+		return -1;
+	}
+
 	internals = eth_dev->data->dev_private;
 
 	switch (mode) {
@@ -3798,9 +3830,18 @@ bond_probe(struct rte_vdev_device *dev)
 			RTE_BOND_LOG(ERR, "Failed to probe %s", name);
 			return -1;
 		}
-		/* TODO: request info from primary to set up Rx and Tx */
+
 		eth_dev->dev_ops = &default_dev_ops;
 		eth_dev->device = &dev->device;
+
+		/*
+		 * Propagation of bond mode would require adding
+		 * MP client/server support and lots of error handling.
+		 *
+		 * For now just install a black hole.
+		 */
+		eth_dev->tx_pkt_burst = bond_ethdev_tx_secondary;
+		eth_dev->rx_pkt_burst = bond_ethdev_rx_secondary;
 		rte_eth_dev_probing_finish(eth_dev);
 		return 0;
 	}
-- 
2.53.0


^ permalink raw reply related

* [PATCH v2 4/4] net/bonding: remove redundant function names from log
From: Stephen Hemminger @ 2026-05-28 23:59 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Chas Williams, Min Hu (Connor)
In-Reply-To: <20260529000157.235931-1-stephen@networkplumber.org>

The function name is already printed as part of RTE_BOND_LOG().
Fix grammar in log messages.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bonding/rte_eth_bond_api.c |  4 ++--
 drivers/net/bonding/rte_eth_bond_pmd.c | 23 ++++++++++-------------
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 9e5df67c18..d9b6f1c417 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -485,8 +485,8 @@ __eth_bond_member_add_lock_free(uint16_t bonding_port_id, uint16_t member_port_i
 	ret = rte_eth_dev_info_get(member_port_id, &dev_info);
 	if (ret != 0) {
 		RTE_BOND_LOG(ERR,
-			"%s: Error during getting device (port %u) info: %s",
-			__func__, member_port_id, strerror(-ret));
+			"Error getting device (port %u) info: %s",
+			member_port_id, strerror(-ret));
 
 		return ret;
 	}
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 8a9c329fb8..6a4f997b5a 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -210,8 +210,8 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev,
 	int ret = rte_flow_validate(member_port, &flow_attr_8023ad,
 			flow_item_8023ad, actions, &error);
 	if (ret < 0) {
-		RTE_BOND_LOG(ERR, "%s: %s (member_port=%d queue_id=%d)",
-				__func__, error.message, member_port,
+		RTE_BOND_LOG(ERR, "%s (member_port=%u queue_id=%u)",
+				error.message, member_port,
 				internals->mode4.dedicated_queues.rx_qid);
 		return -1;
 	}
@@ -219,8 +219,8 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev,
 	ret = rte_eth_dev_info_get(member_port, &member_info);
 	if (ret != 0) {
 		RTE_BOND_LOG(ERR,
-			"%s: Error during getting device (port %u) info: %s",
-			__func__, member_port, strerror(-ret));
+			"Error getting device (port %u) info: %s",
+			member_port, strerror(-ret));
 
 		return ret;
 	}
@@ -228,8 +228,8 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev,
 	if (member_info.max_rx_queues < bond_dev->data->nb_rx_queues ||
 			member_info.max_tx_queues < bond_dev->data->nb_tx_queues) {
 		RTE_BOND_LOG(ERR,
-			"%s: Member %d capabilities doesn't allow allocating additional queues",
-			__func__, member_port);
+			"Member %u capabilities doesn't allow allocating additional queues",
+			member_port);
 		return -1;
 	}
 
@@ -249,9 +249,8 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) {
 		ret = rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info);
 		if (ret != 0) {
 			RTE_BOND_LOG(ERR,
-				"%s: Error during getting device (port %u) info: %s",
-				__func__, bond_dev->data->port_id,
-				strerror(-ret));
+				"Error getting device (port %u) info: %s",
+				bond_dev->data->port_id, strerror(-ret));
 
 			return ret;
 		}
@@ -2346,10 +2345,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			ret = rte_eth_dev_info_get(member.port_id, &member_info);
 			if (ret != 0) {
 				RTE_BOND_LOG(ERR,
-					"%s: Error during getting device (port %u) info: %s",
-					__func__,
-					member.port_id,
-					strerror(-ret));
+					"Error getting device (port %u) info: %s",
+					member.port_id, strerror(-ret));
 
 				return ret;
 			}
-- 
2.53.0


^ permalink raw reply related

* [PATCH v2] ethdev: add buffer size parameter to rte_eth_dev_get_name_by_port()
From: Stephen Hemminger @ 2026-05-29  0:07 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Andrew Rybchenko, Reshma Pattan, Aman Singh,
	Naga Harish K S V, Bruce Richardson, Kishore Padmanabha,
	Ajit Khaparde, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Harman Kalra, Anatoly Burakov, Cristian Dumitrescu,
	Thomas Monjalon
In-Reply-To: <20260409013658.965613-1-stephen@networkplumber.org>

rte_eth_dev_get_name_by_port() uses strcpy() into a caller-provided
buffer with no bounds checking. A mistaken caller that supplies a
buffer smaller than RTE_ETH_NAME_MAX_LEN can overflow the buffer.

Add a size parameter and replace strcpy() with strlcpy(), returning
-ERANGE if the name is truncated. The copy is now performed under
the ethdev shared data lock so that the name cannot be mutated by
another process between reading and copying.

The previous ABI is preserved via symbol versioning (DPDK_26) with a
thin wrapper that delegates to the new implementation with
RTE_ETH_NAME_MAX_LEN. The versioned symbol will be removed in 26.11.

Update all in-tree callers to pass sizeof(name) as the new parameter.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 app/dumpcap/main.c                           |  8 ++--
 app/pdump/main.c                             |  8 ++--
 app/test-pmd/config.c                        |  6 +--
 app/test/test_event_eth_tx_adapter.c         |  4 +-
 app/test/test_pmd_ring_perf.c                |  4 +-
 app/test/test_pmd_tap.c                      |  6 +--
 doc/guides/rel_notes/release_26_07.rst       |  4 ++
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c        |  4 +-
 drivers/net/cnxk/cnxk_flow.c                 | 10 +++--
 examples/multi_process/hotplug_mp/commands.c |  2 +-
 examples/pipeline/cli.c                      |  2 +-
 lib/ethdev/meson.build                       |  2 +
 lib/ethdev/rte_ethdev.c                      | 42 +++++++++++++++-----
 lib/ethdev/rte_ethdev.h                      | 10 +++--
 lib/pdump/rte_pdump.c                        |  8 ++--
 15 files changed, 78 insertions(+), 42 deletions(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 46a6cb251e..47483535fc 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -244,7 +244,7 @@ static void find_interfaces(void)
 
 		/* maybe got passed port number string as name */
 		intf->port = get_uint(intf->name, "port_number", UINT16_MAX);
-		if (rte_eth_dev_get_name_by_port(intf->port, intf->name) < 0)
+		if (rte_eth_dev_get_name_by_port(intf->port, intf->name, sizeof(intf->name)) < 0)
 			rte_exit(EXIT_FAILURE, "Invalid port number %u\n",
 				 intf->port);
 	}
@@ -261,7 +261,7 @@ static void set_default_interface(void)
 	uint16_t p;
 
 	RTE_ETH_FOREACH_DEV(p) {
-		if (rte_eth_dev_get_name_by_port(p, name) < 0)
+		if (rte_eth_dev_get_name_by_port(p, name, sizeof(name)) < 0)
 			continue;
 
 		intf = add_interface(name);
@@ -278,7 +278,7 @@ static void dump_interfaces(void)
 	uint16_t p;
 
 	RTE_ETH_FOREACH_DEV(p) {
-		if (rte_eth_dev_get_name_by_port(p, name) < 0)
+		if (rte_eth_dev_get_name_by_port(p, name, sizeof(name)) < 0)
 			continue;
 		printf("%u. %s\n", p, name);
 	}
@@ -498,7 +498,7 @@ static void statistics_loop(void)
 
 	while (!rte_atomic_load_explicit(&quit_signal, rte_memory_order_relaxed)) {
 		RTE_ETH_FOREACH_DEV(p) {
-			if (rte_eth_dev_get_name_by_port(p, name) < 0)
+			if (rte_eth_dev_get_name_by_port(p, name, sizeof(name)) < 0)
 				continue;
 
 			r = rte_eth_stats_get(p, &stats);
diff --git a/app/pdump/main.c b/app/pdump/main.c
index 1e62c8adc1..1f6135b20e 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -539,16 +539,16 @@ cleanup_pdump_resources(void)
 
 		/* Remove the vdev(s) created */
 		if (pt->dir & RTE_PDUMP_FLAG_RX) {
-			rte_eth_dev_get_name_by_port(pt->rx_vdev_id, name);
-			rte_eal_hotplug_remove("vdev", name);
+			if (rte_eth_dev_get_name_by_port(pt->rx_vdev_id, name, sizeof(name)) == 0)
+				rte_eal_hotplug_remove("vdev", name);
 		}
 
 		if (pt->single_pdump_dev)
 			continue;
 
 		if (pt->dir & RTE_PDUMP_FLAG_TX) {
-			rte_eth_dev_get_name_by_port(pt->tx_vdev_id, name);
-			rte_eal_hotplug_remove("vdev", name);
+			if (rte_eth_dev_get_name_by_port(pt->tx_vdev_id, name, sizeof(name)) == 0)
+				rte_eal_hotplug_remove("vdev", name);
 		}
 
 	}
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index c950793aaf..1cf441acf5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -697,7 +697,7 @@ device_infos_display(const char *identifier)
 							      &mac_addr) == 0)
 					print_ethaddr("\n\tMAC address: ",
 						      &mac_addr);
-				rte_eth_dev_get_name_by_port(port_id, name);
+				rte_eth_dev_get_name_by_port(port_id, name, sizeof(name));
 				printf("\n\tDevice name: %s", name);
 				if (rte_eth_dev_info_get(port_id, &dev_info) == 0)
 					device_infos_display_speeds(dev_info.speed_capa);
@@ -823,7 +823,7 @@ port_infos_display(portid_t port_id)
 	       info_border, port_id, info_border);
 	if (eth_macaddr_get_print_err(port_id, &mac_addr) == 0)
 		print_ethaddr("MAC address: ", &mac_addr);
-	rte_eth_dev_get_name_by_port(port_id, name);
+	rte_eth_dev_get_name_by_port(port_id, name, sizeof(name));
 	printf("\nDevice name: %s", name);
 	printf("\nDriver name: %s", dev_info.driver_name);
 
@@ -1011,7 +1011,7 @@ port_summary_display(portid_t port_id)
 	if (ret != 0)
 		return;
 
-	rte_eth_dev_get_name_by_port(port_id, name);
+	rte_eth_dev_get_name_by_port(port_id, name, sizeof(name));
 	ret = eth_macaddr_get_print_err(port_id, &mac_addr);
 	if (ret != 0)
 		return;
diff --git a/app/test/test_event_eth_tx_adapter.c b/app/test/test_event_eth_tx_adapter.c
index bec298a8b8..a7cbe39367 100644
--- a/app/test/test_event_eth_tx_adapter.c
+++ b/app/test/test_event_eth_tx_adapter.c
@@ -192,8 +192,8 @@ deinit_ports(void)
 
 	for (i = 0; i < RTE_DIM(default_params.port); i++) {
 		rte_eth_dev_stop(default_params.port[i]);
-		rte_eth_dev_get_name_by_port(default_params.port[i], name);
-		rte_vdev_uninit(name);
+		if (rte_eth_dev_get_name_by_port(default_params.port[i], name, sizeof(name)) == 0)
+			rte_vdev_uninit(name);
 		for (j = 0; j < RTE_DIM(default_params.r[i]); j++)
 			rte_ring_free(default_params.r[i][j]);
 	}
diff --git a/app/test/test_pmd_ring_perf.c b/app/test/test_pmd_ring_perf.c
index 3636df5c73..ac60f506ab 100644
--- a/app/test/test_pmd_ring_perf.c
+++ b/app/test/test_pmd_ring_perf.c
@@ -157,8 +157,8 @@ test_ring_pmd_perf(void)
 	/* release port and ring resources */
 	if (rte_eth_dev_stop(ring_ethdev_port) != 0)
 		return -1;
-	rte_eth_dev_get_name_by_port(ring_ethdev_port, name);
-	rte_vdev_uninit(name);
+	if (rte_eth_dev_get_name_by_port(ring_ethdev_port, name, sizeof(name)) == 0)
+		rte_vdev_uninit(name);
 	rte_ring_free(r);
 	return 0;
 }
diff --git a/app/test/test_pmd_tap.c b/app/test/test_pmd_tap.c
index 6d0e8b4f54..ded26bc5e3 100644
--- a/app/test/test_pmd_tap.c
+++ b/app/test/test_pmd_tap.c
@@ -594,7 +594,7 @@ test_tap_multi_queue(void)
 	uint16_t port;
 	RTE_ETH_FOREACH_DEV(port) {
 		char name[RTE_ETH_NAME_MAX_LEN];
-		if (rte_eth_dev_get_name_by_port(port, name) == 0 &&
+		if (rte_eth_dev_get_name_by_port(port, name, sizeof(name)) == 0 &&
 		    strstr(name, "net_tap_mq"))
 			goto found;
 	}
@@ -739,7 +739,7 @@ test_tap_setup(void)
 	/* Find the port IDs */
 	RTE_ETH_FOREACH_DEV(port_id) {
 		char name[RTE_ETH_NAME_MAX_LEN];
-		if (rte_eth_dev_get_name_by_port(port_id, name) != 0)
+		if (rte_eth_dev_get_name_by_port(port_id, name, sizeof(name)) != 0)
 			continue;
 
 		if (strstr(name, "net_tap0"))
@@ -785,7 +785,7 @@ test_tap_rx_queue_setup(void)
 	port = -1;
 	RTE_ETH_FOREACH_DEV(port_id) {
 		char name[RTE_ETH_NAME_MAX_LEN];
-		if (rte_eth_dev_get_name_by_port(port_id, name) == 0 &&
+		if (rte_eth_dev_get_name_by_port(port_id, name, sizeof(name)) == 0 &&
 		    strstr(name, "net_tap_neg")) {
 			port = port_id;
 			break;
diff --git a/doc/guides/rel_notes/release_26_07.rst b/doc/guides/rel_notes/release_26_07.rst
index 8b4f8401e2..6c91487a11 100644
--- a/doc/guides/rel_notes/release_26_07.rst
+++ b/doc/guides/rel_notes/release_26_07.rst
@@ -116,6 +116,10 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* ethdev: Added ``size`` parameter to ``rte_eth_dev_get_name_by_port()``
+  to prevent buffer overflows. The old ABI version without the size parameter
+  is preserved using symbol versioning and will be removed in 26.11.
+
 
 ABI Changes
 -----------
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c
index 6ca9d3309b..e1ffc64c5e 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c
@@ -608,7 +608,7 @@ ulp_tf_ctx_shared_session_open(struct bnxt *bp,
 
 	memset(&parms, 0, sizeof(parms));
 	rc = rte_eth_dev_get_name_by_port(ethdev->data->port_id,
-					  parms.ctrl_chan_name);
+					  parms.ctrl_chan_name, sizeof(parms.ctrl_chan_name));
 	if (rc) {
 		BNXT_DRV_DBG(ERR, "Invalid port %d, rc = %d\n",
 			     ethdev->data->port_id, rc);
@@ -786,7 +786,7 @@ ulp_tf_ctx_session_open(struct bnxt *bp,
 	memset(&params, 0, sizeof(params));
 
 	rc = rte_eth_dev_get_name_by_port(ethdev->data->port_id,
-					  params.ctrl_chan_name);
+					  params.ctrl_chan_name, sizeof(params.ctrl_chan_name));
 	if (rc) {
 		BNXT_DRV_DBG(ERR, "Invalid port %d, rc = %d\n",
 			     ethdev->data->port_id, rc);
diff --git a/drivers/net/cnxk/cnxk_flow.c b/drivers/net/cnxk/cnxk_flow.c
index c1c48eb7ab..eb51ce37e8 100644
--- a/drivers/net/cnxk/cnxk_flow.c
+++ b/drivers/net/cnxk/cnxk_flow.c
@@ -117,7 +117,7 @@ npc_parse_port_id_action(struct rte_eth_dev *eth_dev, const struct rte_flow_acti
 
 	port_act = (const struct rte_flow_action_port_id *)action->conf;
 
-	rc = rte_eth_dev_get_name_by_port(port_act->id, if_name);
+	rc = rte_eth_dev_get_name_by_port(port_act->id, if_name, sizeof(if_name));
 	if (rc) {
 		plt_err("Name not found for output port id");
 		goto err_exit;
@@ -517,7 +517,8 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,
 		case RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR:
 			in_actions[i].conf = actions->conf;
 			act_ethdev = (const struct rte_flow_action_ethdev *)actions->conf;
-			if (rte_eth_dev_get_name_by_port(act_ethdev->port_id, if_name)) {
+			if (rte_eth_dev_get_name_by_port(act_ethdev->port_id, if_name,
+							 sizeof(if_name))) {
 				plt_err("Name not found for output port id");
 				goto err_exit;
 			}
@@ -557,7 +558,7 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,
 				    actions->type != RTE_FLOW_ACTION_TYPE_PORT_ID ?
 					    act_ethdev->port_id :
 					    port_act->id,
-				    if_name)) {
+				    if_name, sizeof(if_name))) {
 				plt_err("Name not found for output port id");
 				goto err_exit;
 			}
@@ -713,7 +714,8 @@ cnxk_map_pattern(struct rte_eth_dev *eth_dev, const struct rte_flow_item pattern
 		if (pattern->type == RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT ||
 		    pattern->type == RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR) {
 			rep_eth_dev = (const struct rte_flow_item_ethdev *)pattern->spec;
-			if (rte_eth_dev_get_name_by_port(rep_eth_dev->port_id, if_name)) {
+			if (rte_eth_dev_get_name_by_port(rep_eth_dev->port_id, if_name,
+							 sizeof(if_name))) {
 				plt_err("Name not found for output port id");
 				goto fail;
 			}
diff --git a/examples/multi_process/hotplug_mp/commands.c b/examples/multi_process/hotplug_mp/commands.c
index 900eb9f774..92a4f0378b 100644
--- a/examples/multi_process/hotplug_mp/commands.c
+++ b/examples/multi_process/hotplug_mp/commands.c
@@ -36,7 +36,7 @@ cmd_list_parsed(__rte_unused void *parsed_result,
 	cmdline_printf(cl, "list all etherdev\n");
 
 	RTE_ETH_FOREACH_DEV(port_id) {
-		rte_eth_dev_get_name_by_port(port_id, dev_name);
+		rte_eth_dev_get_name_by_port(port_id, dev_name, sizeof(dev_name));
 		if (strlen(dev_name) > 0)
 			cmdline_printf(cl, "%d\t%s\n", port_id, dev_name);
 		else
diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 215b4061d5..51c8864077 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -396,7 +396,7 @@ ethdev_show(uint16_t port_id, char **out, size_t *out_size)
 	if (rte_eth_link_get(port_id, &link) != 0)
 		return;
 
-	rte_eth_dev_get_name_by_port(port_id, name);
+	rte_eth_dev_get_name_by_port(port_id, name, sizeof(name));
 	rte_eth_stats_get(port_id, &stats);
 	rte_eth_macaddr_get(port_id, &addr);
 	rte_eth_dev_get_mtu(port_id, &mtu);
diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build
index 8ba6c708a2..b2c4222fe6 100644
--- a/lib/ethdev/meson.build
+++ b/lib/ethdev/meson.build
@@ -62,3 +62,5 @@ endif
 if get_option('buildtype').contains('debug')
     cflags += ['-DRTE_FLOW_DEBUG']
 endif
+
+use_function_versioning = true
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index d0273e3f7b..1638cab231 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -721,12 +721,9 @@ rte_eth_dev_count_total(void)
 	return count;
 }
 
-RTE_EXPORT_SYMBOL(rte_eth_dev_get_name_by_port)
-int
-rte_eth_dev_get_name_by_port(uint16_t port_id, char *name)
+static int
+eth_dev_get_name_by_port(uint16_t port_id, char *name, size_t size)
 {
-	char *tmp;
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
 	if (name == NULL) {
@@ -735,19 +732,46 @@ rte_eth_dev_get_name_by_port(uint16_t port_id, char *name)
 		return -EINVAL;
 	}
 
+	if (size == 0) {
+		RTE_ETHDEV_LOG_LINE(ERR,
+			"Cannot get ethdev port %u name with zero-size buffer", port_id);
+		return -EINVAL;
+	}
+
 	rte_spinlock_lock(rte_mcfg_ethdev_get_lock());
-	/* shouldn't check 'rte_eth_devices[i].data',
-	 * because it might be overwritten by VDEV PMD */
-	tmp = eth_dev_shared_data->data[port_id].name;
+	/*
+	 * Use the shared data name rather than rte_eth_devices[].data->name
+	 * because VDEV PMDs may overwrite the per-process data pointer.
+	 */
+	size_t n = strlcpy(name, eth_dev_shared_data->data[port_id].name, size);
 	rte_spinlock_unlock(rte_mcfg_ethdev_get_lock());
 
-	strcpy(name, tmp);
+	if (n >= size) {
+		RTE_ETHDEV_LOG_LINE(ERR,
+				    "ethdev port %u name exceeds buffer size %zu",
+				    port_id, size);
+		return -ERANGE;
+	}
 
 	rte_ethdev_trace_get_name_by_port(port_id, name);
 
 	return 0;
 }
 
+/* new ABI version: bounded copy using caller-provided size */
+RTE_DEFAULT_SYMBOL(27, int, rte_eth_dev_get_name_by_port,
+		   (uint16_t port_id, char *name, size_t size))
+{
+	return eth_dev_get_name_by_port(port_id, name, size);
+}
+
+/* old ABI version: delegate to new version with max buffer size */
+RTE_VERSION_SYMBOL(26, int, rte_eth_dev_get_name_by_port,
+		   (uint16_t port_id, char *name))
+{
+	return eth_dev_get_name_by_port(port_id, name, RTE_ETH_NAME_MAX_LEN);
+}
+
 RTE_EXPORT_SYMBOL(rte_eth_dev_get_port_by_name)
 int
 rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id)
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 3f4d2438e4..17c000dbf2 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -5691,14 +5691,18 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
  * @param port_id
  *   Port identifier of the device.
  * @param name
- *   Buffer of size RTE_ETH_NAME_MAX_LEN to store the name.
+ *   Buffer to store the name.
+ * @param size
+ *   Size of the buffer pointed to by @p name. Should be at least
+ *   RTE_ETH_NAME_MAX_LEN bytes.
  * @return
  *   - (0) if successful.
  *   - (-ENODEV) if *port_id* is invalid.
- *   - (-EINVAL) on failure.
+ *   - (-EINVAL) if *name* is NULL or *size* is 0.
+ *   - (-ERANGE) if the buffer is too small for the device name.
  */
 int
-rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
+rte_eth_dev_get_name_by_port(uint16_t port_id, char *name, size_t size);
 
 /**
  * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index ac94efe7ff..ba36949b01 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -726,7 +726,7 @@ pdump_validate_flags(uint32_t flags)
 }
 
 static int
-pdump_validate_port(uint16_t port, char *name)
+pdump_validate_port(uint16_t port, char *name, size_t name_size)
 {
 	int ret = 0;
 
@@ -736,7 +736,7 @@ pdump_validate_port(uint16_t port, char *name)
 		return -1;
 	}
 
-	ret = rte_eth_dev_get_name_by_port(port, name);
+	ret = rte_eth_dev_get_name_by_port(port, name, name_size);
 	if (ret < 0) {
 		PDUMP_LOG_LINE(ERR, "port %u to name mapping failed",
 			  port);
@@ -818,7 +818,7 @@ pdump_enable(uint16_t port, uint16_t queue,
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
 
-	ret = pdump_validate_port(port, name);
+	ret = pdump_validate_port(port, name, sizeof(name));
 	if (ret < 0)
 		return ret;
 	ret = pdump_validate_ring_mp(ring, mp);
@@ -912,7 +912,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	int ret = 0;
 	char name[RTE_DEV_NAME_MAX_LEN];
 
-	ret = pdump_validate_port(port, name);
+	ret = pdump_validate_port(port, name, sizeof(name));
 	if (ret < 0)
 		return ret;
 	ret = pdump_validate_flags(flags);
-- 
2.53.0


^ permalink raw reply related

* Re: [PATCH v2 1/3] usertools/telemetry: add a FOREACH command
From: fengchengwen @ 2026-05-29  0:17 UTC (permalink / raw)
  To: Bruce Richardson, dev
In-Reply-To: <20260522133714.133268-2-bruce.richardson@intel.com>

Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 5/22/2026 9:37 PM, Bruce Richardson wrote:
> To simplify querying data from multiple devices, e.g. across ethdevs, or
> dmadevs, add a FOREACH command to the python script, allowing you to
> run, e.g. /ethdev/list, and then run a second command for each item in
> the list, gathering the relevant output values, optionally including an
> index counter.
> 
> Simple examples are given in the documentation:
> 
>   --> FOREACH /ethdev/list /ethdev/stats .opackets
>   [0, 0]
> 
>   --> FOREACH /ethdev/list /ethdev/stats .ipackets .opackets
>   [{"ipackets": 0, "opackets": 0}, {"ipackets": 0, "opackets": 0}]
> 
>   --> FOREACH i /ethdev/list /ethdev/info,$i .name
>   [{"i": 0, "name": "0000:16:00.0"}, {"i": 1, "name": "0000:16:00.1"}]
> 
>   --> FOREACH i /ethdev/list /ethdev/stats,$i .ipackets .opackets
>   [{"i": 0, "ipackets": 0, "opackets": 0}, {"i": 1, "ipackets": 0, "opackets": 0}]
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>


^ permalink raw reply

* Re: [PATCH v2 2/3] usertools/telemetry: support using aliases for long commands
From: fengchengwen @ 2026-05-29  0:25 UTC (permalink / raw)
  To: Bruce Richardson, dev
In-Reply-To: <20260522133714.133268-3-bruce.richardson@intel.com>

On 5/22/2026 9:37 PM, Bruce Richardson wrote:
> Similarly to how shell aliases work, allow specifying of short alias
> commands for dpdk-telemetry.py script. The aliases are read from
> "$HOME/.dpdk_telemetry_aliases" at startup.
> 
> Some examples of use from the docs. Alias file contents:
> 
>   # Basic shortcuts
>   ls=/ethdev/list
>   names=FOREACH i /ethdev/list /ethdev/info,$i .name
>   q=quit
> 
> Alias use:
> 
>    --> ls
>   {"/ethdev/list": [0, 1]}
> 
>   --> names
>   [{"i": 0, "name": "0000:
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  doc/guides/howto/telemetry.rst | 34 +++++++++++++++
>  usertools/dpdk-telemetry.py    | 75 ++++++++++++++++++++++++++++++++--
>  2 files changed, 105 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/guides/howto/telemetry.rst b/doc/guides/howto/telemetry.rst
> index 4bf48c635e..072289aec8 100644
> --- a/doc/guides/howto/telemetry.rst
> +++ b/doc/guides/howto/telemetry.rst
> @@ -130,6 +130,40 @@ and query information using the telemetry client python script.
>       - With loop variable: returns an array of objects containing the loop
>         variable field and requested value fields.
>  
> +   * Use command aliases.
> +
> +     The telemetry script can load aliases at startup from::
> +
> +        $HOME/.dpdk_telemetry_aliases

How about add one parameter to specific aliases file location

> +
> +     Each alias entry must be in ``alias=command`` format.
> +     Empty lines and lines starting with ``#`` are ignored.
> +
> +     Example alias file::
> +
> +        # Basic shortcuts
> +        ls=/ethdev/list
> +        names=FOREACH i /ethdev/list /ethdev/info,$i .name
> +        q=quit
> +
> +     Alias behavior is intentionally similar to shell aliases:
> +
> +     - The first token of the entered input is checked for an alias match.
> +     - If matched, that first token is replaced with its expansion.
> +     - Alias expansion is recursive (aliases can expand to other aliases).
> +     - Expansion has a safety limit to prevent infinite loops.
> +
> +     Examples::
> +
> +        --> ls
> +        {"/ethdev/list": [0, 1]}
> +
> +        --> names
> +        [{"i": 0, "name": "0000:16:00.0"}, {"i": 1, "name": "0000:16:00.1"}]
> +
> +        --> q
> +        # exits the client
> +
>  
>  Connecting to Different DPDK Processes
>  --------------------------------------
> diff --git a/usertools/dpdk-telemetry.py b/usertools/dpdk-telemetry.py
> index 2de10cff69..8b976160e0 100755
> --- a/usertools/dpdk-telemetry.py
> +++ b/usertools/dpdk-telemetry.py
> @@ -21,6 +21,70 @@
>  SOCKET_NAME = "dpdk_telemetry.{}".format(TELEMETRY_VERSION)
>  DEFAULT_PREFIX = "rte"
>  CMDS = []
> +ALIASES = {}
> +ALIAS_FILE = ".dpdk_telemetry_aliases"
> +MAX_ALIAS_EXPANSIONS = 32
> +
> +
> +def load_aliases():
> +    """Load aliases from $HOME/.dpdk_telemetry_aliases"""
> +    aliases = {}
> +    home = os.environ.get("HOME")
> +    if not home:
> +        return aliases
> +
> +    alias_path = os.path.join(home, ALIAS_FILE)
> +    if not os.path.isfile(alias_path):
> +        return aliases
> +
> +    try:
> +        with open(alias_path) as alias_file:
> +            for line_num, line in enumerate(alias_file, start=1):
> +                entry = line.strip()
> +                if not entry or entry.startswith("#"):
> +                    continue
> +                if "=" not in entry:
> +                    print(
> +                        "Warning: ignoring malformed alias at {}:{}".format(alias_path, line_num),
> +                        file=sys.stderr,
> +                    )
> +                    continue
> +                name, command = entry.split("=", 1)
> +                name = name.strip()
> +                command = command.strip()
> +                if not name or not command:
> +                    print(
> +                        "Warning: ignoring malformed alias at {}:{}".format(alias_path, line_num),
> +                        file=sys.stderr,
> +                    )
> +                    continue
> +                aliases[name] = command
> +    except OSError as e:
> +        print("Warning: failed to read {}: {}".format(alias_path, e), file=sys.stderr)

If load OK, please add one promote at begin:

Loaded xxx command aliases, see `help alias` for detail

> +
> +    return aliases
> +
> +



^ permalink raw reply

* Re: [PATCH v2 3/3] usertools/telemetry: add help support
From: fengchengwen @ 2026-05-29  0:27 UTC (permalink / raw)
  To: Bruce Richardson, dev
In-Reply-To: <20260522133714.133268-4-bruce.richardson@intel.com>

On 5/22/2026 9:37 PM, Bruce Richardson wrote:
> While the telemetry infrastructure supported using "/help,/<cmd>" to get
> help on specific commands, with the addition of script-specific
> commands, we needed better help support to explain the use of FOREACH,
> and to allow e.g. "help /<cmd>" using space separation, which is more
> intuitive. This patch adds that help support.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  usertools/dpdk-telemetry.py | 61 ++++++++++++++++++++++++++++++++++++-
>  1 file changed, 60 insertions(+), 1 deletion(-)
> 
> diff --git a/usertools/dpdk-telemetry.py b/usertools/dpdk-telemetry.py
> index 8b976160e0..2c88b91517 100755
> --- a/usertools/dpdk-telemetry.py
> +++ b/usertools/dpdk-telemetry.py
> @@ -25,6 +25,26 @@
>  ALIAS_FILE = ".dpdk_telemetry_aliases"
>  MAX_ALIAS_EXPANSIONS = 32
>  
> +BASIC_HELP_TEXT = """Basic usage:
> +    /<command>[,<params>]      Send a telemetry command to the app
> +    FOREACH ...                Run a compound query over list items
> +    help                       Show this help
> +    help /<command>            Show app-provided help for a command
> +    help FOREACH               Show FOREACH usage and examples
> +    quit                       Exit the client

Please add help alias to show ALL loaded command alias






^ permalink raw reply

* Re: [PATCH v4 02/25] bus/uacce: set API version during scan
From: fengchengwen @ 2026-05-29  3:50 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: thomas, stephen, bruce.richardson
In-Reply-To: <20260527075654.3780732-3-david.marchand@redhat.com>

Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 5/27/2026 3:56 PM, David Marchand wrote:
> Move API version parsing from the match callback to the time where the
> device object is allocated and filled, since this property is constant.
> 
> This avoids any side effect on the device object when calling the match
> callback.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>


^ permalink raw reply

* Re: [PATCH v4 05/25] bus: remove device and driver checks in DMA map/unmap
From: fengchengwen @ 2026-05-29  3:57 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: thomas, stephen, bruce.richardson, Parav Pandit, Xueming Li,
	Chenbo Xia, Nipun Gupta, Tomasz Duszynski
In-Reply-To: <20260527075654.3780732-6-david.marchand@redhat.com>

Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 5/27/2026 3:56 PM, David Marchand wrote:
> Add rte_dev_is_probed() check in rte_dev_dma_map() and
> rte_dev_dma_unmap() before calling bus-specific implementations.
> 
> The device parameter passed to bus DMA map/unmap operations cannot be
> NULL as the caller already dereferenced the bus structure to invoke
> these operations.
> The driver reference in the bus-specific device cannot be NULL since
> calling the .dma_map is done after dereferencing this pointer.
> 
> Remove redundant checks on probed device, and NULL checks on the
> device/driver parameter and derived device/driver pointers.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>


^ permalink raw reply

* Re: [PATCH v4 06/25] drivers/bus: remove device and driver checks in unplug
From: fengchengwen @ 2026-05-29  4:16 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: thomas, stephen, bruce.richardson, Parav Pandit, Xueming Li,
	Nipun Gupta, Nikhil Agarwal, Hemant Agrawal, Sachin Saxena,
	Rosen Xu, Chenbo Xia, Tomasz Duszynski, Long Li, Wei Hu
In-Reply-To: <20260527075654.3780732-7-david.marchand@redhat.com>

Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 5/27/2026 3:56 PM, David Marchand wrote:
> rte_dev_remove() checks if a device is probed before calling the bus
> unplug operation. Individual bus detach/remove functions checking that
> dev->driver is non-NULL are therefore redundant.
> 
> However, when the unplug operation is called at bus cleanup, care must
> be taken that devices are in probed state, so some check on
> rte_dev_is_probed() must be added.
> 
> The device parameter passed to bus unplug operations cannot be NULL as
> the caller already dereferenced the bus structure to invoke these
> operations.
> The driver reference in the bus-specific device cannot be NULL since
> calling the .unplug is done after dereferencing this pointer.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>


^ permalink raw reply

* [PATCH] net/zxdh : update MAINTAINERS entry
From: Wenqiang Chen @ 2026-05-29  5:55 UTC (permalink / raw)
  To: dev; +Cc: ran.ming, 陈文强10327674


[-- Attachment #1.1.1: Type: text/plain, Size: 644 bytes --]

From: 陈文强10327674 <chen.wenqiang2@zte.com.cn>

Change the GDTC rawdev maintainer from Yong Zhang
to Wenqiang Chen.

Signed-off-by: 陈文强10327674 <chen.wenqiang2@zte.com.cn>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index b390446ed3..48c72e1d67 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1612,7 +1612,7 @@ F: drivers/raw/dpaa2_cmdif/
 F: doc/guides/rawdevs/dpaa2_cmdif.rst
 
 ZTE GDTC
-M: Yong Zhang <zhang.yong25@zte.com.cn>
+M: Wenqiang Chen <chen.wenqiang2@zte.com.cn>
 F: drivers/raw/gdtc/
 F: doc/guides/rawdevs/gdtc.rst
 
-- 
2.27.0

[-- Attachment #1.1.2: Type: text/html , Size: 1045 bytes --]

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox