app/testpmd: add support for ixgbe FDIR configuration
RFC 5/5 app/testpmd: add support for ixgbe FDIR configuration
As annouced in deprecation.rst, the "rte_eth_conf.fdir_conf" field will be removed, but IXGBE generic flow still needs to depend on these configurations. This patch adds setting FDIR configuration for IXGBE PMD by calling private API.
Signed-off-by Chenxu Di <[email protected]>
--- app/test-pmd/parameters.c | 63 ++++++++++++++++++++++++++++++++++++++- app/test-pmd/testpmd.c | 28 +++++++++++++++++ app/test-pmd/testpmd.h | 3 ++ 3 files changed, 93 insertions(+), 1 deletion(-)
app/test-pmd/parameters.c +62 -1
@@ -42,6 +42,9 @@#ifdef RTE_LIBRTE_PMD_BOND #include <rte_eth_bond.h> #endif +#ifdef RTE_LIBRTE_IXGBE_PMD +#include <rte_pmd_ixgbe.h> +#endif #include <rte_flow.h> #include "testpmd.h"
@@ -935,6 +938,29 @@ launch_args_parse(int argc, char** argv)"none, signature, perfect, perfect-mac-vlan" " or perfect-tunnel\n" , optarg); +#ifdef RTE_LIBRTE_IXGBE_PMD +if (!strcmp (optarg,"signature" )) + ixgbe_fdir_conf.mode = +RTE_PMD_IXGBE_FDIR_MODE_SIGNATURE ; +else if (!strcmp (optarg,"perfect" )) + ixgbe_fdir_conf.mode = +RTE_PMD_IXGBE_FDIR_MODE_PERFECT ; +else if (!strcmp (optarg,"perfect-mac-vlan" )) + ixgbe_fdir_conf.mode = +RTE_PMD_IXGBE_FDIR_MODE_PERFECT_MAC_VLAN ; +else if (!strcmp (optarg,"perfect-tunnel" )) + ixgbe_fdir_conf.mode = +RTE_PMD_IXGBE_FDIR_MODE_PERFECT_TUNNEL ; +else if (!strcmp (optarg,"none" )) + ixgbe_fdir_conf.mode = +RTE_PMD_IXGBE_FDIR_MODE_NONE ; +else +rte_exit (EXIT_FAILURE , +"pkt-mode-invalid %s invalid - must be: " +"none, signature, perfect, perfect-mac-vlan" +" or perfect-tunnel\n" , + optarg); +#endif }if (!strcmp (lgopts[opt_idx].name,"pkt-filter-report-hash" )) {
@@ -952,6 +978,22 @@ launch_args_parse(int argc, char** argv)"pkt-filter-report-hash %s invalid " "- must be: none or match or always\n" , optarg); +#ifdef RTE_LIBRTE_IXGBE_PMD +if (!strcmp (optarg,"none" )) + ixgbe_fdir_conf.status = +RTE_PMD_IXGBE_FDIR_NO_REPORT_STATUS ; +else if (!strcmp (optarg,"match" )) + ixgbe_fdir_conf.status = +RTE_PMD_IXGBE_FDIR_REPORT_STATUS ; +else if (!strcmp (optarg,"always" )) + ixgbe_fdir_conf.status = +RTE_PMD_IXGBE_FDIR_REPORT_STATUS_ALWAYS ; +else +rte_exit (EXIT_FAILURE , +"pkt-filter-report-hash %s invalid " +"- must be: none or match or always\n" , + optarg); +#endif }if (!strcmp (lgopts[opt_idx].name,"pkt-filter-size" )) {if (!strcmp (optarg,"64K" ))
@@ -967,12 +1009,31 @@ launch_args_parse(int argc, char** argv)rte_exit (EXIT_FAILURE ,"pkt-filter-size %s invalid -" " must be: 64K or 128K or 256K\n" , optarg); +#ifdef RTE_LIBRTE_IXGBE_PMD +if (!strcmp (optarg,"64K" )) + ixgbe_fdir_conf.pballoc = +RTE_PMD_IXGBE_FDIR_PBALLOC_64K ; +else if (!strcmp (optarg,"128K" )) + ixgbe_fdir_conf.pballoc = +RTE_PMD_IXGBE_FDIR_PBALLOC_128K ; +else if (!strcmp (optarg,"256K" )) + ixgbe_fdir_conf.pballoc = +RTE_PMD_IXGBE_FDIR_PBALLOC_256K ; +else +rte_exit (EXIT_FAILURE ,"pkt-filter-size %s invalid -" +" must be: 64K or 128K or 256K\n" , + optarg); +#endif }if (!strcmp (lgopts[opt_idx].name,"pkt-filter-drop-queue" )) { n =atoi (optarg); -if (n >=0 ) +if (n >=0 ) { fdir_conf.drop_queue = (uint8_t ) n; +#ifdef RTE_LIBRTE_IXGBE_PMD + ixgbe_fdir_conf.drop_queue = (uint8_t ) n; +#endif + }else rte_exit (EXIT_FAILURE , "drop queue %d invalid - must"
app/test-pmd/testpmd.c +28 -0
@@ -459,6 +459,31 @@ struct rte_fdir_conf fdir_conf = { .drop_queue = 127, }; +#ifdef RTE_LIBRTE_IXGBE_PMD +struct rte_pmd_ixgbe_fdir_conf ixgbe_fdir_conf = { + .mode =RTE_PMD_IXGBE_FDIR_MODE_NONE , + .pballoc =RTE_PMD_IXGBE_FDIR_PBALLOC_64K , + .status =RTE_PMD_IXGBE_FDIR_REPORT_STATUS , + .mask = { + .vlan_tci_mask =0xFFEF , + .ipv4_mask = { + .src_ip =0xFFFFFFFF , + .dst_ip =0xFFFFFFFF , + }, + .ipv6_mask = { + .src_ip = {0xFFFFFFFF ,0xFFFFFFFF ,0xFFFFFFFF ,0xFFFFFFFF }, + .dst_ip = {0xFFFFFFFF ,0xFFFFFFFF ,0xFFFFFFFF ,0xFFFFFFFF }, + }, + .src_port_mask =0xFFFF , + .dst_port_mask =0xFFFF , + .mac_addr_byte_mask =0xFF , + .tunnel_type_mask =1 , + .tunnel_id_mask =0xFFFFFFFF , + }, + .drop_queue =127 , +}; +#endif +volatile int test_done =1 ;/* stop packet forwarding when set to 1. */ struct queue_stats_mappings tx_queue_stats_mappings_array[MAX_TX_QUEUE_STATS_MAPPINGS ];
@@ -3342,6 +3367,9 @@ init_port_config(void)RTE_ETH_FOREACH_DEV (pid) { port = &ports[pid]; port->dev_conf.fdir_conf = fdir_conf; +#ifdef RTE_LIBRTE_IXGBE_PMD +rte_pmd_ixgbe_update_fdir_conf (pid, ixgbe_fdir_conf); +#endif ret =eth_dev_info_get_print_err (pid, &port->dev_info);if (ret !=0 )
app/test-pmd/testpmd.h +3 -0
@@ -409,6 +409,9 @@ extern uint8_t bitrate_enabled;#endif extern struct rte_fdir_conf fdir_conf; +#ifdef RTE_LIBRTE_IXGBE_PMD +extern struct rte_pmd_ixgbe_fdir_conf ixgbe_fdir_conf; +#endif /* * Configuration of packet segments used by the "txonly" processing engine.
Signature · 1 line
2.17.1