[dpdk-users] Flow Director feature on Fortville XL710 adapter not working

Arun M arun.m.b at gmail.com
Wed Apr 18 07:50:04 CEST 2018


Hello,

We use Flow director feature in i40e DPDK user space driver to steer the
packets onto a specific queue.
A rule is created to filter IPv4 packets on a specific combination of v4
Src IP and Dst IP.
DPDK user space APIs(DPDK 16.11.04) are used for the same.

However the packets do not get steered to the specific queue. Instead they
arrive on the remaining queues which are part of RSS group.
In our DPDK EAL application, we configure a Single port with 4 queues,
where queues (0,1) are configured in RSS group and the queue (2 & 3)  is
used for FDIR filter.

Below is details of fw and nvm version we are using.
i40e 0000:3b:00.0: fw 5.0.40043 api 1.5 nvm 5.05 0x80002cfb 0.0.0

Below is the Packet Dump of the packet which we are trying to steer to
Queue 3 of Port 0 for which we have created below FDIR Rule.

00000000: AB CD EF DE AD EB 70 AC BE AF 12 34 91 00 00 03 | ......p....4....

00000010: 08 00 45 00 00 3F 00 00 00 00 00 11 B7 E7 7F 04 | ..E..?..........

00000020: 01 01 7F 06 03 BC 27 10 27 10 00 2B 00 00 86 00 | ......'.'..+....

00000030: 01 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 | ................

00000040: 00 00 00 00 00 00 00 00 00 00 02 00 00 00 01 00 | ................

00000050: 00 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | .


Code Block 1 for Filter Input Set Select and Code block 2 for Flow Director
rule creation.
We tried two Filter options, ipv4-other and ip4-udp. In both case FDIR rule
was not hit.
DPDK version used is 16.11.04.  Are we missing something here?


Code Snippet For Configuring FDIR using DPDK APIs:


     portid = 0;

     /* Check FDIR Support and Flush FDIR Entries */

     retval = rte_eth_dev_filter_supported(portid, RTE_ETH_FILTER_FDIR);

     if (retval < 0) {

        rte_panic("flow director is not supported on port %u.\n",portid);

     }



     retval = rte_eth_dev_filter_ctrl(portid, RTE_ETH_FILTER_FDIR,

                        RTE_ETH_FILTER_FLUSH, NULL);

     if (retval < 0) {

        rte_panic("flow director table flushing error: (%s)\n",
strerror(-retval));

     }


     */* Start of Code Block 1  - For Input Set Select*/*
     struct rte_eth_fdir_filter_info filter_info;
     memset(&filter_info, 0, sizeof(filter_info));

     printf("Inside %s: Set Select filter Ctrl for %d \n", __func__,
port_id);
     filter_info.info_type = RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT;
#if 1
     /* Try flow-type ipv4-other */
     filter_info.info.input_set_conf.flow_type  =
*RTE_ETH_FLOW_NONFRAG_IPV4_OTHER*;
     filter_info.info.input_set_conf.inset_size = 2;
     filter_info.info.input_set_conf.field[0]   =
RTE_ETH_INPUT_SET_L3_SRC_IP4;
     filter_info.info.input_set_conf.field[1]   =
RTE_ETH_INPUT_SET_L3_DST_IP4;
#else
     /* Try flow-type ipv4-udp */
     filter_info.info.input_set_conf.flow_type  =
RTE_ETH_FLOW_NONFRAG_IPV4_UDP;
     filter_info.info.input_set_conf.inset_size = 2;
     filter_info.info.input_set_conf.field[0]   =
RTE_ETH_INPUT_SET_L3_DST_IP4;
     filter_info.info.input_set_conf.field[1]   =
RTE_ETH_INPUT_SET_L4_UDP_DST_PORT;
#endif
     filter_info.info.input_set_conf.op = RTE_ETH_INPUT_SET_SELECT;

     retval = rte_eth_dev_filter_ctrl(portid, RTE_ETH_FILTER_FDIR,
                RTE_ETH_FILTER_SET, &filter_info);
           if (retval != 0) {
           rte_panic("Error: Could not set fdir info: %s\n",
                      strerror(-retval));
     }
     */* End of Code Block 1 */*


     */* Start of Code Block 2 – For Flow Director Filter Rule creation */*
     struct rte_eth_fdir_filter entry;

     /* Create the filter data capture */
     memset(&entry, 0, sizeof(struct rte_eth_fdir_filter));
     entry.soft_id = 2;
#if 1
     entry.input.flow_type = RTE_ETH_FLOW_NONFRAG_IPV4_OTHER;
     entry.input.flow.ip4_flow.src_ip =  IPv4(0x7f, 0x04, 0x01, 0x01);  /*
0x7F040101 */
     entry.input.flow.ip4_flow.dst_ip =  IPv4(0x7f, 0x06, 0x03, 0xBC);  /*
0x7F0603BC - Dummy IP Address */
#else
     entry.input.flow_type =  RTE_ETH_FLOW_NONFRAG_IPV4_UDP;
     entry.input.flow.udp4_flow.ip.dst_ip   = IPv4(0x7f, 0x06, 0x03,
0xBC);
     entry.input.flow.udp4_flow.dst_port    = rte_cpu_to_be_16(10000);
#endif

     entry.action.*rx_queue = 3*;
           entry.action.behavior = RTE_ETH_FDIR_ACCEPT;
     entry.action.report_status = RTE_ETH_FDIR_NO_REPORT_STATUS;

     /* Create FDIR Filter Rule */
     retval = rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR,
                      RTE_ETH_FILTER_ADD, &entry);
     if (retval != 0) {
           rte_panic("Error: Could not add fdir UDP filter: %s\n",
                      strerror(-retval));
     }
     else {
           flag_is_port_fdir_initialised[portid] = 1;
           printf("Successfully added FDIR Filter Ctrl for NIC queue 3 of
Port 0\n");
     }

     /* fdir_create_filter_rule()  will help in initializing the flow
director table for portid
      * This takes time. So let us sleep(1), this will help in initializing
properly the table
      * before we go ahead for adding other filter
      */
     sleep(1);
     fdir_get_infos(portid);



Thank you & Regards,
Arun M


More information about the users mailing list