Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 0/3] Add blacklist EAL option for SPP container
@ 2019-08-12  7:13 Yasufumi Ogawa
  2019-08-12  7:13 ` [spp] [PATCH 1/3] tools/sppc: add blacklist and whitelist options Yasufumi Ogawa
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yasufumi Ogawa @ 2019-08-12  7:13 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

PP container is expected to be used on a host which has no ports on
host for simplicity. However, it might have some port in a realistic
situation actually.

In such a case, ports on host should be excluded with blacklist option
to avoid confliction using the same ports from SPP on host and app
containers. Without this option, system causes unexpected behavior.

This series of update is to add blacklist option ``-b`` and
``--pci-blacklist`` to app container tools and descriptions of usage
for the option in documentation.

Yasufumi Ogawa (3):
  tools/sppc: add blacklist and whitelist options
  docs: add two optiosn to examples of sppc
  docs: add usage of blacklist for SPP container

 docs/guides/tools/sppc/app_launcher.rst    | 29 +++++++++++---
 docs/guides/tools/sppc/getting_started.rst | 45 +++++++++++++++++++++-
 tools/sppc/lib/app_helper.py               | 17 ++++++++
 3 files changed, 85 insertions(+), 6 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [spp] [PATCH 1/3] tools/sppc: add blacklist and whitelist options
  2019-08-12  7:13 [spp] [PATCH 0/3] Add blacklist EAL option for SPP container Yasufumi Ogawa
@ 2019-08-12  7:13 ` Yasufumi Ogawa
  2019-08-12  7:13 ` [spp] [PATCH 2/3] docs: add two optiosn to examples of sppc Yasufumi Ogawa
  2019-08-12  7:13 ` [spp] [PATCH 3/3] docs: add usage of blacklist for SPP container Yasufumi Ogawa
  2 siblings, 0 replies; 4+ messages in thread
From: Yasufumi Ogawa @ 2019-08-12  7:13 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

EAL option `blacklist` is to exclude PCI devices from under management
of DPDK, and `whitelist` is to include devices in opposition. This
update is to add thesee options to app launcher because app container
tries to have PCI devices, such as `phy:0` or so,  which are already
owned by SPP without `blacklist` or `whitelist`.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 tools/sppc/lib/app_helper.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tools/sppc/lib/app_helper.py b/tools/sppc/lib/app_helper.py
index 38c9ade..17b98b3 100644
--- a/tools/sppc/lib/app_helper.py
+++ b/tools/sppc/lib/app_helper.py
@@ -29,6 +29,14 @@ def add_eal_args(parser, mem_size=1024, mem_channel=4):
         '--socket-mem',
         type=str,
         help='Memory size')
+    parser.add_argument(
+        '-b', '--pci-blacklist',
+        nargs='*', type=str,
+        help='PCI blacklist for excluding devices')
+    parser.add_argument(
+        '-w', '--pci-whitelist',
+        nargs='*', type=str,
+        help='PCI whitelist for including devices')
     parser.add_argument(
         '--nof-memchan',
         type=int,
@@ -83,6 +91,15 @@ def setup_eal_opts(args, file_prefix, proc_type='auto', hugedir=None):
             '--vdev', 'virtio_user%d,queues=%d,path=%s' % (
                 dev_ids[i], args.nof_queues, socks[i]['guest']), '\\']
 
+    if (args.pci_blacklist is not None) and (args.pci_whitelist is not None):
+        common.error_exit("Cannot use both of '-b' and '-w' at once")
+    elif args.pci_blacklist is not None:
+        for bd in args.pci_blacklist:
+            eal_opts += ['-b', bd, '\\']
+    elif args.pci_whitelist is not None:
+        for wd in args.pci_whitelist:
+            eal_opts += ['-w', wd, '\\']
+
     eal_opts += [
         '--file-prefix', file_prefix, '\\',
         '--', '\\']
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [spp] [PATCH 2/3] docs: add two optiosn to examples of sppc
  2019-08-12  7:13 [spp] [PATCH 0/3] Add blacklist EAL option for SPP container Yasufumi Ogawa
  2019-08-12  7:13 ` [spp] [PATCH 1/3] tools/sppc: add blacklist and whitelist options Yasufumi Ogawa
@ 2019-08-12  7:13 ` Yasufumi Ogawa
  2019-08-12  7:13 ` [spp] [PATCH 3/3] docs: add usage of blacklist for SPP container Yasufumi Ogawa
  2 siblings, 0 replies; 4+ messages in thread
From: Yasufumi Ogawa @ 2019-08-12  7:13 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

This update is to add examples of `blacklist` and `whitelist` to
examples of SPP container tools.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 docs/guides/tools/sppc/app_launcher.rst | 29 ++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/docs/guides/tools/sppc/app_launcher.rst b/docs/guides/tools/sppc/app_launcher.rst
index 2525740..80dc262 100644
--- a/docs/guides/tools/sppc/app_launcher.rst
+++ b/docs/guides/tools/sppc/app_launcher.rst
@@ -142,11 +142,13 @@ On the other hand, application specific options are different each other.
     $ python app/spp-primary.py -h
     usage: spp-primary.py [-h] [-l CORE_LIST] [-c CORE_MASK] [-m MEM]
                           [--socket-mem SOCKET_MEM]
-                          [--nof-memchan NOF_MEMCHAN]
-                          [-n NOF_RING] [-p PORT_MASK] [-dv DEV_VHOST_IDS]
-                          [-dt DEV_TAP_IDS] [-ip CTRL_IP]
-                          [--ctrl-port CTRL_PORT]
-                          [--dist-name DIST_NAME] [--dist-ver DIST_VER]
+                          [-b [PCI_BLACKLIST [PCI_BLACKLIST ...]]]
+                          [-w [PCI_WHITELIST [PCI_WHITELIST ...]]]
+                          [--nof-memchan NOF_MEMCHAN] [-n NOF_RING]
+                          [-p PORT_MASK]
+                          [-dv DEV_VHOST_IDS] [-dt DEV_TAP_IDS] [-ip CTRL_IP]
+                          [--ctrl-port CTRL_PORT] [--dist-name DIST_NAME]
+                          [--dist-ver DIST_VER] [--workdir WORKDIR]
                           [-ci CONTAINER_IMAGE] [-fg] [--dry-run]
 
     Launcher for spp-primary application container
@@ -160,6 +162,10 @@ On the other hand, application specific options are different each other.
       -m MEM, --mem MEM     Memory size (default is 1024)
       --socket-mem SOCKET_MEM
                             Memory size
+      -b [PCI_BLACKLIST [PCI_BLACKLIST ...]], --pci-blacklist [PCI_BLACKLIST..
+                            PCI blacklist for excluding devices
+      -w [PCI_WHITELIST [PCI_WHITELIST ...]], --pci-whitelist [PCI_WHITELIST..
+                            PCI whitelist for including devices
       --nof-memchan NOF_MEMCHAN
                             Number of memory channels (default is 4)
       -n NOF_RING, --nof-ring NOF_RING
@@ -177,6 +183,7 @@ On the other hand, application specific options are different each other.
       --dist-name DIST_NAME
                             Name of Linux distribution
       --dist-ver DIST_VER   Version of Linux distribution
+      --workdir WORKDIR     Path of directory in which the command is launched
       -ci CONTAINER_IMAGE, --container-image CONTAINER_IMAGE
                             Name of container image
       -fg, --foreground     Run container as foreground mode
@@ -209,6 +216,8 @@ It shows only application specific options for simplicity.
     $ python app/spp-nfv.py -h
     usage: spp-nfv.py [-h] [-l CORE_LIST] [-c CORE_MASK] [-m MEM]
                       [--socket-mem SOCKET_MEM] [--nof-memchan NOF_MEMCHAN]
+                      [-b [PCI_BLACKLIST [PCI_BLACKLIST ...]]]
+                      [-w [PCI_WHITELIST [PCI_WHITELIST ...]]]
                       [-i SEC_ID] [-ip CTRL_IP] [--ctrl-port CTRL_PORT]
                       [--dist-name DIST_NAME] [--dist-ver DIST_VER]
                       [-ci CONTAINER_IMAGE] [-fg] [--dry-run]
@@ -258,6 +267,8 @@ It shows options without of EAL and container for simplicity.
     $ python app/l2fwd.py -h
     usage: l2fwd.py [-h] [-l CORE_LIST] [-c CORE_MASK] [-m MEM]
                     [--socket-mem SOCKET_MEM] [--nof-memchan NOF_MEMCHAN]
+                    [-b [PCI_BLACKLIST [PCI_BLACKLIST ...]]]
+                    [-w [PCI_WHITELIST [PCI_WHITELIST ...]]]
                     [-d DEV_IDS] [-nq NOF_QUEUES] [--no-privileged]
                     [-p PORT_MASK]
                     [--dist-name DIST_NAME] [--dist-ver DIST_VER]
@@ -373,6 +384,8 @@ It shows options without of EAL and container for simplicity.
     $ python app/l3fwd.py -h
     usage: l3fwd.py [-h] [-l CORE_LIST] [-c CORE_MASK] [-m MEM]
                     [--socket-mem SOCKET_MEM] [--nof-memchan NOF_MEMCHAN]
+                    [-b [PCI_BLACKLIST [PCI_BLACKLIST ...]]]
+                    [-w [PCI_WHITELIST [PCI_WHITELIST ...]]]
                     [-d DEV_IDS] [-nq NOF_QUEUES] [--no-privileged]
                     [-p PORT_MASK] [--config CONFIG] [-P] [-E] [-L]
                     [-dst [ETH_DEST [ETH_DEST ...]]] [--enable-jumbo]
@@ -470,6 +483,8 @@ It shows options without of EAL and container.
     $ python app/testpmd.py -h
     usage: testpmd.py [-h] [-l CORE_LIST] [-c CORE_MASK] [-m MEM]
                       [--socket-mem SOCKET_MEM] [--nof-memchan NOF_MEMCHAN]
+                      [-b [PCI_BLACKLIST [PCI_BLACKLIST ...]]]
+                      [-w [PCI_WHITELIST [PCI_WHITELIST ...]]]
                       [-d DEV_IDS] [-nq NOF_QUEUES] [--no-privileged]
                       [--pci] [-i] [-a] [--tx-first]
                       [--stats-period STATS_PERIOD]
@@ -753,6 +768,8 @@ It shows options without of EAL and container for simplicity.
     $ python app/pktgen.py -h
     usage: pktgen.py [-h] [-l CORE_LIST] [-c CORE_MASK] [-m MEM]
                      [--socket-mem SOCKET_MEM] [--nof-memchan NOF_MEMCHAN]
+                     [-b [PCI_BLACKLIST [PCI_BLACKLIST ...]]]
+                     [-w [PCI_WHITELIST [PCI_WHITELIST ...]]]
                      [-d DEV_IDS] [-nq NOF_QUEUES] [--no-privileged]
                      [--matrix MATRIX] [--log-level LOG_LEVEL]
                      [--dist-name DIST_NAME] [--dist-ver DIST_VER]
@@ -959,6 +976,8 @@ Refer options and usages by ``load-balancer.py -h``.
     $ python app/load-balancer.py -h
     usage: load-balancer.py [-h] [-l CORE_LIST] [-c CORE_MASK] [-m MEM]
                             [--socket-mem SOCKET_MEM]
+                            [-b [PCI_BLACKLIST [PCI_BLACKLIST ...]]]
+                            [-w [PCI_WHITELIST [PCI_WHITELIST ...]]]
                             [--nof-memchan NOF_MEMCHAN]
                             [-d DEV_IDS] [-nq NOF_QUEUES] [--no-privileged]
                             [-rx RX_PORTS] [-tx TX_PORTS] [-w WORKER_LCORES]
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [spp] [PATCH 3/3] docs: add usage of blacklist for SPP container
  2019-08-12  7:13 [spp] [PATCH 0/3] Add blacklist EAL option for SPP container Yasufumi Ogawa
  2019-08-12  7:13 ` [spp] [PATCH 1/3] tools/sppc: add blacklist and whitelist options Yasufumi Ogawa
  2019-08-12  7:13 ` [spp] [PATCH 2/3] docs: add two optiosn to examples of sppc Yasufumi Ogawa
@ 2019-08-12  7:13 ` Yasufumi Ogawa
  2 siblings, 0 replies; 4+ messages in thread
From: Yasufumi Ogawa @ 2019-08-12  7:13 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

This update is to add description of usage of blacklist option. It
describes how to inspect PCI addresses and how to specify them while
launching app container.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 docs/guides/tools/sppc/getting_started.rst | 45 +++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/docs/guides/tools/sppc/getting_started.rst b/docs/guides/tools/sppc/getting_started.rst
index d92b55f..4834cc0 100644
--- a/docs/guides/tools/sppc/getting_started.rst
+++ b/docs/guides/tools/sppc/getting_started.rst
@@ -256,9 +256,52 @@ app container launcher.
     Done
     testpmd>
 
-
 It launches ``testpmd`` in foreground mode.
 
+.. note::
+
+    DPDK app container tries to own ports on host which are shared with host
+    and containers by default. It causes a confliction between SPP running on
+    host and containers and unexpected behavior.
+
+    To avoid this situation, it is required to use ``-b`` or
+    ``--pci-blacklist`` EAL option to exclude ports on host. PCI address of
+    port can be inspected by using ``dpdk-devbind.py -s``.
+
+If you have ports on host and assign them to SPP, you should to exclude them
+from the app container by specifying PCI addresses of the ports with ``-b``
+or ``--pci-blacklist``.
+
+You can find PCI addresses from ``dpdk-devbind.py -s``.
+
+.. code-block:: console
+
+    # Check the status of the available devices.
+    dpdk-devbind --status
+    Network devices using DPDK-compatible driver
+    ============================================
+    0000:0a:00.0 '82599ES 10-Gigabit' drv=igb_uio unused=ixgbe
+    0000:0a:00.1 '82599ES 10-Gigabit' drv=igb_uio unused=ixgbe
+
+    Network devices using kernel driver
+    ===================================
+    ...
+
+In this case, you should exclude ``0000:0a:00.0`` and ``0000:0a:00.1``
+with ``-b`` option.
+
+.. code-block:: console
+
+    # Terminal 3
+    $ cd /path/to/spp/tools/sppc
+    $ app/testpmd.py -l 3-4 -d 1,2 \
+      -b 0000:0a:00.0 0000:0a:00.1
+    sudo docker run -it \
+    ...
+    -b 0000:0a:00.0 \
+    -b 0000:0a:00.1 \
+    ...
+
 
 .. _sppc_gs_run_apps:
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-12  7:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12  7:13 [spp] [PATCH 0/3] Add blacklist EAL option for SPP container Yasufumi Ogawa
2019-08-12  7:13 ` [spp] [PATCH 1/3] tools/sppc: add blacklist and whitelist options Yasufumi Ogawa
2019-08-12  7:13 ` [spp] [PATCH 2/3] docs: add two optiosn to examples of sppc Yasufumi Ogawa
2019-08-12  7:13 ` [spp] [PATCH 3/3] docs: add usage of blacklist for SPP container Yasufumi Ogawa

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).