Skip to content

Commit

Permalink
eal: replace blacklist/whitelist options
Browse files Browse the repository at this point in the history
Replace -w / --pci-whitelist with -a / --allow options
and --pci-blacklist with --block.
The -b short option remains unchanged.

Allow the old options for now, but print a nag
warning since old options are deprecated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
  • Loading branch information
shemminger authored and tmonjalo committed Nov 15, 2020
1 parent a65a34a commit db27370
Show file tree
Hide file tree
Showing 57 changed files with 264 additions and 246 deletions.
2 changes: 1 addition & 1 deletion app/test/test.c
Expand Up @@ -61,7 +61,7 @@ do_recursive_call(void)
{ "test_main_lcore_flag", no_action },
{ "test_invalid_n_flag", no_action },
{ "test_no_hpet_flag", no_action },
{ "test_whitelist_flag", no_action },
{ "test_allow_flag", no_action },
{ "test_invalid_b_flag", no_action },
{ "test_invalid_vdev_flag", no_action },
{ "test_invalid_r_flag", no_action },
Expand Down
53 changes: 27 additions & 26 deletions app/test/test_eal_flags.c
Expand Up @@ -30,7 +30,7 @@
#define no_hpet "--no-hpet"
#define no_huge "--no-huge"
#define no_shconf "--no-shconf"
#define pci_whitelist "--pci-whitelist"
#define allow "--allow"
#define vdev "--vdev"
#define memtest "memtest"
#define memtest1 "memtest1"
Expand Down Expand Up @@ -223,12 +223,12 @@ get_number_of_sockets(void)
#endif

/*
* Test that the app doesn't run with invalid whitelist option.
* Test that the app doesn't run with invalid allow option.
* Final tests ensures it does run with valid options as sanity check (one
* test for with Domain+BDF, second for just with BDF)
*/
static int
test_whitelist_flag(void)
test_allow_flag(void)
{
unsigned i;
#ifdef RTE_EXEC_ENV_FREEBSD
Expand All @@ -245,53 +245,53 @@ test_whitelist_flag(void)

const char *wlinval[][7] = {
{prgname, prefix, mp_flag,
pci_whitelist, "error", "", ""},
allow, "error", "", ""},
{prgname, prefix, mp_flag,
pci_whitelist, "0:0:0", "", ""},
allow, "0:0:0", "", ""},
{prgname, prefix, mp_flag,
pci_whitelist, "0:error:0.1", "", ""},
allow, "0:error:0.1", "", ""},
{prgname, prefix, mp_flag,
pci_whitelist, "0:0:0.1error", "", ""},
allow, "0:0:0.1error", "", ""},
{prgname, prefix, mp_flag,
pci_whitelist, "error0:0:0.1", "", ""},
allow, "error0:0:0.1", "", ""},
{prgname, prefix, mp_flag,
pci_whitelist, "0:0:0.1.2", "", ""},
allow, "0:0:0.1.2", "", ""},
};
/* Test with valid whitelist option */
/* Test with valid allow option */
const char *wlval1[] = {prgname, prefix, mp_flag,
pci_whitelist, "00FF:09:0B.3"};
allow, "00FF:09:0B.3"};
const char *wlval2[] = {prgname, prefix, mp_flag,
pci_whitelist, "09:0B.3", pci_whitelist, "0a:0b.1"};
allow, "09:0B.3", allow, "0a:0b.1"};
const char *wlval3[] = {prgname, prefix, mp_flag,
pci_whitelist, "09:0B.3,type=test",
pci_whitelist, "08:00.1,type=normal",
allow, "09:0B.3,type=test",
allow, "08:00.1,type=normal",
};

for (i = 0; i < RTE_DIM(wlinval); i++) {
if (launch_proc(wlinval[i]) == 0) {
printf("Error - process did run ok with invalid "
"whitelist parameter\n");
"allow parameter\n");
return -1;
}
}
if (launch_proc(wlval1) != 0 ) {
printf("Error - process did not run ok with valid whitelist\n");
printf("Error - process did not run ok with valid allow\n");
return -1;
}
if (launch_proc(wlval2) != 0 ) {
printf("Error - process did not run ok with valid whitelist value set\n");
printf("Error - process did not run ok with valid allow value set\n");
return -1;
}
if (launch_proc(wlval3) != 0 ) {
printf("Error - process did not run ok with valid whitelist + args\n");
printf("Error - process did not run ok with valid allow + args\n");
return -1;
}

return 0;
}

/*
* Test that the app doesn't run with invalid blacklist option.
* Test that the app doesn't run with invalid blocklist option.
* Final test ensures it does run with valid options as sanity check
*/
static int
Expand All @@ -317,7 +317,7 @@ test_invalid_b_flag(void)
{prgname, prefix, mp_flag, "-b", "error0:0:0.1"},
{prgname, prefix, mp_flag, "-b", "0:0:0.1.2"},
};
/* Test with valid blacklist option */
/* Test with valid blocklist option */
const char *blval[] = {prgname, prefix, mp_flag,
"-b", "FF:09:0B.3"};

Expand All @@ -326,12 +326,12 @@ test_invalid_b_flag(void)
for (i = 0; i != RTE_DIM(blinval); i++) {
if (launch_proc(blinval[i]) == 0) {
printf("Error - process did run ok with invalid "
"blacklist parameter\n");
"blocklist parameter\n");
return -1;
}
}
if (launch_proc(blval) != 0) {
printf("Error - process did not run ok with valid blacklist value\n");
printf("Error - process did not run ok with valid blocklist value\n");
return -1;
}
return 0;
Expand Down Expand Up @@ -419,7 +419,7 @@ test_invalid_r_flag(void)
{prgname, prefix, mp_flag, "-r", "-1"},
{prgname, prefix, mp_flag, "-r", "17"},
};
/* Test with valid blacklist option */
/* Test with valid blocklist option */
const char *rval[] = {prgname, prefix, mp_flag, "-r", "16"};

int i;
Expand Down Expand Up @@ -1492,9 +1492,9 @@ test_eal_flags(void)
return ret;
}

ret = test_whitelist_flag();
ret = test_allow_flag();
if (ret < 0) {
printf("Error in test_invalid_whitelist_flag()\n");
printf("Error in test_allow_flag()\n");
return ret;
}

Expand Down Expand Up @@ -1546,7 +1546,8 @@ REGISTER_TEST_COMMAND(eal_flags_main_opt_autotest, test_main_lcore_flag);
REGISTER_TEST_COMMAND(eal_flags_n_opt_autotest, test_invalid_n_flag);
REGISTER_TEST_COMMAND(eal_flags_hpet_autotest, test_no_hpet_flag);
REGISTER_TEST_COMMAND(eal_flags_no_huge_autotest, test_no_huge_flag);
REGISTER_TEST_COMMAND(eal_flags_w_opt_autotest, test_whitelist_flag);
REGISTER_TEST_COMMAND(eal_flags_w_opt_autotest, test_allow_flag); /* for legacy CI */
REGISTER_TEST_COMMAND(eal_flags_a_opt_autotest, test_allow_flag);
REGISTER_TEST_COMMAND(eal_flags_b_opt_autotest, test_invalid_b_flag);
REGISTER_TEST_COMMAND(eal_flags_vdev_opt_autotest, test_invalid_vdev_flag);
REGISTER_TEST_COMMAND(eal_flags_r_opt_autotest, test_invalid_r_flag);
Expand Down
2 changes: 1 addition & 1 deletion devtools/test-null.sh
Expand Up @@ -28,5 +28,5 @@ fi

(sleep 1 && echo stop) |
$testpmd -c $coremask --no-huge -m 20 \
$libs -w 0:0.0 --vdev net_null1 --vdev net_null2 $eal_options -- \
$libs -a 0:0.0 --vdev net_null1 --vdev net_null2 $eal_options -- \
--no-mlockall --total-num-mbufs=2048 $testpmd_options -ia
2 changes: 1 addition & 1 deletion doc/guides/bbdevs/acc100.rst
Expand Up @@ -241,4 +241,4 @@ Specifically for the BBDEV ACC100 PMD, the command below can be used:
.. code-block:: console
./pf_bb_config ACC100 -c acc100/acc100_config_vf_5g.cfg
./test-bbdev.py -e="-c 0xff0 -w${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data
./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data
2 changes: 1 addition & 1 deletion doc/guides/bbdevs/fpga_5gnr_fec.rst
Expand Up @@ -304,4 +304,4 @@ Specifically for the BBDEV FPGA 5GNR FEC PMD, the command below can be used:
.. code-block:: console
./pf_bb_config FPGA_5GNR -c fpga_5gnr/fpga_5gnr_config_vf.cfg
./test-bbdev.py -e="-c 0xff0 -w${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data
./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data
2 changes: 1 addition & 1 deletion doc/guides/bbdevs/fpga_lte_fec.rst
Expand Up @@ -323,4 +323,4 @@ Specifically for the BBDEV FPGA LTE FEC PMD, the command below can be used:
.. code-block:: console
./pf_bb_config FPGA_LTE -c fpga_lte/fpga_lte_config_vf.cfg
./test-bbdev.py -e="-c 0xff0 -w${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./turbo_dec_default.data
./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./turbo_dec_default.data
6 changes: 3 additions & 3 deletions doc/guides/cryptodevs/dpaa2_sec.rst
Expand Up @@ -134,10 +134,10 @@ Supported DPAA2 SoCs
* LS2088A/LS2048A
* LS1088A/LS1048A

Whitelisting & Blacklisting
---------------------------
Allowing & Blocking
-------------------

For blacklisting a DPAA2 SEC device, following commands can be used.
The DPAA2 SEC device can be blocked with the following:

.. code-block:: console
Expand Down
6 changes: 3 additions & 3 deletions doc/guides/cryptodevs/dpaa_sec.rst
Expand Up @@ -82,10 +82,10 @@ Supported DPAA SoCs
* LS1046A/LS1026A
* LS1043A/LS1023A

Whitelisting & Blacklisting
---------------------------
Allowing & Blocking
-------------------

For blacklisting a DPAA device, following commands can be used.
For blocking a DPAA device, following commands can be used.

.. code-block:: console
Expand Down
12 changes: 6 additions & 6 deletions doc/guides/cryptodevs/qat.rst
Expand Up @@ -127,7 +127,7 @@ Limitations
optimisations in the GEN3 device. And if a GCM session is initialised on a
GEN3 device, then attached to an op sent to a GEN1/GEN2 device, it will not be
enqueued to the device and will be marked as failed. The simplest way to
mitigate this is to use the bdf whitelist to avoid mixing devices of different
mitigate this is to use the PCI allowlist to avoid mixing devices of different
generations in the same process if planning to use for GCM.
* The mixed algo feature on GEN2 is not supported by all kernel drivers. Check
the notes under the Available Kernel Drivers table below for specific details.
Expand Down Expand Up @@ -237,7 +237,7 @@ adjusted to the number of VFs which the QAT common code will need to handle.
QAT VF may expose two crypto devices, sym and asym, it may happen that the
number of devices will be bigger than MAX_DEVS and the process will show an error
during PMD initialisation. To avoid this problem RTE_CRYPTO_MAX_DEVS may be
increased or -w, pci-whitelist domain:bus:devid:func option may be used.
increased or -a, allow domain:bus:devid:func option may be used.


QAT compression PMD needs intermediate buffers to support Deflate compression
Expand Down Expand Up @@ -275,7 +275,7 @@ return 0 (thereby avoiding an MMIO) if the device is congested and number of pac
possible to enqueue is smaller.
To use this feature the user must set the parameter on process start as a device additional parameter::

-w 03:01.1,qat_sym_enq_threshold=32,qat_comp_enq_threshold=16
-a 03:01.1,qat_sym_enq_threshold=32,qat_comp_enq_threshold=16

All parameters can be used with the same device regardless of order. Parameters are separated
by comma. When the same parameter is used more than once first occurrence of the parameter
Expand Down Expand Up @@ -638,19 +638,19 @@ Testing
QAT SYM crypto PMD can be tested by running the test application::

cd ./<build_dir>/app/test
./dpdk-test -l1 -n1 -w <your qat bdf>
./dpdk-test -l1 -n1 -a <your qat bdf>
RTE>>cryptodev_qat_autotest

QAT ASYM crypto PMD can be tested by running the test application::

cd ./<build_dir>/app/test
./dpdk-test -l1 -n1 -w <your qat bdf>
./dpdk-test -l1 -n1 -a <your qat bdf>
RTE>>cryptodev_qat_asym_autotest

QAT compression PMD can be tested by running the test application::

cd ./<build_dir>/app/test
./dpdk-test -l1 -n1 -w <your qat bdf>
./dpdk-test -l1 -n1 -a <your qat bdf>
RTE>>compressdev_autotest


Expand Down
20 changes: 10 additions & 10 deletions doc/guides/eventdevs/octeontx2.rst
Expand Up @@ -55,15 +55,15 @@ Runtime Config Options
upper limit for in-flight events.
For example::

-w 0002:0e:00.0,xae_cnt=16384
-a 0002:0e:00.0,xae_cnt=16384

- ``Force legacy mode``

The ``single_ws`` devargs parameter is introduced to force legacy mode i.e
single workslot mode in SSO and disable the default dual workslot mode.
For example::

-w 0002:0e:00.0,single_ws=1
-a 0002:0e:00.0,single_ws=1

- ``Event Group QoS support``

Expand All @@ -78,7 +78,7 @@ Runtime Config Options
default.
For example::

-w 0002:0e:00.0,qos=[1-50-50-50]
-a 0002:0e:00.0,qos=[1-50-50-50]

- ``Selftest``

Expand All @@ -87,7 +87,7 @@ Runtime Config Options
The tests are run once the vdev creation is successfully complete.
For example::

-w 0002:0e:00.0,selftest=1
-a 0002:0e:00.0,selftest=1

- ``TIM disable NPA``

Expand All @@ -96,7 +96,7 @@ Runtime Config Options
parameter disables NPA and uses software mempool to manage chunks
For example::

-w 0002:0e:00.0,tim_disable_npa=1
-a 0002:0e:00.0,tim_disable_npa=1

- ``TIM modify chunk slots``

Expand All @@ -107,15 +107,15 @@ Runtime Config Options
to SSO. The default value is 255 and the max value is 4095.
For example::

-w 0002:0e:00.0,tim_chnk_slots=1023
-a 0002:0e:00.0,tim_chnk_slots=1023

- ``TIM enable arm/cancel statistics``

The ``tim_stats_ena`` devargs can be used to enable arm and cancel stats of
event timer adapter.
For example::

-w 0002:0e:00.0,tim_stats_ena=1
-a 0002:0e:00.0,tim_stats_ena=1

- ``TIM limit max rings reserved``

Expand All @@ -125,7 +125,7 @@ Runtime Config Options
rings.
For example::

-w 0002:0e:00.0,tim_rings_lmt=5
-a 0002:0e:00.0,tim_rings_lmt=5

- ``TIM ring control internal parameters``

Expand All @@ -135,7 +135,7 @@ Runtime Config Options
default values.
For Example::

-w 0002:0e:00.0,tim_ring_ctl=[2-1023-1-0]
-a 0002:0e:00.0,tim_ring_ctl=[2-1023-1-0]

- ``Lock NPA contexts in NDC``

Expand All @@ -145,7 +145,7 @@ Runtime Config Options

For example::

-w 0002:0e:00.0,npa_lock_mask=0xf
-a 0002:0e:00.0,npa_lock_mask=0xf

Debugging Options
-----------------
Expand Down
2 changes: 1 addition & 1 deletion doc/guides/freebsd_gsg/build_sample_apps.rst
Expand Up @@ -67,7 +67,7 @@ DPDK application. Some of the EAL options for FreeBSD are as follows:
is a list of cores to use instead of a core mask.

* ``-b <domain:bus:devid.func>``:
Blacklisting of ports; prevent EAL from using specified PCI device
Blocklisting of ports; prevent EAL from using specified PCI device
(multiple ``-b`` options are allowed).

* ``--use-device``:
Expand Down
2 changes: 1 addition & 1 deletion doc/guides/linux_gsg/build_sample_apps.rst
Expand Up @@ -53,7 +53,7 @@ The EAL options are as follows:
Number of memory channels per processor socket.

* ``-b <domain:bus:devid.func>``:
Blacklisting of ports; prevent EAL from using specified PCI device
Blocklisting of ports; prevent EAL from using specified PCI device
(multiple ``-b`` options are allowed).

* ``--use-device``:
Expand Down
14 changes: 7 additions & 7 deletions doc/guides/linux_gsg/eal_args.include.rst
Expand Up @@ -44,20 +44,20 @@ Lcore-related options
Device-related options
~~~~~~~~~~~~~~~~~~~~~~

* ``-b, --pci-blacklist <[domain:]bus:devid.func>``
* ``-b, --block <[domain:]bus:devid.func>``

Blacklist a PCI device to prevent EAL from using it. Multiple -b options are
allowed.
Skip probing a PCI device to prevent EAL from using it.
Multiple -b options are allowed.

.. Note::
PCI blacklist cannot be used with ``-w`` option.
Block list cannot be used with the allow list ``-a`` option.

* ``-w, --pci-whitelist <[domain:]bus:devid.func>``
* ``-a, --allow <[domain:]bus:devid.func>``

Add a PCI device in white list.
Add a PCI device in to the list of devices to probe.

.. Note::
PCI whitelist cannot be used with ``-b`` option.
Allow list cannot be used with the block list ``-b`` option.

* ``--vdev <device arguments>``

Expand Down

0 comments on commit db27370

Please sign in to comment.