Skip to content
Snippets Groups Projects
  1. Sep 26, 2023
    • Lionel Landwerlin's avatar
    • Vitaly Prosyak's avatar
      tests/amdgpu: add GFX11 to dispatch tests · d513324e
      Vitaly Prosyak authored
      
      Add GFX11 to dispatch tests known as GPU reset
      with binary shaders.
      Improve GPU reset tests by validating flags, if no reset
      or reset is still in progress then avoid asserting the
      status.
      Use the amdgpu_cs_query_reset_state2 which  is available
      on drmlib > 2.4.99.
      Remove dispatch tests from basic tests due to duplicate.
      
       v2:
           - restricted build for dispatch tests due to build failure
             for drmlib < 2.4.99 (Kamil)
           - spelling correction and formatting issues (Kamil)
           - improve comment (Luben)
      
      Cc: Jesse Zhang <Jesse.Zhang@amd.com>
      Cc: Luben Tuikov <luben.tuikov@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian Koenig <christian.koenig@amd.com>
      Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
      
      Signed-off-by: default avatarVitaly Prosyak <vitaly.prosyak@amd.com>
      Reviewed-by: default avatarJesse Zhang <Jesse.Zhang@amd.com>
      d513324e
    • Vitaly Prosyak's avatar
      tests/amdgpu: split deadlock tests · afcf051a
      Vitaly Prosyak authored
      
      Split GPU reset (known as deadlock) tests into
      command-based (deadlock) and the other using binary shaders
      (dispatch).The one of primary reasons for splitting is to use
      new functions like 'amdgpu_cs_query_reset_state2' in next commits.
      No functional change.
      Some code formatting  improvements to meet IGT guidelines.
      Added igt_describe for GPU reset tests known now as deadlock and
      dispatch based tests.
      
      Cc: Luben Tuikov <luben.tuikov@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian Koenig <christian.koenig@amd.com>
      Cc: Jesse Zhang <Jesse.Zhang@amd.com>
      Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
      
      Signed-off-by: default avatarVitaly Prosyak <vitaly.prosyak@amd.com>
      Reviewed-by: default avatarJesse Zhang <Jesse.Zhang@amd.com>
      afcf051a
  2. Sep 25, 2023
  3. Sep 22, 2023
  4. Sep 21, 2023
  5. Sep 20, 2023
  6. Sep 19, 2023
    • Janusz Krzysztofik's avatar
      lib/kunit: Load test modules in background · f033d053
      Janusz Krzysztofik authored
      
      For igt_runner to be able to correlate a stream of IGT results from
      dynamic sub-subtests that correspond to individual kunit test cases, read
      by the igt_runner from stdout / stderr of the test process, with a stream
      of kernel messages read from /dev/kmsg, we need both result streams being
      fed with data in parallel.  While our KTAP parser is currently started in
      the background and reads KTAP results from /dev/kmsg in parallel with
      execution of kunit tests performed by the kernel while we are loading a
      kunit test module, results from the parser are then only stored as
      intermediate data and not processed any further until the module loading
      completes.  As a consequence, there is no synchronization between the two
      streams.
      
      Call the function that loads the kunit test module from a separate thread
      and process the intermediate results immediately, as soon as available
      from the background parser, without waiting for completion of module
      loading.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Acked-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      f033d053
    • Janusz Krzysztofik's avatar
      lib/ktap: Reimplement KTAP parser · fe06ddff
      Janusz Krzysztofik authored
      
      Current implementation of KTAP parser suffers from several issues:
      - works only with built-in kunit, can't parse KTAP output if modular,
      - in most cases, kernel messages that are not part of KTAP output but
        happen to appear in between break the parser,
      - results from parametrized test cases, not preceded with a "1..N" test
        plan, break the parser,
      - skips are not supported, reported as success,
      - IGT results from all 3 kunit test nesting levels, i.e., from
        parametrized subtests (should those were fixed to work correctly), test
        cases and test suites, are reported individually as if all those items
        were executed sequentially, all at the same level of nesting, which can
        be confusing to igt_runner,
      - subtest names mostly consist of kunit suite name and kunit test case
        name but not always, sometimes the first component is omited,
      - the parser is not only parsing the data, but also handles data input
        from a /dev/kmsg like source, which is integrated into it, making it
        hard if not impossible to feed KTAP data from different sources,
        including mock sources,
      - since the parser has been designed for running it in a separate thread,
        it's not possible to use igt_skip() nor igt_fail() and friends
        immediately when a result is available, only pass it to the main thread
        over a buffer.  As a consequence, it is virtually impossible to
        synchronize IGT output with KTAP output.
      
      Fixing the existing parser occurred more complicated than re-implementing
      it from scratch.  This patch provides a new implementation.
      
      Only results from kunit test cases are reported as results of IGT dynamic
      sub-subtests.  Results from individual parametrized subtests have been
      considered problematic since many of them provide multi-word descriptions
      in place of single-word subtest names.  If a parametrized test case fails
      then full KTAP output from its subtests, potentially mixed with
      accompanying kernel messages, is available in dmesg for analysis so users
      can still find out which individual subtests succeeded and which failed.
      
      Results from test suites level are also omitted in faith that IGT can
      handle aggregation of results from individual kunit test cases reported as
      IGT dynamic sub-subtests and report those aggregated results correctly as
      results from an IGT dynamic subtest.  That 1:1 mapping of kunit test
      suites to IGT dynamic subtests now works perfectly for modules that
      provide only one test suite, which is the case for all kunit test modules
      now existing under drivers/gpu/drm, and the most common case among all
      kunit test modules in the whole kernel tree.
      
      New igt_ktap functions can be called directly from igt_kunit subtest body,
      but for this patch, the old igt_ktap_parser() function that runs in a
      separate thread has been preserved, only modified to use the new
      implementation and translate results from those new functions to legacy
      format.  Unlike the former implementation, translation of kunit names to
      IGT names is handled outside the parser itself, though for now it is still
      performed inside the legacy igt_ktap_parser() function.
      
      For better readability of the patch, no longer used functions have been
      left untouched, only tagged with __maybe_unused to shut up compiler
      warnings / errors.  Kunit library functions will be modified to use the
      new igt_ktap interface, and those old ktap functions removed by follow-
      up patches.
      
      A test with example subtests that feed igt_ktap_parse() function with some
      example data and verifies correctness of their parsing is also provided.
      
      v2: Fix incorrect and missing includes in the test source file,
        - add license and copyright clauses to the test source file.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Acked-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      fe06ddff
    • Janusz Krzysztofik's avatar
      lib/ktap: Use IGT linked lists for storing KTAP results · 1674d77a
      Janusz Krzysztofik authored
      
      For code simplicity and clarity, use existing IGT linked lists library
      instead of open coding a custom implementation of a list of KTAP results.
      
      While being at it, flatten the code by inverting a check for pending
      results.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Acked-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      1674d77a
    • Janusz Krzysztofik's avatar
      lib/kunit: Fail / skip on kernel taint · 10d42083
      Janusz Krzysztofik authored
      
      Similar to how igt_kselftest() handles kernel taints, fail current dynamic
      sub-subtest and skip remaining ones when a kernel taint is detected during
      execution of kunit test cases.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Reviewed-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      10d42083
    • Janusz Krzysztofik's avatar
      lib/ktap: Read /dev/kmsg in blocking mode · 94dbcc8b
      Janusz Krzysztofik authored
      
      We obtain KTAP report from /dev/kmsg.  That file is now opened from
      igt_ktest_begin(), a function originally designed for i915 selftests and
      now reused with kunit tests.  The original intention of opening that file
      was to dump kernel messages to stderr on selftest error.  For that
      purpose, the file is now opened in non-blocking mode so we don't end up
      waiting for more kernel messages than already available.  Since our ktap
      parser code reuses the file descriptor, we now have to loop over
      EAGAIN responses, waiting for more KTAP data.  Since we have no sleeps
      inside those loops, extremely high CPU usage can be observed.
      
      Simplify reading KTAP reports by first switching the file descriptor back
      to blocking mode.
      
      While being at it, fix read errors other than EPIPE likely unintentionally
      ignored when reading first line of KTAP data.
      
      v2: Drop EINTR handling as not applicable since SIGINT default signal
          handler kills the whole process anyway,
        - update commit description to also mention read error handling fix.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Reviewed-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      94dbcc8b
    • Janusz Krzysztofik's avatar
      lib/ktap: Drop is_running flag · 700fd82e
      Janusz Krzysztofik authored
      
      Since we now call pthread_cancel() when we want to stop KTAP parser before
      it completes, and we take care of returning failure in that case as a
      result of KTAP parsing, we no longer need to check a flag that indicates
      whether we should continue parsing or return a failure.  Drop that flag.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Reviewed-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      700fd82e
    • Janusz Krzysztofik's avatar
      lib/kunit: Cancel KTP parser on module load failure · 3276f354
      Janusz Krzysztofik authored
      
      For our KTAP parser to be running in parallel with kunit test module
      loading, we now start it in a separate thread before we load the module.
      If the module loading fails then we join the KTAP parser thread right
      after that failure.  If the KTAP thread sleeps for some reason then we
      can fail to break the test immediately.
      
      Cancel the KTAP parser thread right after module load error and before
      joining it.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Reviewed-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      3276f354
    • Janusz Krzysztofik's avatar
      lib/ktap: Drop checks for EINTR on read() failures · 1dd5530d
      Janusz Krzysztofik authored
      
      While reading KTAP data from /dev/kmsg we now ignore EINTR failures that
      may occur during read() and we continue reading the data.  No explanation
      has been provided on what that could be needed for.
      
      Since we use default SIGINT signal handler, read() should never fail with
      errno set to EINTR on user interrupt, only the whole process should be
      terminated.  Drop checks for errno == EINTR as not applicable.
      
      v2: Drop handling of EINTR completely, update commit message and
          descripion.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Acked-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      1dd5530d
    • Janusz Krzysztofik's avatar
      lib/ktap: Make sure we fail on premature cancel · 2adb7f07
      Janusz Krzysztofik authored
      
      After loading a kunit test module that executes some kunit test cases, we
      evaluate overall result of an IGT subtest that corresponds to that module
      based on an error code returned by kunit_parser_stop() helper, obtained
      from a .ret field of a ktap_args structure.  That code is now assigned to
      that structure field right before completion of the KTAP parser thread
      start routine.  If the thread is canceled for some reason then the return
      code will be undefined.
      
      Initialize the return code on KTAP parser startup with a value that
      indicates a failure, then change it to success when so indicated by result
      of KTAP parsing.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Reviewed-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      2adb7f07
    • Janusz Krzysztofik's avatar
      lib/kunit: Fix illegal igt_fail() calls inside subtest body · 295e91ed
      Janusz Krzysztofik authored
      
      In a body of a subtest with dynamic sub-subtests, it is illegal to call
      igt_fail() and its variants from outside of a dynamic sub-subtest body.
      On the other hand, it is perfectly legal to call either igt_skip() and
      friends or __igt_abort() or its variant from there.
      
      In the current implementation of igt_kunit(), there are several places
      where igt_fail() is called despite being illegal.  Moreover, it is called
      with IGT_EXIT_ABORT as an argument with no good reason for using such
      aggressive method that forces CI to trigger system reboot (in most cases
      igt_runner can decide if abort is required).
      
      Follow igt_kselftests() pattern more closely, where similar setup and
      cleanup operations are performed but their potential errors are processed
      in a more friendly way.  Move common cleanup and their corresponding setup
      steps out of the subtest body.  Place the latter as requirements in a
      preceding igt_fixture section.  Replace remaining illegal igt_fail() calls
      with more friendly skips.  Let igt_runner decide if abort is needed.
      
      v2: Also call igt_skip() on igt_ktest_init() failure (Mauro), but then,
          initialize local tst structure when declaring it to avoid freeing a
          random pointer from igt_ktest_fini() when only listing subtests,
        - call igt_ktest_end() from igt_fixture so it is not unnecessarily
          called when only listing subtests.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Acked-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      295e91ed
  7. Sep 18, 2023
  8. Sep 16, 2023
    • Jie1zhang's avatar
      lib/amdgpu: add shaders for gfx11 · 2aaeef0c
      Jie1zhang authored and Vitaly Prosyak's avatar Vitaly Prosyak committed
      
      add memcpy shader for gfx11
      
      Cc: Luben Tuikov <luben.tuikov@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian Koenig <christian.koenig@amd.com>
      
      v2 : added disassembly comments (Vitaly)
      
      Signed-off-by: default avatarJesse zhang <jesse.zhang@amd.com>
      Reviewed-by: default avatarVitaly Prosyak <vitaly.prosyak@amd.com>
      Reviewed-by: default avatarLuben Tuikov <luben.tuikov@amd.com>
      2aaeef0c
    • Jie1zhang's avatar
      tests/amdgpu: skip CE subtest for gfx11 · 693901d1
      Jie1zhang authored and Vitaly Prosyak's avatar Vitaly Prosyak committed
      
      Due to CE is not available on gfx11,
      so skip CE subtest for gfx11.
      
      v2 : - code logic improvements(Vitaly)
      v3 : - formatting improvements(Luben)
      
      Cc: Luben Tuikov <luben.tuikov@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian Koenig <christian.koenig@amd.com>
      
      Signed-off-by: default avatarJesse Zhang <Jesse.Zhang@amd.com>
      Reviewed-by: default avatarVitaly Prosyak <vitaly.prosyak@amd.com>
      Reviewed-by: default avatarLuben Tuikov <luben.tuikov@amd.com>
      693901d1
    • Jie1zhang's avatar
      lib/amdgpu: Fix family id failed during initialization · e9e64bd2
      Jie1zhang authored and Vitaly Prosyak's avatar Vitaly Prosyak committed
      
      Starting subtest: userptr-with-IP-DMA
      Starting dynamic subtest: userptr
      (amd_basic:1766) amdgpu/amd_command_submission-CRITICAL: Test assertion failure function amdgpu_test_exec_cs_helper, file ../lib/amdgpu/amd_command_submission.c:84:
      (amd_basic:1766) amdgpu/amd_command_submission-CRITICAL: Failed assertion: r == 0
      (amd_basic:1766) amdgpu/amd_command_submission-CRITICAL: Last errno: 62, Timer expired
      (amd_basic:1766) amdgpu/amd_command_submission-CRITICAL: error: -62 != 0
      Stack trace:
        #0 ../lib/igt_core.c:1988 __igt_fail_assert()
        #1 ../lib/amdgpu/amd_command_submission.c:85 amdgpu_test_exec_cs_helper()
        #2 ../tests/amdgpu/amd_basic.c:308 __igt_unique____real_main623()
        #3 ../tests/amdgpu/amd_basic.c:623 main()
        #4 ../sysdeps/nptl/libc_start_call_main.h:58 __libc_start_call_main()
        #5 ../csu/libc-start.c:128 __libc_start_main@@GLIBC_2.34()
        #6 [_start+0x25]
      Due to the incorrect family_id, it result in the
      userptr test fail. So correct the initial value of
      the family id when setting up amdgpu blocks.
      
      v2 : - keep initialization of family_id to FAMILY_VI( Vitaly)
           - added comments (Vitaly)
      
      Cc: Luben Tuikov <luben.tuikov@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian Koenig <christian.koenig@amd.com>
      Signed-off-by: default avatarJesse Zhang <Jesse.Zhang@amd.com>
      Reviewed-by: default avatarVitaly Prosyak <vitaly.prosyak@amd.com>
      Reviewed-by: default avatarLuben Tuikov <luben.tuikov@amd.com>
      e9e64bd2
  9. Sep 15, 2023
Loading