Commit Graph

32 Commits

Author SHA1 Message Date
Debarshi Dutta
200777b854 gpu: nvgpu: bvec for channel and tsg
Below changes are added.

1) Added checks in
    nvgpu_channel_from_id__func, nvgpu_tsg_check_and_get_from_id
2) Added BVEC tests for
    nvgpu_channel_open_new, nvgpu_channel_from_id,
    nvgpu_tsg_check_and_get_from_id, nvgpu_tsg_set_error_notifier
3) Added common function get_random_u32.

Jira NVGPU-6905

Change-Id: I374d6f5503dc05e3224213d772a1752d82cbdc91
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2548304
(cherry picked from commit 39b2529b3e96cfd3cbd3bb020f32ee2cca0ea363)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2554021
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-07-07 12:25:50 -07:00
Thomas Fleury
4f682bf107 gpu: nvgpu: igpu and dgpu driver libs
Different build flags are used for iGPU and dGPU in
safety build. In order to support dGPU in unit tests,
a separate library is needed for the driver.

Added makefiles to build:
- libnvgpu-drv-igpu.so
- libnvgpu-drv-dpgu.so

Updated scripts and units makefiles to use libnvgpu-drv-igu
by default.

Jira NVGPU-5217

Change-Id: Ibcc56088723cec5cb2d0ac42725102ae0c886014
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2333499
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-15 14:13:28 -06:00
Thomas Fleury
80285be2da gpu: nvgpu: unit: add --driver-load-path arg
Add --driver-load-path option to specify which library to
load for driver.
There is already an --unit-load-path option that can be
used to specify where to load units from.

Example usage:
./nvgpu_unit --nvtest --unit-load-path units/dgpu \
      --no-color --num-threads 1 \
      --driver-load-path ./libnvgpu-drv-dgpu.so

Jira NVGPU-5217

Change-Id: I6af5d2029138b25a6715154779b812d30052e9e9
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2333498
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-15 14:13:28 -06:00
Nicolas Benech
fee7b81061 gpu: nvgpu: unit: required tests system
When running unit testing, we need to ensure that all expected unit
tests were actually run. This used to be done by an external Python
script, but it is not suitable for some OSes. This patch brings this
mechanism into the unit testing framework, and makes use of an INI
file to provide the list of expected tests.

JIRA NVGPU-3072

Change-Id: I9ed590de9005fe10324c594ea33ebc8fda482019
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2317220
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-15 14:13:28 -06:00
Nicolas Benech
048c700975 gpu: nvgpu: unit: exit properly if signal in single thread
In the unit test framework, if a fatal error occurs in a module that
generates a POSIX signal (like segfault), the error handler will log
the error and kill the thread. However, if running in single threaded
mode (which is the default), killing the thread means killing the
process too. This means that results.json is not generated which
makes results in automation more difficult to read.

This patch updates the error handler to print the results as expected
and exit gracefully.

JIRA NVGPU-3157

Change-Id: I0204816b18312238e6502eb400e21d0e445e7e6c
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2278481
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:10:29 -06:00
Prateek sethi
5f74899178 gpu: nvgpu: flush the UTF fprintf buffer on each call
In case of segmentation fault or hang unit test prints are not coming
in GVS logs which has already run. It makes difficult to find exact
faulty test/unit.

Adds fflush which flush the msg buffer after each call.

Bug 200577095

Change-Id: Ib77ec40636d9416414ef1a00dcf8886b7aae0f3b
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2275538
Reviewed-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:10:29 -06:00
Nicolas Benech
86f1b2336a gpu: nvgpu: unit: add test function name to logs
This patch adds the test function name to output logs to make it
easier to establish traceability between SWUTS and test results.
Also, the unit test name as defined in the UNIT_TEST macro can
now be used to clarify the subcase when a given test function is
used several times with different arguments.

JIRA NVGPU-3510

Change-Id: I652ecd8c06fd89e4d78d419f73b35b69ae71a8ef
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2241879
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:10:29 -06:00
Philip Elcan
95c3e56961 gpu: nvgpu: unit: propagate fault injection to threads
Change approach to how the fault injection state is stored to facilitate
propagating fault injection state to child-threads. Rather than each
unit maintaining a thread-local object, there is a thread-local
container stored in the posix-fault-injection itself. This container is
initialized for each test module so that is independent of other other
test modules (for parallel test module execution). When child threads
are created with nvgpu_create_thread(), the fault injection container is
configured for the child.

JIRA NVGPU-3981

Change-Id: I9b580dc7f1621a7770eef8eba796f3918f2738bf
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2238474
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:10:29 -06:00
Nicolas Benech
4523ee2b14 gpu: nvgpu: unit: enable signal handler in single thread
Until now, using single thread we disable the signal handler to
make it easier to debug crashes. Since we are now using single
threading in GVS, it is better to have the signal handler enabled
by default. This patch introduces a "-d" argument to explicitly
disable the signal handler and thus make local debugging easier.

JIRA NVGPU-2975

Change-Id: I35b0fb71990b3fef575242c1bba398a3b0e6facf
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2223662
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:10:29 -06:00
Nicolas Benech
9f8470d37c gpu: nvgpu: fw: fix error code in signal handler
In the signal handler (i.e. when a crash such as segfault occurs),
the framework needs to register the test as failed. The call to
core_add_test_record was incorrect as it was using a boolean instead
of an enum value.

JIRA NVGPU-1246

Change-Id: I5480ec38ca9949bc85aa523cc50a68af203fd165
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2206539
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:05:52 -06:00
Philip Elcan
bb61fc110b gpu: nvgpu: unit: add test levels to required test tracking
Add tracking of test levels to the required test mechanism in the unit
test framework. The json output will now include the test level. This
will allow runs with just level 0 tests to correctly verify the right
tests run.

JIRA NVGPU-3200

Change-Id: Ifc7c7ad5b605487945e0406d387f54ba04f1680d
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2103515
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-24 16:54:18 -07:00
Philip Elcan
de1edcc1ee gpu: nvgpu: unit: fix pass calculation for L1 tests
Fix the pass/fail verdict caldulation for the main() return value and
the nvtest print out. They were not considering the skipped tests.

JIRA NVGPU-3200

Change-Id: I4383cff4ef864c49f072299ad2f38a94ca1f5230
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2103514
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-24 16:54:00 -07:00
Philip Elcan
c0d5a715bd gpu: nvgpu: unit: add test levels
Add -t/--test-level option for the unit test framework. This
correlates with the test plan levels in GVS. L0 tests are a subset of
the L1 tests. Currently, only test levels 0 and 1 are supported.

The test output has been updated to display skipped tests. Skipped
tests are not included in the test dump.

JIRA NVGPU-2251

Change-Id: Icc2ff19a81529be8526e89f70983e96040390e00
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085280
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-05 13:14:20 -07:00
Nicolas Benech
88256dd9cc gpu: nvgpu: unit: add verbose_lvl function
The verbose_lvl function allows a unit module to retrieve the current
verbosity level (set by the -v args) and therefore use it to enable
log masks as needed.

JIRA NVGPU-2975

Change-Id: Ic41c9e962ca4fa9c0a6c130857f0df5b3b7215c7
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085058
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-01 11:05:44 -07:00
Philip Elcan
91669ac61e gpu: nvgpu: unit: track time for test modules
When run with '-v' option, the unit tests will include the execution
time for each test module in seconds. E.g.

  [C] Module completed: posix_bitops (execution time: 0.607291)

Update unit.sh to run with -v option on target to get data for GVS runs
if tests start timing out.

Change-Id: I2a38ac458c5a5809777df33635e271e4dc9727de
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2082015
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-28 08:14:55 -07:00
asah
03145af1eb gpu: nvgpu: remove RTLD_GLOBAL flag from libnvgpu-drv.so dlopen for QNX tests
currently libnvgpu-drv.so is opened with RTLD_GLOBAL flag which is
required for nvgpu common tests but for qnx tests we dont need any
symbol from libnvgpu-drv.so (except nvgpu_posix_probe and
nvgpu_posix_cleanup which we will eventually remove for qnx) so
RTLD_GLOBAL should not be used in case of qnx tests. If RTLD_GLOBAL is
used for qnx tests then the symbols from libnvgpu-drv.so will be used
instead of from libqnx_mock.so which is wrong.

This change uses -Q command line option to make the decision about
RTLD_GLOBAL flag

After this change qnx unit tests should be run with -Q option and nvgpu
common unit tests should be run without it

JIRA NVGPU-1352

Change-Id: I759db679f5b95696835c8125c21f95bf35df590c
Signed-off-by: asah <asah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011271
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-14 22:13:39 -08:00
asah
49255caeff gpu: nvgpu: unit: Argument to run QNX tests
Created a command line argument '-Q' for nvgpu_unit. It represents that
the tests are QNX specific tests.

Change-Id: I178e220de1777c7de30f489ad9f3b5352db3aa19
Signed-off-by: asah <asah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2013907
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-10 17:03:39 -08:00
Alex Waterman
16735840ee gpu: nvgpu: unit: Fix --no-color bug
The color itself was not being printed when `--no-color' was set
but the reset color escape sequence was still being printed. This
fixes that bug so that now, when `--no-color' is specified neither
the color or the reset sequence is printed.

This cleans up the log mess in GVS runs.

JIRA  NVGPU-1737

Change-Id: I8f612d3f920b78e25ba606add703b310da36d7a7
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2007626
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-31 09:15:41 -08:00
Nicolas Benech
ccb4c67a1b gpu: nvgpu: unit: Test execution verification
When running unit tests, a log of all executed tests is
generated. A script along with the "required_tests.json"
will check that all required tests were effectively run, thus
ensuring that no tests are silently missing. The "testlist.py"
support script is also used to generate the list of required
tests, and can also generate an HTML-formatted output with links
to JAMA requirements wherever possible.

JIRA NVGPU-1717

Change-Id: Ic361b1d0a5f003f8b24952d63e20fb496dd1e787
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1983631
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-04 15:23:59 -08:00
Nicolas Benech
48648cfc58 gpu: nvgpu: unit: Argument to run single unit
Specify a unit to run from the command line, especially useful
as the number of units is increasing. The argument behaves as
a wildcard. All units that contain the argument in the name will
be executed.

JIRA NVGPU-1246

Change-Id: Ia650929751a0acd83fc034fbeb0fd7df8d39e48d
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1967082
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-07 13:54:27 -08:00
Philip Elcan
78eca5bdc3 gpu: nvgpu: unit: print nvtest info for whole test
The nvtest output required to run as part of the nvgpu_submit framework
was being printed per unit test. However, when we run each test in a
thread with -j, the nvtest output was mixed among the tests as they
finished and the results were not consistent.

This patch changes the unit test framework to only output the nvtest
start/pass/fail messages for the entire unit test framework run so that
the output is consistent. This will allow enabling of threaded runs in
GVS.

For the NVTEST output, we want to use the binary name, so save that from
argv[0] to use later.

JIRA NVGPU-1042

Change-Id: I71697e75d4a0bba8c5aa2425bc25de57322826d7
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1924616
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-18 13:44:28 -07:00
Philip Elcan
9bf47eff8a gpu: nvgpu: unit: fix typo in error msg
This fixes a typo in an error message in the unit test framework when
unable to parse command line arguments.

Change-Id: I8a8fe0dea9480db730b48bcf81671a5701fdd251
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1924615
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-18 13:44:25 -07:00
Philip Elcan
7ac7c061a1 gpu: nvgpu: unit: only load .so files
There was a situation where a .so.debug file was stored with the unit
.so files and was causing the unit test framework to abort with a "Bus
Error."

This update only loads files ending in .so to avoid loading invalid
files in the future.

Bug 2415403

Change-Id: I0c3cdd7a05942b746695f88f5b1f2324f309daba
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1924614
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-18 13:44:21 -07:00
Philip Elcan
334f5869c9 gpu: nvgpu: unit: add output to make nvtest happy
This adds the correct output for the nvtest interpreter in GVS to track
the per-test pass/fails.

JIRA NVGPU-1042

Change-Id: I7f4a1a63c64988520db08029231f0db9deeaee7d
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1850293
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:10 +05:30
Alex Waterman
e1da1cd2c2 gpu: nvgpu: unit: Delete unused Makefile
The nvgpu unit test binary and shim library are built
from nvgpu/userspace. The Makefile.tmk in nvgpu/userspace/src
was not being used for anything it seems.

This also updates the nvgpu/userspace makefile to specify the
dependence on libnvgpu-drv.so.

Change-Id: I24b6682c7ebf84c36ef38923eee96a6277a7083c
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1850544
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:09 +05:30
Konsta Holtta
2cafb5fe74 gpu: nvgpu: unit: close the module dir
Call closedir on the opened load directory also on success; it was there
only for the error path.

Change-Id: I869c9e583fdf7453c752744b0af054d521717feb
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1916642
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:08 +05:30
Nicolas Benech
ac87a707b3 gpu: nvgpu: posix: Multithreading for unit tests
Add a -j argument to enable running unit tests on several
threads. Also adds signal handling to prevent a fatal
error in one thread from killing the whole unit test
framework.

JIRA NVGPU-1043

Change-Id: I891a547640cd005a50ffa5c06367ed46c54de012
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1847740
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:07 +05:30
Konsta Holtta
1982d050cc gpu: nvgpu: unit: deref twice in qsort callback
The compare function for qsort takes pointers to compared elements, and
our elements are already pointers so the void pointer has to be cast to
a pointer pointer. Dereferencing only once would compare some data
that's in the array of module pointers (or past it), not the actual data
where the module pointers point to.

Change-Id: I65678863eddd6fc86d4ffceb621f8123944b058d
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1828164
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-09-17 23:42:05 -07:00
Terje Bergstrom
6af7b2288f gpu: nvgpu: module.c should #include its own hdr
userspace/src/module.c should #include its own <unit/module.h> to get
declarations for the functions defined.

Change-Id: Icff647f19468607ebfb757360b83ce9f133bd5ec
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1797034
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-08-10 21:33:27 -07:00
Alex Waterman
70915d8d60 gpu: nvgpu: unit: Sort unit tests by priority
Sort unit tests by their priority before running said unit tests.
There are three available priorities:

  UNIT_PRIO_SELF_TEST
  UNIT_PRIO_POSIX_TEST
  UNIT_PRIO_NVGPU_TEST

Which correspond to the types of testing expected to be run. In
general unit tests should always just use UNIT_PRIO_NVGPU_TEST but
in the case of tests for the POSIX API layer or the unit test
framework the other two priorities are provided.

The reason for this is that it doesn't make much sense to run a
bunch of unit tests if the environment itself or the POSIX API
layer is broken. By placing these tests at the front of the list
of tests to run an engineer will easily be able to see if there
are core problems versus nvgpu problems.

This also lets users fine grain control of test order by adding
or subtracting to UNIT_PRIO_NVGPU_TEST but one must be very
careful about how they do this.

JIRA NVGPU-525

Change-Id: I12a5b798e998f34e4d1168bb3696c579460f20b1
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1741953
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-08-09 23:11:09 -07:00
Alex Waterman
691bf90445 gpu: nvgpu: unit: Add unit testing FW
Full documentation for this is in the unit testing
confluence page.

JIRA NVGPU-525
Bug 2261555

Change-Id: I463e6267eb0eb12b7313f8b275266e8faabe5ccf
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1683915
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-08-09 23:11:06 -07:00
Alex Waterman
6e739d924f gpu: nvgpu: Userspace POSIX support
Add support for compiling nvgpu in a POSIX compliant userspace.
This code adds all of the necessary abstraction interfaces (mostly
stubbed) to enabled extremely limited and basic functionality in
nvgpu.

The goal of this code is to facilitate unit testing of the nvgpu
common core. By doing this in userspace it is much easier to write
tests that rely on very particular states within nvgpu since a user
can very precisely control the state of nvgpu.

JIRA NVGPU-525

Change-Id: I30e95016df14997d951075777e0585f912dc5960
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1683914
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-05-07 04:41:26 -07:00