Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
SMP Tests

Functions

void test_smp_ipi (void)
 Test interprocessor interrupt. More...
 

Detailed Description

Function Documentation

◆ test_smp_ipi()

void test_smp_ipi ( void  )

#include <tests/kernel/smp/src/main.c>

Test interprocessor interrupt.

Test Objective:

  • To verify architecture layer provides a mechanism to issue an interprocessor interrupt to all other CPUs in the system that calls the scheduler IPI. We simply add a hook in z_sched_ipi(), in order to check if it has been called once in another CPU except the caller, when arch_sched_ipi() is called.

Testing techniques:

  • Interface testing, function and block box testing, dynamic analysis and testing

Prerequisite Conditions:

  • CONFIG_SMP=y, and the HW platform must support SMP.
  • CONFIG_TRACE_SCHED_IPI=y was set.

Input Specifications:

  • N/A

Test Procedure:

  1. In main thread, given a global variable sched_ipi_has_called equaled zero.
  2. Call arch_sched_ipi() then sleep for 100ms.
  3. In z_sched_ipi() handler, increment the sched_ipi_has_called.
  4. In main thread, check the sched_ipi_has_called is not equaled to zero.
  5. Repeat step 1 to 4 for 3 times.

Expected Test Result:

  • The pointer of current cpu data that we got from function call is correct.

Pass/Fail Criteria:

  • Successful if the check of step 4 are all passed.
  • Failure if one of the check of step 4 is failed.

Assumptions and Constraints:

  • This test using for the platform that support SMP, in our current scenario , only x86_64 and arc supported.
See also
arch_sched_ipi()

TESTPOINT: check if enter our IPI interrupt handler