DPDK patches and discussions
 help / color / mirror / Atom feed
From: Le Scouarnec Nicolas <Nicolas.LeScouarnec@technicolor.com>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	"Lu, Wenzhuo" <wenzhuo.lu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] FW: Issues with ixgbe  and rte_flow
Date: Wed, 15 Mar 2017 14:29:44 +0000	[thread overview]
Message-ID: <CY4PR02MB2552867B760B0396E31FD2EAF6270@CY4PR02MB2552.namprd02.prod.outlook.com> (raw)
In-Reply-To: <20170315105344.GJ3790@6wind.com>

Hi Adrien, 

> > > > And about the tpid, ethertype. I have a thought that why we need it as it's
> > > duplicate with the item type. I think the initial design is just following the IEEE
> > > spec to define the structures so we will not miss anything. But why not do some
> > > optimization. For VLAN the tpid must be 0x8100, for IPv4, the ethertype must be
> > > 0x0800. So why bothering let APP provide them and driver check them? Seems
> > > we can just remove these fields from the structures, it can make things simpler.
> > > >
> > > > Adrien, as you're the maintainer of rte_flow, any thought about these ideas?
> > > Thanks.
> >
> > > Basically I think we must give users the flexibility to provide nonstandard TPIDs
> > > as well (there's apparently already a few), so we can't just leave it out entirely.
> > Agree that TPID or something else like that can be changed. But my point is when
> > using the filter, users don't care about the value of TPID, they only care about the
> > vlan packets should be filtered. The type already tells the driver that. 
> > No matter we use  the well-known or self-defined TPID, it's duplicate of vlan type.

> You're right about the usefulness of specifying TPID in most cases, however
> because the pattern is not arranged in the same order as the packet, users
> do not know what EtherType they should specify inside struct
> rte_flow_item_eth if they want to provide one, which I think will haunt us
> for a long time (Nicolas' feedback gave me this impression.)

> I 'm now convinced modifying rte_flow_eth_vlan could make this much clearer
> and intend to update the API accordingly. So far affected PMDs would be
> i40e, ixgbe, mlx4, mlx5, sfc and tap.

Overall, as a user, I feel one difficulty/complexity in using the API comes from the need to
specify both the stack of protocol (in type) and at each level the "next protocol type" of the header (in spec).
Then, the PMD has to check that what I specified as the "next protocol type" is coherent with the protocol
stack before setting up the filters. Basically, for a valid filter, I should always have
rte_flow_item[1].type == rte_flow_item[0].spec.type, and  rte_flow_item[2].type == rte_flow_item[1].spec.{type,next_protocol}
 (except for L2.5 protocol as I experienced, which makes thinks confusing). Couldn't the API leverage this fact so that I don't
need to specify the ether_type, TPID, next_protocol_id, ... which are redundant with rte_flow_item.type ?

Changing this wouldn't reduce the expressiveness of the filter, as long as there is a rte_flow_item type
CustomL3OverEthernet where you can specify the ether_type expected at L2, and a CustomL4OverIP
where you can specifiy the next protocol id at L3 (IP), and if needed to support custom TPID, CustomVLANOverEthernet.
These would be used by a small minority of users, thus keeping the API simpler for users of most common protocols. 

Best regards,

-- 
Nicolas Le Scouarnec

  reply	other threads:[~2017-03-15 14:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 11:11 [dpdk-dev] " Le Scouarnec Nicolas
2017-03-08  3:16 ` Lu, Wenzhuo
2017-03-08  9:24   ` Le Scouarnec Nicolas
2017-03-08 15:41     ` Adrien Mazarguil
     [not found]       ` <CY4PR02MB2552362D11FE183F45F37596F62E0@CY4PR02MB2552.namprd02.prod.outlook.com>
     [not found]         ` <6A0DE07E22DDAD4C9103DF62FEBC09093B56DC90@shsmsx102.ccr.corp.intel.com>
     [not found]           ` <6A0DE07E22DDAD4C9103DF62FEBC09093B56E40A@shsmsx102.ccr.corp.intel.com>
2017-03-10 11:46             ` [dpdk-dev] FW: " Adrien Mazarguil
2017-03-13  2:33               ` Lu, Wenzhuo
2017-03-15 10:53                 ` Adrien Mazarguil
2017-03-15 14:29                   ` Le Scouarnec Nicolas [this message]
2017-03-15 16:01                     ` Adrien Mazarguil
2017-03-16 17:01                       ` Le Scouarnec Nicolas
2017-03-17  9:34                         ` Adrien Mazarguil

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=CY4PR02MB2552867B760B0396E31FD2EAF6270@CY4PR02MB2552.namprd02.prod.outlook.com \
    --to=nicolas.lescouarnec@technicolor.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /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).