netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yuval Avnery <yuvalav@mellanox.com>
To: netdev@vger.kernel.org
Cc: jiri@mellanox.com, saeedm@mellanox.com, leon@kernel.org,
	davem@davemloft.net, jakub.kicinski@netronome.com,
	shuah@kernel.org, danielj@mellanox.com, parav@mellanox.com,
	andrew.gospodarek@broadcom.com, michael.chan@broadcom.com,
	Yuval Avnery <yuvalav@mellanox.com>
Subject: [PATCH net-next v2 06/10] Documentation: Add devlink-subdev documentation.
Date: Fri,  8 Nov 2019 18:18:42 +0200	[thread overview]
Message-ID: <1573229926-30040-7-git-send-email-yuvalav@mellanox.com> (raw)
In-Reply-To: <1573229926-30040-1-git-send-email-yuvalav@mellanox.com>

Add devlink-subdev documentation.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
---
 Documentation/networking/devlink-subdev.rst | 125 ++++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/networking/devlink-subdev.rst

diff --git a/Documentation/networking/devlink-subdev.rst b/Documentation/networking/devlink-subdev.rst
new file mode 100644
index 000000000000..724464111aac
--- /dev/null
+++ b/Documentation/networking/devlink-subdev.rst
@@ -0,0 +1,125 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+==============
+Devlink Subdev
+==============
+
+Introduction
+============
+The network ASIC may expose privileged and non-privileged (subdev) devices.
+A privileged user can control the parameters of the subdev through the
+privileged device.
+
+The network ASIC exposes PCI PF and SR-IOV VF device(s) to the host system
+where it is connected as PCIe end point. An administrator needs to manage
+attributes and resource of such PCI PF/VF such as MAC address, MSI-X vectors
+etc. in the ASIC.
+
+An administrator doesn't have access to the host system where the PCIe ASIC
+device is connected. In some use cases host system may not even be running Linux
+kernel where the PCIe PF and VF devices are enumerated.
+Currently, the networking ASIC exposes devlink interfaces for eswitch
+mamangement. However, there is no user interface to manage attributes and
+resources on the ASIC device.
+
+Additionally, the PCIe PF and VF devices may be of a different class
+than networking; such as NVMe, GPU, crypto or something else.
+For non-networking devices, there may not be any eswitch (eswitch ports).
+
+It is desirable to control common PCIe attributes and resources through
+common kernel infrastructure. Some of the attributes or resources may not be a
+port parameter, i.e. number of IRQ (MSI-X) vectors per PF/VF.
+
+An example system view of a networking ASIC (aka SmartNIC), can be seen in the
+below diagram, where devlink eswitch instance and PCI PF and/or VFs are
+situated on two different CPU subsystems::
+
+
+	  +------------------------------+
+	  |                              |
+	  |             HOST             |
+	  |                              |
+	  |   +----+-----+-----+-----+   |
+	  |   | PF | VF0 | VF1 | VF2 |   |
+	  +---+----+-----------+-----+---+
+        	     PCI1|
+	      +---+------------+
+        	  |
+	 +----------------------------------------+
+	 |        |         SmartNic              |
+	 |   +----+-------------------------+     |
+	 |   |                              |     |
+	 |   |               NIC            |     |
+	 |   |                              |     |
+	 |   +---------------------+--------+     |
+	 |                         |  PCI2        |
+	 |         +-----+---------+--+           |
+	 |               |                        |
+	 |      +-----+--+--+--------------+      |
+	 |      |     | PF  |              |      |
+	 |      |     +-----+              |      |
+	 |      |      Embedded CPU        |      |
+	 |      |                          |      |
+	 |      +--------------------------+      |
+	 |                                        |
+	 +----------------------------------------+
+
+The below diagram shows an example of devlink subdev topology where some
+subdevs are connected to devlink ports::
+
+
+
+            (PF0)    (VF0)    (VF1)           (NVME VF2)
+         +--------------------------+         +--------+
+         | devlink| devlink| devlink|         | devlink|
+         | subdev | subdev | subdev |         | subdev |
+         |    0   |    1   |    2   |         |    3   |
+         +--------------------------+         +--------+
+              |        |        |
+              |        |        |
+              |        |        |
+     +----------------------------------+
+     |   | devlink| devlink| devlink|   |
+     |   |  port  |  port  |  port  |   |
+     |   |    0   |    1   |    2   |   |
+     |   +--------------------------+   |
+     |                                  |
+     |                                  |
+     |           E-switch               |
+     |                                  |
+     |                                  |
+     |          +--------+              |
+     |          | uplink |              |
+     |          | devlink|              |
+     |          |  port  |              |
+     +----------------------------------+
+
+
+.. _Subdev-Flavours:
+
+Subdev flavours
+===============
+
+The ``devlink-subdev`` supports the following device flavours:
+
+  * ``pcipf``: exposes pf_index attribute.
+  * ``pcivf``: exposes vf_index and pf_index.
+
+.. _Subdev-Actions:
+
+Network attributes:
+==================
+
+The ``devlink-subdev`` may represent a network device and expose the following
+attributes:
+
+  * ``hw_addr``: The HW addr of the network device.
+  * ``port_index``: The ``devlink-port`` index associated with the device.
+
+Testing
+=======
+
+See ``tools/testing/selftests/drivers/net/netdevsim/devlink.sh`` for a
+test covering the core infrastructure. Test cases should be added for any new
+functionality.
+
-- 
2.17.1


  parent reply	other threads:[~2019-11-08 16:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 16:18 [PATCH net-next v2 00/10] devlink subdev Yuval Avnery
2019-11-08 16:18 ` [PATCH net-next v2 01/10] devlink: Introduce subdev Yuval Avnery
2019-11-08 16:18 ` [PATCH net-next v2 02/10] devlink: Add PCI attributes support for subdev Yuval Avnery
2019-11-08 16:18 ` [PATCH net-next v2 03/10] devlink: Add port with subdev register support Yuval Avnery
2019-11-08 16:18 ` [PATCH net-next v2 04/10] devlink: Support subdev HW address get Yuval Avnery
2019-11-08 18:00   ` Parav Pandit
2019-11-09 17:45     ` Yuval Avnery
2019-11-09 18:13       ` Parav Pandit
2019-11-10  8:12         ` Jiri Pirko
2019-11-08 16:18 ` [PATCH net-next v2 05/10] devlink: Support subdev HW address set Yuval Avnery
2019-11-08 16:18 ` Yuval Avnery [this message]
2019-11-08 16:18 ` [PATCH net-next v2 07/10] netdevsim: Add max_vfs to bus_dev Yuval Avnery
2019-11-08 16:18 ` [PATCH net-next v2 08/10] netdevsim: Add devlink subdev creation Yuval Avnery
2019-11-08 16:18 ` [PATCH net-next v2 09/10] netdevsim: Add devlink subdev sefltest for netdevsim Yuval Avnery
2019-11-08 16:18 ` [PATCH net-next v2 10/10] net/mlx5e: Add support for devlink subdev and subdev hw_addr set/show Yuval Avnery
2019-11-11 18:00 ` [PATCH net-next v2 00/10] devlink subdev Jakub Kicinski
2019-11-11 18:46   ` Yuval Avnery
2019-11-12 14:55     ` Andy Gospodarek
2019-11-12 18:35       ` Yuval Avnery
2019-11-12 22:19         ` Jakub Kicinski
2019-11-12 23:32           ` Yuval Avnery
2019-11-13  6:37       ` Parav Pandit
2019-11-14 16:47         ` Yuval Avnery

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=1573229926-30040-7-git-send-email-yuvalav@mellanox.com \
    --to=yuvalav@mellanox.com \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=danielj@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jiri@mellanox.com \
    --cc=leon@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=parav@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=shuah@kernel.org \
    /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).