From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH v6 1/8] doc: add switch representation documentation Date: Tue, 3 Apr 2018 17:52:50 +0200 Message-ID: <20180403155250.GE4957@6wind.com> References: <20180328135433.20203-1-declan.doherty@intel.com> <20180328135433.20203-2-declan.doherty@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Declan Doherty Return-path: Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) by dpdk.org (Postfix) with ESMTP id 741F51B7BC for ; Tue, 3 Apr 2018 17:53:04 +0200 (CEST) Received: by mail-wr0-f180.google.com with SMTP id y55so19209175wry.3 for ; Tue, 03 Apr 2018 08:53:04 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180328135433.20203-2-declan.doherty@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Declan, On Wed, Mar 28, 2018 at 02:54:26PM +0100, Declan Doherty wrote: > From: Adrien Mazarguil > > Add document to describe a model for representing switching capable > devices in DPDK, using a general ethdev port model and through port > representors.This document also details the port model and the > rte_flow semantics required for flow programming, as well as listing > some example use cases. > > Signed-off-by: Declan Doherty OK for using the text of my original RFC, however since I'm not the *commit* author, I suggest to make it yours with: git commit --amend --reset-author You can then include my SoB line: Signed-off-by: Adrien Mazarguil Thanks. More cosmetic comments below. > +Port Representors > +----------------- > + > +In many cases, traffic steering rules cannot be determined in advance; > +applications usually have to process a bit of traffic in software before > +thinking about offloading specific flows to hardware. > + > +Applications therefore need the ability to receive and inject traffic to > +various device endpoints (other VFs, PFs or physical ports) before > +connecting them together. Device drivers must provide means to hook the > +"other end" of these endpoints and to refer them when configuring flow > +rules. > + > +This role is left to so-called "port representors" (also known as "VF > +representors" in the specific context of VFs), which are to DPDK what the > +Ethernet switch device driver model (**switchdev**) [1]_ is to Linux, and > +which can be thought as a software "patch panel" front-end for applications. > + > +- DPDK port representors are implemented as additional virtual Ethernet > + device (**ethdev**) instances, spawned on an as needed basis through > + configuration parameters passed to the driver of the underlying > + device using devargs. > + > +:: > + > + -w pci:dbdf,representor=0 > + -w pci:dbdf,representor=[0-3] > + -w pci:dbdf,representor=[0,5-11] > + > +- As virtual devices, they may be more limited than their physical > + counterparts, for instance by exposing only a subset of device > + configuration callbacks and/or by not necessarily having Rx/Tx capability. > + > +- Among other things, they can be used to assign MAC addresses to the > + resource they represent. > + > +- Applications can tell port representors apart from other physcial of virtual > + port by checking the dev_flags field within their device information > + structure for the RTE_ETH_DEV_REPRESENTOR bit-field. > + > +.. code-block:: c > + > + struct rte_eth_dev_info { > + .. > + uint32_t dev_flags; /**< Device flags */ > + .. > + }; > + > +- The device or group relationship of ports can be discovered using the > + switch_id field within the device information structure. By default the > + switch_id of a port will be it's port_id but ports within the same switch > + domain will share the same *switch_id* which in the case of SR-IOV devices > + would align to the port_id of the physical function port. > + > +.. code-block:: c > + > + struct rte_eth_dev_info { > + .. > + uint16_t switch_id; /**< Switch Domain Id */ > + .. > + }; > + OK for these additions, note this section may have to be updated later depending on how the API settles (especially on the devargs side) according to discussions which are still going on. > +VF representors > +~~~~~~~~~~~~~~~ Looks like you capitalized all words in some section titles but missed others such as this one. I'm not a huge fan of capitalization in the middle of sentences and actually prefer the original form, but I know it's very common. So I don't mind which you choose, however it should be consistent across all section titles. > +Switching Examples > +------------------ > + > +This section provides practical examples based on the established Testpmd > +flow command syntax [2]_, in the context described in `traffic steering`_ > + > +:: > + > + .-------------. .-------------. .-------------. > + | hypervisor | | VM 1 | | VM 2 | > + | application | | application | | application | > + `--+---+---+--' `----------+--' `--+----------' > + | | | | | > + | | `-------------------. | | > + | `---------. | | | > + | | | | | > + .----(A)----. .----(B)----. .----(C)----. | | > + | port_id 3 | | port_id 4 | | port_id 5 | | | > + `-----+-----' `-----+-----' `-----+-----' | | > + | | | | | > + .-+--. .-----+-----. .-----+-----. .---+--. .--+---. > + | PF | | VF 1 rep. | | VF 2 rep. | | VF 1 | | VF 2 | > + `-+--' `-----+-----' `-----+-----' `--(D)-' `-(E)--' > + | | | | | > + | | .---------' | | > + `-----. | | .-----------------' | > + | | | | .---------------------' > + | | | | | > + .--|-------|---|---|---|--. > + | | | `---|---' | > + | | `-------' | > + | `---------. | > + `------------|------------' > + | > + .---(F)----. > + | physical | > + | port 0 | > + `----------' This diagram is a somewhat broken horizontally. > + > +By default, PF (**A**) can communicate with the physical port it is > +associated with (**F**), while VF 1 (**D**) and VF 2 (**E**) are isolated > +and restricted to communicate with the hypervisor application through their > +respective representors (**B** and **C**) if supported. > + > +Examples in subsequent sections apply to hypervisor applications only and > +are based on port representors **A**, **B** and **C**. > + > +.. [2] `Flow syntax > + ` Internal documentation links should not go through HTTP where possible but use the ":ref:`foo`" syntax, see doc/guides/contributing/documentation.rst. -- Adrien Mazarguil 6WIND