Commit Graph

164 Commits

Author SHA1 Message Date
Michal Berger
4f857ce593 scripts/setup: Stop checking for broken uio_pci_generic driver
This check was put in place as a workaround for some specific kernel
builds which were mainly shipped under centos8. Since we already
dropped centos8 in the CI and replaced it with rocky8 (where kernel
is actually stable) there's no value in maintaining that anymore.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Idd39b5bae888a991d7d628a19bc18acac6570f81
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15819
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-12-14 08:03:17 +00:00
Michal Berger
eab0c6649d test/nvmf: Make sure ctrl is fully released
There may be some timing issue where attempt to rebind the ctrl from
vfio_pci driver back to nvme, right after issuing the
bdev_nvme_detach_controller() call, fails as the vfio_pci might have
not fully released the device yet.

To mitigate, simply kill the application (as it's not needed anymore
at at point) before starting the kernel_target test - this should give
enough time for the device to be properly released.

As a precaution, make setup.sh to retry the probe attempt in case it
fails.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ifc4f4c18a90605154bf33b078575c8b41129f1f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15767
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-12-14 08:03:17 +00:00
Michal Berger
1f59abaebf scripts/setup: Use driver_override to bind devices
Using new_id attribute is global in scope, meaning that depending
on the kernel's setup seen prior running setup.sh, single write
to it may re-bind ALL matching devices. This doesn't play well
with our PCI_{ALLOWED,BLOCKED} options as they can't be enforced
in such a case. Consider the following example:

  > modprobe -r nvme # all nvme ctrls are detached from the kernel
  > echo 0xdead 0xbeef >/sys/bus/pci/drivers/uio_pci_generic/new_id

  # setup.sh-wise

  > modprobe -r nvme
  > PCI_BLOCKED=some:dead:beef.bdf setup.sh
  # PCI_BLOCKED device still ends up bound to userspace driver.

After this single write, ALL matching devices will end up bound to
uio_pci_generic. To avoid this, we should override preferred driver
on per-bdf basis.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ic4613e33321303b92b47ce3f4d7e1f29ecca3036
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13813
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-12-08 14:16:40 +00:00
paul luse
eb53c23236 add (c) and SPDX header to bash files as needed
per Intel policy to include file commit date using git cmd
below.  The policy does not apply to non-Intel (C) notices.

git log --follow -C90% --format=%ad --date default <file> | tail -1

and then pull just the year from the result.

Intel copyrights were not added to files where Intel either had
no contribution ot the contribution lacked substance (ie license
header updates, formatting changes, etc)

For intel copyrights added, --follow and -C95% were used.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I2ef86976095b88a9bf5b1003e59f3943cd6bbe4c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15209
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-11-29 08:27:51 +00:00
Krzysztof Karas
0af934b38c event: add CPU lock files
When running SPDK application on a given set of
CPU cores, create lock files for each of them.
This wil prevent user misconfiguration and
assigning a core to more than one SPDK instance.

The introduced mechanism is based on device locks
implemented in spdk_pci_device_claim() function.

Add a command line option to disable lock files.
This feature will be useful in cases where differing
CPU cores is impossible (eg. setup with only one core
available).

The patch also fixes all existing cases of overlapping
core masks.

Change-Id: Ie9aacb7523a3597b9aa20f2c3fa9efe4db92c44c
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14919
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-11-09 08:18:32 +00:00
Michal Berger
71605a520d scripts/setup: Fix extglob match
The actual target files come with a .* suffix.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I1c6056c81261ae97bd272d0d99ad915ab4bb870e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15294
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-11-08 08:21:59 +00:00
Michal Berger
0252bdbf60 scripts/setup: Always cleanup target directories
Currently, in case target directories are empty the directories
themselves are not being purged. Change that, as there is no
need to keep them around.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ia1a9d60a91508e74b7e106e0217414a8927029b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15153
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-10-27 09:24:38 +00:00
Michal Berger
cb8174dc4a scripts/setup: Ignore potential readlink failure upon cleanup
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I21ba900f333f0dc3710fcf93fb7fa011301a51bd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15152
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2022-10-27 09:24:38 +00:00
Michal Berger
af5b654df8 test/setup: Adjust use of nullglob, extglob in cleanup_linux()
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I4e5a28f916c5855fefba8594d549b56c63d71013
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15094
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-10-25 06:57:59 +00:00
Michal Berger
8c19851209 scripts/setup: Enable extglob, nullglob in parser's global scope
This done due changes in latest Bash releases (>=5.2) which is
currently shipped with fedora36.

Fixes issue #2740.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Id6e6f00eb4ae8b7f2b110848fd55e710368fcf94
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15081
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
2022-10-25 06:57:59 +00:00
Michal Berger
28bfb8763b scripts/setup: Don't overwrite already allocated number of hugepages
Don't touch existing hp allocations when they already meet the NRHUGE
requirement. Introduce new environment switch, SHRINK_HUGE, to
override that new behavior.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I0cd124b98c3deb7c21b4fbd57529d0995978c2e5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14912
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-10-19 07:49:22 +00:00
Jim Harris
274a9ffbd5 setup.sh: redirect 'hash lsblk' output to /dev/null
We are checking if lsblk exists already, but when it
doesn't let's not emit that detail to the user.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I34fedcc97fb7091229a11b2592cb7bd21a032b5b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14834
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-10-12 06:35:55 +00:00
Jim Harris
813b92af44 setup.sh: add some more app names to the shm cleanup list
accel_perf and bdev_svc were not on the list.

Fixes issue #2483.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9f758c1871f42c10e2c92b2fb6cd676830a1b3a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13877
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-08-05 10:48:42 +00:00
Michal Berger
7a4a97dfbc scripts/setup: Align freebsd's status output with linux's
Signed-off-by: Michal Berger <michallinuxstuff@gmail.com>
Change-Id: I949fd738ae23067afec535c76ef87ba1faa54a93
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12924
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-06-10 07:56:27 +00:00
Michal Berger
7201d0e627 scripts/common: Adjust handling of the pciconf output under FreeBSD 13.x
The pci address needs to interpreted "as is" (base-10) and not
converted to hexadecimal notation. Also, the number of fields also
changed where under newer pciconf, vendor and device IDs are
provided under separate fields.

Signed-off-by: Michal Berger <michallinuxstuff@gmail.com>
Change-Id: Ie540f11b9cde2dbbfe15a6aa449c4eab151c81d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12914
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-06-10 07:56:27 +00:00
Gal Hammer
686dcd88c2 scripts: Do msr existence check only on x86_64 machines
aarch64 doesn't have a msr module (DPDK acquires the TSR rate elsewhere).

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Change-Id: Ib9795141a78436959853ab5548ae49f024344b25
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12354
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-25 07:41:16 +00:00
paul luse
9c55555c71 scrtips/setup.sh: Add support for IAA device
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I59cfa9c9c673a2215a8cd42450b94dfcfc959971
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12763
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-23 07:02:21 +00:00
paul luse
46ac1b8d73 scripts/setup: Update device name IDXD->DSA
In prep for upcoming addition of IAA.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I3044f1e07dbfc65a6a55a7d68bbaff6a43e909d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12761
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-23 07:02:21 +00:00
Jim Harris
95c589e6e9 setup.sh: redirect modprobe msr error messages to /dev/null
We try to modprobe msr so that DPDK can more easily figure
out TSC on x86 systems.  But that just results in a
"Module msr not found" message on non-x86 systems.  setup.sh
still works, but the error message makes it appear
otherwise.  So just redirect the error message to reduce
this confusion.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I71074c7836519b003933551ce51a193070b1bfe6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12671
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2022-05-19 13:05:05 +00:00
Michal Berger
9af7c30e8f scripts/setup: Skip devices which have any valid data present
This is done to make sure we don't miss more complex setups where
target devices are not mounted but still hold some valid data that
shouldn't be touched in any way.

Also, adjust function names so they clearly indicate what is being
checked.

Signed-off-by: Michal Berger <michallinuxstuff@gmail.com>
Change-Id: Ibb0f1f21de68009a2f8f1faf4595a07ae527da35
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11111
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-04-06 07:21:17 +00:00
Michal Berger
bb4657c7c6 scripts/setup: Check if target block device is hold by other devices
Change-Id: Ie072e00b980095c5c794a189c0886e128b7377c9
Signed-off-by: Michal Berger <michallinuxstuff@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11109
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-04-06 07:21:17 +00:00
Samir Raval
b0aba3fcd5 setup.sh: Speed up the VMD device unbind by running in parallel.
If a VMD device present, add message to communicate to the user to use next steps.
Allow for DRIVER_OVERRIDE="none" to just unbind the driver without binding it to any other.

Fixes #2423

Signed-off-by: Samir Raval <samir.raval@intel.com>
Change-Id: Ifef6ed50dd619ce7629eabf458edd54e6bb22fa4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12035
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-04-01 20:49:43 +00:00
Michal Berger
eb8655b2fe setup.sh: Make sure driver is known upon reset
In case collect_driver() returns immediately due to missing modalias
attr, an empty $driver will be passed to check_for_driver() causing
grep inside to fail. Further false-positive then leads to call to
linux_bind_driver() as it's not able to locate proper paths for
given driver.

To avoid this, make sure collect_driver() always attempts to fallback
to a driver setup.sh supports for a target device.

Signed-off-by: Michal Berger <michallinuxstuff@gmail.com>
Change-Id: Id5631a731910f60b63c6afb3a412575bb69d784a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11747
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-09 08:02:41 +00:00
Jim Harris
e4ef7b3910 setup.sh: fix incorrect help message
Reported-by: Chris Demia on Slack
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib77cee03fbd9eaf600f2c0b74f5b6ceae9624600
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11108
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-01-19 08:55:46 +00:00
Josh Soref
1ff3715d38 spelling: scripts
Part of #2256

* available
* classes
* coalesce
* configuration
* controller
* currently
* dependencies
* different
* displaying
* does not
* environment
* explicitly
* hugepages
* ignoring
* inflight
* initialize
* parameters
* priority
* properties
* recovery
* subsystem
* subsystems
* template
* the same
* underlying
* usable
* values

Change-Id: Ibc8567af288c9f4641563835e16bf88949ba6a71
Signed-off-by: Josh Soref <jsoref@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10408
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-12-03 08:13:04 +00:00
Michal Berger
85395e2895 scripts/setup: Fallback to /proc/sys/vm/nr_hugepages if NUMA is not available
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I1801c36ac889e2a25eb937b65382addbbcf7d8b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10394
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-11-25 08:32:29 +00:00
Michal Berger
ddb42b2e69 scripts/setup: Clear hugepages while cleaning up
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I214e6b45f9784df74196de6e8e40a01feba9f102
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10209
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-11-24 08:34:47 +00:00
Michal Berger
637d9e6069 scripts/setup: Try to cleanup any lingering spdk_pci_lock files
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I853e278756e53e40d7faf5eb8392057653ca649f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9065
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-04 14:11:28 +00:00
Michal Berger
8c176db2ca check_format: Fixes for shellcheck's SC2030 directive
SC2030: Modification of var is local (to subshell caused by pipeline)

This directive is raised since the for loop (or rather its contents)
is piped through to another process. In this context it's not harmful
since we are interested only in sending the stdout but since we operate
on variables that happen to be local to the process that handles the
loop shellcheck sees that as a potential issue. To make it happy
remove the pipe and sort pci addresses prior running the loop.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I835c5ac1da9012129c5d01d62880307f70caab1b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8501
Community-CI: Mellanox Build Bot
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-30 22:43:05 +00:00
Konrad Sztyber
4f11fa5b6c scripts/setup: use test -e to test for msr presence
Current `test -f` never succeeds, because `/dev/cpu/0/msr` is a
character device file.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iaa28f04866ab24140668ad43351a37f0ccccef65
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7166
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-14 10:06:41 +00:00
Michal Berger
9801533f8a scripts/setup: Use uio_pci_generic if it's loaded/compiled in
Also, for consistency, use check_for_driver() while checking if
igb_uio is loaded too.

Change-Id: I00302b3cab169c77032fc0cef0ea384e9e5eb5be
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5303
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-03-08 10:49:11 +00:00
Michal Berger
fcc35c86cd scripts/setup: Attempt to load uio driver only when igb_uio is picked up
Change-Id: I5c4860c69ccfdae4532498aaea8886ed3905d899
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5302
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-03-08 10:49:11 +00:00
Tomasz Zawadzki
aa22321aca configure: remove --with-igb-uio-driver option
DPDK 20.11 moved the kernel modules to separate
dpdk-kmod repository. It has to be built separate
from DPDK.

If needed for testing vm_setup.sh script now contains option
to build this driver.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I98a5eb956eb0cc60ec402d88fcdbd66d4854f19a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6033
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-01-22 08:47:48 +00:00
Michal Berger
cac9322dc9 scripts/setup: [VFIO] Load vfio_iommu_type1
This is done in order to make sure IOMMU extensions, which DPDK is
looking for, are enabled.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ia9ff8e5329d14a5eb60721f08ff7063cfb1d6eb7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5259
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Mike Gerdts
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-12-04 09:51:26 +00:00
Jim Harris
f1a966dc3d scripts: replace NVME_WHITELIST with NVME_ALLOWED
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4a03ee4040df32710bba67e9ecb68949e49f8693
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5276
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-12-03 09:41:07 +00:00
Jim Harris
a1280c9878 scripts: replace PCI_WHITELIST with PCI_ALLOWED
Similarly replace PCI_BLACKLIST with PCI_BLOCKED.

Use of ALLOWED/BLOCKED matches similar changes made
in DPDK.

While here, replace use of term "blacklist" with "blocked"
in one of the nvme perf scripts.  The usage there was
associated with how devices are blocked by using the
environment variables that are changed by this patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I720d99118ba5e050f436612c9fd415db44294a63
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5275
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-12-03 09:41:07 +00:00
Michal Berger
c0648d4b45 scripts/setup: Check if hugepage files are used before removal
If DPDK was not told to unlink the hugepage backing files during the
hugepage_init, the application will keep them open while holding a
lock on each file. Check if said lock is held, if not, remove the
file.

Change-Id: I738a3d7756c335b63388a2efeb03debd734d9c9e
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5065
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-11-25 08:51:53 +00:00
Michal Berger
bcf9f8ffc4 scripts/setup: Allow to define number of hugepages per node
Change-Id: Ib3ff5ba285a5e7fc70bf2357e4f367b666bc3977
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5046
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-11-25 08:51:53 +00:00
Michal Berger
2b80955c09 scripts/setup: Refactor hugepages allocation for Linux
Main changes:

- By default, allocate all hugepages on node0. On NUMA-aware systems,
  processes will most often use default policy with local node as the
  preffered one for allocations. This usually is node0, thus splitting
  hugepages evenly across the nodes, in default setup, would force
  allocations from a remote node, impacting overall performance (in
  case hugepages on node0 run out). See 68740678e1 as a reference.

- Introduce HUGE_EVEN_ALLOC - force setup.sh to evenly distribute
  hugepages across all the nodes.

- Introduce HUGEPGSZ - overrides default page size

- Introduce CLEAR_HUGE - remove all hugepages on demand before
  allocation is performed.

- HUGENODE - this now can be a list of nodes to use. NRHUGE will be
  set across all the nodes from the list.

Change-Id: I084829edde3c416e7fc6b7b6abe369cc0631fcd7
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5042
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-25 08:51:53 +00:00
Michal Berger
07e251ef42 scripts/setup: Redirect status headers to stderr
This is done so user can easily filter out parts of the output which
are not relevant for additional processing (greping, seding, etc.).

Change-Id: I67eafd1fbeb723224cca6b0026e149cb7f85bfe9
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5152
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-25 08:51:53 +00:00
Michal Berger
7f34367592 scripts/setup: Sort and unify status output on Linux systems
This is done in order to improve the grepability of the output. Sort
is based on the BDF address.

Hugepages statistics are intact.

Change-Id: I121e9a46bfb1550380f233c1d5c06cefb9d4e7a9
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5022
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-25 08:51:53 +00:00
Michal Berger
602b134fa2 scripts/setup: List all devices which have active mountpoints
Change-Id: Ib8124e6e144b4f6524e87af1e9ab8b383afe978a
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5171
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-11-23 09:37:22 +00:00
Michal Berger
eb32e8b2f1 scripts/setup: Return all block devices attached to a given controller
Each nvme BDF can have multiple namespaces, hence multiple block
devices, return them all.

Change-Id: I93fe8acf5b1904f05514445eb3e970ef4254caed
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5170
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
2020-11-23 09:37:22 +00:00
Michal Berger
06058e9bdb scripts/setup: Revert back to using lsblk for mount checks
lsblk will include all the potential holders|virtual devices given
block device may be part of. This is relevant in case a nvme|virtio
device is part of the lvm|md setup.

Change-Id: I32198ddcf71746c3cbad4a96496a1762a5c201cd
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5167
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-23 09:37:22 +00:00
Michal Berger
203fd7ffc7 scripts/setup: Move fallback driver check to collect_driver()
Change-Id: I98de31e32190350c38b52edef8514dc4ab8bda92
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4659
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-10-21 15:08:18 +00:00
Michal Berger
94067e8baf scripts/setup: Check if DPDK drivers are in place
If they are not, there's no point to continue setup on FreeBSD.

Change-Id: I6d94712f1507c0597fbd569ff73c52f262ab9df9
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4658
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-10-21 15:08:18 +00:00
Michal Berger
c90dac7a6e scripts/setup: Gracefully handle contigmem status
Change-Id: Id59b02f08fb093dfc016bd49b9d5073807831040
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4657
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-10-21 15:08:18 +00:00
Michal Berger
1431ea025c scripts/setup: Handle kenv while looking up contigmem opts
In case contigmem is loaded, but the kernel environment hasn't been
properly updated with hw.contigmem.* options, kenv will fail,
breaking the check to determine if contigmem should be unloaded.

Avoid the above scenario by determining first if given option is
actually set in kernel's environment.

Change-Id: I4118b7622fd876b28f0c07d081c583f5782f0357
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4656
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-10-21 15:08:18 +00:00
Michal Berger
e5a08642c5 scripts/setup: Use igb_uio driver as a fallback
Some 4.18.x kernels are shipped with a broken uio driver due to the
following change:

  git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9421e45f5

Try to detect if we are running against a faulty uio driver and if so
fallback to igb_uio driver if present. The priority of picking up the
drivers has not changed.

Note that this commit may be deemed as not needed since from CI
perspective the https://review.spdk.io/gerrit/c/spdk/spdk/+/4342 may
be simply enough.

Change-Id: I9b12511c203c0be0e8f3f462c9c96babde52dc6e
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4343
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-09-29 09:37:33 +00:00
Michal Berger
0cfefac204 scripts/setup: Update default path to igb_uio driver
Change-Id: I61e4bbdc7fd19c74d2a9bf3f4db0dd2e0278a2e4
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4341
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-09-29 09:37:33 +00:00