[dpdk-dev] [PATCH v6 1/8] doc: add switch representation documentation

Adrien Mazarguil adrien.mazarguil at 6wind.com
Tue Apr 3 17:52:50 CEST 2018


Hi Declan,

On Wed, Mar 28, 2018 at 02:54:26PM +0100, Declan Doherty wrote:
> From: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
> 
> 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 <declan.doherty at intel.com>

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 <adrien.mazarguil at 6wind.com>

Thanks. More cosmetic comments below.

<snip>
> +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.

<snip>
> +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.

<snip>
> +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
> +    <http://dpdk.org/doc/guides/testpmd_app_ug/testpmd_funcs.html#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


More information about the dev mailing list