* [RFC 1/8] app/testpmd: remove support for flow director
2026-05-28 21:37 [RFC 0/8] retire legacy flow director API Stephen Hemminger
@ 2026-05-28 21:37 ` Stephen Hemminger
2026-05-28 21:37 ` [RFC 2/8] net/i40e: remove testpmd flow filter commands Stephen Hemminger
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Aman Singh
The flow director API is deprecated and will be removed in 26.11.
Remove it from testpmd now since testpmd CLI is not a stable API.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/cmdline.c | 21 +--
app/test-pmd/config.c | 163 --------------------
app/test-pmd/testpmd.h | 3 -
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 36 -----
4 files changed, 6 insertions(+), 217 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index cc9c462498..a5022bde04 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -163,7 +163,7 @@ static void cmd_help_long_parsed(void *parsed_result,
"Display:\n"
"--------\n\n"
- "show port (info|stats|summary|xstats|fdir|dcb_tc) (port_id|all)\n"
+ "show port (info|stats|summary|xstats|dcb_tc) (port_id|all)\n"
" Display information for port_id, or all.\n\n"
"show port info (port_id) representor\n"
@@ -189,7 +189,7 @@ static void cmd_help_long_parsed(void *parsed_result,
"show port (port_id) rss-hash [key | algorithm]\n"
" Display the RSS hash functions, RSS hash key and RSS hash algorithms of port\n\n"
- "clear port (info|stats|xstats|fdir) (port_id|all)\n"
+ "clear port (info|stats|xstats) (port_id|all)\n"
" Clear information for port_id, or all.\n\n"
"show (rxq|txq) info (port_id) (queue_id)\n"
@@ -7510,11 +7510,6 @@ static void cmd_showportall_parsed(void *parsed_result,
else if (!strcmp(res->what, "xstats"))
RTE_ETH_FOREACH_DEV(i)
nic_xstats_display(i);
-#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE)
- else if (!strcmp(res->what, "fdir"))
- RTE_ETH_FOREACH_DEV(i)
- fdir_get_infos(i);
-#endif
else if (!strcmp(res->what, "dcb_tc"))
RTE_ETH_FOREACH_DEV(i)
port_dcb_info_display(i);
@@ -7527,14 +7522,14 @@ static cmdline_parse_token_string_t cmd_showportall_port =
TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, port, "port");
static cmdline_parse_token_string_t cmd_showportall_what =
TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, what,
- "info#summary#stats#xstats#fdir#dcb_tc");
+ "info#summary#stats#xstats#dcb_tc");
static cmdline_parse_token_string_t cmd_showportall_all =
TOKEN_STRING_INITIALIZER(struct cmd_showportall_result, all, "all");
static cmdline_parse_inst_t cmd_showportall = {
.f = cmd_showportall_parsed,
.data = NULL,
.help_str = "show|clear port "
- "info|summary|stats|xstats|fdir|dcb_tc all",
+ "info|summary|stats|xstats|dcb_tc all",
.tokens = {
(void *)&cmd_showportall_show,
(void *)&cmd_showportall_port,
@@ -7572,10 +7567,6 @@ static void cmd_showport_parsed(void *parsed_result,
nic_stats_display(res->portnum);
else if (!strcmp(res->what, "xstats"))
nic_xstats_display(res->portnum);
-#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE)
- else if (!strcmp(res->what, "fdir"))
- fdir_get_infos(res->portnum);
-#endif
else if (!strcmp(res->what, "dcb_tc"))
port_dcb_info_display(res->portnum);
}
@@ -7587,7 +7578,7 @@ static cmdline_parse_token_string_t cmd_showport_port =
TOKEN_STRING_INITIALIZER(struct cmd_showport_result, port, "port");
static cmdline_parse_token_string_t cmd_showport_what =
TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
- "info#summary#stats#xstats#fdir#dcb_tc");
+ "info#summary#stats#xstats#dcb_tc");
static cmdline_parse_token_num_t cmd_showport_portnum =
TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, RTE_UINT16);
@@ -7595,7 +7586,7 @@ static cmdline_parse_inst_t cmd_showport = {
.f = cmd_showport_parsed,
.data = NULL,
.help_str = "show|clear port "
- "info|summary|stats|xstats|fdir|dcb_tc "
+ "info|summary|stats|xstats|dcb_tc "
"<port_id>",
.tokens = {
(void *)&cmd_showport_show,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index c950793aaf..12fc679250 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -7041,169 +7041,6 @@ flowtype_to_str(uint16_t flow_type)
return NULL;
}
-#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE)
-
-static inline void
-print_fdir_flex_payload(struct rte_eth_fdir_flex_conf *flex_conf, uint32_t num)
-{
- struct rte_eth_flex_payload_cfg *cfg;
- uint32_t i, j;
-
- for (i = 0; i < flex_conf->nb_payloads; i++) {
- cfg = &flex_conf->flex_set[i];
- if (cfg->type == RTE_ETH_RAW_PAYLOAD)
- printf("\n RAW: ");
- else if (cfg->type == RTE_ETH_L2_PAYLOAD)
- printf("\n L2_PAYLOAD: ");
- else if (cfg->type == RTE_ETH_L3_PAYLOAD)
- printf("\n L3_PAYLOAD: ");
- else if (cfg->type == RTE_ETH_L4_PAYLOAD)
- printf("\n L4_PAYLOAD: ");
- else
- printf("\n UNKNOWN PAYLOAD(%u): ", cfg->type);
- for (j = 0; j < num; j++)
- printf(" %-5u", cfg->src_offset[j]);
- }
- printf("\n");
-}
-
-static inline void
-print_fdir_flex_mask(struct rte_eth_fdir_flex_conf *flex_conf, uint32_t num)
-{
- struct rte_eth_fdir_flex_mask *mask;
- uint32_t i, j;
- const char *p;
-
- for (i = 0; i < flex_conf->nb_flexmasks; i++) {
- mask = &flex_conf->flex_mask[i];
- p = flowtype_to_str(mask->flow_type);
- printf("\n %s:\t", p ? p : "unknown");
- for (j = 0; j < num; j++)
- printf(" %02x", mask->mask[j]);
- }
- printf("\n");
-}
-
-static inline void
-print_fdir_flow_type(uint32_t flow_types_mask)
-{
- int i;
- const char *p;
-
- for (i = RTE_ETH_FLOW_UNKNOWN; i < RTE_ETH_FLOW_MAX; i++) {
- if (!(flow_types_mask & (1 << i)))
- continue;
- p = flowtype_to_str(i);
- if (p)
- printf(" %s", p);
- else
- printf(" unknown");
- }
- printf("\n");
-}
-
-static int
-get_fdir_info(portid_t port_id, struct rte_eth_fdir_info *fdir_info,
- struct rte_eth_fdir_stats *fdir_stat)
-{
- int ret = -ENOTSUP;
-
-#ifdef RTE_NET_I40E
- if (ret == -ENOTSUP) {
- ret = rte_pmd_i40e_get_fdir_info(port_id, fdir_info);
- if (!ret)
- ret = rte_pmd_i40e_get_fdir_stats(port_id, fdir_stat);
- }
-#endif
-#ifdef RTE_NET_IXGBE
- if (ret == -ENOTSUP) {
- ret = rte_pmd_ixgbe_get_fdir_info(port_id, fdir_info);
- if (!ret)
- ret = rte_pmd_ixgbe_get_fdir_stats(port_id, fdir_stat);
- }
-#endif
- switch (ret) {
- case 0:
- break;
- case -ENOTSUP:
- fprintf(stderr, "\n FDIR is not supported on port %-2d\n",
- port_id);
- break;
- default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
- break;
- }
- return ret;
-}
-
-void
-fdir_get_infos(portid_t port_id)
-{
- struct rte_eth_fdir_stats fdir_stat;
- struct rte_eth_fdir_info fdir_info;
-
- static const char *fdir_stats_border = "########################";
-
- if (port_id_is_invalid(port_id, ENABLED_WARN))
- return;
-
- memset(&fdir_info, 0, sizeof(fdir_info));
- memset(&fdir_stat, 0, sizeof(fdir_stat));
- if (get_fdir_info(port_id, &fdir_info, &fdir_stat))
- return;
-
- printf("\n %s FDIR infos for port %-2d %s\n",
- fdir_stats_border, port_id, fdir_stats_border);
- printf(" MODE: ");
- if (fdir_info.mode == RTE_FDIR_MODE_PERFECT)
- printf(" PERFECT\n");
- else if (fdir_info.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN)
- printf(" PERFECT-MAC-VLAN\n");
- else if (fdir_info.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
- printf(" PERFECT-TUNNEL\n");
- else if (fdir_info.mode == RTE_FDIR_MODE_SIGNATURE)
- printf(" SIGNATURE\n");
- else
- printf(" DISABLE\n");
- if (fdir_info.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN
- && fdir_info.mode != RTE_FDIR_MODE_PERFECT_TUNNEL) {
- printf(" SUPPORTED FLOW TYPE: ");
- print_fdir_flow_type(fdir_info.flow_types_mask[0]);
- }
- printf(" FLEX PAYLOAD INFO:\n");
- printf(" max_len: %-10"PRIu32" payload_limit: %-10"PRIu32"\n"
- " payload_unit: %-10"PRIu32" payload_seg: %-10"PRIu32"\n"
- " bitmask_unit: %-10"PRIu32" bitmask_num: %-10"PRIu32"\n",
- fdir_info.max_flexpayload, fdir_info.flex_payload_limit,
- fdir_info.flex_payload_unit,
- fdir_info.max_flex_payload_segment_num,
- fdir_info.flex_bitmask_unit, fdir_info.max_flex_bitmask_num);
- if (fdir_info.flex_conf.nb_payloads > 0) {
- printf(" FLEX PAYLOAD SRC OFFSET:");
- print_fdir_flex_payload(&fdir_info.flex_conf, fdir_info.max_flexpayload);
- }
- if (fdir_info.flex_conf.nb_flexmasks > 0) {
- printf(" FLEX MASK CFG:");
- print_fdir_flex_mask(&fdir_info.flex_conf, fdir_info.max_flexpayload);
- }
- printf(" guarant_count: %-10"PRIu32" best_count: %"PRIu32"\n",
- fdir_stat.guarant_cnt, fdir_stat.best_cnt);
- printf(" guarant_space: %-10"PRIu32" best_space: %"PRIu32"\n",
- fdir_info.guarant_spc, fdir_info.best_spc);
- printf(" collision: %-10"PRIu32" free: %"PRIu32"\n"
- " maxhash: %-10"PRIu32" maxlen: %"PRIu32"\n"
- " add: %-10"PRIu64" remove: %"PRIu64"\n"
- " f_add: %-10"PRIu64" f_remove: %"PRIu64"\n",
- fdir_stat.collision, fdir_stat.free,
- fdir_stat.maxhash, fdir_stat.maxlen,
- fdir_stat.add, fdir_stat.remove,
- fdir_stat.f_add, fdir_stat.f_remove);
- printf(" %s############################%s\n",
- fdir_stats_border, fdir_stats_border);
-}
-
-#endif /* RTE_NET_I40E || RTE_NET_IXGBE */
-
void
set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
{
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 1a54535470..0a4ab188bb 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -1185,9 +1185,6 @@ int all_ports_stopped(void);
int port_is_stopped(portid_t port_id);
int port_is_started(portid_t port_id);
void pmd_test_exit(void);
-#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE)
-void fdir_get_infos(portid_t port_id);
-#endif
void port_rss_reta_info(portid_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t nb_entries);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f99b29b423..1d079f521a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -2266,42 +2266,6 @@ Where the threshold type can be:
These threshold options are also available from the command-line.
-port config pctype mapping
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Reset pctype mapping table::
-
- testpmd> port config (port_id) pctype mapping reset
-
-Update hardware defined pctype to software defined flow type mapping table::
-
- testpmd> port config (port_id) pctype mapping update (pctype_id_0[,pctype_id_1]*) (flow_type_id)
-
-where:
-
-* ``pctype_id_x``: hardware pctype id as index of bit in bitmask value of the pctype mapping table.
-
-* ``flow_type_id``: software flow type id as the index of the pctype mapping table.
-
-port config input set
-~~~~~~~~~~~~~~~~~~~~~
-
-Config RSS/FDIR/FDIR flexible payload input set for some pctype::
-
- testpmd> port config (port_id) pctype (pctype_id) \
- (hash_inset|fdir_inset|fdir_flx_inset) \
- (get|set|clear) field (field_idx)
-
-Clear RSS/FDIR/FDIR flexible payload input set for some pctype::
-
- testpmd> port config (port_id) pctype (pctype_id) \
- (hash_inset|fdir_inset|fdir_flx_inset) clear all
-
-where:
-
-* ``pctype_id``: hardware packet classification types.
-* ``field_idx``: hardware field index.
-
port config udp_tunnel_port
~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [RFC 2/8] net/i40e: remove testpmd flow filter commands
2026-05-28 21:37 [RFC 0/8] retire legacy flow director API Stephen Hemminger
2026-05-28 21:37 ` [RFC 1/8] app/testpmd: remove support for flow director Stephen Hemminger
@ 2026-05-28 21:37 ` Stephen Hemminger
2026-05-28 21:37 ` [RFC 3/8] net/i40e: deprecate legacy flow filter API Stephen Hemminger
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Bruce Richardson
Remove the testpmd commands that drive the i40e PMD-private legacy
flow filter API, which is being deprecated in DPDK 26.07 and removed
in 26.11.
flow_director_filter
Drove rte_pmd_i40e_flow_add_del_packet_template().
port config <port_id> pctype <pctype_id>
hash_inset|fdir_inset|fdir_flx_inset get|set|clear field
port config <port_id> pctype <pctype_id>
hash_inset|fdir_inset|fdir_flx_inset clear all
Drove the rte_pmd_i40e_inset_get/set and inset_field_*
helpers.
show port <port_id> pctype mapping
port config <port_id> pctype mapping reset
port config <port_id> pctype mapping update ...
Drove rte_pmd_i40e_flow_type_mapping_get/reset/update().
The visually-similar "ptype mapping" commands (ptype mapping
get/replace/reset/update) are preserved — they drive the unrelated
rte_pmd_i40e_ptype_mapping_* DDP packet-type mapping API, which is
not in scope for this series. The naming collision between "pctype
mapping" (legacy flow-type mapping, removed here) and "ptype mapping"
(DDP packet-type mapping, kept) was a long-standing source of
confusion.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/nics/i40e.rst | 70 +--
drivers/net/intel/i40e/i40e_testpmd.c | 642 --------------------------
2 files changed, 4 insertions(+), 708 deletions(-)
diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index e67498aef4..0aae5b4d82 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -399,52 +399,6 @@ Add a rule to direct ``ipv4-udp`` packet whose ``dst_ip=2.2.2.5, src_ip=2.2.2.3,
dst is 2.2.2.5 / udp src is 32 dst is 32 / end \
actions mark id 1 / queue index 1 / end
-Check the flow director status:
-
-.. code-block:: console
-
- testpmd> show port fdir 0
-
- ######################## FDIR infos for port 0 ####################
- MODE: PERFECT
- SUPPORTED FLOW TYPE: ipv4-frag ipv4-tcp ipv4-udp ipv4-sctp ipv4-other
- ipv6-frag ipv6-tcp ipv6-udp ipv6-sctp ipv6-other
- l2_payload
- FLEX PAYLOAD INFO:
- max_len: 16 payload_limit: 480
- payload_unit: 2 payload_seg: 3
- bitmask_unit: 2 bitmask_num: 2
- MASK:
- vlan_tci: 0x0000,
- src_ipv4: 0x00000000,
- dst_ipv4: 0x00000000,
- src_port: 0x0000,
- dst_port: 0x0000
- src_ipv6: 0x00000000,0x00000000,0x00000000,0x00000000,
- dst_ipv6: 0x00000000,0x00000000,0x00000000,0x00000000
- FLEX PAYLOAD SRC OFFSET:
- L2_PAYLOAD: 0 1 2 3 4 5 6 ...
- L3_PAYLOAD: 0 1 2 3 4 5 6 ...
- L4_PAYLOAD: 0 1 2 3 4 5 6 ...
- FLEX MASK CFG:
- ipv4-udp: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- ipv4-tcp: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- ipv4-sctp: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- ipv4-other: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- ipv4-frag: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- ipv6-udp: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- ipv6-tcp: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- ipv6-sctp: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- ipv6-other: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- ipv6-frag: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- l2_payload: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- guarant_count: 1 best_count: 0
- guarant_space: 512 best_space: 7168
- collision: 0 free: 0
- maxhash: 0 maxlen: 0
- add: 0 remove: 0
- f_add: 0 f_remove: 0
-
Floating VEB
~~~~~~~~~~~~~
@@ -613,19 +567,10 @@ Limitations or Known issues
MPLS packet classification
~~~~~~~~~~~~~~~~~~~~~~~~~~
-For firmware versions prior to 5.0, MPLS packets are not recognized by the NIC.
-The L2 Payload flow type in flow director can be used to classify MPLS packet
-by using a command in testpmd like:
-
- testpmd> flow_director_filter 0 mode IP add flow l2_payload ether \
- 0x8847 flexbytes () fwd pf queue <N> fd_id <M>
-
-With the NIC firmware version 5.0 or greater, some limited MPLS support
-is added: Native MPLS (MPLS in Ethernet) skip is implemented, while no
-new packet type, no classification or offload are possible. With this change,
-L2 Payload flow type in flow director cannot be used to classify MPLS packet
-as with previous firmware versions. Meanwhile, the Ethertype filter can be
-used to classify MPLS packet by using a command in testpmd like:
+With NIC firmware version 5.0 or greater, native MPLS (MPLS in
+Ethernet) skip is implemented, although no new packet type, no
+classification, and no offload are possible.
+The Ethertype filter can be used to classify MPLS packets via testpmd::
testpmd> flow create 0 ingress pattern eth type is 0x8847 / end \
actions queue index <M> / end
@@ -878,13 +823,6 @@ Reset ptype mapping table::
testpmd> ptype mapping reset (port_id)
-show port pctype mapping
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-List all items from the pctype mapping table::
-
- testpmd> show port (port_id) pctype mapping
-
High Performance of Small Packets on 40GbE NIC
----------------------------------------------
diff --git a/drivers/net/intel/i40e/i40e_testpmd.c b/drivers/net/intel/i40e/i40e_testpmd.c
index 21f596297b..3943287ca9 100644
--- a/drivers/net/intel/i40e/i40e_testpmd.c
+++ b/drivers/net/intel/i40e/i40e_testpmd.c
@@ -464,149 +464,6 @@ static cmdline_parse_inst_t cmd_show_queue_region_info_all = {
},
};
-/* *** deal with flow director filter *** */
-struct cmd_flow_director_result {
- cmdline_fixed_string_t flow_director_filter;
- portid_t port_id;
- cmdline_fixed_string_t mode;
- cmdline_fixed_string_t mode_value;
- cmdline_fixed_string_t ops;
- cmdline_fixed_string_t flow;
- cmdline_fixed_string_t flow_type;
- cmdline_fixed_string_t drop;
- cmdline_fixed_string_t queue;
- uint16_t queue_id;
- cmdline_fixed_string_t fd_id;
- uint32_t fd_id_value;
- cmdline_fixed_string_t packet;
- char filepath[];
-};
-
-static void
-cmd_flow_director_filter_parsed(void *parsed_result,
- __rte_unused struct cmdline *cl, __rte_unused void *data)
-{
- struct cmd_flow_director_result *res = parsed_result;
- int ret = 0;
- struct rte_pmd_i40e_flow_type_mapping
- mapping[RTE_PMD_I40E_FLOW_TYPE_MAX];
- struct rte_pmd_i40e_pkt_template_conf conf;
- uint16_t flow_type = str_to_flowtype(res->flow_type);
- uint16_t i, port = res->port_id;
- uint8_t add;
-
- memset(&conf, 0, sizeof(conf));
-
- if (flow_type == RTE_ETH_FLOW_UNKNOWN) {
- fprintf(stderr, "Invalid flow type specified.\n");
- return;
- }
- ret = rte_pmd_i40e_flow_type_mapping_get(res->port_id,
- mapping);
- if (ret)
- return;
- if (mapping[flow_type].pctype == 0ULL) {
- fprintf(stderr, "Invalid flow type specified.\n");
- return;
- }
- for (i = 0; i < RTE_PMD_I40E_PCTYPE_MAX; i++) {
- if (mapping[flow_type].pctype & (1ULL << i)) {
- conf.input.pctype = i;
- break;
- }
- }
-
- conf.input.packet = open_file(res->filepath,
- &conf.input.length);
- if (!conf.input.packet)
- return;
- if (!strcmp(res->drop, "drop"))
- conf.action.behavior =
- RTE_PMD_I40E_PKT_TEMPLATE_REJECT;
- else
- conf.action.behavior =
- RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT;
- conf.action.report_status =
- RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID;
- conf.action.rx_queue = res->queue_id;
- conf.soft_id = res->fd_id_value;
- add = strcmp(res->ops, "del") ? 1 : 0;
- ret = rte_pmd_i40e_flow_add_del_packet_template(port,
- &conf,
- add);
- if (ret < 0)
- fprintf(stderr, "flow director config error: (%s)\n",
- strerror(-ret));
- close_file(conf.input.packet);
-}
-
-static cmdline_parse_token_string_t cmd_flow_director_filter =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- flow_director_filter, "flow_director_filter");
-static cmdline_parse_token_num_t cmd_flow_director_port_id =
- TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
- port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_flow_director_ops =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- ops, "add#del#update");
-static cmdline_parse_token_string_t cmd_flow_director_flow =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- flow, "flow");
-static cmdline_parse_token_string_t cmd_flow_director_flow_type =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- flow_type, NULL);
-static cmdline_parse_token_string_t cmd_flow_director_drop =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- drop, "drop#fwd");
-static cmdline_parse_token_string_t cmd_flow_director_queue =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- queue, "queue");
-static cmdline_parse_token_num_t cmd_flow_director_queue_id =
- TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
- queue_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_flow_director_fd_id =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- fd_id, "fd_id");
-static cmdline_parse_token_num_t cmd_flow_director_fd_id_value =
- TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
- fd_id_value, RTE_UINT32);
-static cmdline_parse_token_string_t cmd_flow_director_mode =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- mode, "mode");
-static cmdline_parse_token_string_t cmd_flow_director_mode_raw =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- mode_value, "raw");
-static cmdline_parse_token_string_t cmd_flow_director_packet =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- packet, "packet");
-static cmdline_parse_token_string_t cmd_flow_director_filepath =
- TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- filepath, NULL);
-
-static cmdline_parse_inst_t cmd_add_del_raw_flow_director = {
- .f = cmd_flow_director_filter_parsed,
- .data = NULL,
- .help_str = "flow_director_filter ... : Add or delete a raw flow "
- "director entry on NIC",
- .tokens = {
- (void *)&cmd_flow_director_filter,
- (void *)&cmd_flow_director_port_id,
- (void *)&cmd_flow_director_mode,
- (void *)&cmd_flow_director_mode_raw,
- (void *)&cmd_flow_director_ops,
- (void *)&cmd_flow_director_flow,
- (void *)&cmd_flow_director_flow_type,
- (void *)&cmd_flow_director_drop,
- (void *)&cmd_flow_director_queue,
- (void *)&cmd_flow_director_queue_id,
- (void *)&cmd_flow_director_fd_id,
- (void *)&cmd_flow_director_fd_id_value,
- (void *)&cmd_flow_director_packet,
- (void *)&cmd_flow_director_filepath,
- NULL,
- },
-};
-
/* VF unicast promiscuous mode configuration */
/* Common result structure for VF unicast promiscuous mode */
@@ -1670,469 +1527,6 @@ static cmdline_parse_inst_t cmd_ddp_get_list = {
},
};
-/* Configure input set */
-struct cmd_cfg_input_set_result {
- cmdline_fixed_string_t port;
- cmdline_fixed_string_t cfg;
- portid_t port_id;
- cmdline_fixed_string_t pctype;
- uint8_t pctype_id;
- cmdline_fixed_string_t inset_type;
- cmdline_fixed_string_t opt;
- cmdline_fixed_string_t field;
- uint8_t field_idx;
-};
-
-static void
-cmd_cfg_input_set_parsed(__rte_unused void *parsed_result,
- __rte_unused struct cmdline *cl,
- __rte_unused void *data)
-{
- struct cmd_cfg_input_set_result *res = parsed_result;
- enum rte_pmd_i40e_inset_type inset_type = INSET_NONE;
- struct rte_pmd_i40e_inset inset;
- int ret = -ENOTSUP;
-
- if (!all_ports_stopped()) {
- fprintf(stderr, "Please stop all ports first\n");
- return;
- }
-
- if (!strcmp(res->inset_type, "hash_inset"))
- inset_type = INSET_HASH;
- else if (!strcmp(res->inset_type, "fdir_inset"))
- inset_type = INSET_FDIR;
- else if (!strcmp(res->inset_type, "fdir_flx_inset"))
- inset_type = INSET_FDIR_FLX;
- ret = rte_pmd_i40e_inset_get(res->port_id, res->pctype_id, &inset, inset_type);
- if (ret) {
- fprintf(stderr, "Failed to get input set.\n");
- return;
- }
-
- if (!strcmp(res->opt, "get")) {
- ret = rte_pmd_i40e_inset_field_get(inset.inset, res->field_idx);
- if (ret)
- printf("Field index %d is enabled.\n", res->field_idx);
- else
- printf("Field index %d is disabled.\n", res->field_idx);
- return;
- }
-
- if (!strcmp(res->opt, "set"))
- ret = rte_pmd_i40e_inset_field_set(&inset.inset, res->field_idx);
- else if (!strcmp(res->opt, "clear"))
- ret = rte_pmd_i40e_inset_field_clear(&inset.inset, res->field_idx);
- if (ret) {
- fprintf(stderr, "Failed to configure input set field.\n");
- return;
- }
-
- ret = rte_pmd_i40e_inset_set(res->port_id, res->pctype_id, &inset, inset_type);
- if (ret) {
- fprintf(stderr, "Failed to set input set.\n");
- return;
- }
-
- if (ret == -ENOTSUP)
- fprintf(stderr, "Function not supported\n");
-}
-
-static cmdline_parse_token_string_t cmd_cfg_input_set_port =
- TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
- port, "port");
-static cmdline_parse_token_string_t cmd_cfg_input_set_cfg =
- TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
- cfg, "config");
-static cmdline_parse_token_num_t cmd_cfg_input_set_port_id =
- TOKEN_NUM_INITIALIZER(struct cmd_cfg_input_set_result,
- port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_cfg_input_set_pctype =
- TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
- pctype, "pctype");
-static cmdline_parse_token_num_t cmd_cfg_input_set_pctype_id =
- TOKEN_NUM_INITIALIZER(struct cmd_cfg_input_set_result,
- pctype_id, RTE_UINT8);
-static cmdline_parse_token_string_t cmd_cfg_input_set_inset_type =
- TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
- inset_type, "hash_inset#fdir_inset#fdir_flx_inset");
-static cmdline_parse_token_string_t cmd_cfg_input_set_opt =
- TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
- opt, "get#set#clear");
-static cmdline_parse_token_string_t cmd_cfg_input_set_field =
- TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
- field, "field");
-static cmdline_parse_token_num_t cmd_cfg_input_set_field_idx =
- TOKEN_NUM_INITIALIZER(struct cmd_cfg_input_set_result,
- field_idx, RTE_UINT8);
-
-static cmdline_parse_inst_t cmd_cfg_input_set = {
- .f = cmd_cfg_input_set_parsed,
- .data = NULL,
- .help_str = "port config <port_id> pctype <pctype_id> hash_inset|"
- "fdir_inset|fdir_flx_inset get|set|clear field <field_idx>",
- .tokens = {
- (void *)&cmd_cfg_input_set_port,
- (void *)&cmd_cfg_input_set_cfg,
- (void *)&cmd_cfg_input_set_port_id,
- (void *)&cmd_cfg_input_set_pctype,
- (void *)&cmd_cfg_input_set_pctype_id,
- (void *)&cmd_cfg_input_set_inset_type,
- (void *)&cmd_cfg_input_set_opt,
- (void *)&cmd_cfg_input_set_field,
- (void *)&cmd_cfg_input_set_field_idx,
- NULL,
- },
-};
-
-/* Clear input set */
-struct cmd_clear_input_set_result {
- cmdline_fixed_string_t port;
- cmdline_fixed_string_t cfg;
- portid_t port_id;
- cmdline_fixed_string_t pctype;
- uint8_t pctype_id;
- cmdline_fixed_string_t inset_type;
- cmdline_fixed_string_t clear;
- cmdline_fixed_string_t all;
-};
-
-static void
-cmd_clear_input_set_parsed(__rte_unused void *parsed_result,
- __rte_unused struct cmdline *cl,
- __rte_unused void *data)
-{
- struct cmd_clear_input_set_result *res = parsed_result;
- enum rte_pmd_i40e_inset_type inset_type = INSET_NONE;
- struct rte_pmd_i40e_inset inset;
- int ret = -ENOTSUP;
-
- if (!all_ports_stopped()) {
- fprintf(stderr, "Please stop all ports first\n");
- return;
- }
-
- if (!strcmp(res->inset_type, "hash_inset"))
- inset_type = INSET_HASH;
- else if (!strcmp(res->inset_type, "fdir_inset"))
- inset_type = INSET_FDIR;
- else if (!strcmp(res->inset_type, "fdir_flx_inset"))
- inset_type = INSET_FDIR_FLX;
-
- memset(&inset, 0, sizeof(inset));
-
- ret = rte_pmd_i40e_inset_set(res->port_id, res->pctype_id, &inset, inset_type);
- if (ret) {
- fprintf(stderr, "Failed to clear input set.\n");
- return;
- }
-
- if (ret == -ENOTSUP)
- fprintf(stderr, "Function not supported\n");
-}
-
-static cmdline_parse_token_string_t cmd_clear_input_set_port =
- TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
- port, "port");
-static cmdline_parse_token_string_t cmd_clear_input_set_cfg =
- TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
- cfg, "config");
-static cmdline_parse_token_num_t cmd_clear_input_set_port_id =
- TOKEN_NUM_INITIALIZER(struct cmd_clear_input_set_result,
- port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_clear_input_set_pctype =
- TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
- pctype, "pctype");
-static cmdline_parse_token_num_t cmd_clear_input_set_pctype_id =
- TOKEN_NUM_INITIALIZER(struct cmd_clear_input_set_result,
- pctype_id, RTE_UINT8);
-static cmdline_parse_token_string_t cmd_clear_input_set_inset_type =
- TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
- inset_type, "hash_inset#fdir_inset#fdir_flx_inset");
-static cmdline_parse_token_string_t cmd_clear_input_set_clear =
- TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
- clear, "clear");
-static cmdline_parse_token_string_t cmd_clear_input_set_all =
- TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
- all, "all");
-
-static cmdline_parse_inst_t cmd_clear_input_set = {
- .f = cmd_clear_input_set_parsed,
- .data = NULL,
- .help_str = "port config <port_id> pctype <pctype_id> hash_inset|"
- "fdir_inset|fdir_flx_inset clear all",
- .tokens = {
- (void *)&cmd_clear_input_set_port,
- (void *)&cmd_clear_input_set_cfg,
- (void *)&cmd_clear_input_set_port_id,
- (void *)&cmd_clear_input_set_pctype,
- (void *)&cmd_clear_input_set_pctype_id,
- (void *)&cmd_clear_input_set_inset_type,
- (void *)&cmd_clear_input_set_clear,
- (void *)&cmd_clear_input_set_all,
- NULL,
- },
-};
-
-/* port config pctype mapping reset */
-
-/* Common result structure for port config pctype mapping reset */
-struct cmd_pctype_mapping_reset_result {
- cmdline_fixed_string_t port;
- cmdline_fixed_string_t config;
- portid_t port_id;
- cmdline_fixed_string_t pctype;
- cmdline_fixed_string_t mapping;
- cmdline_fixed_string_t reset;
-};
-
-/* Common CLI fields for port config pctype mapping reset*/
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_port =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
- port, "port");
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_config =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
- config, "config");
-static cmdline_parse_token_num_t cmd_pctype_mapping_reset_port_id =
- TOKEN_NUM_INITIALIZER(struct cmd_pctype_mapping_reset_result,
- port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_pctype =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
- pctype, "pctype");
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_mapping =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
- mapping, "mapping");
-static cmdline_parse_token_string_t cmd_pctype_mapping_reset_reset =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_reset_result,
- reset, "reset");
-
-static void
-cmd_pctype_mapping_reset_parsed(void *parsed_result,
- __rte_unused struct cmdline *cl,
- __rte_unused void *data)
-{
- struct cmd_pctype_mapping_reset_result *res = parsed_result;
- int ret = -ENOTSUP;
-
- if (port_id_is_invalid(res->port_id, ENABLED_WARN))
- return;
-
- ret = rte_pmd_i40e_flow_type_mapping_reset(res->port_id);
- switch (ret) {
- case 0:
- break;
- case -ENODEV:
- fprintf(stderr, "invalid port_id %d\n", res->port_id);
- break;
- case -ENOTSUP:
- fprintf(stderr, "function not implemented\n");
- break;
- default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
- }
-}
-
-static cmdline_parse_inst_t cmd_pctype_mapping_reset = {
- .f = cmd_pctype_mapping_reset_parsed,
- .data = NULL,
- .help_str = "port config <port_id> pctype mapping reset",
- .tokens = {
- (void *)&cmd_pctype_mapping_reset_port,
- (void *)&cmd_pctype_mapping_reset_config,
- (void *)&cmd_pctype_mapping_reset_port_id,
- (void *)&cmd_pctype_mapping_reset_pctype,
- (void *)&cmd_pctype_mapping_reset_mapping,
- (void *)&cmd_pctype_mapping_reset_reset,
- NULL,
- },
-};
-
-/* show port pctype mapping */
-
-/* Common result structure for show port pctype mapping */
-struct cmd_pctype_mapping_get_result {
- cmdline_fixed_string_t show;
- cmdline_fixed_string_t port;
- portid_t port_id;
- cmdline_fixed_string_t pctype;
- cmdline_fixed_string_t mapping;
-};
-
-/* Common CLI fields for pctype mapping get */
-static cmdline_parse_token_string_t cmd_pctype_mapping_get_show =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_get_result,
- show, "show");
-static cmdline_parse_token_string_t cmd_pctype_mapping_get_port =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_get_result,
- port, "port");
-static cmdline_parse_token_num_t cmd_pctype_mapping_get_port_id =
- TOKEN_NUM_INITIALIZER(struct cmd_pctype_mapping_get_result,
- port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_pctype_mapping_get_pctype =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_get_result,
- pctype, "pctype");
-static cmdline_parse_token_string_t cmd_pctype_mapping_get_mapping =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_get_result,
- mapping, "mapping");
-
-static void
-cmd_pctype_mapping_get_parsed(void *parsed_result,
- __rte_unused struct cmdline *cl,
- __rte_unused void *data)
-{
- struct cmd_pctype_mapping_get_result *res = parsed_result;
- int ret = -ENOTSUP;
- struct rte_pmd_i40e_flow_type_mapping
- mapping[RTE_PMD_I40E_FLOW_TYPE_MAX];
- int i, j, first_pctype;
-
- if (port_id_is_invalid(res->port_id, ENABLED_WARN))
- return;
-
- ret = rte_pmd_i40e_flow_type_mapping_get(res->port_id, mapping);
- switch (ret) {
- case 0:
- break;
- case -ENODEV:
- fprintf(stderr, "invalid port_id %d\n", res->port_id);
- return;
- case -ENOTSUP:
- fprintf(stderr, "function not implemented\n");
- return;
- default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
- return;
- }
-
- for (i = 0; i < RTE_PMD_I40E_FLOW_TYPE_MAX; i++) {
- if (mapping[i].pctype != 0ULL) {
- first_pctype = 1;
-
- printf("pctype: ");
- for (j = 0; j < RTE_PMD_I40E_PCTYPE_MAX; j++) {
- if (mapping[i].pctype & (1ULL << j)) {
- printf(first_pctype ? "%02d" : ",%02d", j);
- first_pctype = 0;
- }
- }
- printf(" -> flowtype: %02d\n", mapping[i].flow_type);
- }
- }
-}
-
-static cmdline_parse_inst_t cmd_pctype_mapping_get = {
- .f = cmd_pctype_mapping_get_parsed,
- .data = NULL,
- .help_str = "show port <port_id> pctype mapping",
- .tokens = {
- (void *)&cmd_pctype_mapping_get_show,
- (void *)&cmd_pctype_mapping_get_port,
- (void *)&cmd_pctype_mapping_get_port_id,
- (void *)&cmd_pctype_mapping_get_pctype,
- (void *)&cmd_pctype_mapping_get_mapping,
- NULL,
- },
-};
-
-/* port config pctype mapping update */
-
-/* Common result structure for port config pctype mapping update */
-struct cmd_pctype_mapping_update_result {
- cmdline_fixed_string_t port;
- cmdline_fixed_string_t config;
- portid_t port_id;
- cmdline_fixed_string_t pctype;
- cmdline_fixed_string_t mapping;
- cmdline_fixed_string_t update;
- cmdline_fixed_string_t pctype_list;
- uint16_t flow_type;
-};
-
-/* Common CLI fields for pctype mapping update*/
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_port =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
- port, "port");
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_config =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
- config, "config");
-static cmdline_parse_token_num_t cmd_pctype_mapping_update_port_id =
- TOKEN_NUM_INITIALIZER(struct cmd_pctype_mapping_update_result,
- port_id, RTE_UINT16);
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_pctype =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
- pctype, "pctype");
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_mapping =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
- mapping, "mapping");
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_update =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
- update, "update");
-static cmdline_parse_token_string_t cmd_pctype_mapping_update_pc_type =
- TOKEN_STRING_INITIALIZER(struct cmd_pctype_mapping_update_result,
- pctype_list, NULL);
-static cmdline_parse_token_num_t cmd_pctype_mapping_update_flow_type =
- TOKEN_NUM_INITIALIZER(struct cmd_pctype_mapping_update_result,
- flow_type, RTE_UINT16);
-
-static void
-cmd_pctype_mapping_update_parsed(void *parsed_result,
- __rte_unused struct cmdline *cl,
- __rte_unused void *data)
-{
- struct cmd_pctype_mapping_update_result *res = parsed_result;
- int ret = -ENOTSUP;
- struct rte_pmd_i40e_flow_type_mapping mapping;
- unsigned int i;
- unsigned int nb_item;
- unsigned int pctype_list[RTE_PMD_I40E_PCTYPE_MAX];
-
- if (port_id_is_invalid(res->port_id, ENABLED_WARN))
- return;
-
- nb_item = parse_item_list(res->pctype_list, "pctypes", RTE_PMD_I40E_PCTYPE_MAX,
- pctype_list, 1);
- mapping.flow_type = res->flow_type;
- for (i = 0, mapping.pctype = 0ULL; i < nb_item; i++)
- mapping.pctype |= (1ULL << pctype_list[i]);
- ret = rte_pmd_i40e_flow_type_mapping_update(res->port_id,
- &mapping,
- 1,
- 0);
- switch (ret) {
- case 0:
- break;
- case -EINVAL:
- fprintf(stderr, "invalid pctype or flow type\n");
- break;
- case -ENODEV:
- fprintf(stderr, "invalid port_id %d\n", res->port_id);
- break;
- case -ENOTSUP:
- fprintf(stderr, "function not implemented\n");
- break;
- default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
- }
-}
-
-static cmdline_parse_inst_t cmd_pctype_mapping_update = {
- .f = cmd_pctype_mapping_update_parsed,
- .data = NULL,
- .help_str = "port config <port_id> pctype mapping update"
- " <pctype_id_0,[pctype_id_1]*> <flowtype_id>",
- .tokens = {
- (void *)&cmd_pctype_mapping_update_port,
- (void *)&cmd_pctype_mapping_update_config,
- (void *)&cmd_pctype_mapping_update_port_id,
- (void *)&cmd_pctype_mapping_update_pctype,
- (void *)&cmd_pctype_mapping_update_mapping,
- (void *)&cmd_pctype_mapping_update_update,
- (void *)&cmd_pctype_mapping_update_pc_type,
- (void *)&cmd_pctype_mapping_update_flow_type,
- NULL,
- },
-};
-
/* ptype mapping get */
/* Common result structure for ptype mapping get */
@@ -2553,13 +1947,6 @@ static struct testpmd_driver_commands i40e_cmds = {
"show port (port_id) queue-region\n"
" show all queue region related configuration info\n",
},
- {
- &cmd_add_del_raw_flow_director,
- "flow_director_filter (port_id) mode raw (add|del|update)"
- " flow (flow_id) (drop|fwd) queue (queue_id)"
- " fd_id (fd_id_value) packet (packet file name)\n"
- " Add/Del a raw type flow director filter.\n",
- },
{
&cmd_set_vf_promisc,
"set vf promisc (port_id) (vf_id) (on|off)\n"
@@ -2620,19 +2007,6 @@ static struct testpmd_driver_commands i40e_cmds = {
"ddp get info (profile_path)\n"
" Get ddp profile information.\n",
},
- {
- &cmd_cfg_input_set,
- "port config (port_id) pctype (pctype_id) hash_inset|"
- "fdir_inset|fdir_flx_inset get|set|clear field\n"
- " (field_idx)\n"
- " Configure RSS|FDIR|FDIR_FLX input set for some pctype\n",
- },
- {
- &cmd_clear_input_set,
- "port config (port_id) pctype (pctype_id) hash_inset|"
- "fdir_inset|fdir_flx_inset clear all\n"
- " Clear RSS|FDIR|FDIR_FLX input set completely for some pctype\n",
- },
{
&cmd_ptype_mapping_get,
"ptype mapping get (port_id) (valid_only)\n"
@@ -2653,22 +2027,6 @@ static struct testpmd_driver_commands i40e_cmds = {
"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
" Update a ptype mapping item on a port\n",
},
- {
- &cmd_pctype_mapping_get,
- "show port (port_id) pctype mapping\n"
- " Get flow ptype to pctype mapping on a port\n",
- },
- {
- &cmd_pctype_mapping_reset,
- "port config (port_id) pctype mapping reset\n"
- " Reset flow type to pctype mapping on a port\n",
- },
- {
- &cmd_pctype_mapping_update,
- "port config (port_id) pctype mapping update"
- " (pctype_id_0[,pctype_id_1]*) (flow_type_id)\n"
- " Update a flow type to pctype mapping item on a port\n",
- },
{
&cmd_config_src_prune_all,
"port config all i40e_src_prune (on|off)\n"
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [RFC 3/8] net/i40e: deprecate legacy flow filter API
2026-05-28 21:37 [RFC 0/8] retire legacy flow director API Stephen Hemminger
2026-05-28 21:37 ` [RFC 1/8] app/testpmd: remove support for flow director Stephen Hemminger
2026-05-28 21:37 ` [RFC 2/8] net/i40e: remove testpmd flow filter commands Stephen Hemminger
@ 2026-05-28 21:37 ` Stephen Hemminger
2026-05-28 21:37 ` [RFC 4/8] net/i40e: remove experimental FDIR API Stephen Hemminger
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Bruce Richardson
The i40e PMD-private filter configuration API in rte_pmd_i40e.h predates
the rte_flow API and duplicates functionality now expressed as rte_flow
rules. Mark the legacy entry points as deprecated so they can be removed
in DPDK 26.11.
The two functions taking public rte_eth_fdir_* types
(rte_pmd_i40e_get_fdir_info, rte_pmd_i40e_get_fdir_stats) are already
marked __rte_experimental and will be removed alongside the ethdev
fdir struct family in 26.11; they need no separate deprecation notice.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/rel_notes/deprecation.rst | 3 +
drivers/net/intel/i40e/rte_pmd_i40e.h | 80 ++++++++++++++++++++++++++-
2 files changed, 82 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 17f90a6352..d152e76fdc 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -158,3 +158,6 @@ Deprecation Notices
* net/iavf: The dynamic mbuf field used to detect LLDP packets on the
transmit path in the iavf PMD will be removed in a future release.
After removal, only packet type-based detection will be supported.
+
+* net/i40e: The legacy filter configuration API in ``rte_pmd_i40e.h``,
+ superseded by the ``rte_flow`` API, will be removed in DPDK 26.11.
diff --git a/drivers/net/intel/i40e/rte_pmd_i40e.h b/drivers/net/intel/i40e/rte_pmd_i40e.h
index 5af7e2330f..5dcca91264 100644
--- a/drivers/net/intel/i40e/rte_pmd_i40e.h
+++ b/drivers/net/intel/i40e/rte_pmd_i40e.h
@@ -229,6 +229,9 @@ struct rte_pmd_i40e_queue_regions {
};
/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
* Behavior will be taken if raw packet template is matched.
*/
enum rte_pmd_i40e_pkt_template_behavior {
@@ -238,7 +241,10 @@ enum rte_pmd_i40e_pkt_template_behavior {
};
/**
- * Flow director report status
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
+ * Flow director report status.
* It defines what will be reported if raw packet template is matched.
*/
enum rte_pmd_i40e_pkt_template_status {
@@ -253,6 +259,9 @@ enum rte_pmd_i40e_pkt_template_status {
};
/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
* A structure used to define an action when raw packet template is matched.
*/
struct rte_pmd_i40e_pkt_template_action {
@@ -271,6 +280,9 @@ struct rte_pmd_i40e_pkt_template_action {
};
/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
* A structure used to define the input for raw packet template.
*/
struct rte_pmd_i40e_pkt_template_input {
@@ -283,6 +295,9 @@ struct rte_pmd_i40e_pkt_template_input {
};
/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ *
* A structure used to define the configuration parameters
* for raw packet template.
*/
@@ -295,6 +310,10 @@ struct rte_pmd_i40e_pkt_template_conf {
uint32_t soft_id;
};
+/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ */
enum rte_pmd_i40e_inset_type {
INSET_NONE = 0,
INSET_HASH,
@@ -307,6 +326,10 @@ struct rte_pmd_i40e_inset_mask {
uint16_t mask;
};
+/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ */
struct rte_pmd_i40e_inset {
uint64_t inset;
struct rte_pmd_i40e_inset_mask mask[2];
@@ -326,7 +349,12 @@ struct rte_pmd_i40e_inset {
* - (-ENODEV) if *port* invalid.
* - (-EINVAL) if *conf* invalid.
* - (-ENOTSUP) not supported by firmware.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
*/
+__rte_deprecated
int rte_pmd_i40e_flow_add_del_packet_template(
uint16_t port,
const struct rte_pmd_i40e_pkt_template_conf *conf,
@@ -865,6 +893,10 @@ int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
#define RTE_PMD_I40E_PCTYPE_MAX 64
#define RTE_PMD_I40E_FLOW_TYPE_MAX 64
+/**
+ * @deprecated
+ * Superseded by the rte_flow API; will be removed in DPDK 26.11.
+ */
struct rte_pmd_i40e_flow_type_mapping {
uint16_t flow_type; /**< software defined flow type*/
uint64_t pctype; /**< hardware defined pctype */
@@ -886,7 +918,12 @@ struct rte_pmd_i40e_flow_type_mapping {
* keep other PCTYPEs mapping unchanged.
* -(!0) overwrite referred PCTYPE mapping,
* set other PCTYPEs maps to PCTYPE_INVALID.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
*/
+__rte_deprecated
int rte_pmd_i40e_flow_type_mapping_update(
uint16_t port,
struct rte_pmd_i40e_flow_type_mapping *mapping_items,
@@ -903,7 +940,12 @@ int rte_pmd_i40e_flow_type_mapping_update(
* the base address of the array to store returned items.
* array should be allocated by caller with minimum size of
* RTE_PMD_I40E_FLOW_TYPE_MAX items
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
*/
+__rte_deprecated
int rte_pmd_i40e_flow_type_mapping_get(
uint16_t port,
struct rte_pmd_i40e_flow_type_mapping *mapping_items);
@@ -914,7 +956,12 @@ int rte_pmd_i40e_flow_type_mapping_get(
*
* @param port
* pointer to port identifier of the device
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
*/
+__rte_deprecated
int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port);
/**
@@ -946,6 +993,12 @@ int rte_pmd_i40e_query_vfid_by_mac(uint16_t port,
int rte_pmd_i40e_rss_queue_region_conf(uint16_t port_id,
enum rte_pmd_i40e_queue_region_op op_type, void *arg);
+/**
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
+ */
+__rte_deprecated
int rte_pmd_i40e_cfg_hash_inset(uint16_t port,
uint64_t pctype, uint64_t inset);
@@ -965,7 +1018,12 @@ int rte_pmd_i40e_cfg_hash_inset(uint16_t port,
* - (-ENODEV) if *port* invalid.
* - (-EINVAL) if bad parameter.
* - (-ENOTSUP) if operation not supported.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
*/
+__rte_deprecated
int rte_pmd_i40e_inset_get(uint16_t port, uint8_t pctype,
struct rte_pmd_i40e_inset *inset,
enum rte_pmd_i40e_inset_type inset_type);
@@ -986,7 +1044,12 @@ int rte_pmd_i40e_inset_get(uint16_t port, uint8_t pctype,
* - (-ENODEV) if *port* invalid.
* - (-EINVAL) if bad parameter.
* - (-ENOTSUP) if operation not supported.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
*/
+__rte_deprecated
int rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
struct rte_pmd_i40e_inset *inset,
enum rte_pmd_i40e_inset_type inset_type);
@@ -1001,7 +1064,12 @@ int rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
* @return
* - (1) if set.
* - (0) if cleared.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
*/
+__rte_deprecated
static inline int
rte_pmd_i40e_inset_field_get(uint64_t inset, uint8_t field_idx)
{
@@ -1027,7 +1095,12 @@ rte_pmd_i40e_inset_field_get(uint64_t inset, uint8_t field_idx)
* @return
* - (-1) if failed.
* - (0) if success.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
*/
+__rte_deprecated
static inline int
rte_pmd_i40e_inset_field_set(uint64_t *inset, uint8_t field_idx)
{
@@ -1052,7 +1125,12 @@ rte_pmd_i40e_inset_field_set(uint64_t *inset, uint8_t field_idx)
* @return
* - (-1) if failed.
* - (0) if success.
+ *
+ * @deprecated
+ * This function is superseded by the rte_flow API and will be removed
+ * in DPDK 26.11.
*/
+__rte_deprecated
static inline int
rte_pmd_i40e_inset_field_clear(uint64_t *inset, uint8_t field_idx)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [RFC 4/8] net/i40e: remove experimental FDIR API
2026-05-28 21:37 [RFC 0/8] retire legacy flow director API Stephen Hemminger
` (2 preceding siblings ...)
2026-05-28 21:37 ` [RFC 3/8] net/i40e: deprecate legacy flow filter API Stephen Hemminger
@ 2026-05-28 21:37 ` Stephen Hemminger
2026-05-28 21:37 ` [RFC 5/8] net/ixgbe: " Stephen Hemminger
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Bruce Richardson
Remove the flow director related private APIs in i40e.
These APIs are experimental, therefore they can be removed
without deprecation warning.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/intel/i40e/i40e_ethdev.c | 4 +-
drivers/net/intel/i40e/i40e_ethdev.h | 4 -
drivers/net/intel/i40e/i40e_fdir.c | 140 --------------------------
drivers/net/intel/i40e/i40e_flow.c | 3 +-
drivers/net/intel/i40e/rte_pmd_i40e.c | 34 -------
drivers/net/intel/i40e/rte_pmd_i40e.h | 33 ------
6 files changed, 3 insertions(+), 215 deletions(-)
diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index e818b6fc7c..207339cc8d 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -9309,8 +9309,8 @@ i40e_get_valid_input_set(enum i40e_filter_pctype pctype,
};
/**
- * Flow director supports only fields defined in
- * union rte_eth_fdir_flow.
+ * Flow director supports only fields reachable through
+ * rte_flow item patterns.
*/
static const uint64_t valid_fdir_inset_table[] = {
[I40E_FILTER_PCTYPE_FRAG_IPV4] =
diff --git a/drivers/net/intel/i40e/i40e_ethdev.h b/drivers/net/intel/i40e/i40e_ethdev.h
index d57c53f661..fecbd67f15 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.h
+++ b/drivers/net/intel/i40e/i40e_ethdev.h
@@ -1366,10 +1366,6 @@ enum i40e_filter_pctype
uint16_t i40e_pctype_to_flowtype(const struct i40e_adapter *adapter,
enum i40e_filter_pctype pctype);
int i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len);
-void i40e_fdir_info_get(struct rte_eth_dev *dev,
- struct rte_eth_fdir_info *fdir);
-void i40e_fdir_stats_get(struct rte_eth_dev *dev,
- struct rte_eth_fdir_stats *stat);
int i40e_select_filter_input_set(struct i40e_hw *hw,
struct rte_eth_input_set_conf *conf,
enum rte_filter_type filter);
diff --git a/drivers/net/intel/i40e/i40e_fdir.c b/drivers/net/intel/i40e/i40e_fdir.c
index ad256a5a11..c1acf389bf 100644
--- a/drivers/net/intel/i40e/i40e_fdir.c
+++ b/drivers/net/intel/i40e/i40e_fdir.c
@@ -1793,146 +1793,6 @@ i40e_fdir_flush(struct rte_eth_dev *dev)
return 0;
}
-static inline void
-i40e_fdir_info_get_flex_set(struct i40e_pf *pf,
- struct rte_eth_flex_payload_cfg *flex_set,
- uint16_t *num)
-{
- struct i40e_fdir_flex_pit *flex_pit;
- struct rte_eth_flex_payload_cfg *ptr = flex_set;
- uint16_t src, dst, size, j, k;
- uint8_t i, layer_idx;
-
- for (layer_idx = I40E_FLXPLD_L2_IDX;
- layer_idx <= I40E_FLXPLD_L4_IDX;
- layer_idx++) {
- if (layer_idx == I40E_FLXPLD_L2_IDX)
- ptr->type = RTE_ETH_L2_PAYLOAD;
- else if (layer_idx == I40E_FLXPLD_L3_IDX)
- ptr->type = RTE_ETH_L3_PAYLOAD;
- else if (layer_idx == I40E_FLXPLD_L4_IDX)
- ptr->type = RTE_ETH_L4_PAYLOAD;
-
- for (i = 0; i < I40E_MAX_FLXPLD_FIED; i++) {
- flex_pit = &pf->fdir.flex_set[layer_idx *
- I40E_MAX_FLXPLD_FIED + i];
- if (flex_pit->size == 0)
- continue;
- src = flex_pit->src_offset * sizeof(uint16_t);
- dst = flex_pit->dst_offset * sizeof(uint16_t);
- size = flex_pit->size * sizeof(uint16_t);
- for (j = src, k = dst; j < src + size; j++, k++)
- ptr->src_offset[k] = j;
- }
- (*num)++;
- ptr++;
- }
-}
-
-static inline void
-i40e_fdir_info_get_flex_mask(struct i40e_pf *pf,
- struct rte_eth_fdir_flex_mask *flex_mask,
- uint16_t *num)
-{
- struct i40e_fdir_flex_mask *mask;
- struct rte_eth_fdir_flex_mask *ptr = flex_mask;
- uint16_t flow_type;
- uint8_t i, j;
- uint16_t off_bytes, mask_tmp;
-
- for (i = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
- i <= I40E_FILTER_PCTYPE_L2_PAYLOAD;
- i++) {
- mask = &pf->fdir.flex_mask[i];
- flow_type = i40e_pctype_to_flowtype(pf->adapter,
- (enum i40e_filter_pctype)i);
- if (flow_type == RTE_ETH_FLOW_UNKNOWN)
- continue;
-
- for (j = 0; j < I40E_FDIR_MAX_FLEXWORD_NUM; j++) {
- if (mask->word_mask & I40E_FLEX_WORD_MASK(j)) {
- ptr->mask[j * sizeof(uint16_t)] = UINT8_MAX;
- ptr->mask[j * sizeof(uint16_t) + 1] = UINT8_MAX;
- } else {
- ptr->mask[j * sizeof(uint16_t)] = 0x0;
- ptr->mask[j * sizeof(uint16_t) + 1] = 0x0;
- }
- }
- for (j = 0; j < I40E_FDIR_BITMASK_NUM_WORD; j++) {
- off_bytes = mask->bitmask[j].offset * sizeof(uint16_t);
- mask_tmp = ~mask->bitmask[j].mask;
- ptr->mask[off_bytes] &= I40E_HI_BYTE(mask_tmp);
- ptr->mask[off_bytes + 1] &= I40E_LO_BYTE(mask_tmp);
- }
- ptr->flow_type = flow_type;
- ptr++;
- (*num)++;
- }
-}
-
-/*
- * i40e_fdir_info_get - get information of Flow Director
- * @pf: ethernet device to get info from
- * @fdir: a pointer to a structure of type *rte_eth_fdir_info* to be filled with
- * the flow director information.
- */
-void
-i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir)
-{
- struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
- struct i40e_hw *hw = I40E_PF_TO_HW(pf);
- uint16_t num_flex_set = 0;
- uint16_t num_flex_mask = 0;
- uint16_t i;
-
- fdir->mode = RTE_FDIR_MODE_NONE;
-
- fdir->guarant_spc =
- (uint32_t)hw->func_caps.fd_filters_guaranteed;
- fdir->best_spc =
- (uint32_t)hw->func_caps.fd_filters_best_effort;
- fdir->max_flexpayload = I40E_FDIR_MAX_FLEX_LEN;
- fdir->flow_types_mask[0] = I40E_FDIR_FLOWS;
- for (i = 1; i < RTE_FLOW_MASK_ARRAY_SIZE; i++)
- fdir->flow_types_mask[i] = 0ULL;
- fdir->flex_payload_unit = sizeof(uint16_t);
- fdir->flex_bitmask_unit = sizeof(uint16_t);
- fdir->max_flex_payload_segment_num = I40E_MAX_FLXPLD_FIED;
- fdir->flex_payload_limit = I40E_MAX_FLX_SOURCE_OFF;
- fdir->max_flex_bitmask_num = I40E_FDIR_BITMASK_NUM_WORD;
-
- i40e_fdir_info_get_flex_set(pf,
- fdir->flex_conf.flex_set,
- &num_flex_set);
- i40e_fdir_info_get_flex_mask(pf,
- fdir->flex_conf.flex_mask,
- &num_flex_mask);
-
- fdir->flex_conf.nb_payloads = num_flex_set;
- fdir->flex_conf.nb_flexmasks = num_flex_mask;
-}
-
-/*
- * i40e_fdir_stat_get - get statistics of Flow Director
- * @pf: ethernet device to get info from
- * @stat: a pointer to a structure of type *rte_eth_fdir_stats* to be filled with
- * the flow director statistics.
- */
-void
-i40e_fdir_stats_get(struct rte_eth_dev *dev, struct rte_eth_fdir_stats *stat)
-{
- struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
- struct i40e_hw *hw = I40E_PF_TO_HW(pf);
- uint32_t fdstat;
-
- fdstat = I40E_READ_REG(hw, I40E_PFQF_FDSTAT);
- stat->guarant_cnt =
- (uint32_t)((fdstat & I40E_PFQF_FDSTAT_GUARANT_CNT_MASK) >>
- I40E_PFQF_FDSTAT_GUARANT_CNT_SHIFT);
- stat->best_cnt =
- (uint32_t)((fdstat & I40E_PFQF_FDSTAT_BEST_CNT_MASK) >>
- I40E_PFQF_FDSTAT_BEST_CNT_SHIFT);
-}
/* Restore flow director filter */
void
diff --git a/drivers/net/intel/i40e/i40e_flow.c b/drivers/net/intel/i40e/i40e_flow.c
index c8eaa2b2e5..1ebc3e8fef 100644
--- a/drivers/net/intel/i40e/i40e_flow.c
+++ b/drivers/net/intel/i40e/i40e_flow.c
@@ -2461,8 +2461,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
for (i = 0; i < raw_spec->length; i++) {
j = i + next_dst_off;
- if (j >= RTE_ETH_FDIR_MAX_FLEXLEN ||
- j >= I40E_FDIR_MAX_FLEX_LEN)
+ if (j >= I40E_FDIR_MAX_FLEX_LEN)
break;
filter->input.flow_ext.flexbytes[j] =
raw_spec->pattern[i];
diff --git a/drivers/net/intel/i40e/rte_pmd_i40e.c b/drivers/net/intel/i40e/rte_pmd_i40e.c
index 2e7943ef8b..e47c1aa9d7 100644
--- a/drivers/net/intel/i40e/rte_pmd_i40e.c
+++ b/drivers/net/intel/i40e/rte_pmd_i40e.c
@@ -3219,40 +3219,6 @@ rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
return 0;
}
-RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_i40e_get_fdir_info, 20.08)
-int
-rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
-
- dev = &rte_eth_devices[port];
- if (!is_i40e_supported(dev))
- return -ENOTSUP;
-
- i40e_fdir_info_get(dev, fdir_info);
-
- return 0;
-}
-
-RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_i40e_get_fdir_stats, 20.08)
-int
-rte_pmd_i40e_get_fdir_stats(uint16_t port, struct rte_eth_fdir_stats *fdir_stat)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
-
- dev = &rte_eth_devices[port];
- if (!is_i40e_supported(dev))
- return -ENOTSUP;
-
- i40e_fdir_stats_get(dev, fdir_stat);
-
- return 0;
-}
-
RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_i40e_set_gre_key_len, 20.08)
int
rte_pmd_i40e_set_gre_key_len(uint16_t port, uint8_t len)
diff --git a/drivers/net/intel/i40e/rte_pmd_i40e.h b/drivers/net/intel/i40e/rte_pmd_i40e.h
index 5dcca91264..097ff4b58d 100644
--- a/drivers/net/intel/i40e/rte_pmd_i40e.h
+++ b/drivers/net/intel/i40e/rte_pmd_i40e.h
@@ -1145,39 +1145,6 @@ rte_pmd_i40e_inset_field_clear(uint64_t *inset, uint8_t field_idx)
return 0;
}
-/**
- * Get port fdir info
- *
- * @param port
- * The port identifier of the Ethernet device.
- * @param fdir_info
- * The fdir info of the port
- * @return
- * - (0) if successful.
- * - (-ENODEV) if *port* invalid.
- * - (-ENOTSUP) if operation not supported.
- */
-__rte_experimental
-int
-rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
-
-/**
- * Get port fdir status
- *
- * @param port
- * The port identifier of the Ethernet device.
- * @param fdir_stat
- * The fdir status of the port
- * @return
- * - (0) if successful.
- * - (-ENODEV) if *port* invalid.
- * - (-ENOTSUP) if operation not supported.
- */
-__rte_experimental
-int
-rte_pmd_i40e_get_fdir_stats(uint16_t port,
- struct rte_eth_fdir_stats *fdir_stat);
-
/**
* Set GRE key length
*
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [RFC 5/8] net/ixgbe: remove experimental FDIR API
2026-05-28 21:37 [RFC 0/8] retire legacy flow director API Stephen Hemminger
` (3 preceding siblings ...)
2026-05-28 21:37 ` [RFC 4/8] net/i40e: remove experimental FDIR API Stephen Hemminger
@ 2026-05-28 21:37 ` Stephen Hemminger
2026-05-28 21:37 ` [RFC 6/8] doc: announce legacy flow director deprecation Stephen Hemminger
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov, Vladimir Medvedkin
Remove the flow director related private APIs in ixgbe.
These APIs are experimental therefore they can be removed
without deprecation warning.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/intel/ixgbe/ixgbe_ethdev.h | 5 -
drivers/net/intel/ixgbe/ixgbe_fdir.c | 117 ------------------------
drivers/net/intel/ixgbe/rte_pmd_ixgbe.c | 34 -------
drivers/net/intel/ixgbe/rte_pmd_ixgbe.h | 32 -------
4 files changed, 188 deletions(-)
diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.h b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
index 5d3243cb4d..c290f04611 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
@@ -717,11 +717,6 @@ int ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
struct rte_eth_fdir_conf *fdir_conf,
struct ixgbe_fdir_rule *rule,
bool del, bool update);
-void ixgbe_fdir_info_get(struct rte_eth_dev *dev,
- struct rte_eth_fdir_info *fdir_info);
-void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
- struct rte_eth_fdir_stats *fdir_stats);
-
void ixgbe_configure_dcb(struct rte_eth_dev *dev);
int
diff --git a/drivers/net/intel/ixgbe/ixgbe_fdir.c b/drivers/net/intel/ixgbe/ixgbe_fdir.c
index b32dc54287..20cc72ffcd 100644
--- a/drivers/net/intel/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/intel/ixgbe/ixgbe_fdir.c
@@ -1202,123 +1202,6 @@ ixgbe_fdir_flush(struct rte_eth_dev *dev)
return ret;
}
-#define FDIRENTRIES_NUM_SHIFT 10
-void
-ixgbe_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir_info)
-{
- struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
- struct ixgbe_hw_fdir_info *info =
- IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
- uint32_t fdirctrl, max_num;
- uint8_t offset;
-
- fdirctrl = IXGBE_READ_REG(hw, IXGBE_FDIRCTRL);
- offset = ((fdirctrl & IXGBE_FDIRCTRL_FLEX_MASK) >>
- IXGBE_FDIRCTRL_FLEX_SHIFT) * sizeof(uint16_t);
-
- fdir_info->mode = fdir_conf->mode;
- max_num = (1 << (FDIRENTRIES_NUM_SHIFT +
- (fdirctrl & FDIRCTRL_PBALLOC_MASK)));
- if (fdir_info->mode >= RTE_FDIR_MODE_PERFECT &&
- fdir_info->mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
- fdir_info->guarant_spc = max_num;
- else if (fdir_info->mode == RTE_FDIR_MODE_SIGNATURE)
- fdir_info->guarant_spc = max_num * 4;
-
- fdir_info->mask.vlan_tci_mask = info->mask.vlan_tci_mask;
- fdir_info->mask.ipv4_mask.src_ip = info->mask.src_ipv4_mask;
- fdir_info->mask.ipv4_mask.dst_ip = info->mask.dst_ipv4_mask;
- IPV6_MASK_TO_ADDR(info->mask.src_ipv6_mask,
- fdir_info->mask.ipv6_mask.src_ip);
- IPV6_MASK_TO_ADDR(info->mask.dst_ipv6_mask,
- fdir_info->mask.ipv6_mask.dst_ip);
- fdir_info->mask.src_port_mask = info->mask.src_port_mask;
- fdir_info->mask.dst_port_mask = info->mask.dst_port_mask;
- fdir_info->mask.mac_addr_byte_mask = info->mask.mac_addr_byte_mask;
- fdir_info->mask.tunnel_id_mask = info->mask.tunnel_id_mask;
- fdir_info->mask.tunnel_type_mask = info->mask.tunnel_type_mask;
- fdir_info->max_flexpayload = IXGBE_FDIR_MAX_FLEX_LEN;
-
- if (fdir_info->mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN ||
- fdir_info->mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
- fdir_info->flow_types_mask[0] = 0ULL;
- else
- fdir_info->flow_types_mask[0] = IXGBE_FDIR_FLOW_TYPES;
- for (uint32_t i = 1; i < RTE_FLOW_MASK_ARRAY_SIZE; i++)
- fdir_info->flow_types_mask[i] = 0ULL;
-
- fdir_info->flex_payload_unit = sizeof(uint16_t);
- fdir_info->max_flex_payload_segment_num = 1;
- fdir_info->flex_payload_limit = IXGBE_MAX_FLX_SOURCE_OFF;
- fdir_info->flex_conf.nb_payloads = 1;
- fdir_info->flex_conf.flex_set[0].type = RTE_ETH_RAW_PAYLOAD;
- fdir_info->flex_conf.flex_set[0].src_offset[0] = offset;
- fdir_info->flex_conf.flex_set[0].src_offset[1] = offset + 1;
- fdir_info->flex_conf.nb_flexmasks = 1;
- fdir_info->flex_conf.flex_mask[0].flow_type = RTE_ETH_FLOW_UNKNOWN;
- fdir_info->flex_conf.flex_mask[0].mask[0] =
- (uint8_t)(info->mask.flex_bytes_mask & 0x00FF);
- fdir_info->flex_conf.flex_mask[0].mask[1] =
- (uint8_t)((info->mask.flex_bytes_mask & 0xFF00) >> 8);
-}
-
-void
-ixgbe_fdir_stats_get(struct rte_eth_dev *dev, struct rte_eth_fdir_stats *fdir_stats)
-{
- struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
- struct ixgbe_hw_fdir_info *info =
- IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
- uint32_t reg, max_num;
- enum rte_fdir_mode fdir_mode = fdir_conf->mode;
-
- /* Get the information from registers */
- reg = IXGBE_READ_REG(hw, IXGBE_FDIRFREE);
- info->collision = (uint16_t)((reg & IXGBE_FDIRFREE_COLL_MASK) >>
- IXGBE_FDIRFREE_COLL_SHIFT);
- info->free = (uint16_t)((reg & IXGBE_FDIRFREE_FREE_MASK) >>
- IXGBE_FDIRFREE_FREE_SHIFT);
-
- reg = IXGBE_READ_REG(hw, IXGBE_FDIRLEN);
- info->maxhash = (uint16_t)((reg & IXGBE_FDIRLEN_MAXHASH_MASK) >>
- IXGBE_FDIRLEN_MAXHASH_SHIFT);
- info->maxlen = (uint8_t)((reg & IXGBE_FDIRLEN_MAXLEN_MASK) >>
- IXGBE_FDIRLEN_MAXLEN_SHIFT);
-
- reg = IXGBE_READ_REG(hw, IXGBE_FDIRUSTAT);
- info->remove += (reg & IXGBE_FDIRUSTAT_REMOVE_MASK) >>
- IXGBE_FDIRUSTAT_REMOVE_SHIFT;
- info->add += (reg & IXGBE_FDIRUSTAT_ADD_MASK) >>
- IXGBE_FDIRUSTAT_ADD_SHIFT;
-
- reg = IXGBE_READ_REG(hw, IXGBE_FDIRFSTAT) & 0xFFFF;
- info->f_remove += (reg & IXGBE_FDIRFSTAT_FREMOVE_MASK) >>
- IXGBE_FDIRFSTAT_FREMOVE_SHIFT;
- info->f_add += (reg & IXGBE_FDIRFSTAT_FADD_MASK) >>
- IXGBE_FDIRFSTAT_FADD_SHIFT;
-
- /* Copy the new information in the fdir parameter */
- fdir_stats->collision = info->collision;
- fdir_stats->free = info->free;
- fdir_stats->maxhash = info->maxhash;
- fdir_stats->maxlen = info->maxlen;
- fdir_stats->remove = info->remove;
- fdir_stats->add = info->add;
- fdir_stats->f_remove = info->f_remove;
- fdir_stats->f_add = info->f_add;
-
- reg = IXGBE_READ_REG(hw, IXGBE_FDIRCTRL);
- max_num = (1 << (FDIRENTRIES_NUM_SHIFT +
- (reg & FDIRCTRL_PBALLOC_MASK)));
- if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
- fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
- fdir_stats->guarant_cnt = max_num - fdir_stats->free;
- else if (fdir_mode == RTE_FDIR_MODE_SIGNATURE)
- fdir_stats->guarant_cnt = max_num * 4 - fdir_stats->free;
-
-}
-
/* restore flow director filter */
void
ixgbe_fdir_filter_restore(struct rte_eth_dev *dev)
diff --git a/drivers/net/intel/ixgbe/rte_pmd_ixgbe.c b/drivers/net/intel/ixgbe/rte_pmd_ixgbe.c
index 30dec57be8..c1f923b100 100644
--- a/drivers/net/intel/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/intel/ixgbe/rte_pmd_ixgbe.c
@@ -1176,37 +1176,3 @@ rte_pmd_ixgbe_mdio_unlocked_write(uint16_t port, uint32_t reg_addr,
return 0;
}
-RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_ixgbe_get_fdir_info, 20.08)
-int
-rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
-
- dev = &rte_eth_devices[port];
- if (!is_ixgbe_supported(dev))
- return -ENOTSUP;
-
- ixgbe_fdir_info_get(dev, fdir_info);
-
- return 0;
-}
-
-RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pmd_ixgbe_get_fdir_stats, 20.08)
-int
-rte_pmd_ixgbe_get_fdir_stats(uint16_t port,
- struct rte_eth_fdir_stats *fdir_stats)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
-
- dev = &rte_eth_devices[port];
- if (!is_ixgbe_supported(dev))
- return -ENOTSUP;
-
- ixgbe_fdir_stats_get(dev, fdir_stats);
-
- return 0;
-}
diff --git a/drivers/net/intel/ixgbe/rte_pmd_ixgbe.h b/drivers/net/intel/ixgbe/rte_pmd_ixgbe.h
index 7ca1126cfb..74bb5aa140 100644
--- a/drivers/net/intel/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/intel/ixgbe/rte_pmd_ixgbe.h
@@ -724,36 +724,4 @@ enum {
int
rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable);
-/**
- * Get port fdir info
- *
- * @param port
- * The port identifier of the Ethernet device.
- * @param fdir_info
- * The fdir info of the port
- * @return
- * - (0) if successful.
- * - (-ENODEV) if *port* invalid.
- * - (-ENOTSUP) if operation not supported.
- */
-__rte_experimental
-int
-rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
-
-/**
- * Get port fdir status
- *
- * @param port
- * The port identifier of the Ethernet device.
- * @param fdir_stats
- * The fdir status of the port
- * @return
- * - (0) if successful.
- * - (-ENODEV) if *port* invalid.
- * - (-ENOTSUP) if operation not supported.
- */
-__rte_experimental
-int
-rte_pmd_ixgbe_get_fdir_stats(uint16_t port,
- struct rte_eth_fdir_stats *fdir_stats);
#endif /* _PMD_IXGBE_H_ */
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [RFC 6/8] doc: announce legacy flow director deprecation
2026-05-28 21:37 [RFC 0/8] retire legacy flow director API Stephen Hemminger
` (4 preceding siblings ...)
2026-05-28 21:37 ` [RFC 5/8] net/ixgbe: " Stephen Hemminger
@ 2026-05-28 21:37 ` Stephen Hemminger
2026-05-28 21:37 ` [RFC 7/8] net/ixgbe: privatize legacy flow director types Stephen Hemminger
2026-05-28 21:37 ` [RFC 8/8] net/txgbe: " Stephen Hemminger
7 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Add the formal deprecation notice for the legacy flow director API
and the matching 26.07 release note.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/rel_notes/deprecation.rst | 7 +++++++
doc/guides/rel_notes/release_26_07.rst | 14 ++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index d152e76fdc..5e2949d153 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -131,6 +131,13 @@ Deprecation Notices
The legacy actions should be removed
once ``MODIFY_FIELD`` alternative is implemented in drivers.
+* ethdev: Legacy flow director API will be removed in DPDK 26.11.
+ This affects: flow director data structures in ``rte_eth_ctrl.h``
+ (``rte_eth_fdir_*`` and ``rte_fdir_*`` types and the associated
+ ``RTE_ETH_FDIR_*`` / ``RTE_FDIR_*`` macros) and the driver-facing
+ definitions in ``ethdev_driver.h`` (``struct rte_eth_fdir_conf``,
+ ``enum rte_eth_fdir_pballoc_type``, ``enum rte_fdir_status_mode``).
+
* cryptodev: Support for OpenSSL versions earlier than 3.0 is deprecated
and will be removed. OpenSSL 1.1.1 reached end-of-life in September 2023.
The minimum supported OpenSSL version will be 3.0,
diff --git a/doc/guides/rel_notes/release_26_07.rst b/doc/guides/rel_notes/release_26_07.rst
index 8b4f8401e2..06689cdcca 100644
--- a/doc/guides/rel_notes/release_26_07.rst
+++ b/doc/guides/rel_notes/release_26_07.rst
@@ -100,6 +100,18 @@ Removed Items
Also, make sure to start the actual text at the margin.
=======================================================
+* Removed legacy flow director artifacts that depended on deprecated API.
+ Users should use ``rte_flow`` API and testpmd ``flow``
+ command instead.
+
+ * app/testpmd: ``show port fdir``, ``clear port fdir``,
+ ``flow_director_filter``, ``port config ... pctype mapping ...``,
+ and ``port config ... hash_inset|fdir_inset|fdir_flx_inset ...``.
+
+ * net/i40e, net/ixgbe: the experimental
+ ``rte_pmd_{i40e,ixgbe}_get_fdir_info()`` and
+ ``rte_pmd_{i40e,ixgbe}_get_fdir_stats()`` functions.
+
API Changes
-----------
@@ -116,6 +128,8 @@ API Changes
Also, make sure to start the actual text at the margin.
=======================================================
+* Deprecated the legacy flow director API; removal scheduled for
+ DPDK 26.11. Use the ``rte_flow`` API instead.
ABI Changes
-----------
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [RFC 7/8] net/ixgbe: privatize legacy flow director types
2026-05-28 21:37 [RFC 0/8] retire legacy flow director API Stephen Hemminger
` (5 preceding siblings ...)
2026-05-28 21:37 ` [RFC 6/8] doc: announce legacy flow director deprecation Stephen Hemminger
@ 2026-05-28 21:37 ` Stephen Hemminger
2026-05-28 21:37 ` [RFC 8/8] net/txgbe: " Stephen Hemminger
7 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov, Vladimir Medvedkin
The ixgbe driver uses several legacy ethdev flow director types
(struct rte_eth_fdir_conf, enum rte_fdir_mode, and related) from
<rte_eth_ctrl.h> and <ethdev_driver.h> as its internal IR for
translating rte_flow rules into hardware programming state. These
types are scheduled for removal from ethdev in DPDK 26.11.
Clone the relevant types into ixgbe_ethdev.h with an ixgbe-private
prefix so the driver no longer depends on the legacy ABI. The
embedded rte_eth_ipv4_flow / rte_eth_ipv6_flow types are cloned
too since they live in the same removal candidate set.
enum ixgbe_fdir_pballoc_type already exists in the Intel base
driver (drivers/net/intel/ixgbe/base/ixgbe_type.h) and is reused
as-is. Its values are NONE=0, 64K=1, 128K=2, 256K=3, whereas the
ethdev enum started at 64K=0. The adapter's pballoc field was
previously zero-initialized and relied on the ethdev convention
that 0 means 64K; initialize it explicitly in eth_ixgbe_dev_init()
to preserve that behavior under the base enum.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/intel/ixgbe/ixgbe_ethdev.c | 12 +-
drivers/net/intel/ixgbe/ixgbe_ethdev.h | 95 +++++++++++++-
drivers/net/intel/ixgbe/ixgbe_fdir.c | 124 +++++++++---------
drivers/net/intel/ixgbe/ixgbe_flow.c | 28 ++--
.../net/intel/ixgbe/ixgbe_rxtx_vec_common.c | 4 +-
5 files changed, 177 insertions(+), 86 deletions(-)
diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
index 9dc015dfff..20b7b91cc3 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
@@ -1471,6 +1471,14 @@ static int ixgbe_fdir_filter_init(struct rte_eth_dev *eth_dev)
/* drop queue is always fixed */
IXGBE_DEV_FDIR_CONF(eth_dev)->drop_queue = IXGBE_FDIR_DROP_QUEUE;
+ /*
+ * Initialize pballoc to 64K. The base driver's
+ * enum ixgbe_fdir_pballoc_type uses NONE=0, 64K=1, ... so an
+ * uninitialized (zero) pballoc would be rejected by
+ * configure_fdir_flags(); set it explicitly here.
+ */
+ IXGBE_DEV_FDIR_CONF(eth_dev)->pballoc = IXGBE_FDIR_PBALLOC_64K;
+
return 0;
}
@@ -2618,7 +2626,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
struct ixgbe_adapter *adapter =
IXGBE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
- struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+ struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
struct ixgbe_vf_info *vfinfo =
*IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
@@ -2723,7 +2731,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
/* Configure DCB hw */
ixgbe_configure_dcb(dev);
- if (fdir_conf->mode != RTE_FDIR_MODE_NONE) {
+ if (fdir_conf->mode != IXGBE_FDIR_MODE_NONE) {
struct ixgbe_hw_fdir_info *info =
IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
err = ixgbe_fdir_configure(adapter, fdir_conf, &info->mask);
diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.h b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
index c290f04611..2fc9f8433e 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
@@ -143,8 +143,91 @@
IXGBE_LINK_SPEED_10GB_FULL)
/*
- * Information about the fdir mode.
+ * Privatized flow director configuration types.
+ *
+ * These were cloned from <rte_eth_ctrl.h> and <ethdev_driver.h> so that
+ * ixgbe no longer depends on the legacy ethdev flow director ABI, which
+ * is scheduled for removal in DPDK 26.11. The semantics are unchanged;
+ * only the names are ixgbe-private.
*/
+#define IXGBE_FDIR_MAX_FLEXLEN 16 /**< Max length of flexbytes. */
+
+struct ixgbe_ipv4_flow {
+ uint32_t src_ip;
+ uint32_t dst_ip;
+ uint8_t tos;
+ uint8_t ttl;
+ uint8_t proto;
+};
+
+struct ixgbe_ipv6_flow {
+ uint32_t src_ip[4];
+ uint32_t dst_ip[4];
+ uint8_t tc;
+ uint8_t proto;
+ uint8_t hop_limits;
+};
+
+struct ixgbe_fdir_masks {
+ uint16_t vlan_tci_mask;
+ struct ixgbe_ipv4_flow ipv4_mask;
+ struct ixgbe_ipv6_flow ipv6_mask;
+ uint16_t src_port_mask;
+ uint16_t dst_port_mask;
+ uint8_t mac_addr_byte_mask;
+ uint32_t tunnel_id_mask;
+ uint8_t tunnel_type_mask;
+};
+
+enum ixgbe_payload_type {
+ IXGBE_PAYLOAD_UNKNOWN = 0,
+ IXGBE_RAW_PAYLOAD,
+ IXGBE_L2_PAYLOAD,
+ IXGBE_L3_PAYLOAD,
+ IXGBE_L4_PAYLOAD,
+ IXGBE_PAYLOAD_MAX = 8,
+};
+
+struct ixgbe_flex_payload_cfg {
+ enum ixgbe_payload_type type;
+ uint16_t src_offset[IXGBE_FDIR_MAX_FLEXLEN];
+};
+
+struct ixgbe_fdir_flex_mask {
+ uint16_t flow_type;
+ uint8_t mask[IXGBE_FDIR_MAX_FLEXLEN];
+};
+
+struct ixgbe_fdir_flex_conf {
+ uint16_t nb_payloads;
+ uint16_t nb_flexmasks;
+ struct ixgbe_flex_payload_cfg flex_set[IXGBE_PAYLOAD_MAX];
+ struct ixgbe_fdir_flex_mask flex_mask[RTE_ETH_FLOW_MAX];
+};
+
+enum ixgbe_fdir_mode {
+ IXGBE_FDIR_MODE_NONE = 0,
+ IXGBE_FDIR_MODE_SIGNATURE,
+ IXGBE_FDIR_MODE_PERFECT,
+ IXGBE_FDIR_MODE_PERFECT_MAC_VLAN,
+ IXGBE_FDIR_MODE_PERFECT_TUNNEL,
+};
+
+enum ixgbe_fdir_status_mode {
+ IXGBE_FDIR_NO_REPORT_STATUS = 0,
+ IXGBE_FDIR_REPORT_STATUS,
+ IXGBE_FDIR_REPORT_STATUS_ALWAYS,
+};
+
+struct ixgbe_fdir_conf {
+ enum ixgbe_fdir_mode mode;
+ enum ixgbe_fdir_pballoc_type pballoc;
+ enum ixgbe_fdir_status_mode status;
+ uint8_t drop_queue;
+ struct ixgbe_fdir_masks mask;
+ struct ixgbe_fdir_flex_conf flex_conf;
+};
+
struct ixgbe_hw_fdir_mask {
uint16_t vlan_tci_mask;
uint32_t src_ipv4_mask;
@@ -176,7 +259,7 @@ struct ixgbe_fdir_rule {
union ixgbe_atr_input ixgbe_fdir; /* key of fdir filter*/
bool b_spec; /* If TRUE, ixgbe_fdir, fdirflags, queue have meaning. */
bool b_mask; /* If TRUE, mask has meaning. */
- enum rte_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
+ enum ixgbe_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
uint32_t fdirflags; /* drop or forward */
uint32_t soft_id; /* an unique value for this rule */
uint8_t queue; /* assigned rx queue */
@@ -468,7 +551,7 @@ struct ixgbe_adapter {
struct ixgbe_hw_stats stats;
struct ixgbe_macsec_stats macsec_stats;
struct ixgbe_macsec_setting macsec_setting;
- struct rte_eth_fdir_conf fdir_conf;
+ struct ixgbe_fdir_conf fdir_conf;
struct ixgbe_hw_fdir_info fdir;
struct ixgbe_interrupt intr;
struct ixgbe_stat_mapping_registers stat_mappings;
@@ -706,15 +789,15 @@ void ixgbe_filterlist_flush(struct rte_eth_dev *dev);
* Flow director function prototypes
*/
int ixgbe_fdir_configure(struct ixgbe_adapter *adapter,
- const struct rte_eth_fdir_conf *fdir_conf,
+ const struct ixgbe_fdir_conf *fdir_conf,
const struct ixgbe_hw_fdir_mask *fdir_mask);
int ixgbe_fdir_set_input_mask(struct ixgbe_adapter *adapter,
const struct ixgbe_hw_fdir_mask *mask,
- enum rte_fdir_mode mode);
+ enum ixgbe_fdir_mode mode);
int ixgbe_fdir_set_flexbytes_offset(struct ixgbe_adapter *adapter,
uint16_t offset);
int ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
- struct rte_eth_fdir_conf *fdir_conf,
+ struct ixgbe_fdir_conf *fdir_conf,
struct ixgbe_fdir_rule *rule,
bool del, bool update);
void ixgbe_configure_dcb(struct rte_eth_dev *dev);
diff --git a/drivers/net/intel/ixgbe/ixgbe_fdir.c b/drivers/net/intel/ixgbe/ixgbe_fdir.c
index 20cc72ffcd..69fd8c674c 100644
--- a/drivers/net/intel/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/intel/ixgbe/ixgbe_fdir.c
@@ -81,23 +81,23 @@
static int fdir_erase_filter_82599(struct ixgbe_hw *hw, uint32_t fdirhash);
static int fdir_set_input_mask_82599(struct ixgbe_adapter *adapter,
const struct ixgbe_hw_fdir_mask *mask,
- enum rte_fdir_mode mode);
+ enum ixgbe_fdir_mode mode);
static int fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
const struct ixgbe_hw_fdir_mask *mask,
- enum rte_fdir_mode mode);
+ enum ixgbe_fdir_mode mode);
static int ixgbe_set_fdir_flex_conf(struct ixgbe_adapter *adapter,
- const struct rte_eth_fdir_flex_conf *conf, uint32_t *fdirctrl);
+ const struct ixgbe_fdir_flex_conf *conf, uint32_t *fdirctrl);
static int fdir_enable_82599(struct ixgbe_hw *hw, uint32_t fdirctrl);
static uint32_t ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input,
uint32_t key);
static uint32_t atr_compute_sig_hash_82599(union ixgbe_atr_input *input,
- enum rte_eth_fdir_pballoc_type pballoc);
+ enum ixgbe_fdir_pballoc_type pballoc);
static uint32_t atr_compute_perfect_hash_82599(union ixgbe_atr_input *input,
- enum rte_eth_fdir_pballoc_type pballoc);
+ enum ixgbe_fdir_pballoc_type pballoc);
static int fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
union ixgbe_atr_input *input, uint8_t queue,
uint32_t fdircmd, uint32_t fdirhash,
- enum rte_fdir_mode mode);
+ enum ixgbe_fdir_mode mode);
static int fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
union ixgbe_atr_input *input, u8 queue, uint32_t fdircmd,
uint32_t fdirhash);
@@ -164,20 +164,20 @@ fdir_enable_82599(struct ixgbe_hw *hw, uint32_t fdirctrl)
* flexbytes matching field, and drop queue (only for perfect matching mode).
*/
static inline int
-configure_fdir_flags(const struct rte_eth_fdir_conf *conf, uint32_t *fdirctrl)
+configure_fdir_flags(const struct ixgbe_fdir_conf *conf, uint32_t *fdirctrl)
{
*fdirctrl = 0;
switch (conf->pballoc) {
- case RTE_ETH_FDIR_PBALLOC_64K:
+ case IXGBE_FDIR_PBALLOC_64K:
/* 8k - 1 signature filters */
*fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_64K;
break;
- case RTE_ETH_FDIR_PBALLOC_128K:
+ case IXGBE_FDIR_PBALLOC_128K:
/* 16k - 1 signature filters */
*fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_128K;
break;
- case RTE_ETH_FDIR_PBALLOC_256K:
+ case IXGBE_FDIR_PBALLOC_256K:
/* 32k - 1 signature filters */
*fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_256K;
break;
@@ -189,14 +189,14 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf, uint32_t *fdirctrl)
/* status flags: write hash & swindex in the rx descriptor */
switch (conf->status) {
- case RTE_FDIR_NO_REPORT_STATUS:
+ case IXGBE_FDIR_NO_REPORT_STATUS:
/* do nothing, default mode */
break;
- case RTE_FDIR_REPORT_STATUS:
+ case IXGBE_FDIR_REPORT_STATUS:
/* report status when the packet matches a fdir rule */
*fdirctrl |= IXGBE_FDIRCTRL_REPORT_STATUS;
break;
- case RTE_FDIR_REPORT_STATUS_ALWAYS:
+ case IXGBE_FDIR_REPORT_STATUS_ALWAYS:
/* always report status */
*fdirctrl |= IXGBE_FDIRCTRL_REPORT_STATUS_ALWAYS;
break;
@@ -209,14 +209,14 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf, uint32_t *fdirctrl)
*fdirctrl |= (IXGBE_DEFAULT_FLEXBYTES_OFFSET / sizeof(uint16_t)) <<
IXGBE_FDIRCTRL_FLEX_SHIFT;
- if (conf->mode >= RTE_FDIR_MODE_PERFECT &&
- conf->mode <= RTE_FDIR_MODE_PERFECT_TUNNEL) {
+ if (conf->mode >= IXGBE_FDIR_MODE_PERFECT &&
+ conf->mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL) {
*fdirctrl |= IXGBE_FDIRCTRL_PERFECT_MATCH;
*fdirctrl |= (conf->drop_queue << IXGBE_FDIRCTRL_DROP_Q_SHIFT);
- if (conf->mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN)
+ if (conf->mode == IXGBE_FDIR_MODE_PERFECT_MAC_VLAN)
*fdirctrl |= (IXGBE_FDIRCTRL_FILTERMODE_MACVLAN
<< IXGBE_FDIRCTRL_FILTERMODE_SHIFT);
- else if (conf->mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
+ else if (conf->mode == IXGBE_FDIR_MODE_PERFECT_TUNNEL)
*fdirctrl |= (IXGBE_FDIRCTRL_FILTERMODE_CLOUD
<< IXGBE_FDIRCTRL_FILTERMODE_SHIFT);
}
@@ -249,12 +249,12 @@ reverse_fdir_bitmasks(uint16_t hi_dword, uint16_t lo_dword)
/*
* This references ixgbe_fdir_set_input_mask_82599() in base/ixgbe_82599.c,
- * but makes use of the rte_fdir_masks structure to see which bits to set.
+ * but makes use of the ixgbe_fdir_masks structure to see which bits to set.
*/
static int
fdir_set_input_mask_82599(struct ixgbe_adapter *adapter,
const struct ixgbe_hw_fdir_mask *mask,
- enum rte_fdir_mode mode)
+ enum ixgbe_fdir_mode mode)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
/*
@@ -317,7 +317,7 @@ fdir_set_input_mask_82599(struct ixgbe_adapter *adapter,
reg = IXGBE_PCI_REG_ADDR(hw, IXGBE_FDIRDIP4M);
*reg = ~(mask->dst_ipv4_mask);
- if (mode == RTE_FDIR_MODE_SIGNATURE) {
+ if (mode == IXGBE_FDIR_MODE_SIGNATURE) {
/*
* Store source and destination IPv6 masks (bit reversed)
*/
@@ -332,12 +332,12 @@ fdir_set_input_mask_82599(struct ixgbe_adapter *adapter,
/*
* This references ixgbe_fdir_set_input_mask_82599() in base/ixgbe_82599.c,
- * but makes use of the rte_fdir_masks structure to see which bits to set.
+ * but makes use of the ixgbe_fdir_masks structure to see which bits to set.
*/
static int
fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
const struct ixgbe_hw_fdir_mask *mask,
- enum rte_fdir_mode mode)
+ enum ixgbe_fdir_mode mode)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
/* mask VM pool and DIPv6 since there are currently not supported
@@ -351,7 +351,7 @@ fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
PMD_INIT_FUNC_TRACE();
/* set the default UDP port for VxLAN */
- if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
+ if (mode == IXGBE_FDIR_MODE_PERFECT_TUNNEL)
IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, RTE_VXLAN_DEFAULT_PORT);
/* some bits must be set for mac vlan or tunnel mode */
@@ -375,11 +375,11 @@ fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
fdiripv6m = ((u32)0xFFFFU << IXGBE_FDIRIP6M_DIPM_SHIFT);
fdiripv6m |= IXGBE_FDIRIP6M_ALWAYS_MASK;
- if (mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN)
+ if (mode == IXGBE_FDIR_MODE_PERFECT_MAC_VLAN)
fdiripv6m |= IXGBE_FDIRIP6M_TUNNEL_TYPE |
IXGBE_FDIRIP6M_TNI_VNI;
- if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
+ if (mode == IXGBE_FDIR_MODE_PERFECT_TUNNEL) {
fdiripv6m |= IXGBE_FDIRIP6M_INNER_MAC;
mac_mask = mask->mac_addr_byte_mask &
(IXGBE_FDIRIP6M_INNER_MAC >>
@@ -428,13 +428,13 @@ fdir_set_input_mask_x550(struct ixgbe_adapter *adapter,
int
ixgbe_fdir_set_input_mask(struct ixgbe_adapter *adapter,
const struct ixgbe_hw_fdir_mask *mask,
- enum rte_fdir_mode mode)
+ enum ixgbe_fdir_mode mode)
{
- if (mode >= RTE_FDIR_MODE_SIGNATURE &&
- mode <= RTE_FDIR_MODE_PERFECT)
+ if (mode >= IXGBE_FDIR_MODE_SIGNATURE &&
+ mode <= IXGBE_FDIR_MODE_PERFECT)
return fdir_set_input_mask_82599(adapter, mask, mode);
- else if (mode >= RTE_FDIR_MODE_PERFECT_MAC_VLAN &&
- mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
+ else if (mode >= IXGBE_FDIR_MODE_PERFECT_MAC_VLAN &&
+ mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL)
return fdir_set_input_mask_x550(adapter, mask, mode);
PMD_DRV_LOG(ERR, "Not supported fdir mode - %d!", mode);
@@ -493,13 +493,13 @@ ixgbe_fdir_set_flexbytes_offset(struct ixgbe_adapter *adapter, uint16_t offset)
*/
static int
ixgbe_set_fdir_flex_conf(struct ixgbe_adapter *adapter,
- const struct rte_eth_fdir_flex_conf *conf, uint32_t *fdirctrl)
+ const struct ixgbe_fdir_flex_conf *conf, uint32_t *fdirctrl)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
struct ixgbe_hw_fdir_info *info =
IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
- const struct rte_eth_flex_payload_cfg *flex_cfg;
- const struct rte_eth_fdir_flex_mask *flex_mask;
+ const struct ixgbe_flex_payload_cfg *flex_cfg;
+ const struct ixgbe_fdir_flex_mask *flex_mask;
uint32_t fdirm;
uint16_t flexbytes = 0;
uint16_t i;
@@ -513,7 +513,7 @@ ixgbe_set_fdir_flex_conf(struct ixgbe_adapter *adapter,
for (i = 0; i < conf->nb_payloads; i++) {
flex_cfg = &conf->flex_set[i];
- if (flex_cfg->type != RTE_ETH_RAW_PAYLOAD) {
+ if (flex_cfg->type != IXGBE_RAW_PAYLOAD) {
PMD_DRV_LOG(ERR, "unsupported payload type.");
return -EINVAL;
}
@@ -556,14 +556,14 @@ ixgbe_set_fdir_flex_conf(struct ixgbe_adapter *adapter,
int
ixgbe_fdir_configure(struct ixgbe_adapter *adapter,
- const struct rte_eth_fdir_conf *fdir_conf,
+ const struct ixgbe_fdir_conf *fdir_conf,
const struct ixgbe_hw_fdir_mask *fdir_mask)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(adapter);
int err;
uint32_t fdirctrl, pbsize;
int i;
- enum rte_fdir_mode mode = fdir_conf->mode;
+ enum ixgbe_fdir_mode mode = fdir_conf->mode;
PMD_INIT_FUNC_TRACE();
@@ -580,8 +580,8 @@ ixgbe_fdir_configure(struct ixgbe_adapter *adapter,
hw->mac.type != ixgbe_mac_X550EM_x &&
hw->mac.type != ixgbe_mac_X550EM_a &&
hw->mac.type != ixgbe_mac_E610 &&
- mode != RTE_FDIR_MODE_SIGNATURE &&
- mode != RTE_FDIR_MODE_PERFECT)
+ mode != IXGBE_FDIR_MODE_SIGNATURE &&
+ mode != IXGBE_FDIR_MODE_PERFECT)
return -ENOSYS;
err = configure_fdir_flags(fdir_conf, &fdirctrl);
@@ -733,13 +733,13 @@ ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input,
static uint32_t
atr_compute_perfect_hash_82599(union ixgbe_atr_input *input,
- enum rte_eth_fdir_pballoc_type pballoc)
+ enum ixgbe_fdir_pballoc_type pballoc)
{
- if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
+ if (pballoc == IXGBE_FDIR_PBALLOC_256K)
return ixgbe_atr_compute_hash_82599(input,
IXGBE_ATR_BUCKET_HASH_KEY) &
PERFECT_BUCKET_256KB_HASH_MASK;
- else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
+ else if (pballoc == IXGBE_FDIR_PBALLOC_128K)
return ixgbe_atr_compute_hash_82599(input,
IXGBE_ATR_BUCKET_HASH_KEY) &
PERFECT_BUCKET_128KB_HASH_MASK;
@@ -776,15 +776,15 @@ ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw, uint32_t *fdircmd)
*/
static uint32_t
atr_compute_sig_hash_82599(union ixgbe_atr_input *input,
- enum rte_eth_fdir_pballoc_type pballoc)
+ enum ixgbe_fdir_pballoc_type pballoc)
{
uint32_t bucket_hash, sig_hash;
- if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
+ if (pballoc == IXGBE_FDIR_PBALLOC_256K)
bucket_hash = ixgbe_atr_compute_hash_82599(input,
IXGBE_ATR_BUCKET_HASH_KEY) &
SIG_BUCKET_256KB_HASH_MASK;
- else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
+ else if (pballoc == IXGBE_FDIR_PBALLOC_128K)
bucket_hash = ixgbe_atr_compute_hash_82599(input,
IXGBE_ATR_BUCKET_HASH_KEY) &
SIG_BUCKET_128KB_HASH_MASK;
@@ -809,7 +809,7 @@ static int
fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
union ixgbe_atr_input *input, uint8_t queue,
uint32_t fdircmd, uint32_t fdirhash,
- enum rte_fdir_mode mode)
+ enum ixgbe_fdir_mode mode)
{
uint32_t fdirport, fdirvlan;
u32 addr_low, addr_high;
@@ -817,7 +817,7 @@ fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
int err = 0;
volatile uint32_t *reg;
- if (mode == RTE_FDIR_MODE_PERFECT) {
+ if (mode == IXGBE_FDIR_MODE_PERFECT) {
/* record the IPv4 address (big-endian)
* can not use IXGBE_WRITE_REG.
*/
@@ -831,8 +831,8 @@ fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
fdirport <<= IXGBE_FDIRPORT_DESTINATION_SHIFT;
fdirport |= IXGBE_NTOHS(input->formatted.src_port);
IXGBE_WRITE_REG(hw, IXGBE_FDIRPORT, fdirport);
- } else if (mode >= RTE_FDIR_MODE_PERFECT_MAC_VLAN &&
- mode <= RTE_FDIR_MODE_PERFECT_TUNNEL) {
+ } else if (mode >= IXGBE_FDIR_MODE_PERFECT_MAC_VLAN &&
+ mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL) {
/* for mac vlan and tunnel modes */
addr_low = ((u32)input->formatted.inner_mac[0] |
((u32)input->formatted.inner_mac[1] << 8) |
@@ -841,7 +841,7 @@ fdir_write_perfect_filter_82599(struct ixgbe_hw *hw,
addr_high = ((u32)input->formatted.inner_mac[4] |
((u32)input->formatted.inner_mac[5] << 8));
- if (mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
+ if (mode == IXGBE_FDIR_MODE_PERFECT_MAC_VLAN) {
IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(0), addr_low);
IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(1), addr_high);
IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(2), 0);
@@ -1035,7 +1035,7 @@ ixgbe_remove_fdir_filter(struct ixgbe_hw_fdir_info *fdir_info,
int
ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
- struct rte_eth_fdir_conf *fdir_conf,
+ struct ixgbe_fdir_conf *fdir_conf,
struct ixgbe_fdir_rule *rule,
bool del,
bool update)
@@ -1048,11 +1048,11 @@ ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
int err;
struct ixgbe_hw_fdir_info *info =
IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
- enum rte_fdir_mode fdir_mode = fdir_conf->mode;
+ enum ixgbe_fdir_mode fdir_mode = fdir_conf->mode;
struct ixgbe_fdir_filter *node;
bool add_node = FALSE;
- if (fdir_mode == RTE_FDIR_MODE_NONE ||
+ if (fdir_mode == IXGBE_FDIR_MODE_NONE ||
fdir_mode != rule->mode)
return -ENOTSUP;
@@ -1073,16 +1073,16 @@ ixgbe_fdir_filter_program(struct ixgbe_adapter *adapter,
IXGBE_ATR_FLOW_TYPE_IPV6) &&
(info->mask.src_port_mask != 0 ||
info->mask.dst_port_mask != 0) &&
- (rule->mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN &&
- rule->mode != RTE_FDIR_MODE_PERFECT_TUNNEL)) {
+ (rule->mode != IXGBE_FDIR_MODE_PERFECT_MAC_VLAN &&
+ rule->mode != IXGBE_FDIR_MODE_PERFECT_TUNNEL)) {
PMD_DRV_LOG(ERR, "By this device,"
" IPv4 is not supported without"
" L4 protocol and ports masked!");
return -ENOTSUP;
}
- if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
- fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
+ if (fdir_mode >= IXGBE_FDIR_MODE_PERFECT &&
+ fdir_mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL)
is_perfect = TRUE;
if (is_perfect) {
@@ -1207,15 +1207,15 @@ void
ixgbe_fdir_filter_restore(struct rte_eth_dev *dev)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+ struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
struct ixgbe_hw_fdir_info *fdir_info =
IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
struct ixgbe_fdir_filter *node;
bool is_perfect = FALSE;
- enum rte_fdir_mode fdir_mode = fdir_conf->mode;
+ enum ixgbe_fdir_mode fdir_mode = fdir_conf->mode;
- if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
- fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
+ if (fdir_mode >= IXGBE_FDIR_MODE_PERFECT &&
+ fdir_mode <= IXGBE_FDIR_MODE_PERFECT_TUNNEL)
is_perfect = TRUE;
if (is_perfect) {
@@ -1242,7 +1242,7 @@ ixgbe_fdir_filter_restore(struct rte_eth_dev *dev)
int
ixgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
{
- struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+ struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
struct ixgbe_hw_fdir_info *fdir_info =
IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
struct ixgbe_fdir_filter *fdir_filter;
@@ -1267,7 +1267,7 @@ ixgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
fdir_info->mask = (struct ixgbe_hw_fdir_mask){0};
fdir_info->flex_bytes_offset = 0;
fdir_info->mask_added = FALSE;
- fdir_conf->mode = RTE_FDIR_MODE_NONE;
+ fdir_conf->mode = IXGBE_FDIR_MODE_NONE;
if (had_flows)
ret = ixgbe_fdir_flush(dev);
diff --git a/drivers/net/intel/ixgbe/ixgbe_flow.c b/drivers/net/intel/ixgbe/ixgbe_flow.c
index 9038aae001..e990126b5f 100644
--- a/drivers/net/intel/ixgbe/ixgbe_flow.c
+++ b/drivers/net/intel/ixgbe/ixgbe_flow.c
@@ -1501,7 +1501,7 @@ ixgbe_parse_fdir_act_attr(const struct rte_flow_attr *attr,
rule->queue = act_q->index;
} else { /* drop */
/* signature mode does not support drop action. */
- if (rule->mode == RTE_FDIR_MODE_SIGNATURE) {
+ if (rule->mode == IXGBE_FDIR_MODE_SIGNATURE) {
memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION,
@@ -1727,9 +1727,9 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
}
if (signature_match(pattern))
- rule->mode = RTE_FDIR_MODE_SIGNATURE;
+ rule->mode = IXGBE_FDIR_MODE_SIGNATURE;
else
- rule->mode = RTE_FDIR_MODE_PERFECT;
+ rule->mode = IXGBE_FDIR_MODE_PERFECT;
/*Not supported last point for range*/
if (item->last) {
@@ -1772,7 +1772,7 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
/* Ether type should be masked. */
if (eth_mask->hdr.ether_type ||
- rule->mode == RTE_FDIR_MODE_SIGNATURE) {
+ rule->mode == IXGBE_FDIR_MODE_SIGNATURE) {
memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1781,7 +1781,7 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
}
/* If ethernet has meaning, it means MAC VLAN mode. */
- rule->mode = RTE_FDIR_MODE_PERFECT_MAC_VLAN;
+ rule->mode = IXGBE_FDIR_MODE_PERFECT_MAC_VLAN;
/**
* src MAC address must be masked,
@@ -1812,7 +1812,7 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
* IPv6 is not supported.
*/
item = next_no_fuzzy_pattern(pattern, item);
- if (rule->mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
+ if (rule->mode == IXGBE_FDIR_MODE_PERFECT_MAC_VLAN) {
if (item->type != RTE_FLOW_ITEM_TYPE_VLAN) {
memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
rte_flow_error_set(error, EINVAL,
@@ -1955,7 +1955,7 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
* 2. not support last
* 3. mask must not null
*/
- if (rule->mode != RTE_FDIR_MODE_SIGNATURE ||
+ if (rule->mode != IXGBE_FDIR_MODE_SIGNATURE ||
item->last ||
!item->mask) {
memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
@@ -2432,7 +2432,7 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
return -rte_errno;
}
- rule->mode = RTE_FDIR_MODE_PERFECT_TUNNEL;
+ rule->mode = IXGBE_FDIR_MODE_PERFECT_TUNNEL;
/* Skip MAC. */
if (item->type == RTE_FLOW_ITEM_TYPE_ETH) {
@@ -2920,8 +2920,8 @@ ixgbe_fdir_flow_program(struct rte_eth_dev *dev,
bool *first_mask,
struct rte_flow_error *error)
{
- struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
- struct rte_eth_fdir_conf local_fdir_conf = *fdir_conf;
+ struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+ struct ixgbe_fdir_conf local_fdir_conf = *fdir_conf;
struct ixgbe_hw_fdir_info *fdir_info =
IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
int ret;
@@ -2935,7 +2935,7 @@ ixgbe_fdir_flow_program(struct rte_eth_dev *dev,
local_fdir_conf.mode = fdir_rule->mode;
/* Configure FDIR mode if this is the first filter */
- if (fdir_conf->mode == RTE_FDIR_MODE_NONE) {
+ if (fdir_conf->mode == IXGBE_FDIR_MODE_NONE) {
ret = ixgbe_fdir_configure(adapter, &local_fdir_conf, &fdir_rule->mask);
if (ret) {
return rte_flow_error_set(error, EINVAL,
@@ -3249,7 +3249,7 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
ret = ixgbe_parse_fdir_filter(dev, attr, pattern,
actions, &fdir_rule, error);
if (!ret) {
- struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+ struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
bool first_mask = false;
ret = ixgbe_fdir_flow_program(dev, adapter, &fdir_rule,
@@ -3420,7 +3420,7 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
struct ixgbe_filter_ele_base *flow_mem_base;
struct ixgbe_hw_fdir_info *fdir_info =
IXGBE_DEV_PRIVATE_TO_FDIR_INFO(adapter);
- struct rte_eth_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
+ struct ixgbe_fdir_conf *fdir_conf = IXGBE_DEV_FDIR_CONF(dev);
struct ixgbe_rss_conf_ele *rss_filter_ptr;
/* Validate ownership before touching HW/SW state. */
@@ -3487,7 +3487,7 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
fdir_info->mask_added = false;
fdir_info->mask = (struct ixgbe_hw_fdir_mask){0};
fdir_info->flex_bytes_offset = 0;
- fdir_conf->mode = RTE_FDIR_MODE_NONE;
+ fdir_conf->mode = IXGBE_FDIR_MODE_NONE;
}
}
break;
diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c b/drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c
index c42b8fc96b..d2dd640893 100644
--- a/drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c
+++ b/drivers/net/intel/ixgbe/ixgbe_rxtx_vec_common.c
@@ -120,10 +120,10 @@ int __rte_cold
ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev)
{
#ifndef RTE_LIBRTE_IEEE1588
- struct rte_eth_fdir_conf *fconf = IXGBE_DEV_FDIR_CONF(dev);
+ struct ixgbe_fdir_conf *fconf = IXGBE_DEV_FDIR_CONF(dev);
/* no fdir support */
- if (fconf->mode != RTE_FDIR_MODE_NONE)
+ if (fconf->mode != IXGBE_FDIR_MODE_NONE)
return -1;
for (uint16_t i = 0; i < dev->data->nb_rx_queues; i++) {
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [RFC 8/8] net/txgbe: privatize legacy flow director types
2026-05-28 21:37 [RFC 0/8] retire legacy flow director API Stephen Hemminger
` (6 preceding siblings ...)
2026-05-28 21:37 ` [RFC 7/8] net/ixgbe: privatize legacy flow director types Stephen Hemminger
@ 2026-05-28 21:37 ` Stephen Hemminger
2026-05-29 7:29 ` Jiawen Wu
7 siblings, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2026-05-28 21:37 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jiawen Wu, Zaiyu Wang
The txgbe driver inherited its flow director representation from
ixgbe (it derives from the same hardware lineage) and uses the
same legacy ethdev types (struct rte_eth_fdir_conf, enum
rte_fdir_mode, and related) as its internal IR for translating
rte_flow rules into hardware programming state. These types are
scheduled for removal from ethdev in DPDK 26.11.
Clone the relevant types into txgbe_ethdev.h with a txgbe-private
prefix so the driver no longer depends on the legacy ABI. The
embedded rte_eth_ipv4_flow / rte_eth_ipv6_flow types are cloned
too since they live in the same removal candidate set.
Unlike ixgbe, txgbe base/ does not pre-declare an
enum txgbe_fdir_pballoc_type, so the cloned one is defined here.
txgbe uses the integer value of pballoc directly in the table-
size calculation
(1024 << (fdir_conf->pballoc + 1)) - 2
so the enum values match the original ethdev numbering
(64K=0, 128K=1, 256K=2). pballoc is set explicitly from devargs
in txgbe_handle_devarg(), so no extra initialization is required.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/txgbe/txgbe_ethdev.c | 6 +-
drivers/net/txgbe/txgbe_ethdev.h | 101 +++++++++++++++++++++-
drivers/net/txgbe/txgbe_fdir.c | 78 ++++++++---------
drivers/net/txgbe/txgbe_flow.c | 24 ++---
drivers/net/txgbe/txgbe_rxtx_vec_common.h | 4 +-
5 files changed, 155 insertions(+), 58 deletions(-)
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 5d360f8305..258ec4d97c 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -524,7 +524,7 @@ txgbe_handle_devarg(__rte_unused const char *key, const char *value,
static void
txgbe_parse_devargs(struct rte_eth_dev *dev)
{
- struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
+ struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
struct rte_devargs *devargs = pci_dev->device.devargs;
struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
@@ -934,7 +934,7 @@ static int txgbe_l2_tn_filter_uninit(struct rte_eth_dev *eth_dev)
int txgbe_fdir_filter_init(struct rte_eth_dev *eth_dev)
{
- struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(eth_dev);
+ struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(eth_dev);
struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(eth_dev);
char fdir_hash_name[RTE_HASH_NAMESIZE];
u16 max_fdir_num = (1024 << (fdir_conf->pballoc + 1)) - 2;
@@ -1834,7 +1834,7 @@ txgbe_dev_start(struct rte_eth_dev *dev)
txgbe_configure_port(dev);
txgbe_configure_dcb(dev);
- if (TXGBE_DEV_FDIR_CONF(dev)->mode != RTE_FDIR_MODE_NONE) {
+ if (TXGBE_DEV_FDIR_CONF(dev)->mode != TXGBE_FDIR_MODE_NONE) {
err = txgbe_fdir_configure(dev);
if (err)
goto error;
diff --git a/drivers/net/txgbe/txgbe_ethdev.h b/drivers/net/txgbe/txgbe_ethdev.h
index 189fbac541..1f4ce4f3b8 100644
--- a/drivers/net/txgbe/txgbe_ethdev.h
+++ b/drivers/net/txgbe/txgbe_ethdev.h
@@ -83,6 +83,103 @@
/*
* Information about the fdir mode.
*/
+/*
+ * Privatized flow director configuration types.
+ *
+ * Cloned from <rte_eth_ctrl.h> and <ethdev_driver.h> so that txgbe no
+ * longer depends on the legacy ethdev flow director ABI, which is
+ * scheduled for removal in DPDK 26.11. Semantics unchanged; only the
+ * names are txgbe-private.
+ *
+ * NB: txgbe uses the integer value of pballoc directly in
+ * (1024 << (fdir_conf->pballoc + 1)) - 2
+ * to size the HW filter table. The enum values therefore match the
+ * original ethdev numbering (64K=0, 128K=1, 256K=2).
+ */
+#define TXGBE_FDIR_MAX_FLEXLEN 16 /**< Max length of flexbytes. */
+
+struct txgbe_ipv4_flow {
+ uint32_t src_ip;
+ uint32_t dst_ip;
+ uint8_t tos;
+ uint8_t ttl;
+ uint8_t proto;
+};
+
+struct txgbe_ipv6_flow {
+ uint32_t src_ip[4];
+ uint32_t dst_ip[4];
+ uint8_t tc;
+ uint8_t proto;
+ uint8_t hop_limits;
+};
+
+struct txgbe_fdir_masks {
+ uint16_t vlan_tci_mask;
+ struct txgbe_ipv4_flow ipv4_mask;
+ struct txgbe_ipv6_flow ipv6_mask;
+ uint16_t src_port_mask;
+ uint16_t dst_port_mask;
+ uint8_t mac_addr_byte_mask;
+ uint32_t tunnel_id_mask;
+ uint8_t tunnel_type_mask;
+};
+
+enum txgbe_payload_type {
+ TXGBE_PAYLOAD_UNKNOWN = 0,
+ TXGBE_RAW_PAYLOAD,
+ TXGBE_L2_PAYLOAD,
+ TXGBE_L3_PAYLOAD,
+ TXGBE_L4_PAYLOAD,
+ TXGBE_PAYLOAD_MAX = 8,
+};
+
+struct txgbe_flex_payload_cfg {
+ enum txgbe_payload_type type;
+ uint16_t src_offset[TXGBE_FDIR_MAX_FLEXLEN];
+};
+
+struct txgbe_fdir_flex_mask {
+ uint16_t flow_type;
+ uint8_t mask[TXGBE_FDIR_MAX_FLEXLEN];
+};
+
+struct txgbe_fdir_flex_conf {
+ uint16_t nb_payloads;
+ uint16_t nb_flexmasks;
+ struct txgbe_flex_payload_cfg flex_set[TXGBE_PAYLOAD_MAX];
+ struct txgbe_fdir_flex_mask flex_mask[RTE_ETH_FLOW_MAX];
+};
+
+enum txgbe_fdir_mode {
+ TXGBE_FDIR_MODE_NONE = 0,
+ TXGBE_FDIR_MODE_SIGNATURE,
+ TXGBE_FDIR_MODE_PERFECT,
+ TXGBE_FDIR_MODE_PERFECT_MAC_VLAN,
+ TXGBE_FDIR_MODE_PERFECT_TUNNEL,
+};
+
+enum txgbe_fdir_pballoc_type {
+ TXGBE_FDIR_PBALLOC_64K = 0,
+ TXGBE_FDIR_PBALLOC_128K,
+ TXGBE_FDIR_PBALLOC_256K,
+};
+
+enum txgbe_fdir_status_mode {
+ TXGBE_FDIR_NO_REPORT_STATUS = 0,
+ TXGBE_FDIR_REPORT_STATUS,
+ TXGBE_FDIR_REPORT_STATUS_ALWAYS,
+};
+
+struct txgbe_fdir_conf {
+ enum txgbe_fdir_mode mode;
+ enum txgbe_fdir_pballoc_type pballoc;
+ enum txgbe_fdir_status_mode status;
+ uint8_t drop_queue;
+ struct txgbe_fdir_masks mask;
+ struct txgbe_fdir_flex_conf flex_conf;
+};
+
struct txgbe_hw_fdir_mask {
uint16_t vlan_tci_mask;
uint32_t src_ipv4_mask;
@@ -111,7 +208,7 @@ struct txgbe_fdir_rule {
struct txgbe_atr_input input; /* key of fdir filter */
bool b_spec; /* If TRUE, input, fdirflags, queue have meaning. */
bool b_mask; /* If TRUE, mask has meaning. */
- enum rte_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
+ enum txgbe_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
uint32_t fdirflags; /* drop or forward */
uint32_t soft_id; /* an unique value for this rule */
uint8_t queue; /* assigned rx queue */
@@ -352,7 +449,7 @@ struct txgbe_tm_conf {
struct txgbe_adapter {
struct txgbe_hw hw;
struct txgbe_hw_stats stats;
- struct rte_eth_fdir_conf fdir_conf;
+ struct txgbe_fdir_conf fdir_conf;
struct txgbe_hw_fdir_info fdir;
struct txgbe_interrupt intr;
struct txgbe_stat_mappings stat_mappings;
diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
index 67f586ffc7..ded01341a4 100644
--- a/drivers/net/txgbe/txgbe_fdir.c
+++ b/drivers/net/txgbe/txgbe_fdir.c
@@ -102,22 +102,22 @@ txgbe_fdir_enable(struct txgbe_hw *hw, uint32_t fdirctrl)
* flexbytes matching field, and drop queue (only for perfect matching mode).
*/
static inline int
-configure_fdir_flags(const struct rte_eth_fdir_conf *conf,
+configure_fdir_flags(const struct txgbe_fdir_conf *conf,
uint32_t *fdirctrl, uint32_t *flex)
{
*fdirctrl = 0;
*flex = 0;
switch (conf->pballoc) {
- case RTE_ETH_FDIR_PBALLOC_64K:
+ case TXGBE_FDIR_PBALLOC_64K:
/* 8k - 1 signature filters */
*fdirctrl |= TXGBE_FDIRCTL_BUF_64K;
break;
- case RTE_ETH_FDIR_PBALLOC_128K:
+ case TXGBE_FDIR_PBALLOC_128K:
/* 16k - 1 signature filters */
*fdirctrl |= TXGBE_FDIRCTL_BUF_128K;
break;
- case RTE_ETH_FDIR_PBALLOC_256K:
+ case TXGBE_FDIR_PBALLOC_256K:
/* 32k - 1 signature filters */
*fdirctrl |= TXGBE_FDIRCTL_BUF_256K;
break;
@@ -129,14 +129,14 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf,
/* status flags: write hash & swindex in the rx descriptor */
switch (conf->status) {
- case RTE_FDIR_NO_REPORT_STATUS:
+ case TXGBE_FDIR_NO_REPORT_STATUS:
/* do nothing, default mode */
break;
- case RTE_FDIR_REPORT_STATUS:
+ case TXGBE_FDIR_REPORT_STATUS:
/* report status when the packet matches a fdir rule */
*fdirctrl |= TXGBE_FDIRCTL_REPORT_MATCH;
break;
- case RTE_FDIR_REPORT_STATUS_ALWAYS:
+ case TXGBE_FDIR_REPORT_STATUS_ALWAYS:
/* always report status */
*fdirctrl |= TXGBE_FDIRCTL_REPORT_ALWAYS;
break;
@@ -150,9 +150,9 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf,
*flex |= TXGBE_FDIRFLEXCFG_OFST(TXGBE_DEFAULT_FLEXBYTES_OFFSET / 2);
switch (conf->mode) {
- case RTE_FDIR_MODE_SIGNATURE:
+ case TXGBE_FDIR_MODE_SIGNATURE:
break;
- case RTE_FDIR_MODE_PERFECT:
+ case TXGBE_FDIR_MODE_PERFECT:
*fdirctrl |= TXGBE_FDIRCTL_PERFECT;
*fdirctrl |= TXGBE_FDIRCTL_DROPQP(conf->drop_queue);
break;
@@ -179,7 +179,7 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
{
struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
- enum rte_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+ enum txgbe_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
/*
* mask VM pool and DIPv6 since there are currently not supported
* mask FLEX byte, it will be set in flex_conf
@@ -190,8 +190,8 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
- if (mode != RTE_FDIR_MODE_SIGNATURE &&
- mode != RTE_FDIR_MODE_PERFECT) {
+ if (mode != TXGBE_FDIR_MODE_SIGNATURE &&
+ mode != TXGBE_FDIR_MODE_PERFECT) {
PMD_DRV_LOG(ERR, "Not supported fdir mode - %d!", mode);
return -ENOTSUP;
}
@@ -232,14 +232,14 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
static int
txgbe_fdir_store_input_mask(struct rte_eth_dev *dev)
{
- struct rte_eth_fdir_masks *input_mask = &TXGBE_DEV_FDIR_CONF(dev)->mask;
- enum rte_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+ struct txgbe_fdir_masks *input_mask = &TXGBE_DEV_FDIR_CONF(dev)->mask;
+ enum txgbe_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
uint16_t dst_ipv6m = 0;
uint16_t src_ipv6m = 0;
- if (mode != RTE_FDIR_MODE_SIGNATURE &&
- mode != RTE_FDIR_MODE_PERFECT) {
+ if (mode != TXGBE_FDIR_MODE_SIGNATURE &&
+ mode != TXGBE_FDIR_MODE_PERFECT) {
PMD_DRV_LOG(ERR, "Not supported fdir mode - %d!", mode);
return -ENOTSUP;
}
@@ -304,12 +304,12 @@ txgbe_fdir_set_flexbytes_offset(struct rte_eth_dev *dev,
static int
txgbe_set_fdir_flex_conf(struct rte_eth_dev *dev, uint32_t flex)
{
- const struct rte_eth_fdir_flex_conf *conf =
+ const struct txgbe_fdir_flex_conf *conf =
&TXGBE_DEV_FDIR_CONF(dev)->flex_conf;
struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
- const struct rte_eth_flex_payload_cfg *flex_cfg;
- const struct rte_eth_fdir_flex_mask *flex_mask;
+ const struct txgbe_flex_payload_cfg *flex_cfg;
+ const struct txgbe_fdir_flex_mask *flex_mask;
uint16_t flexbytes = 0;
uint16_t i;
@@ -322,7 +322,7 @@ txgbe_set_fdir_flex_conf(struct rte_eth_dev *dev, uint32_t flex)
for (i = 0; i < conf->nb_payloads; i++) {
flex_cfg = &conf->flex_set[i];
- if (flex_cfg->type != RTE_ETH_RAW_PAYLOAD) {
+ if (flex_cfg->type != TXGBE_RAW_PAYLOAD) {
PMD_DRV_LOG(ERR, "unsupported payload type.");
return -EINVAL;
}
@@ -375,13 +375,13 @@ txgbe_fdir_configure(struct rte_eth_dev *dev)
int err;
uint32_t fdirctrl, flex, pbsize;
int i;
- enum rte_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+ enum txgbe_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
PMD_INIT_FUNC_TRACE();
/* supports mac-vlan and tunnel mode */
- if (mode != RTE_FDIR_MODE_SIGNATURE &&
- mode != RTE_FDIR_MODE_PERFECT)
+ if (mode != TXGBE_FDIR_MODE_SIGNATURE &&
+ mode != TXGBE_FDIR_MODE_PERFECT)
return -ENOSYS;
err = configure_fdir_flags(TXGBE_DEV_FDIR_CONF(dev), &fdirctrl, &flex);
@@ -531,15 +531,15 @@ txgbe_atr_compute_hash(struct txgbe_atr_input *atr_input,
static uint32_t
atr_compute_perfect_hash(struct txgbe_atr_input *input,
- enum rte_eth_fdir_pballoc_type pballoc)
+ enum txgbe_fdir_pballoc_type pballoc)
{
uint32_t bucket_hash;
bucket_hash = txgbe_atr_compute_hash(input,
TXGBE_ATR_BUCKET_HASH_KEY);
- if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
+ if (pballoc == TXGBE_FDIR_PBALLOC_256K)
bucket_hash &= PERFECT_BUCKET_256KB_HASH_MASK;
- else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
+ else if (pballoc == TXGBE_FDIR_PBALLOC_128K)
bucket_hash &= PERFECT_BUCKET_128KB_HASH_MASK;
else
bucket_hash &= PERFECT_BUCKET_64KB_HASH_MASK;
@@ -574,15 +574,15 @@ txgbe_fdir_check_cmd_complete(struct txgbe_hw *hw, uint32_t *fdircmd)
*/
static uint32_t
atr_compute_signature_hash(struct txgbe_atr_input *input,
- enum rte_eth_fdir_pballoc_type pballoc)
+ enum txgbe_fdir_pballoc_type pballoc)
{
uint32_t bucket_hash, sig_hash;
bucket_hash = txgbe_atr_compute_hash(input,
TXGBE_ATR_BUCKET_HASH_KEY);
- if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
+ if (pballoc == TXGBE_FDIR_PBALLOC_256K)
bucket_hash &= SIG_BUCKET_256KB_HASH_MASK;
- else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
+ else if (pballoc == TXGBE_FDIR_PBALLOC_128K)
bucket_hash &= SIG_BUCKET_128KB_HASH_MASK;
else
bucket_hash &= SIG_BUCKET_64KB_HASH_MASK;
@@ -603,7 +603,7 @@ static int
fdir_write_perfect_filter(struct txgbe_hw *hw,
struct txgbe_atr_input *input, uint8_t queue,
uint32_t fdircmd, uint32_t fdirhash,
- enum rte_fdir_mode mode)
+ enum txgbe_fdir_mode mode)
{
uint32_t fdirport, fdirflex;
int err = 0;
@@ -830,14 +830,14 @@ txgbe_fdir_filter_program(struct rte_eth_dev *dev,
bool is_perfect = FALSE;
int err;
struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
- enum rte_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+ enum txgbe_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
struct txgbe_fdir_filter *node;
- if (fdir_mode == RTE_FDIR_MODE_NONE ||
+ if (fdir_mode == TXGBE_FDIR_MODE_NONE ||
fdir_mode != rule->mode)
return -ENOTSUP;
- if (fdir_mode >= RTE_FDIR_MODE_PERFECT)
+ if (fdir_mode >= TXGBE_FDIR_MODE_PERFECT)
is_perfect = TRUE;
txgbe_fdir_mask_input(&info->mask, &rule->input);
@@ -1021,7 +1021,7 @@ txgbevf_fdir_filter_program(struct rte_eth_dev *dev,
uint32_t fdirhash;
int ret;
- if (rule->mode != RTE_FDIR_MODE_PERFECT ||
+ if (rule->mode != TXGBE_FDIR_MODE_PERFECT ||
rule->fdirflags == TXGBE_FDIRPICMD_DROP)
return -ENOTSUP;
@@ -1109,10 +1109,10 @@ txgbe_fdir_filter_restore(struct rte_eth_dev *dev)
struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(dev);
struct txgbe_fdir_filter *node;
bool is_perfect = FALSE;
- enum rte_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
+ enum txgbe_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
- if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
- fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
+ if (fdir_mode >= TXGBE_FDIR_MODE_PERFECT &&
+ fdir_mode <= TXGBE_FDIR_MODE_PERFECT_TUNNEL)
is_perfect = TRUE;
if (is_perfect) {
@@ -1139,7 +1139,7 @@ txgbe_fdir_filter_restore(struct rte_eth_dev *dev)
int
txgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
{
- struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
+ struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(dev);
struct txgbe_fdir_filter *fdir_filter;
struct txgbe_fdir_filter *filter_flag;
@@ -1150,7 +1150,7 @@ txgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
memset(fdir_info->hash_map, 0,
sizeof(struct txgbe_fdir_filter *) *
((1024 << (fdir_conf->pballoc + 1)) - 2));
- fdir_conf->mode = RTE_FDIR_MODE_NONE;
+ fdir_conf->mode = TXGBE_FDIR_MODE_NONE;
filter_flag = TAILQ_FIRST(&fdir_info->fdir_list);
while ((fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list))) {
TAILQ_REMOVE(&fdir_info->fdir_list,
diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
index a97588e57a..8470bf78af 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -1412,7 +1412,7 @@ txgbe_parse_fdir_act_attr(const struct rte_flow_attr *attr,
rule->queue = act_q->index;
} else { /* drop */
/* signature mode does not support drop action. */
- if (rule->mode == RTE_FDIR_MODE_SIGNATURE) {
+ if (rule->mode == TXGBE_FDIR_MODE_SIGNATURE) {
memset(rule, 0, sizeof(struct txgbe_fdir_rule));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION,
@@ -1646,9 +1646,9 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
}
if (signature_match(pattern))
- rule->mode = RTE_FDIR_MODE_SIGNATURE;
+ rule->mode = TXGBE_FDIR_MODE_SIGNATURE;
else
- rule->mode = RTE_FDIR_MODE_PERFECT;
+ rule->mode = TXGBE_FDIR_MODE_PERFECT;
/*Not supported last point for range*/
if (item->last) {
@@ -1678,7 +1678,7 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
/* Ether type should be masked. */
if (eth_mask->hdr.ether_type ||
- rule->mode == RTE_FDIR_MODE_SIGNATURE) {
+ rule->mode == TXGBE_FDIR_MODE_SIGNATURE) {
memset(rule, 0, sizeof(struct txgbe_fdir_rule));
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1687,7 +1687,7 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
}
/* If ethernet has meaning, it means MAC VLAN mode. */
- rule->mode = RTE_FDIR_MODE_PERFECT_MAC_VLAN;
+ rule->mode = TXGBE_FDIR_MODE_PERFECT_MAC_VLAN;
/**
* src MAC address must be masked,
@@ -1718,7 +1718,7 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
* IPv6 is not supported.
*/
item = next_no_fuzzy_pattern(pattern, item);
- if (rule->mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
+ if (rule->mode == TXGBE_FDIR_MODE_PERFECT_MAC_VLAN) {
if (item->type != RTE_FLOW_ITEM_TYPE_VLAN) {
memset(rule, 0, sizeof(struct txgbe_fdir_rule));
rte_flow_error_set(error, EINVAL,
@@ -2282,7 +2282,7 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
return -rte_errno;
}
- rule->mode = RTE_FDIR_MODE_PERFECT;
+ rule->mode = TXGBE_FDIR_MODE_PERFECT;
ptid = TXGBE_PTID_PKT_TUN;
/* Skip MAC. */
@@ -2949,7 +2949,7 @@ txgbe_parse_fdir_filter(struct rte_eth_dev *dev,
struct rte_flow_error *error)
{
int ret;
- struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
+ struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
ret = txgbe_parse_fdir_filter_normal(dev, attr, pattern,
actions, rule, error);
@@ -2965,11 +2965,11 @@ txgbe_parse_fdir_filter(struct rte_eth_dev *dev,
if (!txgbe_is_pf(TXGBE_DEV_HW(dev)))
return ret;
- if (fdir_conf->mode == RTE_FDIR_MODE_NONE) {
+ if (fdir_conf->mode == TXGBE_FDIR_MODE_NONE) {
fdir_conf->mode = rule->mode;
ret = txgbe_fdir_configure(dev);
if (ret) {
- fdir_conf->mode = RTE_FDIR_MODE_NONE;
+ fdir_conf->mode = TXGBE_FDIR_MODE_NONE;
return ret;
}
} else if (fdir_conf->mode != rule->mode) {
@@ -3562,7 +3562,7 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
struct txgbe_fdir_rule_ele *fdir_rule_ptr;
struct txgbe_flow_mem *txgbe_flow_mem_ptr;
struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(dev);
- struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
+ struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
struct txgbe_rss_conf_ele *rss_filter_ptr;
switch (filter_type) {
@@ -3625,7 +3625,7 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
fdir_info->mask_added = false;
fdir_info->flex_relative = false;
fdir_info->flex_bytes_offset = 0;
- fdir_conf->mode = RTE_FDIR_MODE_NONE;
+ fdir_conf->mode = TXGBE_FDIR_MODE_NONE;
}
}
break;
diff --git a/drivers/net/txgbe/txgbe_rxtx_vec_common.h b/drivers/net/txgbe/txgbe_rxtx_vec_common.h
index 00847d087b..c6144cad70 100644
--- a/drivers/net/txgbe/txgbe_rxtx_vec_common.h
+++ b/drivers/net/txgbe/txgbe_rxtx_vec_common.h
@@ -299,10 +299,10 @@ static inline int
txgbe_rx_vec_dev_conf_condition_check_default(struct rte_eth_dev *dev)
{
#ifndef RTE_LIBRTE_IEEE1588
- struct rte_eth_fdir_conf *fconf = TXGBE_DEV_FDIR_CONF(dev);
+ struct txgbe_fdir_conf *fconf = TXGBE_DEV_FDIR_CONF(dev);
/* no fdir support */
- if (fconf->mode != RTE_FDIR_MODE_NONE)
+ if (fconf->mode != TXGBE_FDIR_MODE_NONE)
return -1;
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* RE: [RFC 8/8] net/txgbe: privatize legacy flow director types
2026-05-28 21:37 ` [RFC 8/8] net/txgbe: " Stephen Hemminger
@ 2026-05-29 7:29 ` Jiawen Wu
0 siblings, 0 replies; 10+ messages in thread
From: Jiawen Wu @ 2026-05-29 7:29 UTC (permalink / raw)
To: 'Stephen Hemminger', dev; +Cc: 'Zaiyu Wang'
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Friday, May 29, 2026 5:37 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Jiawen Wu <jiawenwu@trustnetic.com>; Zaiyu Wang
> <zaiyuwang@trustnetic.com>
> Subject: [RFC 8/8] net/txgbe: privatize legacy flow director types
>
> The txgbe driver inherited its flow director representation from
> ixgbe (it derives from the same hardware lineage) and uses the
> same legacy ethdev types (struct rte_eth_fdir_conf, enum
> rte_fdir_mode, and related) as its internal IR for translating
> rte_flow rules into hardware programming state. These types are
> scheduled for removal from ethdev in DPDK 26.11.
>
> Clone the relevant types into txgbe_ethdev.h with a txgbe-private
> prefix so the driver no longer depends on the legacy ABI. The
> embedded rte_eth_ipv4_flow / rte_eth_ipv6_flow types are cloned
> too since they live in the same removal candidate set.
>
> Unlike ixgbe, txgbe base/ does not pre-declare an
> enum txgbe_fdir_pballoc_type, so the cloned one is defined here.
> txgbe uses the integer value of pballoc directly in the table-
> size calculation
>
> (1024 << (fdir_conf->pballoc + 1)) - 2
>
> so the enum values match the original ethdev numbering
> (64K=0, 128K=1, 256K=2). pballoc is set explicitly from devargs
> in txgbe_handle_devarg(), so no extra initialization is required.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/net/txgbe/txgbe_ethdev.c | 6 +-
> drivers/net/txgbe/txgbe_ethdev.h | 101 +++++++++++++++++++++-
> drivers/net/txgbe/txgbe_fdir.c | 78 ++++++++---------
> drivers/net/txgbe/txgbe_flow.c | 24 ++---
> drivers/net/txgbe/txgbe_rxtx_vec_common.h | 4 +-
> 5 files changed, 155 insertions(+), 58 deletions(-)
LGTM, thanks.
> diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
> index 5d360f8305..258ec4d97c 100644
> --- a/drivers/net/txgbe/txgbe_ethdev.c
> +++ b/drivers/net/txgbe/txgbe_ethdev.c
> @@ -524,7 +524,7 @@ txgbe_handle_devarg(__rte_unused const char *key, const char *value,
> static void
> txgbe_parse_devargs(struct rte_eth_dev *dev)
> {
> - struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
> + struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
> struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> struct rte_devargs *devargs = pci_dev->device.devargs;
> struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
> @@ -934,7 +934,7 @@ static int txgbe_l2_tn_filter_uninit(struct rte_eth_dev *eth_dev)
>
> int txgbe_fdir_filter_init(struct rte_eth_dev *eth_dev)
> {
> - struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(eth_dev);
> + struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(eth_dev);
> struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(eth_dev);
> char fdir_hash_name[RTE_HASH_NAMESIZE];
> u16 max_fdir_num = (1024 << (fdir_conf->pballoc + 1)) - 2;
> @@ -1834,7 +1834,7 @@ txgbe_dev_start(struct rte_eth_dev *dev)
> txgbe_configure_port(dev);
> txgbe_configure_dcb(dev);
>
> - if (TXGBE_DEV_FDIR_CONF(dev)->mode != RTE_FDIR_MODE_NONE) {
> + if (TXGBE_DEV_FDIR_CONF(dev)->mode != TXGBE_FDIR_MODE_NONE) {
> err = txgbe_fdir_configure(dev);
> if (err)
> goto error;
> diff --git a/drivers/net/txgbe/txgbe_ethdev.h b/drivers/net/txgbe/txgbe_ethdev.h
> index 189fbac541..1f4ce4f3b8 100644
> --- a/drivers/net/txgbe/txgbe_ethdev.h
> +++ b/drivers/net/txgbe/txgbe_ethdev.h
> @@ -83,6 +83,103 @@
> /*
> * Information about the fdir mode.
> */
> +/*
> + * Privatized flow director configuration types.
> + *
> + * Cloned from <rte_eth_ctrl.h> and <ethdev_driver.h> so that txgbe no
> + * longer depends on the legacy ethdev flow director ABI, which is
> + * scheduled for removal in DPDK 26.11. Semantics unchanged; only the
> + * names are txgbe-private.
> + *
> + * NB: txgbe uses the integer value of pballoc directly in
> + * (1024 << (fdir_conf->pballoc + 1)) - 2
> + * to size the HW filter table. The enum values therefore match the
> + * original ethdev numbering (64K=0, 128K=1, 256K=2).
> + */
> +#define TXGBE_FDIR_MAX_FLEXLEN 16 /**< Max length of flexbytes. */
> +
> +struct txgbe_ipv4_flow {
> + uint32_t src_ip;
> + uint32_t dst_ip;
> + uint8_t tos;
> + uint8_t ttl;
> + uint8_t proto;
> +};
> +
> +struct txgbe_ipv6_flow {
> + uint32_t src_ip[4];
> + uint32_t dst_ip[4];
> + uint8_t tc;
> + uint8_t proto;
> + uint8_t hop_limits;
> +};
> +
> +struct txgbe_fdir_masks {
> + uint16_t vlan_tci_mask;
> + struct txgbe_ipv4_flow ipv4_mask;
> + struct txgbe_ipv6_flow ipv6_mask;
> + uint16_t src_port_mask;
> + uint16_t dst_port_mask;
> + uint8_t mac_addr_byte_mask;
> + uint32_t tunnel_id_mask;
> + uint8_t tunnel_type_mask;
> +};
> +
> +enum txgbe_payload_type {
> + TXGBE_PAYLOAD_UNKNOWN = 0,
> + TXGBE_RAW_PAYLOAD,
> + TXGBE_L2_PAYLOAD,
> + TXGBE_L3_PAYLOAD,
> + TXGBE_L4_PAYLOAD,
> + TXGBE_PAYLOAD_MAX = 8,
> +};
> +
> +struct txgbe_flex_payload_cfg {
> + enum txgbe_payload_type type;
> + uint16_t src_offset[TXGBE_FDIR_MAX_FLEXLEN];
> +};
> +
> +struct txgbe_fdir_flex_mask {
> + uint16_t flow_type;
> + uint8_t mask[TXGBE_FDIR_MAX_FLEXLEN];
> +};
> +
> +struct txgbe_fdir_flex_conf {
> + uint16_t nb_payloads;
> + uint16_t nb_flexmasks;
> + struct txgbe_flex_payload_cfg flex_set[TXGBE_PAYLOAD_MAX];
> + struct txgbe_fdir_flex_mask flex_mask[RTE_ETH_FLOW_MAX];
> +};
> +
> +enum txgbe_fdir_mode {
> + TXGBE_FDIR_MODE_NONE = 0,
> + TXGBE_FDIR_MODE_SIGNATURE,
> + TXGBE_FDIR_MODE_PERFECT,
> + TXGBE_FDIR_MODE_PERFECT_MAC_VLAN,
> + TXGBE_FDIR_MODE_PERFECT_TUNNEL,
> +};
> +
> +enum txgbe_fdir_pballoc_type {
> + TXGBE_FDIR_PBALLOC_64K = 0,
> + TXGBE_FDIR_PBALLOC_128K,
> + TXGBE_FDIR_PBALLOC_256K,
> +};
> +
> +enum txgbe_fdir_status_mode {
> + TXGBE_FDIR_NO_REPORT_STATUS = 0,
> + TXGBE_FDIR_REPORT_STATUS,
> + TXGBE_FDIR_REPORT_STATUS_ALWAYS,
> +};
> +
> +struct txgbe_fdir_conf {
> + enum txgbe_fdir_mode mode;
> + enum txgbe_fdir_pballoc_type pballoc;
> + enum txgbe_fdir_status_mode status;
> + uint8_t drop_queue;
> + struct txgbe_fdir_masks mask;
> + struct txgbe_fdir_flex_conf flex_conf;
> +};
> +
> struct txgbe_hw_fdir_mask {
> uint16_t vlan_tci_mask;
> uint32_t src_ipv4_mask;
> @@ -111,7 +208,7 @@ struct txgbe_fdir_rule {
> struct txgbe_atr_input input; /* key of fdir filter */
> bool b_spec; /* If TRUE, input, fdirflags, queue have meaning. */
> bool b_mask; /* If TRUE, mask has meaning. */
> - enum rte_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
> + enum txgbe_fdir_mode mode; /* IP, MAC VLAN, Tunnel */
> uint32_t fdirflags; /* drop or forward */
> uint32_t soft_id; /* an unique value for this rule */
> uint8_t queue; /* assigned rx queue */
> @@ -352,7 +449,7 @@ struct txgbe_tm_conf {
> struct txgbe_adapter {
> struct txgbe_hw hw;
> struct txgbe_hw_stats stats;
> - struct rte_eth_fdir_conf fdir_conf;
> + struct txgbe_fdir_conf fdir_conf;
> struct txgbe_hw_fdir_info fdir;
> struct txgbe_interrupt intr;
> struct txgbe_stat_mappings stat_mappings;
> diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
> index 67f586ffc7..ded01341a4 100644
> --- a/drivers/net/txgbe/txgbe_fdir.c
> +++ b/drivers/net/txgbe/txgbe_fdir.c
> @@ -102,22 +102,22 @@ txgbe_fdir_enable(struct txgbe_hw *hw, uint32_t fdirctrl)
> * flexbytes matching field, and drop queue (only for perfect matching mode).
> */
> static inline int
> -configure_fdir_flags(const struct rte_eth_fdir_conf *conf,
> +configure_fdir_flags(const struct txgbe_fdir_conf *conf,
> uint32_t *fdirctrl, uint32_t *flex)
> {
> *fdirctrl = 0;
> *flex = 0;
>
> switch (conf->pballoc) {
> - case RTE_ETH_FDIR_PBALLOC_64K:
> + case TXGBE_FDIR_PBALLOC_64K:
> /* 8k - 1 signature filters */
> *fdirctrl |= TXGBE_FDIRCTL_BUF_64K;
> break;
> - case RTE_ETH_FDIR_PBALLOC_128K:
> + case TXGBE_FDIR_PBALLOC_128K:
> /* 16k - 1 signature filters */
> *fdirctrl |= TXGBE_FDIRCTL_BUF_128K;
> break;
> - case RTE_ETH_FDIR_PBALLOC_256K:
> + case TXGBE_FDIR_PBALLOC_256K:
> /* 32k - 1 signature filters */
> *fdirctrl |= TXGBE_FDIRCTL_BUF_256K;
> break;
> @@ -129,14 +129,14 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf,
>
> /* status flags: write hash & swindex in the rx descriptor */
> switch (conf->status) {
> - case RTE_FDIR_NO_REPORT_STATUS:
> + case TXGBE_FDIR_NO_REPORT_STATUS:
> /* do nothing, default mode */
> break;
> - case RTE_FDIR_REPORT_STATUS:
> + case TXGBE_FDIR_REPORT_STATUS:
> /* report status when the packet matches a fdir rule */
> *fdirctrl |= TXGBE_FDIRCTL_REPORT_MATCH;
> break;
> - case RTE_FDIR_REPORT_STATUS_ALWAYS:
> + case TXGBE_FDIR_REPORT_STATUS_ALWAYS:
> /* always report status */
> *fdirctrl |= TXGBE_FDIRCTL_REPORT_ALWAYS;
> break;
> @@ -150,9 +150,9 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf,
> *flex |= TXGBE_FDIRFLEXCFG_OFST(TXGBE_DEFAULT_FLEXBYTES_OFFSET / 2);
>
> switch (conf->mode) {
> - case RTE_FDIR_MODE_SIGNATURE:
> + case TXGBE_FDIR_MODE_SIGNATURE:
> break;
> - case RTE_FDIR_MODE_PERFECT:
> + case TXGBE_FDIR_MODE_PERFECT:
> *fdirctrl |= TXGBE_FDIRCTL_PERFECT;
> *fdirctrl |= TXGBE_FDIRCTL_DROPQP(conf->drop_queue);
> break;
> @@ -179,7 +179,7 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
> {
> struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
> struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
> - enum rte_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
> + enum txgbe_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
> /*
> * mask VM pool and DIPv6 since there are currently not supported
> * mask FLEX byte, it will be set in flex_conf
> @@ -190,8 +190,8 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
>
> PMD_INIT_FUNC_TRACE();
>
> - if (mode != RTE_FDIR_MODE_SIGNATURE &&
> - mode != RTE_FDIR_MODE_PERFECT) {
> + if (mode != TXGBE_FDIR_MODE_SIGNATURE &&
> + mode != TXGBE_FDIR_MODE_PERFECT) {
> PMD_DRV_LOG(ERR, "Not supported fdir mode - %d!", mode);
> return -ENOTSUP;
> }
> @@ -232,14 +232,14 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
> static int
> txgbe_fdir_store_input_mask(struct rte_eth_dev *dev)
> {
> - struct rte_eth_fdir_masks *input_mask = &TXGBE_DEV_FDIR_CONF(dev)->mask;
> - enum rte_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
> + struct txgbe_fdir_masks *input_mask = &TXGBE_DEV_FDIR_CONF(dev)->mask;
> + enum txgbe_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
> struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
> uint16_t dst_ipv6m = 0;
> uint16_t src_ipv6m = 0;
>
> - if (mode != RTE_FDIR_MODE_SIGNATURE &&
> - mode != RTE_FDIR_MODE_PERFECT) {
> + if (mode != TXGBE_FDIR_MODE_SIGNATURE &&
> + mode != TXGBE_FDIR_MODE_PERFECT) {
> PMD_DRV_LOG(ERR, "Not supported fdir mode - %d!", mode);
> return -ENOTSUP;
> }
> @@ -304,12 +304,12 @@ txgbe_fdir_set_flexbytes_offset(struct rte_eth_dev *dev,
> static int
> txgbe_set_fdir_flex_conf(struct rte_eth_dev *dev, uint32_t flex)
> {
> - const struct rte_eth_fdir_flex_conf *conf =
> + const struct txgbe_fdir_flex_conf *conf =
> &TXGBE_DEV_FDIR_CONF(dev)->flex_conf;
> struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
> struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
> - const struct rte_eth_flex_payload_cfg *flex_cfg;
> - const struct rte_eth_fdir_flex_mask *flex_mask;
> + const struct txgbe_flex_payload_cfg *flex_cfg;
> + const struct txgbe_fdir_flex_mask *flex_mask;
> uint16_t flexbytes = 0;
> uint16_t i;
>
> @@ -322,7 +322,7 @@ txgbe_set_fdir_flex_conf(struct rte_eth_dev *dev, uint32_t flex)
>
> for (i = 0; i < conf->nb_payloads; i++) {
> flex_cfg = &conf->flex_set[i];
> - if (flex_cfg->type != RTE_ETH_RAW_PAYLOAD) {
> + if (flex_cfg->type != TXGBE_RAW_PAYLOAD) {
> PMD_DRV_LOG(ERR, "unsupported payload type.");
> return -EINVAL;
> }
> @@ -375,13 +375,13 @@ txgbe_fdir_configure(struct rte_eth_dev *dev)
> int err;
> uint32_t fdirctrl, flex, pbsize;
> int i;
> - enum rte_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
> + enum txgbe_fdir_mode mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
>
> PMD_INIT_FUNC_TRACE();
>
> /* supports mac-vlan and tunnel mode */
> - if (mode != RTE_FDIR_MODE_SIGNATURE &&
> - mode != RTE_FDIR_MODE_PERFECT)
> + if (mode != TXGBE_FDIR_MODE_SIGNATURE &&
> + mode != TXGBE_FDIR_MODE_PERFECT)
> return -ENOSYS;
>
> err = configure_fdir_flags(TXGBE_DEV_FDIR_CONF(dev), &fdirctrl, &flex);
> @@ -531,15 +531,15 @@ txgbe_atr_compute_hash(struct txgbe_atr_input *atr_input,
>
> static uint32_t
> atr_compute_perfect_hash(struct txgbe_atr_input *input,
> - enum rte_eth_fdir_pballoc_type pballoc)
> + enum txgbe_fdir_pballoc_type pballoc)
> {
> uint32_t bucket_hash;
>
> bucket_hash = txgbe_atr_compute_hash(input,
> TXGBE_ATR_BUCKET_HASH_KEY);
> - if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
> + if (pballoc == TXGBE_FDIR_PBALLOC_256K)
> bucket_hash &= PERFECT_BUCKET_256KB_HASH_MASK;
> - else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
> + else if (pballoc == TXGBE_FDIR_PBALLOC_128K)
> bucket_hash &= PERFECT_BUCKET_128KB_HASH_MASK;
> else
> bucket_hash &= PERFECT_BUCKET_64KB_HASH_MASK;
> @@ -574,15 +574,15 @@ txgbe_fdir_check_cmd_complete(struct txgbe_hw *hw, uint32_t *fdircmd)
> */
> static uint32_t
> atr_compute_signature_hash(struct txgbe_atr_input *input,
> - enum rte_eth_fdir_pballoc_type pballoc)
> + enum txgbe_fdir_pballoc_type pballoc)
> {
> uint32_t bucket_hash, sig_hash;
>
> bucket_hash = txgbe_atr_compute_hash(input,
> TXGBE_ATR_BUCKET_HASH_KEY);
> - if (pballoc == RTE_ETH_FDIR_PBALLOC_256K)
> + if (pballoc == TXGBE_FDIR_PBALLOC_256K)
> bucket_hash &= SIG_BUCKET_256KB_HASH_MASK;
> - else if (pballoc == RTE_ETH_FDIR_PBALLOC_128K)
> + else if (pballoc == TXGBE_FDIR_PBALLOC_128K)
> bucket_hash &= SIG_BUCKET_128KB_HASH_MASK;
> else
> bucket_hash &= SIG_BUCKET_64KB_HASH_MASK;
> @@ -603,7 +603,7 @@ static int
> fdir_write_perfect_filter(struct txgbe_hw *hw,
> struct txgbe_atr_input *input, uint8_t queue,
> uint32_t fdircmd, uint32_t fdirhash,
> - enum rte_fdir_mode mode)
> + enum txgbe_fdir_mode mode)
> {
> uint32_t fdirport, fdirflex;
> int err = 0;
> @@ -830,14 +830,14 @@ txgbe_fdir_filter_program(struct rte_eth_dev *dev,
> bool is_perfect = FALSE;
> int err;
> struct txgbe_hw_fdir_info *info = TXGBE_DEV_FDIR(dev);
> - enum rte_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
> + enum txgbe_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
> struct txgbe_fdir_filter *node;
>
> - if (fdir_mode == RTE_FDIR_MODE_NONE ||
> + if (fdir_mode == TXGBE_FDIR_MODE_NONE ||
> fdir_mode != rule->mode)
> return -ENOTSUP;
>
> - if (fdir_mode >= RTE_FDIR_MODE_PERFECT)
> + if (fdir_mode >= TXGBE_FDIR_MODE_PERFECT)
> is_perfect = TRUE;
>
> txgbe_fdir_mask_input(&info->mask, &rule->input);
> @@ -1021,7 +1021,7 @@ txgbevf_fdir_filter_program(struct rte_eth_dev *dev,
> uint32_t fdirhash;
> int ret;
>
> - if (rule->mode != RTE_FDIR_MODE_PERFECT ||
> + if (rule->mode != TXGBE_FDIR_MODE_PERFECT ||
> rule->fdirflags == TXGBE_FDIRPICMD_DROP)
> return -ENOTSUP;
>
> @@ -1109,10 +1109,10 @@ txgbe_fdir_filter_restore(struct rte_eth_dev *dev)
> struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(dev);
> struct txgbe_fdir_filter *node;
> bool is_perfect = FALSE;
> - enum rte_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
> + enum txgbe_fdir_mode fdir_mode = TXGBE_DEV_FDIR_CONF(dev)->mode;
>
> - if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
> - fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
> + if (fdir_mode >= TXGBE_FDIR_MODE_PERFECT &&
> + fdir_mode <= TXGBE_FDIR_MODE_PERFECT_TUNNEL)
> is_perfect = TRUE;
>
> if (is_perfect) {
> @@ -1139,7 +1139,7 @@ txgbe_fdir_filter_restore(struct rte_eth_dev *dev)
> int
> txgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
> {
> - struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
> + struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
> struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(dev);
> struct txgbe_fdir_filter *fdir_filter;
> struct txgbe_fdir_filter *filter_flag;
> @@ -1150,7 +1150,7 @@ txgbe_clear_all_fdir_filter(struct rte_eth_dev *dev)
> memset(fdir_info->hash_map, 0,
> sizeof(struct txgbe_fdir_filter *) *
> ((1024 << (fdir_conf->pballoc + 1)) - 2));
> - fdir_conf->mode = RTE_FDIR_MODE_NONE;
> + fdir_conf->mode = TXGBE_FDIR_MODE_NONE;
> filter_flag = TAILQ_FIRST(&fdir_info->fdir_list);
> while ((fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list))) {
> TAILQ_REMOVE(&fdir_info->fdir_list,
> diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
> index a97588e57a..8470bf78af 100644
> --- a/drivers/net/txgbe/txgbe_flow.c
> +++ b/drivers/net/txgbe/txgbe_flow.c
> @@ -1412,7 +1412,7 @@ txgbe_parse_fdir_act_attr(const struct rte_flow_attr *attr,
> rule->queue = act_q->index;
> } else { /* drop */
> /* signature mode does not support drop action. */
> - if (rule->mode == RTE_FDIR_MODE_SIGNATURE) {
> + if (rule->mode == TXGBE_FDIR_MODE_SIGNATURE) {
> memset(rule, 0, sizeof(struct txgbe_fdir_rule));
> rte_flow_error_set(error, EINVAL,
> RTE_FLOW_ERROR_TYPE_ACTION,
> @@ -1646,9 +1646,9 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
> }
>
> if (signature_match(pattern))
> - rule->mode = RTE_FDIR_MODE_SIGNATURE;
> + rule->mode = TXGBE_FDIR_MODE_SIGNATURE;
> else
> - rule->mode = RTE_FDIR_MODE_PERFECT;
> + rule->mode = TXGBE_FDIR_MODE_PERFECT;
>
> /*Not supported last point for range*/
> if (item->last) {
> @@ -1678,7 +1678,7 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
>
> /* Ether type should be masked. */
> if (eth_mask->hdr.ether_type ||
> - rule->mode == RTE_FDIR_MODE_SIGNATURE) {
> + rule->mode == TXGBE_FDIR_MODE_SIGNATURE) {
> memset(rule, 0, sizeof(struct txgbe_fdir_rule));
> rte_flow_error_set(error, EINVAL,
> RTE_FLOW_ERROR_TYPE_ITEM,
> @@ -1687,7 +1687,7 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
> }
>
> /* If ethernet has meaning, it means MAC VLAN mode. */
> - rule->mode = RTE_FDIR_MODE_PERFECT_MAC_VLAN;
> + rule->mode = TXGBE_FDIR_MODE_PERFECT_MAC_VLAN;
>
> /**
> * src MAC address must be masked,
> @@ -1718,7 +1718,7 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
> * IPv6 is not supported.
> */
> item = next_no_fuzzy_pattern(pattern, item);
> - if (rule->mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
> + if (rule->mode == TXGBE_FDIR_MODE_PERFECT_MAC_VLAN) {
> if (item->type != RTE_FLOW_ITEM_TYPE_VLAN) {
> memset(rule, 0, sizeof(struct txgbe_fdir_rule));
> rte_flow_error_set(error, EINVAL,
> @@ -2282,7 +2282,7 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
> return -rte_errno;
> }
>
> - rule->mode = RTE_FDIR_MODE_PERFECT;
> + rule->mode = TXGBE_FDIR_MODE_PERFECT;
> ptid = TXGBE_PTID_PKT_TUN;
>
> /* Skip MAC. */
> @@ -2949,7 +2949,7 @@ txgbe_parse_fdir_filter(struct rte_eth_dev *dev,
> struct rte_flow_error *error)
> {
> int ret;
> - struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
> + struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
>
> ret = txgbe_parse_fdir_filter_normal(dev, attr, pattern,
> actions, rule, error);
> @@ -2965,11 +2965,11 @@ txgbe_parse_fdir_filter(struct rte_eth_dev *dev,
> if (!txgbe_is_pf(TXGBE_DEV_HW(dev)))
> return ret;
>
> - if (fdir_conf->mode == RTE_FDIR_MODE_NONE) {
> + if (fdir_conf->mode == TXGBE_FDIR_MODE_NONE) {
> fdir_conf->mode = rule->mode;
> ret = txgbe_fdir_configure(dev);
> if (ret) {
> - fdir_conf->mode = RTE_FDIR_MODE_NONE;
> + fdir_conf->mode = TXGBE_FDIR_MODE_NONE;
> return ret;
> }
> } else if (fdir_conf->mode != rule->mode) {
> @@ -3562,7 +3562,7 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
> struct txgbe_fdir_rule_ele *fdir_rule_ptr;
> struct txgbe_flow_mem *txgbe_flow_mem_ptr;
> struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(dev);
> - struct rte_eth_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
> + struct txgbe_fdir_conf *fdir_conf = TXGBE_DEV_FDIR_CONF(dev);
> struct txgbe_rss_conf_ele *rss_filter_ptr;
>
> switch (filter_type) {
> @@ -3625,7 +3625,7 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
> fdir_info->mask_added = false;
> fdir_info->flex_relative = false;
> fdir_info->flex_bytes_offset = 0;
> - fdir_conf->mode = RTE_FDIR_MODE_NONE;
> + fdir_conf->mode = TXGBE_FDIR_MODE_NONE;
> }
> }
> break;
> diff --git a/drivers/net/txgbe/txgbe_rxtx_vec_common.h b/drivers/net/txgbe/txgbe_rxtx_vec_common.h
> index 00847d087b..c6144cad70 100644
> --- a/drivers/net/txgbe/txgbe_rxtx_vec_common.h
> +++ b/drivers/net/txgbe/txgbe_rxtx_vec_common.h
> @@ -299,10 +299,10 @@ static inline int
> txgbe_rx_vec_dev_conf_condition_check_default(struct rte_eth_dev *dev)
> {
> #ifndef RTE_LIBRTE_IEEE1588
> - struct rte_eth_fdir_conf *fconf = TXGBE_DEV_FDIR_CONF(dev);
> + struct txgbe_fdir_conf *fconf = TXGBE_DEV_FDIR_CONF(dev);
>
> /* no fdir support */
> - if (fconf->mode != RTE_FDIR_MODE_NONE)
> + if (fconf->mode != TXGBE_FDIR_MODE_NONE)
> return -1;
>
> return 0;
> --
> 2.53.0
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread