From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UocSAufxrjTPxMKTxO6y0Y4N3E5pttzUMmQDoa6pjnA=; b=UMK9KGspIVp97JLqZ1VmHzu2T+da7MAg+EqnAKumitYKBTKteZNXJzBNaMPisz39mw GfZW9XoeApW/TFkkca+zjgFY5M83gD0q9eyTfn9L86YELo/WRAQ7dbqKqGLXq+oaeAYu fuAqbQ3bpP5M2c1fjE3wL8e7VR1kAeoRapTrW4eOIsLeTiWFS1vwntPwdyc3fhcylXIM GleMg3IZQuszPCFjDihB+Bwpb+0WEUnYoZJLOHFCXSqxESh1kUQKwSLbgvPM8T2TLG2a vGeQQX3m5m92oq6INxrb1vouzWzHGhoT8SH6RMJGiK8RcTkExnCsWD7+C65E1n6M8nSt gU9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UocSAufxrjTPxMKTxO6y0Y4N3E5pttzUMmQDoa6pjnA=; b=HUyLuMQkd2zOIJfwiX2C8kdlrf3cw9sPytIHEsnObilaMEWia8kWQhOxE7/ULoDMGU RyPIEeE3sDm/DPWj3FTdAuiBTavvKoLO0mCU9R4Z9MkQ1+pIIQ5LWHYPBgBLEHwq0ptn cZbjPyJ9/7vIo2pyfZAkHbiz2/DRyOzbeb9YNaKZJ3ZYPePS25IAyYCUd/KpBsRa7E3t gX3DWBLACrbRPQ/P8mzg/bardqBqaykPBkEkgGIBj8O5OyG/izRm2czSmciqxUHeV65U Xand9fLseoQPpx0A7xoHqKiIXR66tXU3kuAWy/sMhM/lDW/SDAYUe4S27rGTOmMcj8vX rsyw== X-Gm-Message-State: AElRT7GBoIAynaJdmw5dJ7dR3jZAf5dxUGI7r6A+xVxRAxImfE3TAGQP jwT8VcoEqy9APG7K1jKQLRwtY6He X-Google-Smtp-Source: AIpwx4+tEhwH9uJ2s8y1kBBaeqGAzXnbyN0NV+kQ227bh7FMpIzo4aFHmcPnCM6+lR0aFxtqal0pOw== X-Received: by 10.223.160.195 with SMTP id n3mr11001524wrn.92.1522770784180; Tue, 03 Apr 2018 08:53:04 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id p14sm6762488wrc.30.2018.04.03.08.53.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 08:53:03 -0700 (PDT) Date: Tue, 3 Apr 2018 17:52:50 +0200 From: Adrien Mazarguil To: Declan Doherty Cc: dev@dpdk.org 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 Content-Disposition: inline In-Reply-To: <20180328135433.20203-2-declan.doherty@intel.com> Subject: Re: [dpdk-dev] [PATCH v6 1/8] doc: add switch representation documentation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 15:53:04 -0000 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