DPDK usage discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: 曾懷恩 <the@csie.io>
Cc: 張敬昊 <frank@csie.io>, users@dpdk.org
Subject: Re: [dpdk-users] Flow director struct rte_flow_item_raw guild
Date: Fri, 10 May 2019 15:44:27 +0200	[thread overview]
Message-ID: <20190510134427.GG4284@6wind.com> (raw)
In-Reply-To: <BD5F2744-AA65-4C9E-BAD4-462C8F322FF6@csie.io>

On Fri, May 10, 2019 at 02:38:56PM +0800, 曾懷恩 wrote:
> Hi Adrien, thanks for reply and explanation 
> 
> I can understand the principle now.
> 
> However, I try to merge your rewriting code to mine and the ICMP packets seem not to fit this rule.
> 
> My ethernet card is Connectx-4 lx.

Bad news then, you can't match ICMP using RAW pattern items with mlx5
yet. According to "git grep -l RTE_FLOW_ITEM_TYPE_RAW drivers/net" so far
only e1000/igb, enic, i40e, ixgbe and softnic PMDs provide some form of
support for RTE_FLOW_ITEM_RAW.

> Can you give me some suggestion?

Since RTE_FLOW_ITEM_TYPE_ICMP is neither supported by mlx5, how about
directly matching the protocol field inside IPv4 headers?

 struct rte_flow_item_ipv4 item_ipv4[] = {
     {
         .hdr.next_proto_id = 0x01,
     },
     {
         .hdr.next_proto_id = 0xff,
     },
 };
 struct rte_flow_pattern pattern[] = {
     {
         .type = RTE_FLOW_ITEM_TYPE_IPV4,
         .spec = &item_ipv4[0],
         .mask = &item_ipv4[1],
     },
     {
         .type = RTE_FLOW_ITEM_TYPE_END,
     },
 };

Should be all it takes to match ICMPv4 packets. Compared to the RAW
approach, this one should also match ICMP traffic inside recognized VLAN,
QinQ and tunnel types (e.g. VXLAN) at no extra cost.

-- 
Adrien Mazarguil
6WIND

  reply	other threads:[~2019-05-10 13:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09  2:01 曾懷恩
2019-05-09  2:10 ` 張敬昊
2019-05-09  3:51   ` 曾懷恩
2019-05-09 12:38     ` Adrien Mazarguil
2019-05-10  6:38       ` 曾懷恩
2019-05-10 13:44         ` Adrien Mazarguil [this message]
2019-05-10 18:20           ` Huai-En Tseng
2019-05-13  8:49             ` Adrien Mazarguil
2019-05-16  5:34               ` 曾懷恩
2019-05-16  6:00                 ` Tom Barbette
2019-05-22  3:18                   ` 曾懷恩

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=20190510134427.GG4284@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=frank@csie.io \
    --cc=the@csie.io \
    --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).