From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: george.dit@gmail.com
Cc: Shahaf Shuler <shahafs@mellanox.com>, "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] DPDK application that sends rules to the NIC
Date: Mon, 18 Sep 2017 15:20:56 +0200 [thread overview]
Message-ID: <20170918132054.twz6ba3xnhubhpc4@shalom> (raw)
In-Reply-To: <CAN9HtFAN2reWWLY-zAPTraoyOh6z3TMkxZzJCsiCr+NjWRUZJw@mail.gmail.com>
Hi Georgios,
On Mon, Sep 18, 2017 at 05:26:08AM -0700, george.dit@gmail.com wrote:
> Dear all,
>
> I am implementing my own DPDK application to program a Mellanox NIC (mlx5
> driver) but I have some issues.
> Specifically I compose a simple rule that matches only the Ethernet
> header's type field using value 800 (Ethernet frames that encapsulate IPv4
> packets).
> Then I compose an action RTE_FLOW_ACTION_TYPE_QUEUE which redirects the
> matched packets to queue index 0.
>
> Using test-pmd, this rule is: "flow create 0 ingress pattern eth type is
> 800 / end actions queue index 0 / end" and I get a "Flow rule #0 created"
> message.
> In my application I compose the same rule using:
>
> PATTERNS
>
> struct rte_flow_item_eth flow_item_eth_type_ipv4 = {
> .dst = {
> .addr_bytes = { 0 }
> },
> .src = {
> .addr_bytes = { 0 }
> },
> .type = RTE_BE16(ETHER_TYPE_IPv4) // from rte_ether.h
> };
>
> struct rte_flow_item_eth flow_item_eth_mask_type_ipv4 = {
> .dst = {
> .addr_bytes = { 0 }
> },
> .src = {
> .addr_bytes = { 0 }
> },
> .type = 0xFFFF
> // match only the 'type' filed
> };
>
> struct rte_flow_item patterns[] = {
> {
> .type = RTE_FLOW_ITEM_TYPE_ETH,
> .spec = &flow_item_eth_type_ipv4,
> .last = NULL,
> .mask = &flow_item_eth_mask_type_ipv4,
> },
> {
> .type = RTE_FLOW_ITEM_TYPE_END,
> .spec = NULL,
> .last = NULL,
> .mask = NULL,
> }
> };
>
> ACTIONS
>
> struct rte_flow_action_queue queue_conf;
> queue_conf.index = 0;
>
> struct rte_flow_action actions[] =
> {
> {
> .type = RTE_FLOW_ACTION_TYPE_QUEUE,
> .conf = &queue_conf
> },
> {
> .type = RTE_FLOW_ACTION_TYPE_END,
> .conf = NULL
> }
> };
>
> PROBLEM
>
> When I pass this rule to rte_flow_validate(...) it is successfully
> validated, but rte_flow_create() crashes although it get the very same
> arguments.
Can you explain a little more what do you mean by "crash" ?
> If I replace my Mellanox NIC with an Intel 82599 (using DPDK's ixgbe
> driver), then the validate function returns error: "Caught error type 9
> (specific pattern item): Not supported by L2 tunnel filter".
> The error reported by the Intel driver is weird because there is no
> tunneling.
>
> I guess some value assignments require strict format and are sensitive
> (e.g., big/little endian) so I would really appreciate your help.
>
> Thanks in advance and best regards,
> Georgios
With so few informations it is not easy to help, from the code above I
don't see anything wrong. To help can you answer the following points:
- which version of DPDK are you using,
- which version of MLNX_OFED,
- Is it possible to share your snippet of code (just the pattern/action
allocation) ?
Regards,
--
Nélio Laranjeiro
6WIND
next prev parent reply other threads:[~2017-09-18 13:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-13 8:08 george.dit
2017-09-14 10:26 ` Shahaf Shuler
2017-09-14 11:37 ` george.dit
2017-09-18 12:26 ` george.dit
2017-09-18 13:20 ` Nélio Laranjeiro [this message]
2017-09-18 13:38 ` george.dit
2017-09-18 14:55 ` Nélio Laranjeiro
2017-09-18 14:58 ` george.dit
2017-09-19 9:43 ` george.dit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170918132054.twz6ba3xnhubhpc4@shalom \
--to=nelio.laranjeiro@6wind.com \
--cc=george.dit@gmail.com \
--cc=shahafs@mellanox.com \
--cc=users@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).