Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mctpd: Make timeout and bus owner configs configurable #14

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Sep 27, 2023

  1. mctpd: Add timeout overriding using program arguments

    Currently, the timeout is hardcoded with the value of 250ms. However,
    when developing, we may want to make the timeout longer to make sure we
    do not miss any messages due to other reasons.
    
    This commit adds timeout overriding using program arguments. This makes
    tweaking the timeout at runtime possible.
    
    Tested:
    
    1. Send a request to a non-existent endpoint. It should timeout in 250ms
       by default.
    
           root@mtmitchell:~# time busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp \
           > au.com.CodeConstruct.MCTP SetupEndpoint say mctppcie0 2 0xCA 0xFE
           Call failed: MCTP Endpoint did not respond
    
           real    0m0.344s
           user    0m0.016s
           sys     0m0.000s
    
    2. Change mctpd.service to use longer timeout, 10 seconds for example.
    
           ExecStart=/usr/sbin/mctpd -t 10000000
    
    3. Resend the request. It should timeout in 10 seconds.
    
           root@mtmitchell:~# time busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp \
           > au.com.CodeConstruct.MCTP SetupEndpoint say mctppcie0 2 0xCA 0xFE
           Call failed: MCTP Endpoint did not respond
    
           real    0m10.083s
           user    0m0.015s
           sys     0m0.001s
    
    Signed-off-by: Khang Nguyen <[email protected]>
    Khang Nguyen committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    237fa96 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2023

  1. mctpd: Add bus owner and endpoint switch using arguments

    Currently, mctpd defaults to run as a bus owner, so ctx->bus_owner is
    always true. This commit adds a role argument so that we can change the
    role without editing the source code.
    
    Tested: Send a Get EID command to mctpd. See the response:
    
    - Running as Bus Owner (no flag):
    
          00 00 02 00 ee 12 00
    
    - Running as Endpoint (-r endpoint):
    
          00 00 02 00 ee 02 00
    
    The second to last byte signifies the endpoint type.
    (0xee is the EID assigned to mctpd)
    
    Signed-off-by: Khang Nguyen <[email protected]>
    Khang Nguyen committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    2370286 View commit details
    Browse the repository at this point in the history