summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasufumi Ogawa <yasufum.o@gmail.com>2019-08-12 16:13:07 +0900
committerYasufumi Ogawa <yasufum.o@gmail.com>2019-08-13 17:08:18 +0900
commit32fd4cdb7bdb5e5d2c432f75670b3a45d86f6c0a (patch)
tree431e1b9f2929eabedfbe55eab4cde3269b789271
parentc617c97e825596260aa06eb54099d07cdfaec0bb (diff)
downloadspp-32fd4cdb7bdb5e5d2c432f75670b3a45d86f6c0a.zip
spp-32fd4cdb7bdb5e5d2c432f75670b3a45d86f6c0a.tar.gz
spp-32fd4cdb7bdb5e5d2c432f75670b3a45d86f6c0a.tar.xz
tools/sppc: add blacklist and whitelist options
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>
-rw-r--r--tools/sppc/lib/app_helper.py17
1 files changed, 17 insertions, 0 deletions
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
@@ -30,6 +30,14 @@ def add_eal_args(parser, mem_size=1024, mem_channel=4):
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,
default=mem_channel,
@@ -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, '\\',
'--', '\\']