Skip to contentSkip to conversation

ethdev: clean up legacy flow director

PATCH Superseded Stephen Hemminger 6 participants 89 messages Aug 3 – Sep 3

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover ethdev: clean up legacy flow director

The original flow support in DPDK was Intel-specific and built around the flow director feature. It was superseded by the generic rte_flow API introduced in the 17.02 release. The direct API calls to flow director were removed in 20.11, but the data structures were never removed and drivers still use them. Some Intel drivers also carry driver-specific APIs related to flow director.

These vestiges mean applications can still see flow director data structures, since rte_ethdev.h pulls in rte_eth_ctrl.h. It also means several drivers and libraries have come to depend on network header definitions arriving indirectly.

Since drivers still need these definitions, rte_eth_ctrl.h is renamed to ethdev_fdir.h and the remaining bits in ethdev_driver.h are folded into it. This is a driver SDK header, not public API, and exists only so that drivers still carrying legacy flow director state have somewhere to get these definitions. New drivers should not use it.

Applications relying on the indirect includes will need to add explicit ones; this is a source level change only, with no ABI impact. The fdir option of the testpmd "show port" and "clear port" commands is also removed.

There is more to do here, but with no Intel hardware and no standalone tests for this code, I have kept to mechanical refactoring.

v2:
- fix enetfec driver not built on x86
- reword commit messages based on AI review

Stephen Hemminger (22):
drivers/net: remove unused include in dpaa
ethdev: use DPDK byte order conversion net/ixgbe: remove experimental FDIR API net/i40e: remove experimental FDIR API app/testpmd: remove support for flow director net/gve: include IP, UDP and TCP headers crypto/dpaa_sec: include UDP header net/nfp: break implicit dependency on rte_eth_ctrl.h net/mana: include used network headers
gro: include headers directly
app/test: include headers directly
node: get UDP header
net/rnp: include network headers
net/r8169: get network headers
net/ngbe: include network protocol headers
examples: include network headers
net/mlx5: include rte_flow as needed net/sfc: include rte_flow
net/intel/common: include network headers net/enetfec: add missing sys/types.h include ethdev, drivers: isolate flow director
doc: add release note about rte_ethdev changes

 app/test-eventdev/test_pipeline_common.h      |   1 +
 app/test-pmd/cmdline.c                        |  21 +--
 app/test-pmd/config.c                         | 163 ------------------
 app/test-pmd/testpmd.h                        |   3 -
 app/test/test_bpf.c                           |  18 +-
 app/test/test_security_inline_macsec.c        |   2 +
 app/test/test_security_inline_proto.c         |   1 +
 doc/api/doxy-api-index.md                     |   1 -
 doc/guides/rel_notes/release_26_11.rst        |  19 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |  36 ----
 drivers/crypto/dpaa_sec/dpaa_sec.h            |   2 +
 drivers/net/dpaa/dpaa_ptp.c                   |   1 -
 drivers/net/dpaa2/dpaa2_ptp.c                 |   1 -
 drivers/net/enetfec/enet_regs.h               |   2 +
 drivers/net/gve/gve_ethdev.h                  |   3 +
 drivers/net/hinic/hinic_pmd_ethdev.h          |   2 +
 drivers/net/hinic3/hinic3_ethdev.h            |   1 +
 drivers/net/intel/common/tx_scalar.h          |   3 +
 drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c |   2 +-
 drivers/net/intel/e1000/e1000_ethdev.h        |   1 +
 drivers/net/intel/e1000/igc_filter.h          |   2 +-
 drivers/net/intel/i40e/i40e_ethdev.c          |   4 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |   5 +-
 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 ----
 drivers/net/intel/iavf/iavf_fsub.c            |   2 +-
 drivers/net/intel/iavf/iavf_hash.c            |   2 +-
 drivers/net/intel/ice/ice_acl_filter.c        |   2 +-
 drivers/net/intel/ice/ice_ethdev.h            |   2 +
 drivers/net/intel/ice/ice_generic_flow.c      |   1 +
 drivers/net/intel/ice/ice_hash.c              |   2 +-
 drivers/net/intel/ice/ice_switch_filter.c     |   2 +-
 drivers/net/intel/ipn3ke/ipn3ke_flow.c        |   2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |   6 +-
 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 ----
 drivers/net/mana/mana.c                       |   2 +
 drivers/net/mana/tx.c                         |   3 +
 drivers/net/mlx5/mlx5_ethdev.c                |   1 +
 drivers/net/mlx5/mlx5_flow.h                  |   1 +
 drivers/net/mlx5/mlx5_txq.c                   |   1 +
 drivers/net/mlx5/mlx5_utils.c                 |   1 +
 drivers/net/mlx5/mlx5_utils.h                 |   1 +
 drivers/net/nbl/nbl_include/nbl_include.h     |   1 +
 drivers/net/nfp/nfp_ethdev.c                  |   6 +-
 drivers/net/nfp/nfp_net_common.h              |   1 +
 drivers/net/ngbe/ngbe_rxtx.c                  |   4 +
 drivers/net/r8169/r8169_rxtx.c                |   3 +
 drivers/net/rnp/rnp_rxtx.c                    |   6 +
 drivers/net/sfc/sfc_dp.c                      |   1 +
 drivers/net/txgbe/txgbe_ethdev.h              |   1 +
 examples/l2fwd-macsec/main.c                  |   2 +
 examples/l3fwd-graph/main.c                   |   1 +
 examples/l3fwd/l3fwd.h                        |   2 +
 lib/ethdev/ethdev_driver.h                    |  36 ----
 lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h}  |  58 +++++--
 lib/ethdev/meson.build                        |   2 +-
 lib/ethdev/rte_ethdev.h                       |  13 +-
 lib/ethdev/sff_8472.c                         |   3 +-
 lib/gro/gro_tcp4.c                            |   1 +
 lib/gro/gro_vxlan_tcp4.c                      |   4 +-
 lib/gro/gro_vxlan_udp4.c                      |   1 +
 lib/gro/rte_gro.c                             |   1 +
 lib/node/udp4_input.c                         |   1 +
 67 files changed, 165 insertions(+), 701 deletions(-)
 rename lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h} (91%)
Signature · 1 line
2.53.0
#1 lore raw

PATCH v2 1/22 drivers/net: remove unused include in dpaa

rte_eth_ctrl.h is deprecated and its contents are not used here.

---
 drivers/net/dpaa/dpaa_ptp.c   | 1 -
 drivers/net/dpaa2/dpaa2_ptp.c | 1 -
 2 files changed, 2 deletions(-)
drivers/net/dpaa/dpaa_ptp.c +0 -1
index e9b332c571..f91d3f9ce3 100644
@@ -9,7 +9,6 @@
 
 #include <rte_ethdev.h>
 #include <rte_log.h>
-#include <rte_eth_ctrl.h>
 #include <rte_malloc.h>
 #include <rte_time.h>
 
drivers/net/dpaa2/dpaa2_ptp.c +0 -1
index 751e558c73..77d5d82b44 100644
@@ -12,7 +12,6 @@
 
 #include <ethdev_driver.h>
 #include <rte_log.h>
-#include <rte_eth_ctrl.h>
 #include <rte_malloc.h>
 #include <rte_time.h>
 
Signature · 1 line
2.53.0
#2 lore raw

PATCH v2 2/22 ethdev: use DPDK byte order conversion

In reply to Stephen Hemminger

DPDK has its own byte order macros which are preferred over the POSIX/libc ones in arpa/inet.h
This resolves issue where this code was inheriting the inclusion of arpa/inet.h from rte_ethdev.h -> rte_eth_ctrl.h.

---
 lib/ethdev/sff_8472.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/ethdev/sff_8472.c +2 -1
index 97f231854c..acbbcee210 100644
@@ -4,6 +4,7 @@
  */
 
 #include <stdio.h>
+#include <rte_byteorder.h>
 
 #include "sff_common.h"
 
@@ -176,7 +177,7 @@ static float befloattoh(const uint32_t *source)
 		float dst;
 	} converter;
 
-	converter.src = ntohl(*source);
+	converter.src = rte_be_to_cpu_32(*source);
 	return converter.dst;
 }
 
Signature · 1 line
2.53.0
#3 lore raw

PATCH v2 3/22 net/ixgbe: remove experimental FDIR API

In reply to Stephen Hemminger

Remove the PMD specific flow director API from ixgbe. These APIs are experimental, therefore they can be removed without additional warnings.

---
 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(-)
drivers/net/intel/ixgbe/ixgbe_ethdev.h +0 -5
index 5d3243cb4d..c290f04611 100644
@@ -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
drivers/net/intel/ixgbe/ixgbe_fdir.c +0 -117

123 lines not on this page · raw message

drivers/net/intel/ixgbe/rte_pmd_ixgbe.c +0 -34
index f816fa3173..e0dff9cd73 100644
@@ -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;
-}
drivers/net/intel/ixgbe/rte_pmd_ixgbe.h +0 -32
index 7ca1126cfb..74bb5aa140 100644
@@ -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_ */
Signature · 1 line
2.53.0
#4 lore raw

PATCH v2 4/22 net/i40e: remove experimental FDIR API

In reply to Stephen Hemminger

Remove the flow director related private APIs in i40e. These APIs are experimental, therefore they can be removed without additional warnings.

---
 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(-)
drivers/net/intel/i40e/i40e_ethdev.c +2 -2
index b6b2d291ee..5cbdfe9db2 100644
@@ -9335,8 +9335,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] =
drivers/net/intel/i40e/i40e_ethdev.h +0 -4
index 9d9bde6aeb..3968bfd267 100644
@@ -1369,10 +1369,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);
drivers/net/intel/i40e/i40e_fdir.c +0 -140

146 lines not on this page · raw message

drivers/net/intel/i40e/i40e_flow.c +1 -2
index 6eb85a7d0d..e9993db6dd 100644
@@ -2391,8 +2391,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];
drivers/net/intel/i40e/rte_pmd_i40e.c +0 -34
index 2e7943ef8b..e47c1aa9d7 100644
@@ -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)
drivers/net/intel/i40e/rte_pmd_i40e.h +0 -33
index 5af7e2330f..34900f9bec 100644
@@ -1067,39 +1067,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
  *
Signature · 1 line
2.53.0
#5 lore raw

PATCH v2 5/22 app/testpmd: remove support for flow director

In reply to Stephen Hemminger

The legacy flow director API is deprecated and being removed. Drop it from testpmd; the testpmd CLI is not a stable API.

Removed commands:
show port fdir (port_id|all)
clear port fdir (port_id|all)

Also drop the documentation for "port config pctype mapping" and "port config input set" which no longer exist.

---
 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(-)
app/test-pmd/cmdline.c +6 -15
index 10ee7c5179..c142a8ec50 100644
@@ -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"
@@ -7514,11 +7514,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);
@@ -7531,14 +7526,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,
@@ -7576,10 +7571,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);
 }
@@ -7591,7 +7582,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);
 
@@ -7599,7 +7590,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,
app/test-pmd/config.c +0 -163

169 lines not on this page · raw message

app/test-pmd/testpmd.h +0 -3
index 083171853c..f7c10ab6b8 100644
@@ -1212,9 +1212,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);
doc/guides/testpmd_app_ug/testpmd_funcs.rst +0 -36
index e65376df54..f75a8d700c 100644
@@ -2288,42 +2288,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
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
2.53.0
#6 lore raw

PATCH v2 6/22 net/gve: include IP, UDP and TCP headers

In reply to Stephen Hemminger

This driver was getting rte_ip.h, rte_udp.h and rte_tcp.h implicitly through rte_ethdev.h -> rte_eth_ctrl.h -> rte_flow.h. Since rte_eth_ctrl.h is deprecated, better to not depend on that.

---
 drivers/net/gve/gve_ethdev.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/gve/gve_ethdev.h +3 -0
index c9a176ff17..8087bf98f9 100644
@@ -14,6 +14,9 @@
 #include <rte_bitmap.h>
 #include <rte_memzone.h>
 #include <rte_thread.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "base/gve.h"
 
Signature · 1 line
2.53.0
Reviewed-by on v2 6/22
#7 lore raw

Re: [PATCH v2 06/22] net/gve: include IP, UDP and TCP headers

Quoted 7 lines · Stephen Hemminger

This driver was getting rte_ip.h, rte_udp.h and rte_tcp.h implicitly through rte_ethdev.h -> rte_eth_ctrl.h -> rte_flow.h. Since rte_eth_ctrl.h is deprecated, better to not depend on that.

Quoted 21 lines
---
 drivers/net/gve/gve_ethdev.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/gve/gve_ethdev.h +3 -1
index c9a176ff17..8087bf98f9 100644
@@ -14,6 +14,9 @@
 #include <rte_bitmap.h>
 #include <rte_memzone.h>
 #include <rte_thread.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "base/gve.h"
 
--

2.53.0

#8 lore raw

PATCH v2 7/22 crypto/dpaa_sec: include UDP header

In reply to Stephen Hemminger

The driver was getting the UDP header definition indirectly via rte_ethdev.h. That will change, so include the header directly.

---
 drivers/crypto/dpaa_sec/dpaa_sec.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/crypto/dpaa_sec/dpaa_sec.h +2 -0
index d78cad818a..bce60d9cb8 100644
@@ -7,6 +7,8 @@
 #ifndef _DPAA_SEC_H_
 #define _DPAA_SEC_H_
 
+#include <rte_udp.h>
+
 #define CRYPTODEV_NAME_DPAA_SEC_PMD	crypto_dpaa_sec
 /**< NXP DPAA - SEC PMD device name */
 
Signature · 1 line
2.53.0
#9 lore raw

PATCH v2 8/22 net/nfp: break implicit dependency on rte_eth_ctrl.h

In reply to Stephen Hemminger

This driver was using UINT64_BIT which was getting defined via deprecated rte_eth_ctrl.h. Replace with local definition.

Also include rte_flow.h instead of depending on indirect inclusion from rte_ethdev.h.

---
 drivers/net/nfp/nfp_ethdev.c     | 6 ++++--
 drivers/net/nfp/nfp_net_common.h | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/net/nfp/nfp_ethdev.c +4 -2
index d2da18013c..25be1de080 100644
@@ -6,6 +6,7 @@
  */
 
 #include <unistd.h>
+#include <limits.h>
 
 #include <eal_firmware.h>
 #include <rte_alarm.h>
@@ -32,6 +33,7 @@
 
 /* 64-bit per app capabilities */
 #define NFP_NET_APP_CAP_SP_INDIFF       RTE_BIT64(0) /* Indifferent to port speed */
+#define NFP_UINT64_BIT (CHAR_BIT * sizeof(uint64_t))
 
 #define NFP_PF_DRIVER_NAME net_nfp_pf
 #define NFP_PF_FORCE_RELOAD_FW   "force_reload_fw"
@@ -2060,8 +2062,8 @@ nfp_net_speed_capa_get_real(struct nfp_eth_media_buf *media_buf,
 
 	for (i = 0; i < RTE_DIM(media_buf->supported_modes); i++) {
 		supported_modes = media_buf->supported_modes[i];
-		offset = i * UINT64_BIT;
-		for (j = 0; j < UINT64_BIT; j++) {
+		offset = i * NFP_UINT64_BIT;
+		for (j = 0; j < NFP_UINT64_BIT; j++) {
 			if (supported_modes == 0)
 				break;
 
drivers/net/nfp/nfp_net_common.h +1 -0
index 2bd2d54028..a479a7fbd4 100644
@@ -8,6 +8,7 @@
 
 #include <bus_pci_driver.h>
 #include <ethdev_driver.h>
+#include <rte_flow.h>
 #include <nfp_common.h>
 #include <nfp_dev.h>
 #include <rte_spinlock.h>
Signature · 1 line
2.53.0
#10 lore raw

PATCH v2 9/22 net/mana: include used network headers

In reply to Stephen Hemminger

This driver was getting definition of IP, UDP, and TCP headers implicitly via rte_ethdev.h. That will be changing so instead include the required headers directly.

---
 drivers/net/mana/mana.c | 2 ++
 drivers/net/mana/tx.c   | 3 +++
 2 files changed, 5 insertions(+)
drivers/net/mana/mana.c +2 -0
index 0b72f711a1..3870cb4a52 100644
@@ -6,8 +6,10 @@
 #include <dirent.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
+#include <netinet/in.h>
 
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
drivers/net/mana/tx.c +3 -0
index 10f2212b5d..9517b033dc 100644
@@ -3,6 +3,9 @@
  */
 
 #include <ethdev_driver.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
 
 #include <infiniband/verbs.h>
 #include <infiniband/manadv.h>
Signature · 1 line
2.53.0
Reviewed-by on v2 9/22
#11 lore raw

RE: [EXTERNAL] [PATCH v2 09/22] net/mana: include used network headers

Quoted 10 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Monday, August 3, 2026 9:52 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Long Li <[email protected]>; Wei Hu <[email protected]>
Subject: [EXTERNAL] [PATCH v2 09/22] net/mana: include used network headers

Quoted 5 lines

This driver was getting definition of IP, UDP, and TCP headers implicitly via rte_ethdev.h. That will be changing so instead include the required headers directly.

Quoted 36 lines
---
 drivers/net/mana/mana.c | 2 ++
 drivers/net/mana/tx.c   | 3 +++
 2 files changed, 5 insertions(+)
drivers/net/mana/mana.c index renamed from drivers/net/mana/mana.c +0 -0

0b72f711a1..3870cb4a52 100644

drivers/net/mana/mana.c +2 -0
@@ -6,8 +6,10 @@
 #include <dirent.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
+#include <netinet/in.h>
 
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
drivers/net/mana/tx.c index renamed from drivers/net/mana/tx.c +0 -0

10f2212b5d..9517b033dc 100644

drivers/net/mana/tx.c +3 -1
@@ -3,6 +3,9 @@
  */
 
 #include <ethdev_driver.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
 
 #include <infiniband/verbs.h>
 #include <infiniband/manadv.h>
--

2.53.0

#12 lore raw

PATCH v2 10/22 gro: include headers directly

In reply to Stephen Hemminger

The gro library was getting headers such as VXLAN implicitly via rte_ethdev.h.
This will change, so include the needed headers directly.

---
 lib/gro/gro_tcp4.c       | 1 +
 lib/gro/gro_vxlan_tcp4.c | 4 +++-
 lib/gro/gro_vxlan_udp4.c | 1 +
 lib/gro/rte_gro.c        | 1 +
 4 files changed, 6 insertions(+), 1 deletion(-)
lib/gro/gro_tcp4.c +1 -0
index 855cc7a71d..d8f3227c92 100644
@@ -5,6 +5,7 @@
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
+#include <rte_ip.h>
 
 #include "gro_tcp4.h"
 #include "gro_tcp_internal.h"
lib/gro/gro_vxlan_tcp4.c +3 -1
index 29d4a2e13d..653c7ea585 100644
@@ -5,7 +5,9 @@
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
-#include <rte_udp.h>
+#include <rte_vxlan.h>
+#include <rte_ip.h>
+#include <rte_tcp.h>
 
 #include "gro_vxlan_tcp4.h"
 
lib/gro/gro_vxlan_udp4.c +1 -0
index ca8cee270d..47262bcc32 100644
@@ -5,6 +5,7 @@
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
+#include <rte_vxlan.h>
 #include <rte_udp.h>
 
 #include "gro_vxlan_udp4.h"
lib/gro/rte_gro.c +1 -0
index 578cc9b801..d6b27bf8fb 100644
@@ -6,6 +6,7 @@
 #include <rte_malloc.h>
 #include <rte_cycles.h>
 #include <rte_ethdev.h>
+#include <rte_vxlan.h>
 
 #include "rte_gro.h"
 #include "gro_tcp4.h"
Signature · 1 line
2.53.0
#13 lore raw

PATCH v2 11/22 app/test: include headers directly

In reply to Stephen Hemminger

The test code was getting network headers indirectly via inclusion of rte_ethdev.h. This will change in the future, instead get the headers directly.

For BPF test, use the tool "iwyu" to get more complete set of headers. Replace use of htons() with equivalent DPDK byteorder macro.

---
 app/test-eventdev/test_pipeline_common.h |  1 +
 app/test/test_bpf.c                      | 18 +++++++++++++-----
 app/test/test_security_inline_macsec.c   |  2 ++
 app/test/test_security_inline_proto.c    |  1 +
 4 files changed, 17 insertions(+), 5 deletions(-)
app/test-eventdev/test_pipeline_common.h +1 -0
index 61370fb799..e9f20e7f62 100644
@@ -12,6 +12,7 @@
 #include <rte_cycles.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
+#include <rte_ip.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_event_eth_tx_adapter.h>
 #include <rte_eventdev.h>
app/test/test_bpf.c +13 -5
index 3205afaa63..2fea37396e 100644
@@ -5,16 +5,26 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdalign.h>
 #include <inttypes.h>
+#include <errno.h>
+#include <limits.h>
 #include <unistd.h>
 
-#include <rte_memory.h>
+#include <rte_bitops.h>
 #include <rte_debug.h>
 #include <rte_hexdump.h>
 #include <rte_malloc.h>
+#include <rte_memcpy.h>
+#include <rte_mbuf.h>
 #include <rte_random.h>
 #include <rte_byteorder.h>
 #include <rte_errno.h>
+#include <rte_ether.h>
+#include <rte_ip.h>
 
 #include "test.h"
 
@@ -30,8 +40,6 @@ test_bpf(void)
 #else
 
 #include <rte_bpf.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
 
 
 /* Tests of most simple BPF programs (no instructions, one instruction etc.) */
@@ -1331,7 +1339,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 	uint16_t eth_type;
 	uint64_t v = -1;
 
-	if (eth_hdr->ether_type == htons(0x8100)) {
+	if (eth_hdr->ether_type == rte_cpu_to_be_16(0x8100)) {
 		const struct rte_vlan_hdr *vlan_hdr =
 			(const void *)(eth_hdr + 1);
 		eth_type = vlan_hdr->eth_proto;
@@ -1341,7 +1349,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 		next = eth_hdr + 1;
 	}
 
-	if (eth_type == htons(0x0800)) {
+	if (eth_type == rte_cpu_to_be_16(0x0800)) {
 		ipv4_hdr = next;
 		if ((ipv4_hdr->dst_addr & rte_cpu_to_be_32(TEST_NETMASK)) ==
 		    rte_cpu_to_be_32(TEST_SUBNET)) {
app/test/test_security_inline_macsec.c +2 -0
index a929ff5326..43672ef237 100644
@@ -8,6 +8,8 @@
 #include <rte_ethdev.h>
 #include <rte_malloc.h>
 #include <rte_security.h>
+#include <rte_flow.h>
+#include <rte_macsec.h>
 
 #include "test.h"
 #include "test_security_inline_macsec_vectors.h"
app/test/test_security_inline_proto.c +1 -0
index 0b1f7fbbab..99111e5432 100644
@@ -7,6 +7,7 @@
 #include <inttypes.h>
 
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <rte_malloc.h>
 #include <rte_security.h>
 
Signature · 1 line
2.53.0
#14 lore raw

PATCH v2 12/22 node: get UDP header

In reply to Stephen Hemminger

This library was getting UDP header indirectly via rte_ethdev.h

---
 lib/node/udp4_input.c | 1 +
 1 file changed, 1 insertion(+)
lib/node/udp4_input.c +1 -0
index 5a74e28c85..fb62822b76 100644
@@ -11,6 +11,7 @@
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
 #include <rte_ip.h>
+#include <rte_udp.h>
 #include <rte_lpm.h>
 #include <rte_hash.h>
 #include <rte_fbk_hash.h>
Signature · 1 line
2.53.0
#15 lore raw

PATCH v2 13/22 net/rnp: include network headers

In reply to Stephen Hemminger

The driver was getting definition of standard network protocol headers indirectly from rte_ethdev.h.

---
 drivers/net/rnp/rnp_rxtx.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/rnp/rnp_rxtx.c +6 -0
index 81e8c6ba44..93a3372e5a 100644
@@ -8,6 +8,12 @@
 #include <rte_memzone.h>
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
+#include <rte_vxlan.h>
+#include <rte_ip.h>
+#include <rte_gre.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "base/rnp_bdq_if.h"
 #include "base/rnp_dma_regs.h"
Signature · 1 line
2.53.0
#16 lore raw

PATCH v2 14/22 net/r8169: get network headers

In reply to Stephen Hemminger

This driver was getting network protocol headers indirectly via rte_ethdev.h.

---
 drivers/net/r8169/r8169_rxtx.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/r8169/r8169_rxtx.c +3 -0
index 00de0471f4..b84d451bb3 100644
@@ -20,6 +20,9 @@
 #include <rte_memory.h>
 #include <rte_malloc.h>
 #include <dev_driver.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
 
 #include "r8169_ethdev.h"
 #include "r8169_hw.h"
Signature · 1 line
2.53.0
#17 lore raw

PATCH v2 15/22 net/ngbe: include network protocol headers

In reply to Stephen Hemminger

Do not depend on network protocol headers getting included via rte_ethdev.h.

---
 drivers/net/ngbe/ngbe_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ngbe/ngbe_rxtx.c +4 -0
index a1389de9c0..fee984c396 100644
@@ -11,6 +11,10 @@
 #include <rte_malloc.h>
 #include <rte_net.h>
 #include <rte_vect.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "ngbe_logs.h"
 #include "base/ngbe.h"
Signature · 1 line
2.53.0
#18 lore raw

PATCH v2 16/22 examples: include network headers

In reply to Stephen Hemminger

Don't depend on network protocol headers getting indirectly included via rte_ethdev.h.

---
 examples/l2fwd-macsec/main.c | 2 ++
 examples/l3fwd-graph/main.c  | 1 +
 examples/l3fwd/l3fwd.h       | 2 ++
 3 files changed, 5 insertions(+)
examples/l2fwd-macsec/main.c +2 -0
index 059f8a2170..e07769bd57 100644
@@ -33,9 +33,11 @@
 #include <rte_debug.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_security.h>
+#include <rte_macsec.h>
 #include <rte_string_fns.h>
 
 static volatile bool force_quit;
examples/l3fwd-graph/main.c +1 -0
index 5f89286dce..79dee4d103 100644
@@ -36,6 +36,7 @@
 #include <rte_per_lcore.h>
 #include <rte_string_fns.h>
 #include <rte_vect.h>
+#include <rte_ip.h>
 
 #include <cmdline_parse.h>
 #include <cmdline_parse_etheraddr.h>
examples/l3fwd/l3fwd.h +2 -0
index 349fc37c79..db7b746f59 100644
@@ -8,6 +8,8 @@
 #include <rte_ethdev.h>
 #include <rte_vect.h>
 #include <rte_acl.h>
+#include <rte_ip.h>
+
 
 #define DO_RFC_1812_CHECKS
 
Signature · 1 line
2.53.0
#19 lore raw

PATCH v2 17/22 net/mlx5: include rte_flow as needed

In reply to Stephen Hemminger

The driver was getting rte_flow.h included indirectly via rte_ethdev.h. This will change in future and driver should include it where needed.

---
 drivers/net/mlx5/mlx5_ethdev.c | 1 +
 drivers/net/mlx5/mlx5_flow.h   | 1 +
 drivers/net/mlx5/mlx5_txq.c    | 1 +
 drivers/net/mlx5/mlx5_utils.c  | 1 +
 drivers/net/mlx5/mlx5_utils.h  | 1 +
 5 files changed, 5 insertions(+)
drivers/net/mlx5/mlx5_ethdev.c +1 -0
index 8160d10e7e..c3d8e1b04f 100644
@@ -19,6 +19,7 @@
 #include <rte_string_fns.h>
 #include <rte_rwlock.h>
 #include <rte_cycles.h>
+#include <rte_flow.h>
 
 #include <mlx5_malloc.h>
 
drivers/net/mlx5/mlx5_flow.h +1 -0
index 3415b4722e..0da50fab85 100644
@@ -12,6 +12,7 @@
 
 #include <rte_alarm.h>
 #include <rte_mtr.h>
+#include <rte_flow.h>
 
 #include <mlx5_glue.h>
 #include <mlx5_prm.h>
drivers/net/mlx5/mlx5_txq.c +1 -0
index f9b254c6c5..f0b7b2d032 100644
@@ -18,6 +18,7 @@
 #include <rte_common.h>
 #include <rte_eal_paging.h>
 #include <rte_bitops.h>
+#include <rte_flow.h>
 
 #include <mlx5_common.h>
 #include <mlx5_common_mr.h>
drivers/net/mlx5/mlx5_utils.c +1 -0
index 606743c4b7..12820054ff 100644
@@ -3,6 +3,7 @@
  */
 
 #include <rte_malloc.h>
+#include <rte_flow.h>
 
 #include <mlx5_malloc.h>
 
drivers/net/mlx5/mlx5_utils.h +1 -0
index 9ab79c8ad5..19d03145a6 100644
@@ -16,6 +16,7 @@
 #include <rte_rwlock.h>
 #include <rte_memory.h>
 #include <rte_bitmap.h>
+#include <rte_flow.h>
 
 #include <mlx5_common.h>
 #include <mlx5_common_utils.h>
Signature · 1 line
2.53.0
#20 lore raw

PATCH v2 18/22 net/sfc: include rte_flow

In reply to Stephen Hemminger

This driver was depending on rte_ethdev.h doing inclusion of rte_flow.h.

---
 drivers/net/sfc/sfc_dp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/sfc/sfc_dp.c +1 -0
index 7e2a20e4dc..c867c2c2ff 100644
@@ -15,6 +15,7 @@
 #include <rte_ethdev.h>
 #include <rte_log.h>
 #include <rte_mbuf_dyn.h>
+#include <rte_flow.h>
 
 #include "efx.h"
 
Signature · 1 line
2.53.0
#21 lore raw

PATCH v2 19/22 net/intel/common: include network headers

In reply to Stephen Hemminger

This file was depending on network protocol headers getting included via rte_ethdev.h -> rte_flow.h.

---
 drivers/net/intel/common/tx_scalar.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/intel/common/tx_scalar.h +3 -0
index 11ab6c08fc..dcb2ea5542 100644
@@ -8,6 +8,9 @@
 #include <stdint.h>
 #include <rte_io.h>
 #include <rte_byteorder.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 /* depends on common Tx definitions. */
 #include "tx.h"
Signature · 1 line
2.53.0
#22 lore raw

PATCH v2 20/22 net/enetfec: add missing sys/types.h include

In reply to Stephen Hemminger

The enet_regs.h header uses BSD types 'uint' and 'ushort' which were previously available through indirect inclusion via:
rte_ethdev.h -> rte_flow.h -> rte_ip.h -> rte_ip[46].h -> sys/types.h

After changes to reduce rte_ethdev.h header dependencies, this indirect inclusion no longer occurs, causing build failures on PowerPC.

---
 drivers/net/enetfec/enet_regs.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/enetfec/enet_regs.h +2 -0
index c9400957f8..a834fa5889 100644
@@ -5,6 +5,8 @@
 #ifndef __ENETFEC_REGS_H
 #define __ENETFEC_REGS_H
 
+#include <sys/types.h>
+
 /* Ethernet receive use control and status of buffer descriptor
  */
 #define RX_BD_TR	((ushort)0x0001) /* Truncated */
Signature · 1 line
2.53.0
#23 lore raw

PATCH v2 21/22 ethdev, drivers: isolate flow director

In reply to Stephen Hemminger

There are leftover bits of legacy flow director that are still being used by drivers. Move the definitions contained in ethdev_driver.h and rte_eth_ctrl.h into a single file ethdev_fdir.h and only include it in the drivers that require it.

Change rte_ethdev.h to include the headers required which it was previously getting from rte_eth_ctrl.h -> rte_flow.h.

Since ethdev_fdir.h is internal for driver SDK only it does not have to include as many secondary headers.

---
 doc/api/doxy-api-index.md                     |  1 -
 drivers/net/hinic/hinic_pmd_ethdev.h          |  2 +
 drivers/net/hinic3/hinic3_ethdev.h            |  1 +
 drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c |  2 +-
 drivers/net/intel/e1000/e1000_ethdev.h        |  1 +
 drivers/net/intel/e1000/igc_filter.h          |  2 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |  1 +
 drivers/net/intel/iavf/iavf_fsub.c            |  2 +-
 drivers/net/intel/iavf/iavf_hash.c            |  2 +-
 drivers/net/intel/ice/ice_acl_filter.c        |  2 +-
 drivers/net/intel/ice/ice_ethdev.h            |  2 +
 drivers/net/intel/ice/ice_generic_flow.c      |  1 +
 drivers/net/intel/ice/ice_hash.c              |  2 +-
 drivers/net/intel/ice/ice_switch_filter.c     |  2 +-
 drivers/net/intel/ipn3ke/ipn3ke_flow.c        |  2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |  1 +
 drivers/net/nbl/nbl_include/nbl_include.h     |  1 +
 drivers/net/txgbe/txgbe_ethdev.h              |  1 +
 lib/ethdev/ethdev_driver.h                    | 36 ------------
 lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h}  | 58 ++++++++++++++-----
 lib/ethdev/meson.build                        |  2 +-
 lib/ethdev/rte_ethdev.h                       | 13 +----
 22 files changed, 67 insertions(+), 70 deletions(-)
 rename lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h} (91%)
doc/api/doxy-api-index.md +0 -1
index 9296042119..ac8314e908 100644
@@ -11,7 +11,6 @@ The public API headers are grouped by topics:
 - **device**:
   [dev](@ref rte_dev.h),
   [ethdev](@ref rte_ethdev.h),
-  [ethctrl](@ref rte_eth_ctrl.h),
   [rte_flow](@ref rte_flow.h),
   [rte_tm](@ref rte_tm.h),
   [rte_mtr](@ref rte_mtr.h),
drivers/net/hinic/hinic_pmd_ethdev.h +2 -0
index 8e6251f69f..10285ce814 100644
@@ -7,7 +7,9 @@
 
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
+#include <rte_flow.h>
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 
 #include "base/hinic_compat.h"
 #include "base/hinic_pmd_cfg.h"
drivers/net/hinic3/hinic3_ethdev.h +1 -0
index 9061e2b217..515ba044a1 100644
@@ -7,6 +7,7 @@
 
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
+#include <ethdev_fdir.h>
 
 #include "hinic3_fdir.h"
 
drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c +1 -1
index f42156e28f..977036bec5 100644
@@ -16,7 +16,7 @@
 #include <rte_ether.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/e1000/e1000_ethdev.h +1 -0
index 0907c7c259..da4dacc7d4 100644
@@ -9,6 +9,7 @@
 #include <sys/queue.h>
 
 #include <rte_flow.h>
+#include <ethdev_fdir.h>
 #include <rte_time.h>
 #include <rte_pci.h>
 
drivers/net/intel/e1000/igc_filter.h +1 -1
index 2b7e6b619a..d1e098e5bb 100644
@@ -8,7 +8,7 @@
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
 #include <ethdev_driver.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 
 #include "igc_ethdev.h"
 
drivers/net/intel/i40e/i40e_ethdev.h +1 -0
index 3968bfd267..c03eaab946 100644
@@ -13,6 +13,7 @@
 #include <rte_hash.h>
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_tm_driver.h>
 #include "rte_pmd_i40e.h"
 #include <rte_vect.h>
drivers/net/intel/iavf/iavf_fsub.c +1 -1
index 19ae0e2dc2..745089c1e4 100644
@@ -14,7 +14,7 @@
 #include <rte_ethdev.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/iavf/iavf_hash.c +1 -1
index 9515094402..38526eb7e6 100644
@@ -15,7 +15,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 
drivers/net/intel/ice/ice_acl_filter.c +1 -1
index 30ff1254c9..08f44e26cf 100644
@@ -13,9 +13,9 @@
 #include <rte_debug.h>
 #include <rte_ether.h>
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/ice/ice_ethdev.h +2 -0
index 7ee3ea8a70..fe0dc19c98 100644
@@ -8,8 +8,10 @@
 #include <rte_compat.h>
 #include <rte_kvargs.h>
 #include <rte_time.h>
+#include <rte_flow.h>
 
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_tm_driver.h>
 #include <rte_vect.h>
 
drivers/net/intel/ice/ice_generic_flow.c +1 -0
index 76b3800545..9c81c3aea8 100644
@@ -13,6 +13,7 @@
 
 #include <rte_ether.h>
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_hexdump.h>
 #include <rte_malloc.h>
 #include <rte_tailq.h>
drivers/net/intel/ice/ice_hash.c +1 -1
index 7a9a4f1a04..5158a4f886 100644
@@ -16,7 +16,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 
drivers/net/intel/ice/ice_switch_filter.c +1 -1
index 6f5af03f6a..cbc3df6d7c 100644
@@ -15,7 +15,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/ipn3ke/ipn3ke_flow.c +1 -1
index 941d2921fb..47f4936bc6 100644
@@ -16,7 +16,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_rawdev.h>
 #include <rte_rawdev_pmd.h>
drivers/net/intel/ixgbe/ixgbe_ethdev.h +1 -0
index c290f04611..68b54ae750 100644
@@ -16,6 +16,7 @@
 #include "ixgbe_bypass.h"
 #include "ixgbe_ipsec.h"
 #include <rte_flow.h>
+#include <ethdev_fdir.h>
 #include <rte_time.h>
 #include <rte_hash.h>
 #include <rte_pci.h>
drivers/net/nbl/nbl_include/nbl_include.h +1 -0
index eeae6a3301..c1383e7b4e 100644
@@ -27,6 +27,7 @@
 
 #include <rte_alarm.h>
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <bus_pci_driver.h>
drivers/net/txgbe/txgbe_ethdev.h +1 -0
index c32c61d8bf..a48d710ab1 100644
@@ -18,6 +18,7 @@
 #include <rte_time.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
+#include <ethdev_fdir.h>
 #include <rte_hash.h>
 #include <rte_hash_crc.h>
 #include <bus_pci_driver.h>
lib/ethdev/ethdev_driver.h +0 -36
index 0f336f9567..2dc63cfa18 100644
@@ -2365,42 +2365,6 @@ struct rte_eth_tunnel_filter_conf {
 	uint16_t queue_id;      /**< Queue assigned to if match */
 };
 
-/**
- *  Memory space that can be configured to store Flow Director filters
- *  in the board memory.
- */
-enum rte_eth_fdir_pballoc_type {
-	RTE_ETH_FDIR_PBALLOC_64K = 0,  /**< 64k. */
-	RTE_ETH_FDIR_PBALLOC_128K,     /**< 128k. */
-	RTE_ETH_FDIR_PBALLOC_256K,     /**< 256k. */
-};
-
-/**
- *  Select report mode of FDIR hash information in Rx descriptors.
- */
-enum rte_fdir_status_mode {
-	RTE_FDIR_NO_REPORT_STATUS = 0, /**< Never report FDIR hash. */
-	RTE_FDIR_REPORT_STATUS, /**< Only report FDIR hash for matching pkts. */
-	RTE_FDIR_REPORT_STATUS_ALWAYS, /**< Always report FDIR hash. */
-};
-
-/**
- * A structure used to configure the Flow Director (FDIR) feature
- * of an Ethernet port.
- *
- * If mode is RTE_FDIR_MODE_NONE, the pballoc value is ignored.
- */
-struct rte_eth_fdir_conf {
-	enum rte_fdir_mode mode; /**< Flow Director mode. */
-	enum rte_eth_fdir_pballoc_type pballoc; /**< Space for FDIR filters. */
-	enum rte_fdir_status_mode status;  /**< How to report FDIR hash. */
-	/** Rx queue of packets matching a "drop" filter in perfect mode. */
-	uint8_t drop_queue;
-	struct rte_eth_fdir_masks mask;
-	/** Flex payload configuration. */
-	struct rte_eth_fdir_flex_conf flex_conf;
-};
-
 /**
  * @internal
  * Fetch from the driver what kind of configuration must be restored by ethdev layer,
lib/ethdev/ethdev_fdir.h renamed from lib/ethdev/rte_eth_ctrl.h +45 -13

73 lines not on this page · raw message

lib/ethdev/meson.build +1 -1
index 8ba6c708a2..3d556f8b7f 100644
@@ -32,11 +32,11 @@ headers = files(
 
 indirect_headers += files(
         'rte_ethdev_core.h',
-        'rte_eth_ctrl.h',
 )
 
 driver_sdk_headers += files(
         'ethdev_driver.h',
+        'ethdev_fdir.h',
         'ethdev_pci.h',
         'ethdev_vdev.h',
         'rte_flow_driver.h',
lib/ethdev/rte_ethdev.h +2 -11
index ee400b386f..7a17b81208 100644
@@ -164,8 +164,10 @@
 #include <rte_devargs.h>
 #include <rte_bitops.h>
 #include <rte_errno.h>
+#include <rte_ether.h>
 #include <rte_common.h>
 #include <rte_config.h>
+#include <rte_mbuf_history.h>
 #include <rte_power_intrinsics.h>
 
 #include "rte_ethdev_trace_fp.h"
@@ -1505,17 +1507,6 @@ enum rte_eth_tunnel_type {
 	RTE_ETH_TUNNEL_TYPE_MAX,
 };
 
-#ifdef __cplusplus
-}
-#endif
-
-/* Deprecated API file for rte_eth_dev_filter_* functions */
-#include "rte_eth_ctrl.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /**
  * UDP tunneling configuration.
  *
Signature · 1 line
2.53.0
#24 lore raw

PATCH v2 22/22 doc: add release note about rte_ethdev changes

In reply to Stephen Hemminger

The changes to rte_ethdev are visible to applications, which may need to include some network headers directly.

---
 doc/guides/rel_notes/release_26_11.rst | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
doc/guides/rel_notes/release_26_11.rst +19 -0
index c8cc86295d..a5e049ac04 100644
@@ -77,6 +77,15 @@ Removed Items
     ``rte_rib6_is_equal``
   * table: ``RTE_LPM_IPV6_ADDR_SIZE``
 
+* Removed the experimental flow director API:
+
+  * ixgbe: ``rte_pmd_ixgbe_get_fdir_info``, ``rte_pmd_ixgbe_get_fdir_stats``
+  * i40e: ``rte_pmd_i40e_get_fdir_info``, ``rte_pmd_i40e_get_fdir_stats``
+
+* Removed some testpmd commands:
+
+  The ``fdir`` option in ``show port`` and ``clear port`` were removed.
+
 
 API Changes
 -----------
@@ -93,6 +102,16 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* **Changed ethdev include files.**
+
+  * Dropped inclusion of ``rte_flow.h`` in ``rte_ethdev.h``.
+    Applications using flow API should include it directly.
+  * Network headers ``rte_ip.h``, ``rte_udp.h``, ``rte_tcp.h`` and ``rte_sctp.h``
+    are no longer indirectly included by ``rte_ethdev.h``.
+    Applications should include network headers as needed.
+  * Legacy flow director definitions are no longer included by ``rte_ethdev.h``.
+    ``rte_eth_ctrl.h`` is removed. Internal driver definitions were moved to ``ethdev_fdir.h``.
+
 
 ABI Changes
 -----------
Signature · 1 line
2.53.0
#25 lore raw

v3 cover ethdev: isolate legacy flow director

In reply to Stephen Hemminger

The original flow support in DPDK was Intel-specific and built around the flow director feature. It was superseded by the generic rte_flow API introduced in the 17.02 release. The direct API calls to flow director were removed in 20.11, but the data structures were never removed and drivers still use them. Some Intel drivers also carry driver-specific APIs related to flow director.

These vestiges mean applications can still see flow director data structures, since rte_ethdev.h pulls in rte_eth_ctrl.h. It also means several drivers and libraries have come to depend on network header definitions arriving indirectly.

Since drivers still need these definitions, rte_eth_ctrl.h is renamed to ethdev_fdir.h and the remaining bits in ethdev_driver.h are folded into it. This is a driver SDK header, not public API, and exists only so that drivers still carrying legacy flow director state have somewhere to get these definitions. New drivers should not use it.

Applications relying on the indirect includes will need to add explicit ones; this is a source level change only, with no ABI impact. The fdir option of the testpmd "show port" and "clear port" commands is also removed.

There is more to do here, but with no Intel hardware and no standalone tests for this code, I have kept to mechanical refactoring.

v3:
- fix some include issues in test
- drop i40e specific flow_director_filter
- cleanup unused stuff in testpmd

v2:
- fix enetfec driver not built on x86
- reword commit messages based on AI review

Stephen Hemminger (23):
drivers/net: remove unused include in dpaa
ethdev: use DPDK byte order conversion net/ixgbe: remove experimental FDIR API net/i40e: remove experimental FDIR API app/testpmd: remove support for flow director app/testpmd: move str_to_flowtype to i40e app/test: include headers directly
gro: include headers directly crypto/dpaa_sec: include UDP header net/gve: include UDP, SCTP and TCP headers net/nfp: break implicit dependency on rte_eth_ctrl.h net/mana: include used network headers
node: get UDP header
net/rnp: include network headers
net/r8169: get network headers
net/ngbe: include network protocol headers
examples: include network headers
net/mlx5: include rte_flow as needed net/sfc: include rte_flow
net/intel/common: include network headers net/enetfec: add missing sys/types.h include ethdev, drivers: isolate flow director
doc: add release note about rte_ethdev changes

 app/test-eventdev/test_pipeline_common.h      |   1 +
 app/test-pmd/cmdline.c                        |  21 +-
 app/test-pmd/config.c                         | 225 ------------------
 app/test-pmd/testpmd.h                        |   6 -
 app/test/test_bpf.c                           |  20 +-
 app/test/test_security_inline_macsec.c        |   2 +
 app/test/test_security_inline_proto.c         |   1 +
 doc/api/doxy-api-index.md                     |   1 -
 doc/guides/nics/i40e.rst                      |  46 ----
 doc/guides/rel_notes/release_26_11.rst        |  19 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |  54 +----
 drivers/crypto/dpaa_sec/dpaa_sec.h            |   2 +
 drivers/net/dpaa/dpaa_ptp.c                   |   1 -
 drivers/net/dpaa2/dpaa2_ptp.c                 |   1 -
 drivers/net/enetfec/enet_regs.h               |   2 +
 drivers/net/gve/gve_ethdev.h                  |  13 +-
 drivers/net/hinic/hinic_pmd_ethdev.h          |   2 +
 drivers/net/hinic3/hinic3_ethdev.h            |   1 +
 drivers/net/intel/common/tx_scalar.h          |   3 +
 drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c |   2 +-
 drivers/net/intel/e1000/e1000_ethdev.h        |   1 +
 drivers/net/intel/e1000/igc_filter.h          |   2 +-
 drivers/net/intel/i40e/i40e_ethdev.c          |   4 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |   5 +-
 drivers/net/intel/i40e/i40e_fdir.c            | 140 -----------
 drivers/net/intel/i40e/i40e_flow.c            |   3 +-
 drivers/net/intel/i40e/i40e_testpmd.c         |  51 ++++
 drivers/net/intel/i40e/rte_pmd_i40e.c         |  34 ---
 drivers/net/intel/i40e/rte_pmd_i40e.h         |  33 ---
 drivers/net/intel/iavf/iavf_fsub.c            |   2 +-
 drivers/net/intel/iavf/iavf_hash.c            |   2 +-
 drivers/net/intel/ice/ice_acl_filter.c        |   2 +-
 drivers/net/intel/ice/ice_ethdev.h            |   2 +
 drivers/net/intel/ice/ice_generic_flow.c      |   1 +
 drivers/net/intel/ice/ice_hash.c              |   2 +-
 drivers/net/intel/ice/ice_switch_filter.c     |   2 +-
 drivers/net/intel/ipn3ke/ipn3ke_flow.c        |   2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |   6 +-
 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 ---
 drivers/net/mana/mana.c                       |  26 +-
 drivers/net/mana/tx.c                         |   3 +
 drivers/net/mlx5/mlx5_ethdev.c                |   1 +
 drivers/net/mlx5/mlx5_flow.h                  |   1 +
 drivers/net/mlx5/mlx5_txq.c                   |   1 +
 drivers/net/mlx5/mlx5_utils.c                 |   1 +
 drivers/net/mlx5/mlx5_utils.h                 |   1 +
 drivers/net/nbl/nbl_include/nbl_include.h     |   1 +
 drivers/net/nfp/nfp_ethdev.c                  |   6 +-
 drivers/net/nfp/nfp_net_common.h              |   4 +-
 drivers/net/ngbe/ngbe_rxtx.c                  |   4 +
 drivers/net/r8169/r8169_rxtx.c                |  18 +-
 drivers/net/rnp/rnp_rxtx.c                    |   6 +
 drivers/net/sfc/sfc_dp.c                      |   1 +
 drivers/net/txgbe/txgbe_ethdev.h              |   1 +
 examples/l2fwd-macsec/main.c                  |   2 +
 examples/l3fwd-graph/main.c                   |   1 +
 examples/l3fwd/l3fwd.h                        |   2 +
 lib/ethdev/ethdev_driver.h                    |  36 ---
 lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h}  |  58 ++++-
 lib/ethdev/meson.build                        |   2 +-
 lib/ethdev/rte_ethdev.h                       |  13 +-
 lib/ethdev/sff_8472.c                         |   3 +-
 lib/gro/gro_tcp4.c                            |   9 +-
 lib/gro/gro_tcp6.c                            |   9 +-
 lib/gro/gro_vxlan_tcp4.c                      |  10 +-
 lib/gro/gro_vxlan_udp4.c                      |   9 +-
 lib/gro/rte_gro.c                             |   9 +-
 lib/node/udp4_input.c                         |  17 +-
 70 files changed, 311 insertions(+), 844 deletions(-)
 rename lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h} (91%)
Signature · 1 line
2.53.0
#26 lore raw

PATCH v3 1/23 drivers/net: remove unused include in dpaa

rte_eth_ctrl.h is deprecated and its contents are not used here.

---
 drivers/net/dpaa/dpaa_ptp.c   | 1 -
 drivers/net/dpaa2/dpaa2_ptp.c | 1 -
 2 files changed, 2 deletions(-)
drivers/net/dpaa/dpaa_ptp.c +0 -1
index e9b332c571..f91d3f9ce3 100644
@@ -9,7 +9,6 @@
 
 #include <rte_ethdev.h>
 #include <rte_log.h>
-#include <rte_eth_ctrl.h>
 #include <rte_malloc.h>
 #include <rte_time.h>
 
drivers/net/dpaa2/dpaa2_ptp.c +0 -1
index 751e558c73..77d5d82b44 100644
@@ -12,7 +12,6 @@
 
 #include <ethdev_driver.h>
 #include <rte_log.h>
-#include <rte_eth_ctrl.h>
 #include <rte_malloc.h>
 #include <rte_time.h>
 
Signature · 1 line
2.53.0
#27 lore raw

PATCH v3 2/23 ethdev: use DPDK byte order conversion

In reply to Stephen Hemminger

DPDK has its own byte order macros which are preferred over the POSIX/libc ones in arpa/inet.h
This resolves issue where this code was inheriting the inclusion of arpa/inet.h from rte_ethdev.h -> rte_eth_ctrl.h.

---
 lib/ethdev/sff_8472.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/ethdev/sff_8472.c +2 -1
index 97f231854c..acbbcee210 100644
@@ -4,6 +4,7 @@
  */
 
 #include <stdio.h>
+#include <rte_byteorder.h>
 
 #include "sff_common.h"
 
@@ -176,7 +177,7 @@ static float befloattoh(const uint32_t *source)
 		float dst;
 	} converter;
 
-	converter.src = ntohl(*source);
+	converter.src = rte_be_to_cpu_32(*source);
 	return converter.dst;
 }
 
Signature · 1 line
2.53.0
#28 lore raw

PATCH v3 3/23 net/ixgbe: remove experimental FDIR API

In reply to Stephen Hemminger

Remove the PMD specific flow director API from ixgbe. These APIs are experimental, therefore they can be removed without additional warnings.

---
 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(-)
drivers/net/intel/ixgbe/ixgbe_ethdev.h +0 -5
index 5d3243cb4d..c290f04611 100644
@@ -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
drivers/net/intel/ixgbe/ixgbe_fdir.c +0 -117

123 lines not on this page · raw message

drivers/net/intel/ixgbe/rte_pmd_ixgbe.c +0 -34
index f816fa3173..e0dff9cd73 100644
@@ -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;
-}
drivers/net/intel/ixgbe/rte_pmd_ixgbe.h +0 -32
index 7ca1126cfb..74bb5aa140 100644
@@ -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_ */
Signature · 1 line
2.53.0
#29 lore raw

PATCH v3 4/23 net/i40e: remove experimental FDIR API

In reply to Stephen Hemminger

Remove the flow director related private APIs in i40e. These APIs are experimental, therefore they can be removed without additional warnings.

---
 doc/guides/nics/i40e.rst              |  46 ---------
 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 ------
 7 files changed, 3 insertions(+), 261 deletions(-)
doc/guides/nics/i40e.rst +0 -46
index 29234dbf0f..67a3b29024 100644
@@ -397,52 +397,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
 ~~~~~~~~~~~~
drivers/net/intel/i40e/i40e_ethdev.c +2 -2
index b6b2d291ee..5cbdfe9db2 100644
@@ -9335,8 +9335,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] =
drivers/net/intel/i40e/i40e_ethdev.h +0 -4
index 9d9bde6aeb..3968bfd267 100644
@@ -1369,10 +1369,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);
drivers/net/intel/i40e/i40e_fdir.c +0 -140

146 lines not on this page · raw message

drivers/net/intel/i40e/i40e_flow.c +1 -2
index 6eb85a7d0d..e9993db6dd 100644
@@ -2391,8 +2391,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];
drivers/net/intel/i40e/rte_pmd_i40e.c +0 -34
index 2e7943ef8b..e47c1aa9d7 100644
@@ -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)
drivers/net/intel/i40e/rte_pmd_i40e.h +0 -33
index 5af7e2330f..34900f9bec 100644
@@ -1067,39 +1067,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
  *
Signature · 1 line
2.53.0
#30 lore raw

PATCH v3 5/23 app/testpmd: remove support for flow director

In reply to Stephen Hemminger

The legacy flow director API is deprecated and being removed. Drop it from testpmd; the testpmd CLI is not a stable API.

Removed commands:
show port fdir (port_id|all)
clear port fdir (port_id|all)

---
 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 |  54 +------
 4 files changed, 14 insertions(+), 227 deletions(-)
app/test-pmd/cmdline.c +6 -15
index 10ee7c5179..c142a8ec50 100644
@@ -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"
@@ -7514,11 +7514,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);
@@ -7531,14 +7526,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,
@@ -7576,10 +7571,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);
 }
@@ -7591,7 +7582,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);
 
@@ -7599,7 +7590,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,
app/test-pmd/config.c +0 -163

169 lines not on this page · raw message

app/test-pmd/testpmd.h +0 -3
index 083171853c..f7c10ab6b8 100644
@@ -1212,9 +1212,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);
doc/guides/testpmd_app_ug/testpmd_funcs.rst +8 -46

92 lines not on this page · raw message

Signature · 1 line
2.53.0
#31 lore raw

PATCH v3 6/23 app/testpmd: move str_to_flowtype to i40e

In reply to Stephen Hemminger

Only the i40e internal command is still using str_to_flowtype() so move it to there.

---
 app/test-pmd/config.c                 | 62 ---------------------------
 app/test-pmd/testpmd.h                |  3 --
 drivers/net/intel/i40e/i40e_testpmd.c | 51 ++++++++++++++++++++++
 3 files changed, 51 insertions(+), 65 deletions(-)
app/test-pmd/config.c +0 -62
index 582e7287be..230640ea44 100644
@@ -3,7 +3,6 @@
  * Copyright 2013-2014 6WIND S.A.
  */
 
-#include <ctype.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <stdbool.h>
@@ -182,35 +181,6 @@ static const struct {
 	},
 };
 
-static const struct {
-	char str[32];
-	uint16_t ftype;
-} flowtype_str_table[] = {
-	{"raw", RTE_ETH_FLOW_RAW},
-	{"ipv4", RTE_ETH_FLOW_IPV4},
-	{"ipv4-frag", RTE_ETH_FLOW_FRAG_IPV4},
-	{"ipv4-tcp", RTE_ETH_FLOW_NONFRAG_IPV4_TCP},
-	{"ipv4-udp", RTE_ETH_FLOW_NONFRAG_IPV4_UDP},
-	{"ipv4-sctp", RTE_ETH_FLOW_NONFRAG_IPV4_SCTP},
-	{"ipv4-other", RTE_ETH_FLOW_NONFRAG_IPV4_OTHER},
-	{"ipv6", RTE_ETH_FLOW_IPV6},
-	{"ipv6-frag", RTE_ETH_FLOW_FRAG_IPV6},
-	{"ipv6-tcp", RTE_ETH_FLOW_NONFRAG_IPV6_TCP},
-	{"ipv6-udp", RTE_ETH_FLOW_NONFRAG_IPV6_UDP},
-	{"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP},
-	{"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER},
-	{"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
-	{"ipv6-ex", RTE_ETH_FLOW_IPV6_EX},
-	{"ipv6-tcp-ex", RTE_ETH_FLOW_IPV6_TCP_EX},
-	{"ipv6-udp-ex", RTE_ETH_FLOW_IPV6_UDP_EX},
-	{"port", RTE_ETH_FLOW_PORT},
-	{"vxlan", RTE_ETH_FLOW_VXLAN},
-	{"geneve", RTE_ETH_FLOW_GENEVE},
-	{"nvgre", RTE_ETH_FLOW_NVGRE},
-	{"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
-	{"gtpu", RTE_ETH_FLOW_GTPU},
-};
-
 static void
 print_ethaddr(const char *name, struct rte_ether_addr *eth_addr)
 {
@@ -7024,38 +6994,6 @@ set_record_burst_stats(uint8_t on_off)
 	record_burst_stats = on_off;
 }
 
-uint16_t
-str_to_flowtype(const char *string)
-{
-	uint8_t i;
-
-	for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
-		if (!strcmp(flowtype_str_table[i].str, string))
-			return flowtype_str_table[i].ftype;
-	}
-
-	if (isdigit(string[0])) {
-		int val = atoi(string);
-		if (val > 0 && val < 64)
-			return (uint16_t)val;
-	}
-
-	return RTE_ETH_FLOW_UNKNOWN;
-}
-
-const char*
-flowtype_to_str(uint16_t flow_type)
-{
-	uint8_t i;
-
-	for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
-		if (flowtype_str_table[i].ftype == flow_type)
-			return flowtype_str_table[i].str;
-	}
-
-	return NULL;
-}
-
 void
 set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 {
app/test-pmd/testpmd.h +0 -3
index f7c10ab6b8..ed94bd65c6 100644
@@ -1325,9 +1325,6 @@ int parse_hairpin_map(const char *hpmap);
 uint64_t str_to_rsstypes(const char *str);
 const char *rsstypes_to_str(uint64_t rss_type);
 
-uint16_t str_to_flowtype(const char *string);
-const char *flowtype_to_str(uint16_t flow_type);
-
 /* For registering driver specific testpmd commands. */
 struct testpmd_driver_commands {
 	TAILQ_ENTRY(testpmd_driver_commands) next;
drivers/net/intel/i40e/i40e_testpmd.c +51 -0

63 lines not on this page · raw message

Signature · 1 line
2.53.0
#32 lore raw

PATCH v3 7/23 app/test: include headers directly

In reply to Stephen Hemminger

The test code was getting network headers indirectly via inclusion of rte_ethdev.h. This will change in the future, instead get the headers directly.

For BPF test, use the tool "iwyu" to get more complete set of headers. Replace use of htons() with equivalent DPDK byteorder macro.

---
 app/test-eventdev/test_pipeline_common.h |  1 +
 app/test/test_bpf.c                      | 20 +++++++++++++++-----
 app/test/test_security_inline_macsec.c   |  2 ++
 app/test/test_security_inline_proto.c    |  1 +
 4 files changed, 19 insertions(+), 5 deletions(-)
app/test-eventdev/test_pipeline_common.h +1 -0
index 61370fb799..e9f20e7f62 100644
@@ -12,6 +12,7 @@
 #include <rte_cycles.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
+#include <rte_ip.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_event_eth_tx_adapter.h>
 #include <rte_eventdev.h>
app/test/test_bpf.c +15 -5
index 3205afaa63..5b71f94a71 100644
@@ -5,16 +5,28 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdalign.h>
 #include <inttypes.h>
+#include <errno.h>
+#include <limits.h>
 #include <unistd.h>
 
-#include <rte_memory.h>
+#include <rte_bitops.h>
 #include <rte_debug.h>
 #include <rte_hexdump.h>
 #include <rte_malloc.h>
+#include <rte_memcpy.h>
+#include <rte_mbuf.h>
 #include <rte_random.h>
 #include <rte_byteorder.h>
 #include <rte_errno.h>
+#include <rte_ether.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
 
 #include "test.h"
 
@@ -30,8 +42,6 @@ test_bpf(void)
 #else
 
 #include <rte_bpf.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
 
 
 /* Tests of most simple BPF programs (no instructions, one instruction etc.) */
@@ -1331,7 +1341,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 	uint16_t eth_type;
 	uint64_t v = -1;
 
-	if (eth_hdr->ether_type == htons(0x8100)) {
+	if (eth_hdr->ether_type == rte_cpu_to_be_16(0x8100)) {
 		const struct rte_vlan_hdr *vlan_hdr =
 			(const void *)(eth_hdr + 1);
 		eth_type = vlan_hdr->eth_proto;
@@ -1341,7 +1351,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 		next = eth_hdr + 1;
 	}
 
-	if (eth_type == htons(0x0800)) {
+	if (eth_type == rte_cpu_to_be_16(0x0800)) {
 		ipv4_hdr = next;
 		if ((ipv4_hdr->dst_addr & rte_cpu_to_be_32(TEST_NETMASK)) ==
 		    rte_cpu_to_be_32(TEST_SUBNET)) {
app/test/test_security_inline_macsec.c +2 -0
index a929ff5326..43672ef237 100644
@@ -8,6 +8,8 @@
 #include <rte_ethdev.h>
 #include <rte_malloc.h>
 #include <rte_security.h>
+#include <rte_flow.h>
+#include <rte_macsec.h>
 
 #include "test.h"
 #include "test_security_inline_macsec_vectors.h"
app/test/test_security_inline_proto.c +1 -0
index 0b1f7fbbab..99111e5432 100644
@@ -7,6 +7,7 @@
 #include <inttypes.h>
 
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <rte_malloc.h>
 #include <rte_security.h>
 
Signature · 1 line
2.53.0
Acked-by on v3 7/23
#33 lore raw

RE: [PATCH v3 07/23] app/test: include headers directly

Quoted 53 lines
app/test/test_bpf.c +14 -4
index 3205afaa63..5b71f94a71 100644
@@ -5,16 +5,28 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdalign.h>
 #include <inttypes.h>
+#include <errno.h>
+#include <limits.h>
 #include <unistd.h>
 
-#include <rte_memory.h>
+#include <rte_bitops.h>
 #include <rte_debug.h>
 #include <rte_hexdump.h>
 #include <rte_malloc.h>
+#include <rte_memcpy.h>
+#include <rte_mbuf.h>
 #include <rte_random.h>
 #include <rte_byteorder.h>
 #include <rte_errno.h>
+#include <rte_ether.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
 
 #include "test.h"
 
@@ -30,8 +42,6 @@ test_bpf(void)
 #else
 
 #include <rte_bpf.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
 
 
 /* Tests of most simple BPF programs (no instructions, one instruction etc.) */
@@ -1331,7 +1341,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 	uint16_t eth_type;
 	uint64_t v = -1;
 
-	if (eth_hdr->ether_type == htons(0x8100)) {
+	if (eth_hdr->ether_type == rte_cpu_to_be_16(0x8100)) {
 		const struct rte_vlan_hdr *vlan_hdr =
 			(const void *)(eth_hdr + 1);
 		eth_type = vlan_hdr->eth_proto;

app/test/test_bpf.c test_jump2_check(uint64_t rc, const void *arg) · line 1357

Quoted 8 lines
app/test/test_bpf.c +1 -1
@@ -1341,7 +1351,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 		next = eth_hdr + 1;
 	}
 
-	if (eth_type == htons(0x0800)) {
+	if (eth_type == rte_cpu_to_be_16(0x0800)) {
 		ipv4_hdr = next;
 		if ((ipv4_hdr->dst_addr & rte_cpu_to_be_32(TEST_NETMASK)) ==
 		    rte_cpu_to_be_32(TEST_SUBNET)) {

For the test_bpf.c part:

#34 lore raw

PATCH v3 8/23 gro: include headers directly

In reply to Stephen Hemminger

The gro library was getting headers such as VXLAN implicitly via rte_ethdev.h.
This will change, so include the needed headers directly. Use iwyu to make sure all headers are covered.

---
 lib/gro/gro_tcp4.c       |  9 ++++++++-
 lib/gro/gro_tcp6.c       |  9 ++++++++-
 lib/gro/gro_vxlan_tcp4.c | 10 +++++++++-
 lib/gro/gro_vxlan_udp4.c |  9 ++++++++-
 lib/gro/rte_gro.c        |  9 ++++++++-
 5 files changed, 41 insertions(+), 5 deletions(-)
lib/gro/gro_tcp4.c +8 -1
index 855cc7a71d..3997fb8bf1 100644
@@ -2,9 +2,16 @@
  * Copyright(c) 2017 Intel Corporation
  */
 
+#include <stddef.h>
+
+#include <rte_branch_prediction.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
+#include <rte_ether.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ip.h>
+#include <rte_tcp.h>
 
 #include "gro_tcp4.h"
 #include "gro_tcp_internal.h"
lib/gro/gro_tcp6.c +8 -1
index ab4cd6c68b..4e1ae596b7 100644
@@ -2,9 +2,16 @@
  * Copyright(c) 2023 Intel Corporation
  */
 
+#include <stdbool.h>
+
+#include <rte_branch_prediction.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
+#include <rte_ether.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ip.h>
+#include <rte_tcp.h>
 
 #include "gro_tcp6.h"
 #include "gro_tcp_internal.h"
lib/gro/gro_vxlan_tcp4.c +9 -1
index 29d4a2e13d..650d02eb74 100644
@@ -2,9 +2,17 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <stddef.h>
+
+#include <rte_branch_prediction.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ether.h>
+#include <rte_vxlan.h>
+#include <rte_ip.h>
+#include <rte_tcp.h>
 #include <rte_udp.h>
 
 #include "gro_vxlan_tcp4.h"
lib/gro/gro_vxlan_udp4.c +8 -1
index ca8cee270d..bdfa8d6d20 100644
@@ -2,9 +2,16 @@
  * Copyright(c) 2020 Inspur Corporation
  */
 
+#include <stddef.h>
+
+#include <rte_branch_prediction.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ether.h>
+#include <rte_vxlan.h>
+#include <rte_ip.h>
 #include <rte_udp.h>
 
 #include "gro_vxlan_udp4.h"
lib/gro/rte_gro.c +8 -1
index 578cc9b801..5bccd3cbac 100644
@@ -2,12 +2,19 @@
  * Copyright(c) 2017 Intel Corporation
  */
 
+#include <stddef.h>
+
 #include <eal_export.h>
+#include <rte_branch_prediction.h>
+#include <rte_common.h>
 #include <rte_malloc.h>
+#include <rte_mbuf.h>
 #include <rte_cycles.h>
-#include <rte_ethdev.h>
+#include <rte_ether.h>
+#include <rte_vxlan.h>
 
 #include "rte_gro.h"
+#include "gro_tcp.h"
 #include "gro_tcp4.h"
 #include "gro_tcp6.h"
 #include "gro_udp4.h"
Signature · 1 line
2.53.0
#35 lore raw

PATCH v3 9/23 crypto/dpaa_sec: include UDP header

In reply to Stephen Hemminger

The driver was getting the UDP header definition indirectly via rte_ethdev.h. That will change, so include the header directly.

---
 drivers/crypto/dpaa_sec/dpaa_sec.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/crypto/dpaa_sec/dpaa_sec.h +2 -0
index d78cad818a..bce60d9cb8 100644
@@ -7,6 +7,8 @@
 #ifndef _DPAA_SEC_H_
 #define _DPAA_SEC_H_
 
+#include <rte_udp.h>
+
 #define CRYPTODEV_NAME_DPAA_SEC_PMD	crypto_dpaa_sec
 /**< NXP DPAA - SEC PMD device name */
 
Signature · 1 line
2.53.0
#36 lore raw

PATCH v3 10/23 net/gve: include UDP, SCTP and TCP headers

In reply to Stephen Hemminger

This driver was getting rte_udp.h, rte_tcp.h and rte_sctp.h implicitly through rte_ethdev.h -> rte_eth_ctrl.h -> rte_flow.h. Since rte_eth_ctrl.h is deprecated, better to not depend on that.

Use iwyu to make sure all used includes are here.

---
 drivers/net/gve/gve_ethdev.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.h +12 -1
index c9a176ff17..95b32420b4 100644
@@ -5,15 +5,26 @@
 #ifndef _GVE_ETHDEV_H_
 #define _GVE_ETHDEV_H_
 
+#include <stdbool.h>
+#include <stdint.h>
+#include <pthread.h>
+#include <sys/queue.h>
+
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <rte_alarm.h>
+#include <rte_atomic.h>
+#include <rte_stdatomic.h>
+#include <rte_bitops.h>
+#include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_pci.h>
-#include <pthread.h>
 #include <rte_bitmap.h>
 #include <rte_memzone.h>
 #include <rte_thread.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "base/gve.h"
 
Signature · 1 line
2.53.0
#37 lore raw

PATCH v3 11/23 net/nfp: break implicit dependency on rte_eth_ctrl.h

In reply to Stephen Hemminger

This driver was using UINT64_BIT which was getting defined via deprecated rte_eth_ctrl.h. Replace with local definition.

Also include rte_flow.h instead of depending on indirect inclusion from rte_ethdev.h.

---
 drivers/net/nfp/nfp_ethdev.c     | 6 ++++--
 drivers/net/nfp/nfp_net_common.h | 4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/nfp/nfp_ethdev.c +4 -2
index d2da18013c..25be1de080 100644
@@ -6,6 +6,7 @@
  */
 
 #include <unistd.h>
+#include <limits.h>
 
 #include <eal_firmware.h>
 #include <rte_alarm.h>
@@ -32,6 +33,7 @@
 
 /* 64-bit per app capabilities */
 #define NFP_NET_APP_CAP_SP_INDIFF       RTE_BIT64(0) /* Indifferent to port speed */
+#define NFP_UINT64_BIT (CHAR_BIT * sizeof(uint64_t))
 
 #define NFP_PF_DRIVER_NAME net_nfp_pf
 #define NFP_PF_FORCE_RELOAD_FW   "force_reload_fw"
@@ -2060,8 +2062,8 @@ nfp_net_speed_capa_get_real(struct nfp_eth_media_buf *media_buf,
 
 	for (i = 0; i < RTE_DIM(media_buf->supported_modes); i++) {
 		supported_modes = media_buf->supported_modes[i];
-		offset = i * UINT64_BIT;
-		for (j = 0; j < UINT64_BIT; j++) {
+		offset = i * NFP_UINT64_BIT;
+		for (j = 0; j < NFP_UINT64_BIT; j++) {
 			if (supported_modes == 0)
 				break;
 
drivers/net/nfp/nfp_net_common.h +3 -1
index 2bd2d54028..62c6448cc3 100644
@@ -8,9 +8,11 @@
 
 #include <bus_pci_driver.h>
 #include <ethdev_driver.h>
+#include <rte_flow.h>
+#include <rte_spinlock.h>
+
 #include <nfp_common.h>
 #include <nfp_dev.h>
-#include <rte_spinlock.h>
 
 #include "nfpcore/nfp_sync.h"
 #include "nfp_net_ctrl.h"
Signature · 1 line
2.53.0
#38 lore raw

PATCH v3 12/23 net/mana: include used network headers

In reply to Stephen Hemminger

This driver was getting definition of IP, UDP, and TCP headers implicitly via rte_ethdev.h. That will be changing so instead include the required headers directly.

Use include-what-you-use (iwyu) to add headers that are being used in this driver to avoid future issues.

---
 drivers/net/mana/mana.c | 26 +++++++++++++++++++++++---
 drivers/net/mana/tx.c   |  3 +++
 2 files changed, 26 insertions(+), 3 deletions(-)
drivers/net/mana/mana.c +23 -3
index 0b72f711a1..89f6033517 100644
@@ -2,24 +2,44 @@
  * Copyright 2022 Microsoft Corporation
  */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <dirent.h>
 #include <fcntl.h>
+#include <errno.h>
+#include <time.h>
+#include <string.h>
+#include <inttypes.h>
 #include <sys/mman.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
+#include <netinet/in.h>
 
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
-#include <rte_kvargs.h>
+#include <rte_atomic.h>
+#include <rte_debug.h>
+#include <rte_dev.h>
+#include <rte_devargs.h>
+#include <rte_eal.h>
 #include <rte_eal_paging.h>
+#include <rte_errno.h>
+#include <rte_ether.h>
+#include <rte_interrupts.h>
+#include <rte_kvargs.h>
+#include <rte_malloc.h>
+#include <rte_mbuf.h>
+#include <rte_memory.h>
+#include <rte_memzone.h>
+#include <rte_pause.h>
 #include <rte_pci.h>
+#include <rte_spinlock.h>
 
 #include <infiniband/verbs.h>
 #include <infiniband/manadv.h>
 
-#include <assert.h>
-
 #include "mana.h"
 
 /* Shared memory between primary/secondary processes, per driver */
drivers/net/mana/tx.c +3 -0
index 10f2212b5d..9517b033dc 100644
@@ -3,6 +3,9 @@
  */
 
 #include <ethdev_driver.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
 
 #include <infiniband/verbs.h>
 #include <infiniband/manadv.h>
Signature · 1 line
2.53.0
#39 lore raw

PATCH v3 13/23 node: get UDP header

In reply to Stephen Hemminger

This library was getting UDP header indirectly via rte_ethdev.h Use iwyu to update includes to match usage.

---
 lib/node/udp4_input.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
lib/node/udp4_input.c +9 -8
index 5a74e28c85..02a8284982 100644
@@ -2,20 +2,21 @@
  * Copyright(C) 2023 Marvell International Ltd.
  */
 
-#include <arpa/inet.h>
-#include <sys/socket.h>
+#include <stdio.h>
+#include <stdint.h>
 
 #include <eal_export.h>
-#include <rte_ethdev.h>
+#include <rte_common.h>
+#include <rte_byteorder.h>
+#include <rte_errno.h>
 #include <rte_ether.h>
 #include <rte_graph.h>
-#include <rte_graph_worker.h>
-#include <rte_ip.h>
-#include <rte_lpm.h>
 #include <rte_hash.h>
-#include <rte_fbk_hash.h>
+#include <rte_ip.h>
 #include <rte_jhash.h>
-#include <rte_hash_crc.h>
+#include <rte_log.h>
+#include <rte_memcpy.h>
+#include <rte_udp.h>
 
 #include "rte_node_udp4_input_api.h"
 
Signature · 1 line
2.53.0
#40 lore raw

PATCH v3 14/23 net/rnp: include network headers

In reply to Stephen Hemminger

The driver was getting definition of standard network protocol headers indirectly from rte_ethdev.h.

---
 drivers/net/rnp/rnp_rxtx.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/rnp/rnp_rxtx.c +6 -0
index 81e8c6ba44..93a3372e5a 100644
@@ -8,6 +8,12 @@
 #include <rte_memzone.h>
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
+#include <rte_vxlan.h>
+#include <rte_ip.h>
+#include <rte_gre.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "base/rnp_bdq_if.h"
 #include "base/rnp_dma_regs.h"
Signature · 1 line
2.53.0
#41 lore raw

PATCH v3 15/23 net/r8169: get network headers

In reply to Stephen Hemminger

This driver was getting network protocol headers indirectly via rte_ethdev.h. Use iwyu to update to full list of includes.

---
 drivers/net/r8169/r8169_rxtx.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/net/r8169/r8169_rxtx.c +13 -5
index 00de0471f4..750ddd20db 100644
@@ -5,21 +5,29 @@
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
-
-#include <rte_eal.h>
+#include <stdbool.h>
+#include <string.h>
+#include <arpa/inet.h>
 
 #include <rte_common.h>
-#include <rte_interrupts.h>
+#include <rte_atomic.h>
 #include <rte_byteorder.h>
 #include <rte_debug.h>
-#include <rte_pci.h>
+#include <rte_log.h>
 #include <bus_pci_driver.h>
 #include <rte_ether.h>
+#include <rte_ethdev.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
-#include <rte_memory.h>
+#include <rte_bitops.h>
+#include <rte_memzone.h>
 #include <rte_malloc.h>
+#include <rte_mbuf.h>
+#include <rte_prefetch.h>
+#include <rte_random.h>
+#include <rte_stdatomic.h>
 #include <dev_driver.h>
+#include <rte_udp.h>
 
 #include "r8169_ethdev.h"
 #include "r8169_hw.h"
Signature · 1 line
2.53.0
#42 lore raw

PATCH v3 16/23 net/ngbe: include network protocol headers

In reply to Stephen Hemminger

Do not depend on network protocol headers getting included via rte_ethdev.h.

---
 drivers/net/ngbe/ngbe_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ngbe/ngbe_rxtx.c +4 -0
index a1389de9c0..fee984c396 100644
@@ -11,6 +11,10 @@
 #include <rte_malloc.h>
 #include <rte_net.h>
 #include <rte_vect.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "ngbe_logs.h"
 #include "base/ngbe.h"
Signature · 1 line
2.53.0
#43 lore raw

PATCH v3 17/23 examples: include network headers

In reply to Stephen Hemminger

Don't depend on network protocol headers getting indirectly included via rte_ethdev.h.

---
 examples/l2fwd-macsec/main.c | 2 ++
 examples/l3fwd-graph/main.c  | 1 +
 examples/l3fwd/l3fwd.h       | 2 ++
 3 files changed, 5 insertions(+)
examples/l2fwd-macsec/main.c +2 -0
index 059f8a2170..e07769bd57 100644
@@ -33,9 +33,11 @@
 #include <rte_debug.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_security.h>
+#include <rte_macsec.h>
 #include <rte_string_fns.h>
 
 static volatile bool force_quit;
examples/l3fwd-graph/main.c +1 -0
index 5f89286dce..79dee4d103 100644
@@ -36,6 +36,7 @@
 #include <rte_per_lcore.h>
 #include <rte_string_fns.h>
 #include <rte_vect.h>
+#include <rte_ip.h>
 
 #include <cmdline_parse.h>
 #include <cmdline_parse_etheraddr.h>
examples/l3fwd/l3fwd.h +2 -0
index 349fc37c79..db7b746f59 100644
@@ -8,6 +8,8 @@
 #include <rte_ethdev.h>
 #include <rte_vect.h>
 #include <rte_acl.h>
+#include <rte_ip.h>
+
 
 #define DO_RFC_1812_CHECKS
 
Signature · 1 line
2.53.0
#44 lore raw

PATCH v3 18/23 net/mlx5: include rte_flow as needed

In reply to Stephen Hemminger

The driver was getting rte_flow.h included indirectly via rte_ethdev.h. This will change in future and driver should include it where needed.

---
 drivers/net/mlx5/mlx5_ethdev.c | 1 +
 drivers/net/mlx5/mlx5_flow.h   | 1 +
 drivers/net/mlx5/mlx5_txq.c    | 1 +
 drivers/net/mlx5/mlx5_utils.c  | 1 +
 drivers/net/mlx5/mlx5_utils.h  | 1 +
 5 files changed, 5 insertions(+)
drivers/net/mlx5/mlx5_ethdev.c +1 -0
index 8160d10e7e..c3d8e1b04f 100644
@@ -19,6 +19,7 @@
 #include <rte_string_fns.h>
 #include <rte_rwlock.h>
 #include <rte_cycles.h>
+#include <rte_flow.h>
 
 #include <mlx5_malloc.h>
 
drivers/net/mlx5/mlx5_flow.h +1 -0
index 3415b4722e..0da50fab85 100644
@@ -12,6 +12,7 @@
 
 #include <rte_alarm.h>
 #include <rte_mtr.h>
+#include <rte_flow.h>
 
 #include <mlx5_glue.h>
 #include <mlx5_prm.h>
drivers/net/mlx5/mlx5_txq.c +1 -0
index f9b254c6c5..f0b7b2d032 100644
@@ -18,6 +18,7 @@
 #include <rte_common.h>
 #include <rte_eal_paging.h>
 #include <rte_bitops.h>
+#include <rte_flow.h>
 
 #include <mlx5_common.h>
 #include <mlx5_common_mr.h>
drivers/net/mlx5/mlx5_utils.c +1 -0
index 606743c4b7..12820054ff 100644
@@ -3,6 +3,7 @@
  */
 
 #include <rte_malloc.h>
+#include <rte_flow.h>
 
 #include <mlx5_malloc.h>
 
drivers/net/mlx5/mlx5_utils.h +1 -0
index 9ab79c8ad5..19d03145a6 100644
@@ -16,6 +16,7 @@
 #include <rte_rwlock.h>
 #include <rte_memory.h>
 #include <rte_bitmap.h>
+#include <rte_flow.h>
 
 #include <mlx5_common.h>
 #include <mlx5_common_utils.h>
Signature · 1 line
2.53.0
#45 lore raw

PATCH v3 19/23 net/sfc: include rte_flow

In reply to Stephen Hemminger

This driver was depending on rte_ethdev.h doing inclusion of rte_flow.h.

---
 drivers/net/sfc/sfc_dp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/sfc/sfc_dp.c +1 -0
index 7e2a20e4dc..c867c2c2ff 100644
@@ -15,6 +15,7 @@
 #include <rte_ethdev.h>
 #include <rte_log.h>
 #include <rte_mbuf_dyn.h>
+#include <rte_flow.h>
 
 #include "efx.h"
 
Signature · 1 line
2.53.0
#46 lore raw

PATCH v3 20/23 net/intel/common: include network headers

In reply to Stephen Hemminger

This file was depending on network protocol headers getting included via rte_ethdev.h -> rte_flow.h.

---
 drivers/net/intel/common/tx_scalar.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/intel/common/tx_scalar.h +3 -0
index 11ab6c08fc..dcb2ea5542 100644
@@ -8,6 +8,9 @@
 #include <stdint.h>
 #include <rte_io.h>
 #include <rte_byteorder.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 /* depends on common Tx definitions. */
 #include "tx.h"
Signature · 1 line
2.53.0
#47 lore raw

PATCH v3 21/23 net/enetfec: add missing sys/types.h include

In reply to Stephen Hemminger

The enet_regs.h header uses BSD types 'uint' and 'ushort' which were previously available through indirect inclusion via:
rte_ethdev.h -> rte_flow.h -> rte_ip.h -> rte_ip[46].h -> sys/types.h

After changes to reduce rte_ethdev.h header dependencies, this indirect inclusion no longer occurs, causing build failures on PowerPC.

---
 drivers/net/enetfec/enet_regs.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/enetfec/enet_regs.h +2 -0
index c9400957f8..a834fa5889 100644
@@ -5,6 +5,8 @@
 #ifndef __ENETFEC_REGS_H
 #define __ENETFEC_REGS_H
 
+#include <sys/types.h>
+
 /* Ethernet receive use control and status of buffer descriptor
  */
 #define RX_BD_TR	((ushort)0x0001) /* Truncated */
Signature · 1 line
2.53.0
#48 lore raw

PATCH v3 22/23 ethdev, drivers: isolate flow director

In reply to Stephen Hemminger

There are leftover bits of legacy flow director that are still being used by drivers. Move the definitions contained in ethdev_driver.h and rte_eth_ctrl.h into a single file ethdev_fdir.h and only include it in the drivers that require it.

Change rte_ethdev.h to include the headers required which it was previously getting from rte_eth_ctrl.h -> rte_flow.h.

Since ethdev_fdir.h is internal for driver SDK only it does not have to include as many secondary headers.

---
 doc/api/doxy-api-index.md                     |  1 -
 drivers/net/hinic/hinic_pmd_ethdev.h          |  2 +
 drivers/net/hinic3/hinic3_ethdev.h            |  1 +
 drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c |  2 +-
 drivers/net/intel/e1000/e1000_ethdev.h        |  1 +
 drivers/net/intel/e1000/igc_filter.h          |  2 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |  1 +
 drivers/net/intel/iavf/iavf_fsub.c            |  2 +-
 drivers/net/intel/iavf/iavf_hash.c            |  2 +-
 drivers/net/intel/ice/ice_acl_filter.c        |  2 +-
 drivers/net/intel/ice/ice_ethdev.h            |  2 +
 drivers/net/intel/ice/ice_generic_flow.c      |  1 +
 drivers/net/intel/ice/ice_hash.c              |  2 +-
 drivers/net/intel/ice/ice_switch_filter.c     |  2 +-
 drivers/net/intel/ipn3ke/ipn3ke_flow.c        |  2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |  1 +
 drivers/net/nbl/nbl_include/nbl_include.h     |  1 +
 drivers/net/txgbe/txgbe_ethdev.h              |  1 +
 lib/ethdev/ethdev_driver.h                    | 36 ------------
 lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h}  | 58 ++++++++++++++-----
 lib/ethdev/meson.build                        |  2 +-
 lib/ethdev/rte_ethdev.h                       | 13 +----
 22 files changed, 67 insertions(+), 70 deletions(-)
 rename lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h} (91%)
doc/api/doxy-api-index.md +0 -1
index 9296042119..ac8314e908 100644
@@ -11,7 +11,6 @@ The public API headers are grouped by topics:
 - **device**:
   [dev](@ref rte_dev.h),
   [ethdev](@ref rte_ethdev.h),
-  [ethctrl](@ref rte_eth_ctrl.h),
   [rte_flow](@ref rte_flow.h),
   [rte_tm](@ref rte_tm.h),
   [rte_mtr](@ref rte_mtr.h),
drivers/net/hinic/hinic_pmd_ethdev.h +2 -0
index 8e6251f69f..10285ce814 100644
@@ -7,7 +7,9 @@
 
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
+#include <rte_flow.h>
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 
 #include "base/hinic_compat.h"
 #include "base/hinic_pmd_cfg.h"
drivers/net/hinic3/hinic3_ethdev.h +1 -0
index 9061e2b217..515ba044a1 100644
@@ -7,6 +7,7 @@
 
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
+#include <ethdev_fdir.h>
 
 #include "hinic3_fdir.h"
 
drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c +1 -1
index f42156e28f..977036bec5 100644
@@ -16,7 +16,7 @@
 #include <rte_ether.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/e1000/e1000_ethdev.h +1 -0
index 0907c7c259..da4dacc7d4 100644
@@ -9,6 +9,7 @@
 #include <sys/queue.h>
 
 #include <rte_flow.h>
+#include <ethdev_fdir.h>
 #include <rte_time.h>
 #include <rte_pci.h>
 
drivers/net/intel/e1000/igc_filter.h +1 -1
index 2b7e6b619a..d1e098e5bb 100644
@@ -8,7 +8,7 @@
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
 #include <ethdev_driver.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 
 #include "igc_ethdev.h"
 
drivers/net/intel/i40e/i40e_ethdev.h +1 -0
index 3968bfd267..c03eaab946 100644
@@ -13,6 +13,7 @@
 #include <rte_hash.h>
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_tm_driver.h>
 #include "rte_pmd_i40e.h"
 #include <rte_vect.h>
drivers/net/intel/iavf/iavf_fsub.c +1 -1
index 19ae0e2dc2..745089c1e4 100644
@@ -14,7 +14,7 @@
 #include <rte_ethdev.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/iavf/iavf_hash.c +1 -1
index 9515094402..38526eb7e6 100644
@@ -15,7 +15,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 
drivers/net/intel/ice/ice_acl_filter.c +1 -1
index 30ff1254c9..08f44e26cf 100644
@@ -13,9 +13,9 @@
 #include <rte_debug.h>
 #include <rte_ether.h>
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/ice/ice_ethdev.h +2 -0
index 7ee3ea8a70..fe0dc19c98 100644
@@ -8,8 +8,10 @@
 #include <rte_compat.h>
 #include <rte_kvargs.h>
 #include <rte_time.h>
+#include <rte_flow.h>
 
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_tm_driver.h>
 #include <rte_vect.h>
 
drivers/net/intel/ice/ice_generic_flow.c +1 -0
index 76b3800545..9c81c3aea8 100644
@@ -13,6 +13,7 @@
 
 #include <rte_ether.h>
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_hexdump.h>
 #include <rte_malloc.h>
 #include <rte_tailq.h>
drivers/net/intel/ice/ice_hash.c +1 -1
index 7a9a4f1a04..5158a4f886 100644
@@ -16,7 +16,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 
drivers/net/intel/ice/ice_switch_filter.c +1 -1
index 6f5af03f6a..cbc3df6d7c 100644
@@ -15,7 +15,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/ipn3ke/ipn3ke_flow.c +1 -1
index 941d2921fb..47f4936bc6 100644
@@ -16,7 +16,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_rawdev.h>
 #include <rte_rawdev_pmd.h>
drivers/net/intel/ixgbe/ixgbe_ethdev.h +1 -0
index c290f04611..68b54ae750 100644
@@ -16,6 +16,7 @@
 #include "ixgbe_bypass.h"
 #include "ixgbe_ipsec.h"
 #include <rte_flow.h>
+#include <ethdev_fdir.h>
 #include <rte_time.h>
 #include <rte_hash.h>
 #include <rte_pci.h>
drivers/net/nbl/nbl_include/nbl_include.h +1 -0
index eeae6a3301..c1383e7b4e 100644
@@ -27,6 +27,7 @@
 
 #include <rte_alarm.h>
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <bus_pci_driver.h>
drivers/net/txgbe/txgbe_ethdev.h +1 -0
index c32c61d8bf..a48d710ab1 100644
@@ -18,6 +18,7 @@
 #include <rte_time.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
+#include <ethdev_fdir.h>
 #include <rte_hash.h>
 #include <rte_hash_crc.h>
 #include <bus_pci_driver.h>
lib/ethdev/ethdev_driver.h +0 -36
index 0f336f9567..2dc63cfa18 100644
@@ -2365,42 +2365,6 @@ struct rte_eth_tunnel_filter_conf {
 	uint16_t queue_id;      /**< Queue assigned to if match */
 };
 
-/**
- *  Memory space that can be configured to store Flow Director filters
- *  in the board memory.
- */
-enum rte_eth_fdir_pballoc_type {
-	RTE_ETH_FDIR_PBALLOC_64K = 0,  /**< 64k. */
-	RTE_ETH_FDIR_PBALLOC_128K,     /**< 128k. */
-	RTE_ETH_FDIR_PBALLOC_256K,     /**< 256k. */
-};
-
-/**
- *  Select report mode of FDIR hash information in Rx descriptors.
- */
-enum rte_fdir_status_mode {
-	RTE_FDIR_NO_REPORT_STATUS = 0, /**< Never report FDIR hash. */
-	RTE_FDIR_REPORT_STATUS, /**< Only report FDIR hash for matching pkts. */
-	RTE_FDIR_REPORT_STATUS_ALWAYS, /**< Always report FDIR hash. */
-};
-
-/**
- * A structure used to configure the Flow Director (FDIR) feature
- * of an Ethernet port.
- *
- * If mode is RTE_FDIR_MODE_NONE, the pballoc value is ignored.
- */
-struct rte_eth_fdir_conf {
-	enum rte_fdir_mode mode; /**< Flow Director mode. */
-	enum rte_eth_fdir_pballoc_type pballoc; /**< Space for FDIR filters. */
-	enum rte_fdir_status_mode status;  /**< How to report FDIR hash. */
-	/** Rx queue of packets matching a "drop" filter in perfect mode. */
-	uint8_t drop_queue;
-	struct rte_eth_fdir_masks mask;
-	/** Flex payload configuration. */
-	struct rte_eth_fdir_flex_conf flex_conf;
-};
-
 /**
  * @internal
  * Fetch from the driver what kind of configuration must be restored by ethdev layer,
lib/ethdev/ethdev_fdir.h renamed from lib/ethdev/rte_eth_ctrl.h +45 -13

73 lines not on this page · raw message

lib/ethdev/meson.build +1 -1
index 8ba6c708a2..3d556f8b7f 100644
@@ -32,11 +32,11 @@ headers = files(
 
 indirect_headers += files(
         'rte_ethdev_core.h',
-        'rte_eth_ctrl.h',
 )
 
 driver_sdk_headers += files(
         'ethdev_driver.h',
+        'ethdev_fdir.h',
         'ethdev_pci.h',
         'ethdev_vdev.h',
         'rte_flow_driver.h',
lib/ethdev/rte_ethdev.h +2 -11
index ee400b386f..7a17b81208 100644
@@ -164,8 +164,10 @@
 #include <rte_devargs.h>
 #include <rte_bitops.h>
 #include <rte_errno.h>
+#include <rte_ether.h>
 #include <rte_common.h>
 #include <rte_config.h>
+#include <rte_mbuf_history.h>
 #include <rte_power_intrinsics.h>
 
 #include "rte_ethdev_trace_fp.h"
@@ -1505,17 +1507,6 @@ enum rte_eth_tunnel_type {
 	RTE_ETH_TUNNEL_TYPE_MAX,
 };
 
-#ifdef __cplusplus
-}
-#endif
-
-/* Deprecated API file for rte_eth_dev_filter_* functions */
-#include "rte_eth_ctrl.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /**
  * UDP tunneling configuration.
  *
Signature · 1 line
2.53.0
#49 lore raw

PATCH v3 23/23 doc: add release note about rte_ethdev changes

In reply to Stephen Hemminger

The changes to rte_ethdev are visible to applications, which may need to include some network headers directly.

---
 doc/guides/rel_notes/release_26_11.rst | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
doc/guides/rel_notes/release_26_11.rst +19 -0
index c8cc86295d..a5e049ac04 100644
@@ -77,6 +77,15 @@ Removed Items
     ``rte_rib6_is_equal``
   * table: ``RTE_LPM_IPV6_ADDR_SIZE``
 
+* Removed the experimental flow director API:
+
+  * ixgbe: ``rte_pmd_ixgbe_get_fdir_info``, ``rte_pmd_ixgbe_get_fdir_stats``
+  * i40e: ``rte_pmd_i40e_get_fdir_info``, ``rte_pmd_i40e_get_fdir_stats``
+
+* Removed some testpmd commands:
+
+  The ``fdir`` option in ``show port`` and ``clear port`` were removed.
+
 
 API Changes
 -----------
@@ -93,6 +102,16 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* **Changed ethdev include files.**
+
+  * Dropped inclusion of ``rte_flow.h`` in ``rte_ethdev.h``.
+    Applications using flow API should include it directly.
+  * Network headers ``rte_ip.h``, ``rte_udp.h``, ``rte_tcp.h`` and ``rte_sctp.h``
+    are no longer indirectly included by ``rte_ethdev.h``.
+    Applications should include network headers as needed.
+  * Legacy flow director definitions are no longer included by ``rte_ethdev.h``.
+    ``rte_eth_ctrl.h`` is removed. Internal driver definitions were moved to ``ethdev_fdir.h``.
+
 
 ABI Changes
 -----------
Signature · 1 line
2.53.0
#50 lore raw

v4 cover ethdev: refactor remaining uses of flow director

In reply to Stephen Hemminger

The original flow support in DPDK was Intel-specific and built around the flow director feature. It was superseded by the generic rte_flow API introduced in the 17.02 release. The direct API calls to flow director were removed in 20.11, but the data structures were never removed and drivers still use them. Some Intel drivers also carry driver-specific APIs related to flow director.

These vestiges mean applications can still see flow director data structures, since rte_ethdev.h pulls in rte_eth_ctrl.h. It also means several drivers and libraries have come to depend on network header definitions arriving indirectly.

Since drivers still need these definitions, rte_eth_ctrl.h is renamed to ethdev_fdir.h and the remaining bits in ethdev_driver.h are folded into it. This is a driver SDK header, not public API, and exists only so that drivers still carrying legacy flow director state have somewhere to get these definitions. New drivers should not use it.

Applications relying on the indirect includes will need to add explicit ones; this is a source level change only, with no ABI impact. The fdir option of the testpmd "show port" and "clear port" commands is also removed.

v4 - fix AI review comments
- fix build of enetfec
- cleanup more leftovers from flow director in testpmd

Stephen Hemminger (23):
drivers/net: remove unused include in dpaa and dpaa2
ethdev: use DPDK byte order conversion net/ixgbe: remove experimental FDIR API net/i40e: remove experimental FDIR API app/testpmd: remove support for flow director app/testpmd: move str_to_flowtype to i40e app/test: include headers directly
gro: include headers directly crypto/dpaa_sec: include UDP header net/gve: include UDP, SCTP and TCP headers net/nfp: break implicit dependency on rte_eth_ctrl.h net/mana: include used network headers
node: get UDP header
net/rnp: include network headers
net/r8169: get network headers
net/ngbe: include network protocol headers
examples: include network headers
net/mlx5: include rte_flow as needed net/sfc: include rte_flow
net/intel/common: include network headers net/enetfec: add missing sys/types.h include ethdev, drivers: isolate flow director
doc: add release note about rte_ethdev changes

 app/test-eventdev/test_pipeline_common.h      |   1 +
 app/test-pmd/cmdline.c                        |  21 +-
 app/test-pmd/config.c                         | 225 ------------------
 app/test-pmd/testpmd.h                        |   6 -
 app/test/test_bpf.c                           |  20 +-
 app/test/test_security_inline_macsec.c        |   2 +
 app/test/test_security_inline_proto.c         |   1 +
 doc/api/doxy-api-index.md                     |   1 -
 doc/guides/nics/i40e.rst                      |  46 ----
 doc/guides/rel_notes/release_26_11.rst        |  24 ++
 doc/guides/testpmd_app_ug/intro.rst           |   4 +-
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |  56 +----
 drivers/crypto/dpaa_sec/dpaa_sec.h            |   2 +
 drivers/net/dpaa/dpaa_ptp.c                   |   1 -
 drivers/net/dpaa2/dpaa2_ptp.c                 |   1 -
 drivers/net/enetfec/enet_regs.h               |   2 +
 drivers/net/gve/gve_ethdev.h                  |  13 +-
 drivers/net/hinic/hinic_pmd_ethdev.h          |   2 +
 drivers/net/hinic3/hinic3_ethdev.h            |   1 +
 drivers/net/intel/common/tx_scalar.h          |   3 +
 drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c |   2 +-
 drivers/net/intel/e1000/e1000_ethdev.h        |   1 +
 drivers/net/intel/e1000/igc_filter.h          |   2 +-
 drivers/net/intel/i40e/i40e_ethdev.c          |   4 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |   5 +-
 drivers/net/intel/i40e/i40e_fdir.c            | 140 -----------
 drivers/net/intel/i40e/i40e_flow.c            |   3 +-
 drivers/net/intel/i40e/i40e_testpmd.c         |  51 ++++
 drivers/net/intel/i40e/rte_pmd_i40e.c         |  34 ---
 drivers/net/intel/i40e/rte_pmd_i40e.h         |  33 ---
 drivers/net/intel/iavf/iavf_fsub.c            |   2 +-
 drivers/net/intel/iavf/iavf_hash.c            |   2 +-
 drivers/net/intel/ice/ice_acl_filter.c        |   2 +-
 drivers/net/intel/ice/ice_ethdev.h            |   2 +
 drivers/net/intel/ice/ice_generic_flow.c      |   1 +
 drivers/net/intel/ice/ice_hash.c              |   2 +-
 drivers/net/intel/ice/ice_switch_filter.c     |   2 +-
 drivers/net/intel/ipn3ke/ipn3ke_flow.c        |   2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |   6 +-
 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 ---
 drivers/net/mana/mana.c                       |  26 +-
 drivers/net/mana/tx.c                         |   3 +
 drivers/net/mlx5/mlx5_ethdev.c                |   1 +
 drivers/net/mlx5/mlx5_flow.h                  |   1 +
 drivers/net/mlx5/mlx5_txq.c                   |   1 +
 drivers/net/mlx5/mlx5_utils.c                 |   1 +
 drivers/net/mlx5/mlx5_utils.h                 |   1 +
 drivers/net/nbl/nbl_include/nbl_include.h     |   1 +
 drivers/net/nfp/nfp_ethdev.c                  |   6 +-
 drivers/net/nfp/nfp_net_common.h              |   4 +-
 drivers/net/ngbe/ngbe_rxtx.c                  |   4 +
 drivers/net/r8169/r8169_rxtx.c                |  19 +-
 drivers/net/rnp/rnp_rxtx.c                    |   6 +
 drivers/net/sfc/sfc_dp.c                      |   1 +
 drivers/net/txgbe/txgbe_ethdev.h              |   1 +
 examples/l2fwd-macsec/main.c                  |   2 +
 examples/l3fwd-graph/main.c                   |   1 +
 examples/l3fwd/l3fwd.h                        |   2 +
 lib/ethdev/ethdev_driver.h                    |  36 ---
 lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h}  |  62 ++++-
 lib/ethdev/meson.build                        |   2 +-
 lib/ethdev/rte_ethdev.h                       |  13 +-
 lib/ethdev/sff_8472.c                         |   4 +-
 lib/gro/gro_tcp4.c                            |   9 +-
 lib/gro/gro_tcp6.c                            |   9 +-
 lib/gro/gro_vxlan_tcp4.c                      |  10 +-
 lib/gro/gro_vxlan_udp4.c                      |   9 +-
 lib/gro/rte_gro.c                             |   9 +-
 lib/node/udp4_input.c                         |  17 +-
 71 files changed, 324 insertions(+), 848 deletions(-)
 rename lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h} (90%)
Signature · 1 line
2.53.0
#51 lore raw

PATCH v4 1/23 drivers/net: remove unused include in dpaa and dpaa2

rte_eth_ctrl.h is deprecated and its contents are not used here.

---
 drivers/net/dpaa/dpaa_ptp.c   | 1 -
 drivers/net/dpaa2/dpaa2_ptp.c | 1 -
 2 files changed, 2 deletions(-)
drivers/net/dpaa/dpaa_ptp.c +0 -1
index e9b332c571..f91d3f9ce3 100644
@@ -9,7 +9,6 @@
 
 #include <rte_ethdev.h>
 #include <rte_log.h>
-#include <rte_eth_ctrl.h>
 #include <rte_malloc.h>
 #include <rte_time.h>
 
drivers/net/dpaa2/dpaa2_ptp.c +0 -1
index 751e558c73..77d5d82b44 100644
@@ -12,7 +12,6 @@
 
 #include <ethdev_driver.h>
 #include <rte_log.h>
-#include <rte_eth_ctrl.h>
 #include <rte_malloc.h>
 #include <rte_time.h>
 
Signature · 1 line
2.53.0
Acked-by on v4 1/23
#52 lore raw

Re: [PATCH v4 01/23] drivers/net: remove unused include in dpaa and dpaa2

Quoted 3 lines · Stephen Hemminger

rte_eth_ctrl.h is deprecated and its contents are not used here.

Quoted 29 lines
---
  drivers/net/dpaa/dpaa_ptp.c   | 1 -
  drivers/net/dpaa2/dpaa2_ptp.c | 1 -
  2 files changed, 2 deletions(-)
drivers/net/dpaa/dpaa_ptp.c +0 -1
index e9b332c571..f91d3f9ce3 100644
@@ -9,7 +9,6 @@
 
  #include <rte_ethdev.h>
  #include <rte_log.h>
-#include <rte_eth_ctrl.h>
  #include <rte_malloc.h>
  #include <rte_time.h>
 
drivers/net/dpaa2/dpaa2_ptp.c +0 -1
index 751e558c73..77d5d82b44 100644
@@ -12,7 +12,6 @@
 
  #include <ethdev_driver.h>
  #include <rte_log.h>
-#include <rte_eth_ctrl.h>
  #include <rte_malloc.h>
  #include <rte_time.h>
 
#53 lore raw

PATCH v4 2/23 ethdev: use DPDK byte order conversion

In reply to Stephen Hemminger

DPDK has its own byte order macros which are preferred over the POSIX/libc ones in arpa/inet.h
This resolves issue where this code was inheriting the inclusion of arpa/inet.h from rte_ethdev.h -> rte_eth_ctrl.h.

---
 lib/ethdev/sff_8472.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/ethdev/sff_8472.c +3 -1
index 97f231854c..e29711eb74 100644
@@ -5,6 +5,8 @@
 
 #include <stdio.h>
 
+#include <rte_byteorder.h>
+
 #include "sff_common.h"
 
 /* Offsets in decimal, for direct comparison with the SFF specs */
@@ -176,7 +178,7 @@ static float befloattoh(const uint32_t *source)
 		float dst;
 	} converter;
 
-	converter.src = ntohl(*source);
+	converter.src = rte_be_to_cpu_32(*source);
 	return converter.dst;
 }
 
Signature · 1 line
2.53.0
Acked-by on v4 2/23
#54 lore raw

Re: [PATCH v4 02/23] ethdev: use DPDK byte order conversion

Quoted 10 lines · Stephen Hemminger

DPDK has its own byte order macros which are preferred over the POSIX/libc ones in arpa/inet.h
This resolves issue where this code was inheriting the inclusion of arpa/inet.h from rte_ethdev.h -> rte_eth_ctrl.h.

---
 lib/ethdev/sff_8472.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Ok fix, though I would note that this fix is nothing to do with the removal of flow director material.

Quoted 22 lines
lib/ethdev/sff_8472.c +3 -1
index 97f231854c..e29711eb74 100644
@@ -5,6 +5,8 @@
 
 #include <stdio.h>
 
+#include <rte_byteorder.h>
+
 #include "sff_common.h"
 
 /* Offsets in decimal, for direct comparison with the SFF specs */
@@ -176,7 +178,7 @@ static float befloattoh(const uint32_t *source)
 		float dst;
 	} converter;
 
-	converter.src = ntohl(*source);
+	converter.src = rte_be_to_cpu_32(*source);
 	return converter.dst;
 }
 
#55 lore raw

Re: [PATCH v4 02/23] ethdev: use DPDK byte order conversion

Quoted 12 lines · On Thu, 3 Sep 2026 10:20:31 +0100 Bruce Richardson…
Quoted 10 lines · Stephen Hemminger

DPDK has its own byte order macros which are preferred over the POSIX/libc ones in arpa/inet.h
This resolves issue where this code was inheriting the inclusion of arpa/inet.h from rte_ethdev.h -> rte_eth_ctrl.h.

---
 lib/ethdev/sff_8472.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 4 lines

Ok fix, though I would note that this fix is nothing to do with the removal of flow director material.

What happened was that when flow director part (in rte_eth_ctrl.h) is removed from always being included by rte_ethdev.h, then this code would not build. The code relied on the include cascade:
rte_ethdev.h

     rte_eth_ctrl.h
       rte_flow.h
         rte_ip4.h
           arpa/inet.h

Maybe other things are getting this as well?
The DPDK IP headers should rely on the Linux definitions, but that is a different issue.

#56 lore raw

Re: [PATCH v4 02/23] ethdev: use DPDK byte order conversion

Quoted 20 lines · Stephen Hemminger
Quoted 12 lines · On Thu, 3 Sep 2026 10:20:31 +0100 Bruce Richardson…
Quoted 10 lines · Stephen Hemminger

DPDK has its own byte order macros which are preferred over the POSIX/libc ones in arpa/inet.h
This resolves issue where this code was inheriting the inclusion of arpa/inet.h from rte_ethdev.h -> rte_eth_ctrl.h.

---
 lib/ethdev/sff_8472.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 4 lines

Ok fix, though I would note that this fix is nothing to do with the removal of flow director material.

Quoted 9 lines

What happened was that when flow director part (in rte_eth_ctrl.h) is removed from always being included by rte_ethdev.h, then this code would not build. The code relied on the include cascade:

   rte_ethdev.h
     rte_eth_ctrl.h
       rte_flow.h
         rte_ip4.h
           arpa/inet.h

Right. In cases like this, then, it's better that all the pre-requisite fixups go at the start of the series so they are in inter-mingled with the actual fdir removal. In this case, there are more fixes than removal patches so I think the series needs splitting (as I explained in another mail).

#57 lore raw

PATCH v4 3/23 net/ixgbe: remove experimental FDIR API

In reply to Stephen Hemminger

Remove the PMD specific flow director API from ixgbe. These APIs are experimental, therefore they can be removed without additional warnings.

---
 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(-)
drivers/net/intel/ixgbe/ixgbe_ethdev.h +0 -5
index 5d3243cb4d..c290f04611 100644
@@ -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
drivers/net/intel/ixgbe/ixgbe_fdir.c +0 -117

123 lines not on this page · raw message

drivers/net/intel/ixgbe/rte_pmd_ixgbe.c +0 -34
index f816fa3173..e0dff9cd73 100644
@@ -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;
-}
drivers/net/intel/ixgbe/rte_pmd_ixgbe.h +0 -32
index 7ca1126cfb..74bb5aa140 100644
@@ -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_ */
Signature · 1 line
2.53.0
#58 lore raw

Re: [PATCH v4 03/23] net/ixgbe: remove experimental FDIR API

Quoted 4 lines · Stephen Hemminger

Remove the PMD specific flow director API from ixgbe. These APIs are experimental, therefore they can be removed without additional warnings.

Quoted 8 lines
---
 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(-)

Yes, they are experimental and can be removed without warning, but that doesn't mean that they should just be removed. Checking the original commit that added these, the comment says:

"There are also several small features which can not be
implemented in rte_flow. This patch re-implemented these features as private API."

Therefore, I think we should keep these two APIs or if we are going to remove them, we mark them as deprecated for a couple of releases first. Since these are driver private, and are not part of a common API like ethdev, I'd view their presence as "mostly harmless".

/Bruce

#59 lore raw

PATCH v4 4/23 net/i40e: remove experimental FDIR API

In reply to Stephen Hemminger

Remove the flow director related private APIs in i40e. These APIs are experimental, therefore they can be removed without additional warnings.

---
 doc/guides/nics/i40e.rst              |  46 ---------
 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 ------
 7 files changed, 3 insertions(+), 261 deletions(-)
doc/guides/nics/i40e.rst +0 -46
index 29234dbf0f..67a3b29024 100644
@@ -397,52 +397,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
 ~~~~~~~~~~~~
drivers/net/intel/i40e/i40e_ethdev.c +2 -2
index b6b2d291ee..5cbdfe9db2 100644
@@ -9335,8 +9335,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] =
drivers/net/intel/i40e/i40e_ethdev.h +0 -4
index 9d9bde6aeb..3968bfd267 100644
@@ -1369,10 +1369,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);
drivers/net/intel/i40e/i40e_fdir.c +0 -140

146 lines not on this page · raw message

drivers/net/intel/i40e/i40e_flow.c +1 -2
index 6eb85a7d0d..e9993db6dd 100644
@@ -2391,8 +2391,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];
drivers/net/intel/i40e/rte_pmd_i40e.c +0 -34
index 2e7943ef8b..e47c1aa9d7 100644
@@ -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)
drivers/net/intel/i40e/rte_pmd_i40e.h +0 -33
index 5af7e2330f..34900f9bec 100644
@@ -1067,39 +1067,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
  *
Signature · 1 line
2.53.0
#60 lore raw

PATCH v4 5/23 app/testpmd: remove support for flow director

In reply to Stephen Hemminger

The legacy flow director API is deprecated and being removed. Drop it from testpmd; the testpmd CLI is not a stable API.

Removed commands:
show port fdir (port_id|all)
clear port fdir (port_id|all)

Also, update documentation of testpmd to not refer to Flow Director.

---
 app/test-pmd/cmdline.c                      |  21 +--
 app/test-pmd/config.c                       | 163 --------------------
 app/test-pmd/testpmd.h                      |   3 -
 doc/guides/testpmd_app_ug/intro.rst         |   4 +-
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  56 ++-----
 5 files changed, 17 insertions(+), 230 deletions(-)
app/test-pmd/cmdline.c +6 -15
index 10ee7c5179..c142a8ec50 100644
@@ -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"
@@ -7514,11 +7514,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);
@@ -7531,14 +7526,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,
@@ -7576,10 +7571,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);
 }
@@ -7591,7 +7582,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);
 
@@ -7599,7 +7590,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,
app/test-pmd/config.c +0 -163

169 lines not on this page · raw message

app/test-pmd/testpmd.h +0 -3
index 083171853c..f7c10ab6b8 100644
@@ -1212,9 +1212,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);
doc/guides/testpmd_app_ug/intro.rst +2 -2
index 5d8d8cf4eb..35321b084a 100644
@@ -7,8 +7,8 @@ Introduction
 This document is a user guide for the ``testpmd`` example application that is shipped as part of the Data Plane Development Kit.
 
 The ``testpmd`` application can be used to test the DPDK in a packet forwarding mode
-and also to access NIC hardware features such as Flow Director.
-It also serves as a example of how to build a more fully-featured application using the DPDK SDK.
+and also to access NIC hardware offload and flow features.
+It also serves as an example of how to build a more fully-featured application using the DPDK SDK.
 
 The guide shows how to build and run the testpmd application and
 how to configure the application from the command line and the run-time environment.
doc/guides/testpmd_app_ug/testpmd_funcs.rst +9 -47

100 lines not on this page · raw message

Signature · 1 line
2.53.0
Acked-by on v4 5/23
#61 lore raw

Re: [PATCH v4 05/23] app/testpmd: remove support for flow director

Quoted 9 lines · Stephen Hemminger

The legacy flow director API is deprecated and being removed. Drop it from testpmd; the testpmd CLI is not a stable API.

Removed commands:
show port fdir (port_id|all)
clear port fdir (port_id|all)

Also, update documentation of testpmd to not refer to Flow Director.

Quoted 9 lines
---
 app/test-pmd/cmdline.c                      |  21 +--
 app/test-pmd/config.c                       | 163 --------------------
 app/test-pmd/testpmd.h                      |   3 -
 doc/guides/testpmd_app_ug/intro.rst         |   4 +-
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  56 ++-----
 5 files changed, 17 insertions(+), 230 deletions(-)
#62 lore raw

PATCH v4 6/23 app/testpmd: move str_to_flowtype to i40e

In reply to Stephen Hemminger

Only the i40e internal command is still using str_to_flowtype() so move it to there.

---
 app/test-pmd/config.c                 | 62 ---------------------------
 app/test-pmd/testpmd.h                |  3 --
 drivers/net/intel/i40e/i40e_testpmd.c | 51 ++++++++++++++++++++++
 3 files changed, 51 insertions(+), 65 deletions(-)
app/test-pmd/config.c +0 -62
index 582e7287be..230640ea44 100644
@@ -3,7 +3,6 @@
  * Copyright 2013-2014 6WIND S.A.
  */
 
-#include <ctype.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <stdbool.h>
@@ -182,35 +181,6 @@ static const struct {
 	},
 };
 
-static const struct {
-	char str[32];
-	uint16_t ftype;
-} flowtype_str_table[] = {
-	{"raw", RTE_ETH_FLOW_RAW},
-	{"ipv4", RTE_ETH_FLOW_IPV4},
-	{"ipv4-frag", RTE_ETH_FLOW_FRAG_IPV4},
-	{"ipv4-tcp", RTE_ETH_FLOW_NONFRAG_IPV4_TCP},
-	{"ipv4-udp", RTE_ETH_FLOW_NONFRAG_IPV4_UDP},
-	{"ipv4-sctp", RTE_ETH_FLOW_NONFRAG_IPV4_SCTP},
-	{"ipv4-other", RTE_ETH_FLOW_NONFRAG_IPV4_OTHER},
-	{"ipv6", RTE_ETH_FLOW_IPV6},
-	{"ipv6-frag", RTE_ETH_FLOW_FRAG_IPV6},
-	{"ipv6-tcp", RTE_ETH_FLOW_NONFRAG_IPV6_TCP},
-	{"ipv6-udp", RTE_ETH_FLOW_NONFRAG_IPV6_UDP},
-	{"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP},
-	{"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER},
-	{"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
-	{"ipv6-ex", RTE_ETH_FLOW_IPV6_EX},
-	{"ipv6-tcp-ex", RTE_ETH_FLOW_IPV6_TCP_EX},
-	{"ipv6-udp-ex", RTE_ETH_FLOW_IPV6_UDP_EX},
-	{"port", RTE_ETH_FLOW_PORT},
-	{"vxlan", RTE_ETH_FLOW_VXLAN},
-	{"geneve", RTE_ETH_FLOW_GENEVE},
-	{"nvgre", RTE_ETH_FLOW_NVGRE},
-	{"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
-	{"gtpu", RTE_ETH_FLOW_GTPU},
-};
-
 static void
 print_ethaddr(const char *name, struct rte_ether_addr *eth_addr)
 {
@@ -7024,38 +6994,6 @@ set_record_burst_stats(uint8_t on_off)
 	record_burst_stats = on_off;
 }
 
-uint16_t
-str_to_flowtype(const char *string)
-{
-	uint8_t i;
-
-	for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
-		if (!strcmp(flowtype_str_table[i].str, string))
-			return flowtype_str_table[i].ftype;
-	}
-
-	if (isdigit(string[0])) {
-		int val = atoi(string);
-		if (val > 0 && val < 64)
-			return (uint16_t)val;
-	}
-
-	return RTE_ETH_FLOW_UNKNOWN;
-}
-
-const char*
-flowtype_to_str(uint16_t flow_type)
-{
-	uint8_t i;
-
-	for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
-		if (flowtype_str_table[i].ftype == flow_type)
-			return flowtype_str_table[i].str;
-	}
-
-	return NULL;
-}
-
 void
 set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 {
app/test-pmd/testpmd.h +0 -3
index f7c10ab6b8..ed94bd65c6 100644
@@ -1325,9 +1325,6 @@ int parse_hairpin_map(const char *hpmap);
 uint64_t str_to_rsstypes(const char *str);
 const char *rsstypes_to_str(uint64_t rss_type);
 
-uint16_t str_to_flowtype(const char *string);
-const char *flowtype_to_str(uint16_t flow_type);
-
 /* For registering driver specific testpmd commands. */
 struct testpmd_driver_commands {
 	TAILQ_ENTRY(testpmd_driver_commands) next;
drivers/net/intel/i40e/i40e_testpmd.c +51 -0

63 lines not on this page · raw message

Signature · 1 line
2.53.0
Acked-by on v4 6/23
#63 lore raw

Re: [PATCH v4 06/23] app/testpmd: move str_to_flowtype to i40e

Quoted 10 lines · Stephen Hemminger

Only the i40e internal command is still using str_to_flowtype() so move it to there.

---
 app/test-pmd/config.c                 | 62 ---------------------------
 app/test-pmd/testpmd.h                |  3 --
 drivers/net/intel/i40e/i40e_testpmd.c | 51 ++++++++++++++++++++++
 3 files changed, 51 insertions(+), 65 deletions(-)
#64 lore raw

PATCH v4 7/23 app/test: include headers directly

In reply to Stephen Hemminger

The test code was getting network headers indirectly via inclusion of rte_ethdev.h. This will change in the future, instead get the headers directly.

For BPF test, use the tool "iwyu" to get more complete set of headers. Replace use of htons() with equivalent DPDK byteorder macro.

---
 app/test-eventdev/test_pipeline_common.h |  1 +
 app/test/test_bpf.c                      | 20 +++++++++++++++-----
 app/test/test_security_inline_macsec.c   |  2 ++
 app/test/test_security_inline_proto.c    |  1 +
 4 files changed, 19 insertions(+), 5 deletions(-)
app/test-eventdev/test_pipeline_common.h +1 -0
index 61370fb799..e9f20e7f62 100644
@@ -12,6 +12,7 @@
 #include <rte_cycles.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
+#include <rte_ip.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_event_eth_tx_adapter.h>
 #include <rte_eventdev.h>
app/test/test_bpf.c +15 -5
index 3205afaa63..5b71f94a71 100644
@@ -5,16 +5,28 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdalign.h>
 #include <inttypes.h>
+#include <errno.h>
+#include <limits.h>
 #include <unistd.h>
 
-#include <rte_memory.h>
+#include <rte_bitops.h>
 #include <rte_debug.h>
 #include <rte_hexdump.h>
 #include <rte_malloc.h>
+#include <rte_memcpy.h>
+#include <rte_mbuf.h>
 #include <rte_random.h>
 #include <rte_byteorder.h>
 #include <rte_errno.h>
+#include <rte_ether.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
 
 #include "test.h"
 
@@ -30,8 +42,6 @@ test_bpf(void)
 #else
 
 #include <rte_bpf.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
 
 
 /* Tests of most simple BPF programs (no instructions, one instruction etc.) */
@@ -1331,7 +1341,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 	uint16_t eth_type;
 	uint64_t v = -1;
 
-	if (eth_hdr->ether_type == htons(0x8100)) {
+	if (eth_hdr->ether_type == rte_cpu_to_be_16(0x8100)) {
 		const struct rte_vlan_hdr *vlan_hdr =
 			(const void *)(eth_hdr + 1);
 		eth_type = vlan_hdr->eth_proto;
@@ -1341,7 +1351,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 		next = eth_hdr + 1;
 	}
 
-	if (eth_type == htons(0x0800)) {
+	if (eth_type == rte_cpu_to_be_16(0x0800)) {
 		ipv4_hdr = next;
 		if ((ipv4_hdr->dst_addr & rte_cpu_to_be_32(TEST_NETMASK)) ==
 		    rte_cpu_to_be_32(TEST_SUBNET)) {
app/test/test_security_inline_macsec.c +2 -0
index a929ff5326..43672ef237 100644
@@ -8,6 +8,8 @@
 #include <rte_ethdev.h>
 #include <rte_malloc.h>
 #include <rte_security.h>
+#include <rte_flow.h>
+#include <rte_macsec.h>
 
 #include "test.h"
 #include "test_security_inline_macsec_vectors.h"
app/test/test_security_inline_proto.c +1 -0
index 0b1f7fbbab..99111e5432 100644
@@ -7,6 +7,7 @@
 #include <inttypes.h>
 
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <rte_malloc.h>
 #include <rte_security.h>
 
Signature · 1 line
2.53.0
Acked-by on v4 7/23
#65 lore raw

RE: [PATCH v4 07/23] app/test: include headers directly

Quoted 16 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday 6 August 2026 06:09
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Jerin Jacob <[email protected]>; Konstantin Ananyev <[email protected]>; Marat Khalili <[email protected]>; Akhil Goyal <[email protected]>; Anoob Joseph <[email protected]>
Subject: [PATCH v4 07/23] app/test: include headers directly

The test code was getting network headers indirectly via inclusion of rte_ethdev.h. This will change in the future, instead get the headers directly.

For BPF test, use the tool "iwyu" to get more complete set of headers. Replace use of htons() with equivalent DPDK byteorder macro.

Quoted 7 lines
---
 app/test-eventdev/test_pipeline_common.h |  1 +
 app/test/test_bpf.c                      | 20 +++++++++++++++-----
 app/test/test_security_inline_macsec.c   |  2 ++
 app/test/test_security_inline_proto.c    |  1 +
 4 files changed, 19 insertions(+), 5 deletions(-)

All of the new headers seem to be defined by always-enabled libraries, something worth mentioning in the future.

Quoted 101 lines
app/test-eventdev/test_pipeline_common.h +1 -0
index 61370fb799..e9f20e7f62 100644
@@ -12,6 +12,7 @@
 #include <rte_cycles.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
+#include <rte_ip.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_event_eth_tx_adapter.h>
 #include <rte_eventdev.h>
app/test/test_bpf.c +15 -5
index 3205afaa63..5b71f94a71 100644
@@ -5,16 +5,28 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdalign.h>
 #include <inttypes.h>
+#include <errno.h>
+#include <limits.h>
 #include <unistd.h>
 
-#include <rte_memory.h>
+#include <rte_bitops.h>
 #include <rte_debug.h>
 #include <rte_hexdump.h>
 #include <rte_malloc.h>
+#include <rte_memcpy.h>
+#include <rte_mbuf.h>
 #include <rte_random.h>
 #include <rte_byteorder.h>
 #include <rte_errno.h>
+#include <rte_ether.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
 
 #include "test.h"
 
@@ -30,8 +42,6 @@ test_bpf(void)
 #else
 
 #include <rte_bpf.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
 
 
 /* Tests of most simple BPF programs (no instructions, one instruction etc.) */
@@ -1331,7 +1341,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 	uint16_t eth_type;
 	uint64_t v = -1;
 
-	if (eth_hdr->ether_type == htons(0x8100)) {
+	if (eth_hdr->ether_type == rte_cpu_to_be_16(0x8100)) {
 		const struct rte_vlan_hdr *vlan_hdr =
 			(const void *)(eth_hdr + 1);
 		eth_type = vlan_hdr->eth_proto;
@@ -1341,7 +1351,7 @@ test_jump2_check(uint64_t rc, const void *arg)
 		next = eth_hdr + 1;
 	}
 
-	if (eth_type == htons(0x0800)) {
+	if (eth_type == rte_cpu_to_be_16(0x0800)) {
 		ipv4_hdr = next;
 		if ((ipv4_hdr->dst_addr & rte_cpu_to_be_32(TEST_NETMASK)) ==
 		    rte_cpu_to_be_32(TEST_SUBNET)) {
app/test/test_security_inline_macsec.c +2 -0
index a929ff5326..43672ef237 100644
@@ -8,6 +8,8 @@
 #include <rte_ethdev.h>
 #include <rte_malloc.h>
 #include <rte_security.h>
+#include <rte_flow.h>
+#include <rte_macsec.h>
 
 #include "test.h"
 #include "test_security_inline_macsec_vectors.h"
app/test/test_security_inline_proto.c +1 -1
index 0b1f7fbbab..99111e5432 100644
@@ -7,6 +7,7 @@
 #include <inttypes.h>
 
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <rte_malloc.h>
 #include <rte_security.h>
 
--

2.53.0

#66 lore raw

PATCH v4 8/23 gro: include headers directly

In reply to Stephen Hemminger

The gro library was getting headers such as VXLAN implicitly via rte_ethdev.h.
This will change, so include the needed headers directly. Use iwyu to make sure all headers are covered.

---
 lib/gro/gro_tcp4.c       |  9 ++++++++-
 lib/gro/gro_tcp6.c       |  9 ++++++++-
 lib/gro/gro_vxlan_tcp4.c | 10 +++++++++-
 lib/gro/gro_vxlan_udp4.c |  9 ++++++++-
 lib/gro/rte_gro.c        |  9 ++++++++-
 5 files changed, 41 insertions(+), 5 deletions(-)
lib/gro/gro_tcp4.c +8 -1
index 855cc7a71d..3997fb8bf1 100644
@@ -2,9 +2,16 @@
  * Copyright(c) 2017 Intel Corporation
  */
 
+#include <stddef.h>
+
+#include <rte_branch_prediction.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
+#include <rte_ether.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ip.h>
+#include <rte_tcp.h>
 
 #include "gro_tcp4.h"
 #include "gro_tcp_internal.h"
lib/gro/gro_tcp6.c +8 -1
index ab4cd6c68b..4e1ae596b7 100644
@@ -2,9 +2,16 @@
  * Copyright(c) 2023 Intel Corporation
  */
 
+#include <stdbool.h>
+
+#include <rte_branch_prediction.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
+#include <rte_ether.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ip.h>
+#include <rte_tcp.h>
 
 #include "gro_tcp6.h"
 #include "gro_tcp_internal.h"
lib/gro/gro_vxlan_tcp4.c +9 -1
index 29d4a2e13d..650d02eb74 100644
@@ -2,9 +2,17 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <stddef.h>
+
+#include <rte_branch_prediction.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ether.h>
+#include <rte_vxlan.h>
+#include <rte_ip.h>
+#include <rte_tcp.h>
 #include <rte_udp.h>
 
 #include "gro_vxlan_tcp4.h"
lib/gro/gro_vxlan_udp4.c +8 -1
index ca8cee270d..bdfa8d6d20 100644
@@ -2,9 +2,16 @@
  * Copyright(c) 2020 Inspur Corporation
  */
 
+#include <stddef.h>
+
+#include <rte_branch_prediction.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ether.h>
+#include <rte_vxlan.h>
+#include <rte_ip.h>
 #include <rte_udp.h>
 
 #include "gro_vxlan_udp4.h"
lib/gro/rte_gro.c +8 -1
index 578cc9b801..5bccd3cbac 100644
@@ -2,12 +2,19 @@
  * Copyright(c) 2017 Intel Corporation
  */
 
+#include <stddef.h>
+
 #include <eal_export.h>
+#include <rte_branch_prediction.h>
+#include <rte_common.h>
 #include <rte_malloc.h>
+#include <rte_mbuf.h>
 #include <rte_cycles.h>
-#include <rte_ethdev.h>
+#include <rte_ether.h>
+#include <rte_vxlan.h>
 
 #include "rte_gro.h"
+#include "gro_tcp.h"
 #include "gro_tcp4.h"
 #include "gro_tcp6.h"
 #include "gro_udp4.h"
Signature · 1 line
2.53.0
Acked-by on v4 8/23
#67 lore raw

Re: [PATCH v4 08/23] gro: include headers directly

Quoted 5 lines · Stephen Hemminger

The gro library was getting headers such as VXLAN implicitly via rte_ethdev.h.
This will change, so include the needed headers directly. Use iwyu to make sure all headers are covered.

Quoted 9 lines
---
 lib/gro/gro_tcp4.c       |  9 ++++++++-
 lib/gro/gro_tcp6.c       |  9 ++++++++-
 lib/gro/gro_vxlan_tcp4.c | 10 +++++++++-
 lib/gro/gro_vxlan_udp4.c |  9 ++++++++-
 lib/gro/rte_gro.c        |  9 ++++++++-
 5 files changed, 41 insertions(+), 5 deletions(-)
#68 lore raw

PATCH v4 9/23 crypto/dpaa_sec: include UDP header

In reply to Stephen Hemminger

The driver was getting the UDP header definition indirectly via rte_ethdev.h. That will change, so include the header directly.

---
 drivers/crypto/dpaa_sec/dpaa_sec.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/crypto/dpaa_sec/dpaa_sec.h +2 -0
index d78cad818a..bce60d9cb8 100644
@@ -7,6 +7,8 @@
 #ifndef _DPAA_SEC_H_
 #define _DPAA_SEC_H_
 
+#include <rte_udp.h>
+
 #define CRYPTODEV_NAME_DPAA_SEC_PMD	crypto_dpaa_sec
 /**< NXP DPAA - SEC PMD device name */
 
Signature · 1 line
2.53.0
Acked-by on v4 9/23
#69 lore raw

Re: [PATCH v4 09/23] crypto/dpaa_sec: include UDP header

Quoted 4 lines · Stephen Hemminger

The driver was getting the UDP header definition indirectly via rte_ethdev.h. That will change, so include the header directly.

Quoted 17 lines
---
  drivers/crypto/dpaa_sec/dpaa_sec.h | 2 ++
  1 file changed, 2 insertions(+)
drivers/crypto/dpaa_sec/dpaa_sec.h +2 -0
index d78cad818a..bce60d9cb8 100644
@@ -7,6 +7,8 @@
  #ifndef _DPAA_SEC_H_
  #define _DPAA_SEC_H_
 
+#include <rte_udp.h>
+
  #define CRYPTODEV_NAME_DPAA_SEC_PMD	crypto_dpaa_sec
  /**< NXP DPAA - SEC PMD device name */
 
#70 lore raw

PATCH v4 10/23 net/gve: include UDP, SCTP and TCP headers

In reply to Stephen Hemminger

This driver was getting rte_udp.h, rte_tcp.h and rte_sctp.h implicitly through rte_ethdev.h -> rte_eth_ctrl.h -> rte_flow.h. Since rte_eth_ctrl.h is deprecated, better to not depend on that.

Use iwyu to make sure all used includes are here.

---
 drivers/net/gve/gve_ethdev.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.h +12 -1
index c9a176ff17..95b32420b4 100644
@@ -5,15 +5,26 @@
 #ifndef _GVE_ETHDEV_H_
 #define _GVE_ETHDEV_H_
 
+#include <stdbool.h>
+#include <stdint.h>
+#include <pthread.h>
+#include <sys/queue.h>
+
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <rte_alarm.h>
+#include <rte_atomic.h>
+#include <rte_stdatomic.h>
+#include <rte_bitops.h>
+#include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_pci.h>
-#include <pthread.h>
 #include <rte_bitmap.h>
 #include <rte_memzone.h>
 #include <rte_thread.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "base/gve.h"
 
Signature · 1 line
2.53.0
#71 lore raw

PATCH v4 11/23 net/nfp: break implicit dependency on rte_eth_ctrl.h

In reply to Stephen Hemminger

This driver was using UINT64_BIT which was getting defined via deprecated rte_eth_ctrl.h. Replace with local definition.

Also include rte_flow.h instead of depending on indirect inclusion from rte_ethdev.h.

---
 drivers/net/nfp/nfp_ethdev.c     | 6 ++++--
 drivers/net/nfp/nfp_net_common.h | 4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/nfp/nfp_ethdev.c +4 -2
index d2da18013c..25be1de080 100644
@@ -6,6 +6,7 @@
  */
 
 #include <unistd.h>
+#include <limits.h>
 
 #include <eal_firmware.h>
 #include <rte_alarm.h>
@@ -32,6 +33,7 @@
 
 /* 64-bit per app capabilities */
 #define NFP_NET_APP_CAP_SP_INDIFF       RTE_BIT64(0) /* Indifferent to port speed */
+#define NFP_UINT64_BIT (CHAR_BIT * sizeof(uint64_t))
 
 #define NFP_PF_DRIVER_NAME net_nfp_pf
 #define NFP_PF_FORCE_RELOAD_FW   "force_reload_fw"
@@ -2060,8 +2062,8 @@ nfp_net_speed_capa_get_real(struct nfp_eth_media_buf *media_buf,
 
 	for (i = 0; i < RTE_DIM(media_buf->supported_modes); i++) {
 		supported_modes = media_buf->supported_modes[i];
-		offset = i * UINT64_BIT;
-		for (j = 0; j < UINT64_BIT; j++) {
+		offset = i * NFP_UINT64_BIT;
+		for (j = 0; j < NFP_UINT64_BIT; j++) {
 			if (supported_modes == 0)
 				break;
 
drivers/net/nfp/nfp_net_common.h +3 -1
index 2bd2d54028..62c6448cc3 100644
@@ -8,9 +8,11 @@
 
 #include <bus_pci_driver.h>
 #include <ethdev_driver.h>
+#include <rte_flow.h>
+#include <rte_spinlock.h>
+
 #include <nfp_common.h>
 #include <nfp_dev.h>
-#include <rte_spinlock.h>
 
 #include "nfpcore/nfp_sync.h"
 #include "nfp_net_ctrl.h"
Signature · 1 line
2.53.0
#72 lore raw

PATCH v4 12/23 net/mana: include used network headers

In reply to Stephen Hemminger

This driver was getting definition of IP, UDP, and TCP headers implicitly via rte_ethdev.h. That will be changing so instead include the required headers directly.

Use include-what-you-use (iwyu) to add headers that are being used in this driver to avoid future issues.

---
 drivers/net/mana/mana.c | 26 +++++++++++++++++++++++---
 drivers/net/mana/tx.c   |  3 +++
 2 files changed, 26 insertions(+), 3 deletions(-)
drivers/net/mana/mana.c +23 -3
index 0b72f711a1..89f6033517 100644
@@ -2,24 +2,44 @@
  * Copyright 2022 Microsoft Corporation
  */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <dirent.h>
 #include <fcntl.h>
+#include <errno.h>
+#include <time.h>
+#include <string.h>
+#include <inttypes.h>
 #include <sys/mman.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
+#include <netinet/in.h>
 
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
-#include <rte_kvargs.h>
+#include <rte_atomic.h>
+#include <rte_debug.h>
+#include <rte_dev.h>
+#include <rte_devargs.h>
+#include <rte_eal.h>
 #include <rte_eal_paging.h>
+#include <rte_errno.h>
+#include <rte_ether.h>
+#include <rte_interrupts.h>
+#include <rte_kvargs.h>
+#include <rte_malloc.h>
+#include <rte_mbuf.h>
+#include <rte_memory.h>
+#include <rte_memzone.h>
+#include <rte_pause.h>
 #include <rte_pci.h>
+#include <rte_spinlock.h>
 
 #include <infiniband/verbs.h>
 #include <infiniband/manadv.h>
 
-#include <assert.h>
-
 #include "mana.h"
 
 /* Shared memory between primary/secondary processes, per driver */
drivers/net/mana/tx.c +3 -0
index 10f2212b5d..9517b033dc 100644
@@ -3,6 +3,9 @@
  */
 
 #include <ethdev_driver.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
 
 #include <infiniband/verbs.h>
 #include <infiniband/manadv.h>
Signature · 1 line
2.53.0
#73 lore raw

PATCH v4 13/23 node: get UDP header

In reply to Stephen Hemminger

This library was getting UDP header indirectly via rte_ethdev.h Use iwyu to update includes to match usage.

---
 lib/node/udp4_input.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
lib/node/udp4_input.c +9 -8
index 5a74e28c85..02a8284982 100644
@@ -2,20 +2,21 @@
  * Copyright(C) 2023 Marvell International Ltd.
  */
 
-#include <arpa/inet.h>
-#include <sys/socket.h>
+#include <stdio.h>
+#include <stdint.h>
 
 #include <eal_export.h>
-#include <rte_ethdev.h>
+#include <rte_common.h>
+#include <rte_byteorder.h>
+#include <rte_errno.h>
 #include <rte_ether.h>
 #include <rte_graph.h>
-#include <rte_graph_worker.h>
-#include <rte_ip.h>
-#include <rte_lpm.h>
 #include <rte_hash.h>
-#include <rte_fbk_hash.h>
+#include <rte_ip.h>
 #include <rte_jhash.h>
-#include <rte_hash_crc.h>
+#include <rte_log.h>
+#include <rte_memcpy.h>
+#include <rte_udp.h>
 
 #include "rte_node_udp4_input_api.h"
 
Signature · 1 line
2.53.0
#74 lore raw

PATCH v4 14/23 net/rnp: include network headers

In reply to Stephen Hemminger

The driver was getting definition of standard network protocol headers indirectly from rte_ethdev.h.

---
 drivers/net/rnp/rnp_rxtx.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/rnp/rnp_rxtx.c +6 -0
index 81e8c6ba44..93a3372e5a 100644
@@ -8,6 +8,12 @@
 #include <rte_memzone.h>
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
+#include <rte_vxlan.h>
+#include <rte_ip.h>
+#include <rte_gre.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "base/rnp_bdq_if.h"
 #include "base/rnp_dma_regs.h"
Signature · 1 line
2.53.0
#75 lore raw

PATCH v4 15/23 net/r8169: get network headers

In reply to Stephen Hemminger

This driver was getting network protocol headers indirectly via rte_ethdev.h. Use iwyu to update to full list of includes.

Replace POSIX/libc byte swap with equivalent DPDK function.

---
 drivers/net/r8169/r8169_rxtx.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/net/r8169/r8169_rxtx.c +13 -6
index 00de0471f4..5786624e27 100644
@@ -5,21 +5,28 @@
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
-
-#include <rte_eal.h>
+#include <stdbool.h>
+#include <string.h>
 
 #include <rte_common.h>
-#include <rte_interrupts.h>
+#include <rte_atomic.h>
 #include <rte_byteorder.h>
 #include <rte_debug.h>
-#include <rte_pci.h>
+#include <rte_log.h>
 #include <bus_pci_driver.h>
 #include <rte_ether.h>
+#include <rte_ethdev.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
-#include <rte_memory.h>
+#include <rte_bitops.h>
+#include <rte_memzone.h>
 #include <rte_malloc.h>
+#include <rte_mbuf.h>
+#include <rte_prefetch.h>
+#include <rte_random.h>
+#include <rte_stdatomic.h>
 #include <dev_driver.h>
+#include <rte_udp.h>
 
 #include "r8169_ethdev.h"
 #include "r8169_hw.h"
@@ -1535,7 +1542,7 @@ rtl8125_get_patch_pad_len(struct rte_mbuf *tx_pkt)
 
 	if (trans_data_len > 3 && trans_data_len < MIN_PATCH_LENGTH) {
 		udp_hdr = rte_pktmbuf_mtod_offset(tx_pkt, struct rte_udp_hdr *, l4_offset);
-		dest_port = ntohs(udp_hdr->dst_port);
+		dest_port = rte_be_to_cpu_16(udp_hdr->dst_port);
 		if (dest_port == 0x13f || dest_port == 0x140) {
 			pad_len = MIN_PATCH_LENGTH - trans_data_len;
 			goto out;
Signature · 1 line
2.53.0
#76 lore raw

PATCH v4 16/23 net/ngbe: include network protocol headers

In reply to Stephen Hemminger

Do not depend on network protocol headers getting included via rte_ethdev.h.

---
 drivers/net/ngbe/ngbe_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ngbe/ngbe_rxtx.c +4 -0
index a1389de9c0..fee984c396 100644
@@ -11,6 +11,10 @@
 #include <rte_malloc.h>
 #include <rte_net.h>
 #include <rte_vect.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 #include "ngbe_logs.h"
 #include "base/ngbe.h"
Signature · 1 line
2.53.0
#77 lore raw

PATCH v4 17/23 examples: include network headers

In reply to Stephen Hemminger

Don't depend on network protocol headers getting indirectly included via rte_ethdev.h.

---
 examples/l2fwd-macsec/main.c | 2 ++
 examples/l3fwd-graph/main.c  | 1 +
 examples/l3fwd/l3fwd.h       | 2 ++
 3 files changed, 5 insertions(+)
examples/l2fwd-macsec/main.c +2 -0
index 059f8a2170..e07769bd57 100644
@@ -33,9 +33,11 @@
 #include <rte_debug.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_security.h>
+#include <rte_macsec.h>
 #include <rte_string_fns.h>
 
 static volatile bool force_quit;
examples/l3fwd-graph/main.c +1 -0
index 5f89286dce..79dee4d103 100644
@@ -36,6 +36,7 @@
 #include <rte_per_lcore.h>
 #include <rte_string_fns.h>
 #include <rte_vect.h>
+#include <rte_ip.h>
 
 #include <cmdline_parse.h>
 #include <cmdline_parse_etheraddr.h>
examples/l3fwd/l3fwd.h +2 -0
index 349fc37c79..db7b746f59 100644
@@ -8,6 +8,8 @@
 #include <rte_ethdev.h>
 #include <rte_vect.h>
 #include <rte_acl.h>
+#include <rte_ip.h>
+
 
 #define DO_RFC_1812_CHECKS
 
Signature · 1 line
2.53.0
#79 lore raw

PATCH v4 18/23 net/mlx5: include rte_flow as needed

In reply to Stephen Hemminger

The driver was getting rte_flow.h included indirectly via rte_ethdev.h. This will change in future and driver should include it where needed.

---
 drivers/net/mlx5/mlx5_ethdev.c | 1 +
 drivers/net/mlx5/mlx5_flow.h   | 1 +
 drivers/net/mlx5/mlx5_txq.c    | 1 +
 drivers/net/mlx5/mlx5_utils.c  | 1 +
 drivers/net/mlx5/mlx5_utils.h  | 1 +
 5 files changed, 5 insertions(+)
drivers/net/mlx5/mlx5_ethdev.c +1 -0
index 8160d10e7e..c3d8e1b04f 100644
@@ -19,6 +19,7 @@
 #include <rte_string_fns.h>
 #include <rte_rwlock.h>
 #include <rte_cycles.h>
+#include <rte_flow.h>
 
 #include <mlx5_malloc.h>
 
drivers/net/mlx5/mlx5_flow.h +1 -0
index 3415b4722e..0da50fab85 100644
@@ -12,6 +12,7 @@
 
 #include <rte_alarm.h>
 #include <rte_mtr.h>
+#include <rte_flow.h>
 
 #include <mlx5_glue.h>
 #include <mlx5_prm.h>
drivers/net/mlx5/mlx5_txq.c +1 -0
index f9b254c6c5..f0b7b2d032 100644
@@ -18,6 +18,7 @@
 #include <rte_common.h>
 #include <rte_eal_paging.h>
 #include <rte_bitops.h>
+#include <rte_flow.h>
 
 #include <mlx5_common.h>
 #include <mlx5_common_mr.h>
drivers/net/mlx5/mlx5_utils.c +1 -0
index 606743c4b7..12820054ff 100644
@@ -3,6 +3,7 @@
  */
 
 #include <rte_malloc.h>
+#include <rte_flow.h>
 
 #include <mlx5_malloc.h>
 
drivers/net/mlx5/mlx5_utils.h +1 -0
index 9ab79c8ad5..19d03145a6 100644
@@ -16,6 +16,7 @@
 #include <rte_rwlock.h>
 #include <rte_memory.h>
 #include <rte_bitmap.h>
+#include <rte_flow.h>
 
 #include <mlx5_common.h>
 #include <mlx5_common_utils.h>
Signature · 1 line
2.53.0
#80 lore raw

PATCH v4 19/23 net/sfc: include rte_flow

In reply to Stephen Hemminger

This driver was depending on rte_ethdev.h doing inclusion of rte_flow.h.

---
 drivers/net/sfc/sfc_dp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/sfc/sfc_dp.c +1 -0
index 7e2a20e4dc..c867c2c2ff 100644
@@ -15,6 +15,7 @@
 #include <rte_ethdev.h>
 #include <rte_log.h>
 #include <rte_mbuf_dyn.h>
+#include <rte_flow.h>
 
 #include "efx.h"
 
Signature · 1 line
2.53.0
#81 lore raw

PATCH v4 20/23 net/intel/common: include network headers

In reply to Stephen Hemminger

This file was depending on network protocol headers getting included via rte_ethdev.h -> rte_flow.h.

---
 drivers/net/intel/common/tx_scalar.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/intel/common/tx_scalar.h +3 -0
index 11ab6c08fc..dcb2ea5542 100644
@@ -8,6 +8,9 @@
 #include <stdint.h>
 #include <rte_io.h>
 #include <rte_byteorder.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 /* depends on common Tx definitions. */
 #include "tx.h"
Signature · 1 line
2.53.0
Acked-by on v4 20/23
#82 lore raw

Re: [PATCH v4 20/23] net/intel/common: include network headers

Quoted 14 lines · Stephen Hemminger

This file was depending on network protocol headers getting included via rte_ethdev.h -> rte_flow.h.

---
 drivers/net/intel/common/tx_scalar.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/intel/common/tx_scalar.h +0 -0
index 11ab6c08fc..dcb2ea5542 100644

drivers/net/intel/common/tx_scalar.h line 16

Quoted 9 lines
drivers/net/intel/common/tx_scalar.h +3 -0
@@ -8,6 +8,9 @@
 #include <stdint.h>
 #include <rte_io.h>
 #include <rte_byteorder.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
+#include <rte_sctp.h>
 
 /* depends on common Tx definitions. */
 #include "tx.h"
#83 lore raw

PATCH v4 21/23 net/enetfec: add missing sys/types.h include

In reply to Stephen Hemminger

The enet_regs.h header uses BSD types 'uint' and 'ushort' which were previously available through indirect inclusion via:
rte_ethdev.h -> rte_flow.h -> rte_ip.h -> rte_ip[46].h -> sys/types.h

After changes to reduce rte_ethdev.h header dependencies, this indirect inclusion no longer occurs, causing build failures.

---
 drivers/net/enetfec/enet_regs.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/enetfec/enet_regs.h +2 -0
index c9400957f8..a834fa5889 100644
@@ -5,6 +5,8 @@
 #ifndef __ENETFEC_REGS_H
 #define __ENETFEC_REGS_H
 
+#include <sys/types.h>
+
 /* Ethernet receive use control and status of buffer descriptor
  */
 #define RX_BD_TR	((ushort)0x0001) /* Truncated */
Signature · 1 line
2.53.0
#84 lore raw

PATCH v4 22/23 ethdev, drivers: isolate flow director

In reply to Stephen Hemminger

There are leftover bits of legacy flow director that are still being used by drivers. Move the definitions contained in ethdev_driver.h and rte_eth_ctrl.h into a single file ethdev_fdir.h and only include it in the drivers that require it.

Change rte_ethdev.h to include the headers required which it was previously getting from rte_eth_ctrl.h -> rte_flow.h.

Since ethdev_fdir.h is internal for driver SDK only it does not have to include as many secondary headers.

---
 doc/api/doxy-api-index.md                     |  1 -
 drivers/net/hinic/hinic_pmd_ethdev.h          |  2 +
 drivers/net/hinic3/hinic3_ethdev.h            |  1 +
 drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c |  2 +-
 drivers/net/intel/e1000/e1000_ethdev.h        |  1 +
 drivers/net/intel/e1000/igc_filter.h          |  2 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |  1 +
 drivers/net/intel/iavf/iavf_fsub.c            |  2 +-
 drivers/net/intel/iavf/iavf_hash.c            |  2 +-
 drivers/net/intel/ice/ice_acl_filter.c        |  2 +-
 drivers/net/intel/ice/ice_ethdev.h            |  2 +
 drivers/net/intel/ice/ice_generic_flow.c      |  1 +
 drivers/net/intel/ice/ice_hash.c              |  2 +-
 drivers/net/intel/ice/ice_switch_filter.c     |  2 +-
 drivers/net/intel/ipn3ke/ipn3ke_flow.c        |  2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |  1 +
 drivers/net/nbl/nbl_include/nbl_include.h     |  1 +
 drivers/net/txgbe/txgbe_ethdev.h              |  1 +
 lib/ethdev/ethdev_driver.h                    | 36 -----------
 lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h}  | 62 +++++++++++++++----
 lib/ethdev/meson.build                        |  2 +-
 lib/ethdev/rte_ethdev.h                       | 13 +---
 22 files changed, 71 insertions(+), 70 deletions(-)
 rename lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h} (90%)
doc/api/doxy-api-index.md +0 -1
index 9296042119..ac8314e908 100644
@@ -11,7 +11,6 @@ The public API headers are grouped by topics:
 - **device**:
   [dev](@ref rte_dev.h),
   [ethdev](@ref rte_ethdev.h),
-  [ethctrl](@ref rte_eth_ctrl.h),
   [rte_flow](@ref rte_flow.h),
   [rte_tm](@ref rte_tm.h),
   [rte_mtr](@ref rte_mtr.h),
drivers/net/hinic/hinic_pmd_ethdev.h +2 -0
index 8e6251f69f..10285ce814 100644
@@ -7,7 +7,9 @@
 
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
+#include <rte_flow.h>
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 
 #include "base/hinic_compat.h"
 #include "base/hinic_pmd_cfg.h"
drivers/net/hinic3/hinic3_ethdev.h +1 -0
index 9061e2b217..515ba044a1 100644
@@ -7,6 +7,7 @@
 
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
+#include <ethdev_fdir.h>
 
 #include "hinic3_fdir.h"
 
drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c +1 -1
index f42156e28f..977036bec5 100644
@@ -16,7 +16,7 @@
 #include <rte_ether.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/e1000/e1000_ethdev.h +1 -0
index 0907c7c259..da4dacc7d4 100644
@@ -9,6 +9,7 @@
 #include <sys/queue.h>
 
 #include <rte_flow.h>
+#include <ethdev_fdir.h>
 #include <rte_time.h>
 #include <rte_pci.h>
 
drivers/net/intel/e1000/igc_filter.h +1 -1
index 2b7e6b619a..d1e098e5bb 100644
@@ -8,7 +8,7 @@
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
 #include <ethdev_driver.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 
 #include "igc_ethdev.h"
 
drivers/net/intel/i40e/i40e_ethdev.h +1 -0
index 3968bfd267..c03eaab946 100644
@@ -13,6 +13,7 @@
 #include <rte_hash.h>
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_tm_driver.h>
 #include "rte_pmd_i40e.h"
 #include <rte_vect.h>
drivers/net/intel/iavf/iavf_fsub.c +1 -1
index 19ae0e2dc2..745089c1e4 100644
@@ -14,7 +14,7 @@
 #include <rte_ethdev.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/iavf/iavf_hash.c +1 -1
index 9515094402..38526eb7e6 100644
@@ -15,7 +15,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 
drivers/net/intel/ice/ice_acl_filter.c +1 -1
index 30ff1254c9..08f44e26cf 100644
@@ -13,9 +13,9 @@
 #include <rte_debug.h>
 #include <rte_ether.h>
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/ice/ice_ethdev.h +2 -0
index 7ee3ea8a70..fe0dc19c98 100644
@@ -8,8 +8,10 @@
 #include <rte_compat.h>
 #include <rte_kvargs.h>
 #include <rte_time.h>
+#include <rte_flow.h>
 
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_tm_driver.h>
 #include <rte_vect.h>
 
drivers/net/intel/ice/ice_generic_flow.c +1 -0
index 76b3800545..9c81c3aea8 100644
@@ -13,6 +13,7 @@
 
 #include <rte_ether.h>
 #include <ethdev_driver.h>
+#include <ethdev_fdir.h>
 #include <rte_hexdump.h>
 #include <rte_malloc.h>
 #include <rte_tailq.h>
drivers/net/intel/ice/ice_hash.c +1 -1
index 7a9a4f1a04..5158a4f886 100644
@@ -16,7 +16,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 
drivers/net/intel/ice/ice_switch_filter.c +1 -1
index 6f5af03f6a..cbc3df6d7c 100644
@@ -15,7 +15,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_flow_driver.h>
 #include <rte_flow.h>
drivers/net/intel/ipn3ke/ipn3ke_flow.c +1 -1
index 941d2921fb..47f4936bc6 100644
@@ -16,7 +16,7 @@
 #include <ethdev_driver.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_eth_ctrl.h>
+#include <ethdev_fdir.h>
 #include <rte_tailq.h>
 #include <rte_rawdev.h>
 #include <rte_rawdev_pmd.h>
drivers/net/intel/ixgbe/ixgbe_ethdev.h +1 -0
index c290f04611..68b54ae750 100644
@@ -16,6 +16,7 @@
 #include "ixgbe_bypass.h"
 #include "ixgbe_ipsec.h"
 #include <rte_flow.h>
+#include <ethdev_fdir.h>
 #include <rte_time.h>
 #include <rte_hash.h>
 #include <rte_pci.h>
drivers/net/nbl/nbl_include/nbl_include.h +1 -0
index eeae6a3301..c1383e7b4e 100644
@@ -27,6 +27,7 @@
 
 #include <rte_alarm.h>
 #include <rte_ethdev.h>
+#include <rte_flow.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <bus_pci_driver.h>
drivers/net/txgbe/txgbe_ethdev.h +1 -0
index c32c61d8bf..a48d710ab1 100644
@@ -18,6 +18,7 @@
 #include <rte_time.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_core.h>
+#include <ethdev_fdir.h>
 #include <rte_hash.h>
 #include <rte_hash_crc.h>
 #include <bus_pci_driver.h>
lib/ethdev/ethdev_driver.h +0 -36
index 0f336f9567..2dc63cfa18 100644
@@ -2365,42 +2365,6 @@ struct rte_eth_tunnel_filter_conf {
 	uint16_t queue_id;      /**< Queue assigned to if match */
 };
 
-/**
- *  Memory space that can be configured to store Flow Director filters
- *  in the board memory.
- */
-enum rte_eth_fdir_pballoc_type {
-	RTE_ETH_FDIR_PBALLOC_64K = 0,  /**< 64k. */
-	RTE_ETH_FDIR_PBALLOC_128K,     /**< 128k. */
-	RTE_ETH_FDIR_PBALLOC_256K,     /**< 256k. */
-};
-
-/**
- *  Select report mode of FDIR hash information in Rx descriptors.
- */
-enum rte_fdir_status_mode {
-	RTE_FDIR_NO_REPORT_STATUS = 0, /**< Never report FDIR hash. */
-	RTE_FDIR_REPORT_STATUS, /**< Only report FDIR hash for matching pkts. */
-	RTE_FDIR_REPORT_STATUS_ALWAYS, /**< Always report FDIR hash. */
-};
-
-/**
- * A structure used to configure the Flow Director (FDIR) feature
- * of an Ethernet port.
- *
- * If mode is RTE_FDIR_MODE_NONE, the pballoc value is ignored.
- */
-struct rte_eth_fdir_conf {
-	enum rte_fdir_mode mode; /**< Flow Director mode. */
-	enum rte_eth_fdir_pballoc_type pballoc; /**< Space for FDIR filters. */
-	enum rte_fdir_status_mode status;  /**< How to report FDIR hash. */
-	/** Rx queue of packets matching a "drop" filter in perfect mode. */
-	uint8_t drop_queue;
-	struct rte_eth_fdir_masks mask;
-	/** Flex payload configuration. */
-	struct rte_eth_fdir_flex_conf flex_conf;
-};
-
 /**
  * @internal
  * Fetch from the driver what kind of configuration must be restored by ethdev layer,
lib/ethdev/ethdev_fdir.h renamed from lib/ethdev/rte_eth_ctrl.h +49 -13

77 lines not on this page · raw message

lib/ethdev/meson.build +1 -1
index 8ba6c708a2..3d556f8b7f 100644
@@ -32,11 +32,11 @@ headers = files(
 
 indirect_headers += files(
         'rte_ethdev_core.h',
-        'rte_eth_ctrl.h',
 )
 
 driver_sdk_headers += files(
         'ethdev_driver.h',
+        'ethdev_fdir.h',
         'ethdev_pci.h',
         'ethdev_vdev.h',
         'rte_flow_driver.h',
lib/ethdev/rte_ethdev.h +2 -11
index ee400b386f..7a17b81208 100644
@@ -164,8 +164,10 @@
 #include <rte_devargs.h>
 #include <rte_bitops.h>
 #include <rte_errno.h>
+#include <rte_ether.h>
 #include <rte_common.h>
 #include <rte_config.h>
+#include <rte_mbuf_history.h>
 #include <rte_power_intrinsics.h>
 
 #include "rte_ethdev_trace_fp.h"
@@ -1505,17 +1507,6 @@ enum rte_eth_tunnel_type {
 	RTE_ETH_TUNNEL_TYPE_MAX,
 };
 
-#ifdef __cplusplus
-}
-#endif
-
-/* Deprecated API file for rte_eth_dev_filter_* functions */
-#include "rte_eth_ctrl.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /**
  * UDP tunneling configuration.
  *
Signature · 1 line
2.53.0
Acked-by on v4 22/23
#85 lore raw

Re: [PATCH v4 22/23] ethdev, drivers: isolate flow director

Quoted 30 lines · Stephen Hemminger

There are leftover bits of legacy flow director that are still being used by drivers. Move the definitions contained in ethdev_driver.h and rte_eth_ctrl.h into a single file ethdev_fdir.h and only include it in the drivers that require it.

Change rte_ethdev.h to include the headers required which it was previously getting from rte_eth_ctrl.h -> rte_flow.h.

Since ethdev_fdir.h is internal for driver SDK only it does not have to include as many secondary headers.

---
 doc/api/doxy-api-index.md                     |  1 -
 drivers/net/hinic/hinic_pmd_ethdev.h          |  2 +
 drivers/net/hinic3/hinic3_ethdev.h            |  1 +
 drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c |  2 +-
 drivers/net/intel/e1000/e1000_ethdev.h        |  1 +
 drivers/net/intel/e1000/igc_filter.h          |  2 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |  1 +
 drivers/net/intel/iavf/iavf_fsub.c            |  2 +-
 drivers/net/intel/iavf/iavf_hash.c            |  2 +-
 drivers/net/intel/ice/ice_acl_filter.c        |  2 +-
 drivers/net/intel/ice/ice_ethdev.h            |  2 +
 drivers/net/intel/ice/ice_generic_flow.c      |  1 +
 drivers/net/intel/ice/ice_hash.c              |  2 +-
 drivers/net/intel/ice/ice_switch_filter.c     |  2 +-
 drivers/net/intel/ipn3ke/ipn3ke_flow.c        |  2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |  1 +
Quoted 9 lines
 drivers/net/nbl/nbl_include/nbl_include.h     |  1 +
 drivers/net/txgbe/txgbe_ethdev.h              |  1 +
 lib/ethdev/ethdev_driver.h                    | 36 -----------
 lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h}  | 62 +++++++++++++++----
 lib/ethdev/meson.build                        |  2 +-
 lib/ethdev/rte_ethdev.h                       | 13 +---
 22 files changed, 71 insertions(+), 70 deletions(-)
 rename lib/ethdev/{rte_eth_ctrl.h => ethdev_fdir.h} (90%)
#86 lore raw

PATCH v4 23/23 doc: add release note about rte_ethdev changes

In reply to Stephen Hemminger

The changes to rte_ethdev are visible to applications, which may need to include some network headers directly.

---
 doc/guides/rel_notes/release_26_11.rst | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
doc/guides/rel_notes/release_26_11.rst +24 -0
index c8cc86295d..3749cbd456 100644
@@ -77,6 +77,21 @@ Removed Items
     ``rte_rib6_is_equal``
   * table: ``RTE_LPM_IPV6_ADDR_SIZE``
 
+* Removed legacy flow director related API and files.
+
+  * Removed experimental APIs in:
+
+    * ixgbe: ``rte_pmd_ixgbe_get_fdir_info``, ``rte_pmd_ixgbe_get_fdir_stats``
+    * i40e: ``rte_pmd_i40e_get_fdir_info``, ``rte_pmd_i40e_get_fdir_stats``
+
+  * Removed testpmd commands:
+
+    The ``fdir`` option in ``show port`` and ``clear port`` were removed.
+
+  * Removed file ``rte_eth_ctrl.h``.
+    Drivers that still require FDIR related structures now use ``ethdev_fdir.h``
+    in driver SDK.
+
 
 API Changes
 -----------
@@ -93,6 +108,15 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* **Changed ethdev include files.**
+
+  * Dropped inclusion of ``rte_flow.h`` in ``rte_ethdev.h``.
+    Applications using flow API should include it directly.
+  * Network headers ``rte_ip.h``, ``rte_udp.h``, ``rte_tcp.h`` and ``rte_sctp.h``
+    are no longer indirectly included by ``rte_ethdev.h``.
+    Applications should include network headers as needed.
+  * Legacy flow director definitions are no longer included by ``rte_ethdev.h``.
+
 
 ABI Changes
 -----------
Signature · 1 line
2.53.0
#87 lore raw

Re: [PATCH v4 23/23] doc: add release note about rte_ethdev changes

Quoted 13 lines · Stephen Hemminger

The changes to rte_ethdev are visible to applications, which may need to include some network headers directly.

---
 doc/guides/rel_notes/release_26_11.rst | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
doc/guides/rel_notes/release_26_11.rst +0 -0
index c8cc86295d..3749cbd456 100644

doc/guides/rel_notes/release_26_11.rst Removed Items · line 86

Quoted 10 lines
doc/guides/rel_notes/release_26_11.rst +7 -0
@@ -77,6 +77,21 @@ Removed Items
     ``rte_rib6_is_equal``
   * table: ``RTE_LPM_IPV6_ADDR_SIZE``
 
+* Removed legacy flow director related API and files.
+
+  * Removed experimental APIs in:
+
+    * ixgbe: ``rte_pmd_ixgbe_get_fdir_info``, ``rte_pmd_ixgbe_get_fdir_stats``
+    * i40e: ``rte_pmd_i40e_get_fdir_info``, ``rte_pmd_i40e_get_fdir_stats``
+

Some concerns about this. I'd rather see them deprecated and then removed in a later release next year.

doc/guides/rel_notes/release_26_11.rst Removed Items · line 94

Quoted 8 lines
doc/guides/rel_notes/release_26_11.rst +8 -0
+  * Removed testpmd commands:
+
+    The ``fdir`` option in ``show port`` and ``clear port`` were removed.
+
+  * Removed file ``rte_eth_ctrl.h``.
+    Drivers that still require FDIR related structures now use ``ethdev_fdir.h``
+    in driver SDK.
+

Fine with this removal.

Quoted 21 lines
doc/guides/rel_notes/release_26_11.rst +9 -0
 API Changes
 -----------
@@ -93,6 +108,15 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* **Changed ethdev include files.**
+
+  * Dropped inclusion of ``rte_flow.h`` in ``rte_ethdev.h``.
+    Applications using flow API should include it directly.
+  * Network headers ``rte_ip.h``, ``rte_udp.h``, ``rte_tcp.h`` and ``rte_sctp.h``
+    are no longer indirectly included by ``rte_ethdev.h``.
+    Applications should include network headers as needed.
+  * Legacy flow director definitions are no longer included by ``rte_ethdev.h``.
+
 
 ABI Changes
 -----------
Signature · 1 line
2.53.0
#88 lore raw

Re: [PATCH v4 00/23] ethdev: refactor remaining uses of flow director

In reply to Stephen Hemminger
Quoted 43 lines · Stephen Hemminger

The original flow support in DPDK was Intel-specific and built around the flow director feature. It was superseded by the generic rte_flow API introduced in the 17.02 release. The direct API calls to flow director were removed in 20.11, but the data structures were never removed and drivers still use them. Some Intel drivers also carry driver-specific APIs related to flow director.

These vestiges mean applications can still see flow director data structures, since rte_ethdev.h pulls in rte_eth_ctrl.h. It also means several drivers and libraries have come to depend on network header definitions arriving indirectly.

Since drivers still need these definitions, rte_eth_ctrl.h is renamed to ethdev_fdir.h and the remaining bits in ethdev_driver.h are folded into it. This is a driver SDK header, not public API, and exists only so that drivers still carrying legacy flow director state have somewhere to get these definitions. New drivers should not use it.

Applications relying on the indirect includes will need to add explicit ones; this is a source level change only, with no ABI impact. The fdir option of the testpmd "show port" and "clear port" commands is also removed.

v4 - fix AI review comments
- fix build of enetfec
- cleanup more leftovers from flow director in testpmd

Stephen Hemminger (23):
drivers/net: remove unused include in dpaa and dpaa2
ethdev: use DPDK byte order conversion net/ixgbe: remove experimental FDIR API net/i40e: remove experimental FDIR API app/testpmd: remove support for flow director app/testpmd: move str_to_flowtype to i40e app/test: include headers directly
gro: include headers directly crypto/dpaa_sec: include UDP header net/gve: include UDP, SCTP and TCP headers net/nfp: break implicit dependency on rte_eth_ctrl.h net/mana: include used network headers
node: get UDP header
net/rnp: include network headers
net/r8169: get network headers

Quoted 9 lines

net/ngbe: include network protocol headers
examples: include network headers
net/mlx5: include rte_flow as needed
net/sfc: include rte_flow
net/intel/common: include network headers
net/enetfec: add missing sys/types.h include
ethdev, drivers: isolate flow director
doc: add release note about rte_ethdev changes

I think this patchset needs to be split up, as many patches have no relevance to flow director that I can see. The various patches cleaning up header includes should be in one patchset. The byte order conversion change probably belongs as a standalone patch, and then the actual fdir changes go as a final patchset.

/Bruce