DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] Flow Director feature on Fortville XL710 adapter not working
@ 2018-04-18  5:50 Arun M
  2018-04-18 10:20 ` Richard Nutman
  0 siblings, 1 reply; 3+ messages in thread
From: Arun M @ 2018-04-18  5:50 UTC (permalink / raw)
  To: users

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] Flow Director feature on Fortville XL710 adapter not working
  2018-04-18  5:50 [dpdk-users] Flow Director feature on Fortville XL710 adapter not working Arun M
@ 2018-04-18 10:20 ` Richard Nutman
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Nutman @ 2018-04-18 10:20 UTC (permalink / raw)
  To: users

Hi Arun,

I wasn't aware you could use RSS and the Flow Director simultaneously.

Are you setting the fdir_conf mode and mask in the rte_eth_conf structure ? Without the mask set, the Flow Director wont match the values you set in the Flow Director filter.

I'm not sure what the input selector achieves, we don’t use that in our Flow Director usage. Is this what allows RSS and Flow Director together ?

-Richard.

> -----Original Message-----
> From: Arun M [mailto:arun.m.b@gmail.com]
> Sent: 18 April 2018 06:50
> To: users@dpdk.org
> Subject: [dpdk-users] Flow Director feature on Fortville XL710 adapter
> not working
> 
> 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
---------------------------------------------------------------------------------------
This email has been scanned for email related threats and delivered safely by Mimecast.
For more information please visit http://www.mimecast.com
---------------------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] Flow Director feature on Fortville XL710 adapter not working
@ 2018-04-19  6:55 Arun M
  0 siblings, 0 replies; 3+ messages in thread
From: Arun M @ 2018-04-19  6:55 UTC (permalink / raw)
  To: users

Hi Richard,

Thank you Richard for replying.

As you mentioned, RSS and Flow director won't work simultaneously on a
Port. We patched the dpdk rss init (function: i40e_pf_config_rss) code to
make it work.
In our earlier platform, which uses Intel Niantic, 82599, we were able to
make both RSS and Flow director working with older versions (DPDK 1.2 and
1.6)

But anyway, I tried FDIR testing with, RSS disabled and still the packets
are not steered to the right queue.

My understanding regrading input set is, to make new FDIR APIs work for
i40e, we need to set Input Selector. I am also using this APIs for the
first time.

Below fdir_conf is also used.

.fdir_conf = {
        .mode = RTE_FDIR_MODE_PERFECT,
        .pballoc = RTE_FDIR_PBALLOC_64K,
        .status = RTE_FDIR_REPORT_STATUS,
        .mask = {
            .vlan_tci_mask = 0x0,
            .ipv4_mask     = {
                .src_ip = 0xFFFFFFFF,
                .dst_ip = 0xFFFFFFFF,
            },
            .ipv6_mask     = {
                .src_ip = {0x0, 0x0, 0x0, 0x0},
                .dst_ip = {0x0, 0x0, 0x0, 0x0},
            },
            .src_port_mask = 0x0,
            .dst_port_mask = 0x0,
            .mac_addr_byte_mask = 0x0,
            .tunnel_type_mask = 0,
            .tunnel_id_mask = 0x0,
        },

Thanks & Regards,
Arun M

On Wed,  Apr 18, at 12:20 PM,  Richard Nutman Richard.Nutman at s-a-m.com
wrote:

> Hi Arun,
>
> I wasn't aware you could use RSS and the Flow Director simultaneously.
>
> Are you setting the fdir_conf mode and mask in the rte_eth_conf structure
? Without the mask set, the Flow Director wont match the values you set in
the Flow Director filter.
>
> I'm not sure what the input selector achieves, we don’t use that in our
Flow Director usage. Is this what allows RSS and Flow Director together ?
>
> -Richard.
>
> > -----Original Message-----
> > From: Arun M [mailto:arun.m.b at gmail.com]
> > Sent: 18 April 2018 06:50
> > To: users at dpdk.org
> > Subject: [dpdk-users] Flow Director feature on Fortville XL710 adapter
> > not working
> >
> > 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-19  6:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18  5:50 [dpdk-users] Flow Director feature on Fortville XL710 adapter not working Arun M
2018-04-18 10:20 ` Richard Nutman
2018-04-19  6:55 Arun M

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).