DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Ferruh Yigit" <ferruh.yigit@amd.com>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"Ori Kam" <orika@nvidia.com>,
	"Jerin Jacob" <jerinjacobk@gmail.com>
Cc: "NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"jerinj@marvell.com" <jerinj@marvell.com>,
	"techboard@dpdk.org" <techboard@dpdk.org>,
	"Mcnamara, John" <john.mcnamara@intel.com>,
	"Zhang, Helin" <helin.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] ethdev: introduce generic flow item and action
Date: Wed, 16 Aug 2023 17:18:44 +0000	[thread overview]
Message-ID: <DS0PR11MB744263C791B7FE9231CDE12BEB15A@DS0PR11MB7442.namprd11.prod.outlook.com> (raw)
In-Reply-To: <2bb39705-9d3d-cc00-213f-2aeea81cdf2b@amd.com>



> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: Wednesday, August 16, 2023 6:08 PM
> To: Morten Brørup <mb@smartsharesystems.com>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Ori
> Kam <orika@nvidia.com>; Jerin Jacob <jerinjacobk@gmail.com>
> Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> david.marchand@redhat.com; Richardson, Bruce
> <bruce.richardson@intel.com>; jerinj@marvell.com; techboard@dpdk.org;
> Mcnamara, John <john.mcnamara@intel.com>; Zhang, Helin
> <helin.zhang@intel.com>; dev@dpdk.org
> Subject: Re: [PATCH] ethdev: introduce generic flow item and action
> 
> On 8/16/2023 3:20 PM, Morten Brørup wrote:
> >> From: Dumitrescu, Cristian [mailto:cristian.dumitrescu@intel.com]
> >> Sent: Wednesday, 16 August 2023 15.23
> >>
> >> Hi Morten,
> >>
> >> <snip>
> >>
> >>>>>
> >>>>> In order to avoid conflicts between P4 and non-P4 generic flow
> >>>> items/actions,
> >>>>> the generic type should include information about how to interpret the
> >>>>> information, which is why I suggest making it a Vendor-Specific type,
> >> with
> >>>>> vendor-specific TLV's (managed by the vendor), like the RADIUS
> Vendor-
> >>>>> Specific attributes I compared to, instead of just an opaque blob.
> >>>>
> >>>> I like this idea, but it is not necessary to introduce a vendor-specific
> >> type,
> >>>> it could be considered a device-specific type (or port-specific in the
> >> context
> >>>> of DPDK).
> >>>>
> >>>> However, the PMD can manage a dictionary, enabling users to query
> about
> >>> the
> >>>> format of each generic item or action if we can expose a set of query
> >> APIs.
> >>>>
> >>>> But I guess we don't need vendor-id / vendor-type as RADIUS does, as
> we
> >>> have
> >>>> port_id here.
> >>>
> >>> If the flow item itself doesn't have a "type" field (identifying how to
> >> interpret
> >>> the blob), you might have two different NICs using each their own blob
> >>> format. The NIC must be able to determine if a given flow item is of a
> type
> >> it
> >>> can understand, before it tries to parse the blob in it.
> >>>
> >>> This is why the "struct rte_flow_item" has a "type" field. It tells the HW
> >> how
> >>> to interpret the values in a flow item.
> >>>
> >>> If we introduce a "generic" flow item type, it can only be used for
> multiple
> >>> purposes (i.e. both P4, but also other purposes than P4) if it has a "sub-
> >> type"
> >>> field. Otherwise, someone will create a "generic" flow item containing a
> P4
> >>> program and send it to a NIC, which uses the "generic" flow item type for
> >>> other program types, e.g. a cBPF program. And this cBPF capable NIC has
> no
> >>> way to detect that the blob in the flow item is not a cBPF program, but a
> P4
> >>> program. The P4 capable NIC will accept the P4 program, but will be
> confused
> >>> when sent the cBPF program understood by the first NIC.
> >>>
> >>> So I am suggesting that the "generic" flow items and actions follow an
> >> existing
> >>> and well known design patterns for how to identify the meaning of blobs:
> >>> Include a Vendor-ID followed by vendor-specific TLV formatted data.
> >>>
> >>> As I wrote initially, I am opposed to introducing uninterpretable blobs into
> >>> DPDK. Flow items/actions need to be well defined. Allowing "Vendor-
> Specific"
> >>> flow items/actions is a workaround that allows you to bypass the normal
> >>> standardization process.
> >>>
> >>
> >> I would be happy to add mechanisms to describe the user-defined flow
> items
> >> and actions in greater detail. Would you be able to provide some examples
> for
> >> your proposal for a flow item and a flow action of your choice, please?
> >> Thanks!
> >>
> >> One thing I would want to stress here: the flow items and flow actions are
> >> defined exclusively by the user (through their P4 program) without any
> >> knowledge or intervention from the HW vendor, so any TLVs / helper fields
> >> must be populated by the user as opposed to the HW vendor.
> >
> > Perhaps I have completely misunderstood this patch...
> >
> > I thought the purpose is for the user to define some generic flow items and
> actions, which are not in the list of DPDK standardized (and fully documented)
> RTE_FLOW items/actions, but are understood by a variety of programmable
> NICs from various HW vendors. In this case, each blob needs to be prefixed
> with a "type" field, so the HW can determine which of its processing engines
> needs to parse the blob. E.g. a NIC could have both a P4 processing engine
> and a BPF processing engine, so the blob needs to indicate which of the two
> engines to use for the provided flow item/action.
> >
> > But maybe the purpose is completely different. Is the purpose of this patch
> to introduce flow items and flow actions, which each make the HW perform a
> "callback" to the user application? In this case, only the user application
> (handling the "callbacks") can understand them, and thus they are completely
> opaque to everything else.
> >
> 
> @Morten, I agree that this is more "opaque" than "generic" and it is
> open to abuse.
> 
> As far as I understand, purpose is NOT to implement unsupported RTE_FLOW
> items/actions, if that is the case I agree with @Ori to figure out gaps
> and implement them.
> 

Exactly.

> 
> Purpose seems to provide control path for P4 pipelines.
> 

+1

> Each P4 pipeline implementation can have set of tables, used for match
> action for the pipeline, and these tables can be for anything, doesn't
> have to be standard net functions or protocols etc..
> 
> To be able to dynamically program the pipeline, someone needs the
> ability to program the tables, since these tables not limited to net
> functions it is not possible to address these tables by rte_flow patterns.
> Hence this opaque rte_flow pattern/action seems designed to dynamically
> update/control the pipeline.
> 

Yes.

> 
> If above understanding is correct, I suggest using a middle ground,
> instead of having wide open key/value based rte_flow item, rename it to
> RTE_FLOW_ITEM_TYPE_P4[SOMETHING],
> 
> and have "struct rte_flow_item_p4[something]" to include all relevant
> fields to program a P4 pipeline, like table_id/table_name, value etc..
> 
> This way new rte_flow item/action remains scoped and focused, but still
> flexible enough to program any type of P4 pipeline.
> 

If this approach would be acceptable, we'd be glad to go for it.

> 
> Also we don't need to maintain a unique vendor ID etc, although what is
> the table name/id, what it is for and what is the relevant action is HW
> (even pipeline) specific, there is nothing to collide per vendor to manage.
> With this approach code can be portable, same application can be used on
> top of different HW that implements exact same P4 pipelines (assuming
> driver implementations are complete.)
> 

Yes, flow items and actions are defined by the user, the vendor is happily
unaware about what the users are doing in their P4 programs.
> 
> 
> 
> 
> 
> 
> 
> 
> 


  reply	other threads:[~2023-08-16 17:20 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02 17:34 Qi Zhang
2023-08-02  9:37 ` Zhang, Qi Z
2023-08-02 10:25 ` Morten Brørup
2023-08-02 11:01   ` Morten Brørup
2023-08-02 11:21     ` Jerin Jacob
2023-08-02 14:06       ` Dumitrescu, Cristian
2023-08-02 15:24         ` Morten Brørup
2023-08-02 15:47           ` Ori Kam
2023-08-02 16:06             ` Ori Kam
2023-08-02 17:22               ` Dumitrescu, Cristian
2023-08-02 17:56                 ` Morten Brørup
2023-08-03  1:05                   ` Zhang, Qi Z
2023-08-03 13:57                     ` Morten Brørup
2023-08-16 13:23                       ` Dumitrescu, Cristian
2023-08-16 14:20                         ` Morten Brørup
2023-08-16 17:08                           ` Ferruh Yigit
2023-08-16 17:18                             ` Dumitrescu, Cristian [this message]
2023-08-16 16:19                         ` DPDK community: RTE_FLOW support for P4-programmable devices Dumitrescu, Cristian
2023-08-27  7:48                           ` Ori Kam
2023-08-28 16:12                             ` Dumitrescu, Cristian
2023-08-29  7:38                               ` Jerin Jacob
2023-08-29 10:18                                 ` Ferruh Yigit
2023-08-31 10:32                                   ` Ori Kam
2023-08-31 13:42                                     ` Stephen Hemminger
2023-09-01  2:07                                     ` Jerin Jacob
2023-09-01  6:57                                       ` Ori Kam
2023-09-01  9:52                                         ` Jerin Jacob
2023-09-04  7:45                                           ` Ferruh Yigit
2023-09-06  8:30                                             ` Ori Kam
2023-09-11 20:20                                         ` Dumitrescu, Cristian
2023-08-02 16:56             ` [PATCH] ethdev: introduce generic flow item and action Dumitrescu, Cristian
2023-08-03  8:39               ` Ori Kam
2023-08-16 13:12                 ` Dumitrescu, Cristian
2023-08-02 16:14           ` Dumitrescu, Cristian
2023-08-02 14:06   ` Dumitrescu, Cristian
2023-08-02 14:54     ` Morten Brørup

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=DS0PR11MB744263C791B7FE9231CDE12BEB15A@DS0PR11MB7442.namprd11.prod.outlook.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=helin.zhang@intel.com \
    --cc=jerinj@marvell.com \
    --cc=jerinjacobk@gmail.com \
    --cc=john.mcnamara@intel.com \
    --cc=mb@smartsharesystems.com \
    --cc=orika@nvidia.com \
    --cc=qi.z.zhang@intel.com \
    --cc=techboard@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).