Skip to content

check-ipc-flood.sh does not work with IPC4 #1066

Closed as not planned
Closed as not planned

Description

@marc-hb

Example in https://sof-ci.01.org/softestpr/PR1057/build454/devicetest/index.html (or in Intel daily test run 28116)

2023-06-15 17:55:26 UTC _ /home/ubuntu/sof-test/test-case/check-ipc-flood.sh need debug version firmware
2023-06-15 17:55:26 UTC _ Starting func_exit_handler(), exit status=2, FUNCNAME stack:
2023-06-15 17:55:26 UTC _  main()  @  /home/ubuntu/sof-test/test-case/check-ipc-flood.sh

cc:

Activity

  1. added
    type:bugSomething doesn't work as expected
    P2Critical bugs or normal features
    type:test coverage gapThis requires a new test case, not just fixing one
    on Jun 23, 2023
  2. ranj063 commented on Jun 27, 2023

    @ranj063
    Contributor

    I'm not sure if flood test will ever work with IPC4. This requires the addition of a new kind of IPC into IPC4 and I dont think there are any plans for it. Can we simply omit these from testing for IPC4?

  3. marc-hb commented on Jun 27, 2023

    @marc-hb
    CollaboratorAuthor

    Can we simply omit these from testing for IPC4?

    We sure can if everyone agrees. Where can we bring that question up?

    BEFORE we remove that test from the corresponding test plans we need to fix the misleading error message. We can probably just add something like if ipc4; then skip_test "only IPC3 is supported"

  4. ranj063 commented on Jun 28, 2023

    @ranj063
    Contributor

    Can we simply omit these from testing for IPC4?

    We sure can if everyone agrees. Where can we bring that question up?

    BEFORE we remove that test from the corresponding test plans we need to fix the misleading error message. We can probably just add something like if ipc4; then skip_test "only IPC3 is supported"

    yes, lets just do that for now

  5. marc-hb commented on Aug 1, 2024

    @marc-hb
    CollaboratorAuthor

    wontfix

  6. marc-hb commented on Aug 13, 2024

    @marc-hb
    CollaboratorAuthor

    I'll see if I can quickly fix the error message.

  7. self-assigned this
    on Aug 13, 2024
  8. marc-hb commented on Aug 13, 2024

    @marc-hb
    CollaboratorAuthor

    So to decide whether it should test or SKIP, the short (and pretty poorly written) check-ipc-flood.sh currently looks for this in the kernel logs:

    Aug 13 18:08:19 jf-cml-sku0983-sdw-1 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 2:2:10-e05ca
    Aug 13 18:08:19 jf-cml-sku0983-sdw-1 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:23:0 Kernel ABI 3:23:0
    Aug 13 18:08:19 jf-cml-sku0983-sdw-1 kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware debug build 65535 on dtermin.-extman - options:
                                                  GDB: disabled
                                                  lock debug: disabled
                                                  lock vdebug: disabled
    

    Instead of this:

    Aug 13 11:17:35 up2 kernel: sof-audio-pci-intel-apl 0000:00:0e.0: Firmware info: version 2:2:0-57864
    Aug 13 11:17:35 up2 kernel: sof-audio-pci-intel-apl 0000:00:0e.0: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
    

    In other words, if Firmware debug is found in the kernel log then it runs, otherwise it skips. (It does not even look for sof-audio... or ... build, sigh...)

    This is quite ugly.

    Is there some more reliable and hopefully generic (IPC-independent) way to check whether this IPC is supported?

    sound/soc/sof/ipc3.c

    [         943.437] (         142.500) c0 ipc                  src/ipc/ipc3/handler.c:1605 INFO ipc: new cmd 0xb0010000
    [         951.771] (           8.333) c0 ipc                  src/ipc/ipc3/handler.c:1650 ERROR ipc: unknown command type 2952790016

    EDIT: this is based on this kernel code, so it's not as "ugly" as I thought it was:

    int sof_ipc3_validate_fw_version(struct snd_sof_dev *sdev)
    {
            dev_info(sdev->dev,
                     "Firmware info: version %d:%d:%d-%s\n",  v->major, v->minor,
                     v->micro, v->tag);
            dev_info(sdev->dev,
                     "Firmware: ABI %d:%d:%d Kernel ABI %d:%d:%d\n",
    
     ....
    
            if (ready->flags & SOF_IPC_INFO_BUILD) {
                    dev_info(sdev->dev,
                             "Firmware debug build %d on %s-%s - options:\n"
                             " GDB: %s\n"
  9. marc-hb commented on Aug 13, 2024

    @marc-hb
    CollaboratorAuthor

    How about this:

    root@up2:~# echo 1 > /sys/kernel/debug/sof/ipc_flood_count ; echo $?
    -bash: echo: write error: Invalid argument
    1
    

    In other words, a "flood" of just 1 just to probe the feature. If that works, then flood "for real" with either the 10,000 default or the command line argument. Otherwise SKIP.

    The risk is wrongly SKIPping because the entire flooding feature is broken (when it shouldn't be) and it fails even with 1.

    cc: @ujfalusi

  10. marc-hb commented on Aug 13, 2024

    @marc-hb
    CollaboratorAuthor

    Here's a much smaller and simpler SKIP message fix, please review:

  11. marc-hb commented on Aug 14, 2024

    @marc-hb
    CollaboratorAuthor

    Just noticed check-ipc-flood.sh does not care about firmware logs...

  12. ujfalusi commented on Aug 14, 2024

    @ujfalusi
    Contributor
    echo 1 > /sys/kernel/debug/sof/snd_sof.ipc_flood.0/ipc_flood_count 
    -bash: echo: write error: Invalid argument
    

    and in kernel:

    [ 1579.215851] snd_sof:ipc3_log_header: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0xb0010000: GLB_TEST_MSG: IPC_FLOOD
    [ 1579.215969] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx error for 0xb0010000 (msg/reply size: 8/0): -22
    [ 1579.215977] snd_sof_ipc_flood_test snd_sof.ipc_flood.0: ipc flood test failed at 0 iterations
    

    so, the firmware have the IPC flood test disabled, because the firmware is not built with CONFIG_DEBUG, there is not much the kernel do here, it cannot know this...

  13. marc-hb commented on Aug 14, 2024

    @marc-hb
    CollaboratorAuthor

    Thanks for the additional information @ujfalusi.

    Better error message just merged with a reference to this issue. Closing as wontfix for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Critical bugs or normal featurestype:bugSomething doesn't work as expectedtype:test coverage gapThis requires a new test case, not just fixing one

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions