[spp] [PATCH 1/3] tools/sppc: add blacklist and whitelist options

Yasufumi Ogawa yasufum.o at gmail.com
Mon Aug 12 09:13:07 CEST 2019


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 at 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



More information about the spp mailing list