8000 Support for enumerating non-local endpoint IDs · Issue #61 · CodeConstruct/mctp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support for enumerating non-local endpoint IDs #61

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

Open
yikaitsaiww opened this issue Jan 22, 2025 · 28 comments
Open

Support for enumerating non-local endpoint IDs #61

yikaitsaiww opened this issue Jan 22, 2025 · 28 comments
Assignees
Labels
enhancement New feature or request

Comments

@yikaitsaiww
Copy link

We are facing a challenge where multiple devices in our system share the same I3C address and bus. This configuration is not supported by AssignEndpoint and AssignEndpointStatic.

Let me show our system architecture:

flowchart LR;
    BIC1["BIC 1
    StaticEID: 10"]
    BIC2["BIC 2
    StaticEID: 12"]
    CXL1["CXL 1
    StaticEID: 14"]
    CXL2["CXL 2
    StaticEID: 15"]
    BMC-->BIC1-->BIC2;
    BIC2-->CXL1;
    BIC2-->CXL2;
Loading
  • BMC communicates with BIC1, BIC2, CXL1, and CXL2 using MCTP over I3C.
  • BIC1 acts as a bridge for communications between the BMC and devices behind it (BIC2, CXL1, CXL2).
  • BIC1 leverages the EID to determine the destination of each transaction from the BMC.

To accommodate this architecture, we've configured all devices (BIC1, BIC2, CXL1, and CXL2) with the same I3C address in the entity-manager, distinguished only by their EIDs.

{
    "Address": ["7", "236", "128", "1", "0", "0"],
    "Bus": "1",
    "Class": "I3C",
    "StaticEndpointID": "10",
    "Name": "BIC1",
    "Type": "MCTPI3CTarget"
},
{
    "Address": ["7", "236", "128", "1", "0", "0"],
    "Bus": "1",
    "Class": "I3C",
    "StaticEndpointID": "12",
    "Name": "BIC2",
    "Type": "MCTPI3CTarget"
},
{
    "Address": ["7", "236", "128", "1", "0", "0"],
    "Bus": "1",
    "Class": "I3C",
    "StaticEndpointID": "14",
    "Name": "CXL1",
    "Type": "MCTPI3CTarget"
},
{
    "Address": ["7", "236", "128", "1", "0", "0"],
    "Bus": "1",
    "Class": "I3C",
    "StaticEndpointID": "15",
    "Name": "CXL2",
    "Type": "MCTPI3CTarget"
}

The MCTP tree we expect will be:

├─ /au/com/codeconstruct/mctp1/networks/1/endpoints/10
├─ /au/com/codeconstruct/mctp1/networks/1/endpoints/12
├─ /au/com/codeconstruct/mctp1/networks/1/endpoints/14
├─ /au/com/codeconstruct/mctp1/networks/1/endpoints/15

Here's a breakdown of the issue:

  1. AssignEndpointStatic checks if it has already assigned a different EID, so the final MCTP tree will be:
├─ /au/com/codeconstruct/mctp1/networks/1/endpoints/10

Only BIC1 is assigned EID.

  1. AssignEndpoint automatically assigns EIDs, and we confirmed journal that all four devices were assigned EID 9,
Jan 16 22:34:37 bmc mctpreactor[7126]: Added MCTP endpoint to device: [ network: 1, EID: 9 | interface: mctpi3c0, address: 0x [ 07 ec 80 01 00 00 ] ]
Jan 16 22:34:37 bmc mctpreactor[7126]: Added MCTP endpoint to device: [ network: 1, EID: 9 | interface: mctpi3c0, address: 0x [ 07 ec 80 01 00 00 ] ]
Jan 16 22:34:37 bmc mctpreactor[7126]: Added MCTP endpoint to device: [ network: 1, EID: 9 | interface: mctpi3c0, address: 0x [ 07 ec 80 01 00 00 ] ]
Jan 16 22:34:37 bmc mctpreactor[7126]: Added MCTP endpoint to device: [ network: 1, EID: 9 | interface: mctpi3c0, address: 0x [ 07 ec 80 01 00 00 ] ]

resulting in the MCTP tree shown in

├─ /au/com/codeconstruct/mctp1/networks/1/endpoints/9

Since all devices have the same EID, BIC1 cannot differentiate the destination based on the EID when the BMC tries to send data to BIC2, CXL1, or CXL2.

Given this, we're seeking alternative solutions to accommodate our specific configuration.

Thanks a lot.

@mkj
Copy link
Member
mkj commented Jan 23, 2025

The I3C specification seems to have a strong assumption that the PIDs of devices on a bus are unique, looking at MIPI I3C Basic v1.1.1, sections 5.1.4.1.1 and 5.1.4.1.2. Are there any strapping/configuration options for the devices on your system?

@jk-ozlabs
Copy link
Member

Further to the same bus & PID concept, and ignoring the MCTP side for now, how is i3c dynamic address allocation able to work at all? Any devices with the identical PID will not lose arbitration during the ENTDAA-triggered dynamic address assignment process, and so you would be targeting multiple devices during each phase of the following dynamic address assignment..

Or is it that the two CXL devices actually have different i3c PIDs (or are even on non-i3c busses), but you're using the BIC 1's i3c address as a proxy for the devices behind BIC 1?

@yikaitsaiww
Copy link
Author

Hi @mkj ,

Thank you for comments regarding the I3C PID uniqueness requirement. Unfortunately, I don't have any other hardware strapping or configuration options available for my system.

Hi @jk-ozlabs ,

I am using the BIC1's I3C address as a proxy for the devices behind BIC1. BIC1 acts as a bridge for communications between the BMC and devices behind it (BIC2, CXL1, CXL2). Thus, "Address": ["7", "236", "128", "1", "0", "0"], is actually BIC1's.

flowchart LR;

    BMC[BMC]
    subgraph Proxy[Proxy]
        BIC1["BIC 1
        StaticEID: 10"]
    end
    BIC2["BIC 2
    StaticEID: 12"]
    CXL1["CXL 1
    StaticEID: 14"]
    CXL2["CXL 2
    StaticEID: 15"]
    BMC-->Proxy;
    Proxy-->BIC2;
    BIC2-->CXL1;
    BIC2-->CXL2;
Loading

Thanks for your help.

@jk-ozlabs
Copy link
Member

Hi @yikaitsaiww

I am using the BIC1's I3C address as a proxy for the devices behind BIC1

OK, so you don't actually have two devices with the same PID on the same i3c bus then, which is a big relief :)

The physical addressing mechanism is only used when mctpd is performing initial enumeration of MCTP devices - and that only occurs when mctpd is the bus-owner for that directly-attached bus. BIC2, CXL1 and CXL2 are not directly-attached.

So, it does not make sense to call AssignEndpoints for non-locally-attached devices. Only BIC1 is local and requires direct enumeration.

Can you elaborate what you're trying to achieve, perhaps? You already know the endpoint EIDs, right? What information are you hoping to find from the endpoint objects in the dbus hierarchy?

It sounds like we may need a new mechanism for enumerating those particular endpoints (specifically: they already have a static EID, and we do not have an intermediate bus owner that would be allocating an EID pool). That "enumeration" would not be performing any address allocation, only the endpoint query (ie. Get Message Type Support).

@yikaitsaiww
Copy link
Author

Thank you for your detailed explanation. Yes, we already know the EIDs. We are using static EID, currently.
Let me clarify our current situation and requirements.

The reason BMC needs to access the EIDs of BIC2 and CXL1, 2 is to monitor sensors and logs and update FW.

  1. For monitoring sensors and logs, BMC uses PLDM over MCTP to access BIC2 EID, and CCI over MCTP for CXL1 and CXL2 EID.

  2. For firmware update purposes, BMC needs BIC2's EID. CXL1, 2 is considered a downstream device of BIC2.

Currently, we are using SetupEndpointByConfigPath (implemented in pull-17) to achieve this.

I hope the information provided above is comprehensive. BTW, I may be slower to respond due to the upcoming Chinese New Year :)

Thanks a lot.

@jk-ozlabs
Copy link
Member

The reason BMC needs to access the EIDs of BIC2 and CXL1, 2 is to monitor sensors and logs and update FW.

Just to clarify: I wasn't querying why you need to access those devices over MCTP, but instead: what information do you need to consume from the dbus representation of those endpoints?

No problem at all about the delay, we have some upcoming holidays here too 😄

@yikaitsaiww
Copy link
Author

Understood. I will gather more information and get back to you.

Have a great holiday. 😀

@yikaitsaiww
Copy link
Author

Let me take BIC1 (EID10) & BIC2 (EID12) for example.

root@bmc:~# busctl introspect -l au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/networks/1/endpoints/10
NAME                                        TYPE      SIGNATURE RESULT/VALUE                                                                                                               FLAGS
au.com.codeconstruct.MCTP.Endpoint1         interface -         -                                                                                                                          -
.Recover                                    method    -         -                                                                                                                          -
.Remove                                     method    -         -                                                                                                                          -
.SetMTU                                     method    u         -                                                                                                                          -
.Connectivity                               property  s         "Available"                                                                                                                emits-change
org.freedesktop.DBus.Introspectable         interface -         -                                                                                                                          -
.Introspect                                 method    -         s                                                                                                                          -
org.freedesktop.DBus.Peer                   interface -         -                                                                                                                          -
.GetMachineId                               method    -         s                                                                                                                          -
.Ping                                       method    -         -                                                                                                                          -
org.freedesktop.DBus.Properties             interface -         -                                                                                                                          -
.Get                                        method    ss        v                                                                                                                          -
.GetAll                                     method    s         a{sv}                                                                                                                      -
.Set                                        method    ssv       -                                                                                                                          -
.PropertiesChanged                          signal    sa{sv}as  -                                                                                                                          -
xyz.openbmc_project.Association.Definitions interface -         -                                                                                                                          -
.Associations                               property  a(sss)    1 "chassis" "mctp_endpoints" "/xyz/openbmc_project/inventory/system/board/Yosemite_4_Sentinel_Dome_T2_with_Retimer_Slot_1" const
xyz.openbmc_project.MCTP.Endpoint           interface -         -                                                                                                                          -
.EID                                        property  y         10                                                                                                                         const
.NetworkId                                  property  u         1                                                                                                                          const
.SupportedMessageTypes                      property  ay        2 0 1                                                                                                                      const
root@bmc:~# busctl introspect -l au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/networks/1/endpoints/12
NAME                                        TYPE      SIGNATURE RESULT/VALUE                                                                                              FLAGS
au.com.codeconstruct.MCTP.Endpoint1         interface -         -                                                                                                         -
.Recover                                    method    -         -                                                                                                         -
.Remove                                     method    -         -                                                                                                         -
.SetMTU                                     method    u         -                                                                                                         -
.Connectivity                               property  s         "Available"                                                                                               emits-change
org.freedesktop.DBus.Introspectable         interface -         -                                                                                                         -
.Introspect                                 method    -         s                                                                                                         -
org.freedesktop.DBus.Peer                   interface -         -                                                                                                         -
.GetMachineId                               method    -         s                                                                                                         -
.Ping                                       method    -         -                                                                                                         -
org.freedesktop.DBus.Properties             interface -         -                                                                                                         -
.Get                                        method    ss        v                                                                                                         -
.GetAll                                     method    s         a{sv}                                                                                                     -
.Set                                        method    ssv       -                                                                                                         -
.PropertiesChanged                          signal    sa{sv}as  -                                                                                                         -
xyz.openbmc_project.Association.Definitions interface -         -                                                                                                         -
.Associations                               property  a(sss)    1 "chassis" "mctp_endpoints" "/xyz/openbmc_project/inventory/system/board/Yosemite_4_Wailua_Falls_S
8000
lot_1" const
xyz.openbmc_project.MCTP.Endpoint           interface -         -                                                                                                         -
.EID                                        property  y         12                                                                                                        const
.NetworkId                                  property  u         1                                                                                                         const
.SupportedMessageTypes                      property  ay        2 0 1                                                                                                     const

For each EID, we need to know if it supports PLDM/CCI by SupportedMessageTypes.
Thank you!

@jk-ozlabs
Copy link
Member

Hi @yikaitsaiww , thanks for the info!

For each EID, we need to know if it supports PLDM/CCI by SupportedMessageTypes.

So the next question: how does the bmc machine know about the presence of EID 12, 13 and 14? Since they're not directly connected to the BMC (in which case they would have been detected on the local physical bus), how has it decided to query those endpoints for their supported message types?

(I am aware of multiple possibilities for this, but I'm keen to hear about your specific use-case)

@yikaitsaiww
Copy link
Author

Thank you for your question. Let me provide additional context:

It's entity-manager, which detects the FRUs, enabling the BMC to know their presence.
Specifically, There are individual FRUs on the boards of both BIC1 (EID10) and BIC2 (EID12), and the FRUs are connected to the BMC via I2C.
(The communication between the BMC and BIC1 is via I3C, but BIC2 is not directly connected to the BMC.)

BIC2 (EID10), CXL1 (EID14), and CXL2 (EID15) are set in the same json file. When entity-manager recognizes the FRU of BIC2, it also know the existence of CXL1 (EID14), and CXL2 (EID15).

Thank you very much!

@jk-ozlabs
Copy link
Member

OK, neat. So the EIDs are known in advance. We should be able to trigger enumeration on the network object given the EID.

I'll propose a new dbus interface on the network to allow this.

@jk-ozlabs jk-ozlabs changed the title Support assigning endpoint IDs when multiple devices share the same I3C address and bus Support for enumerating non-local endpoint IDs Feb 11, 2025
@jk-ozlabs jk-ozlabs added the enhancement New feature or request label Feb 11, 2025
@jk-ozlabs jk-ozlabs self-assigned this Feb 11, 2025
@jk-ozlabs
Copy link
Member

OK, I think I have a design worked out, and prototyped here. New dbus interface would be:

NAME                                TYPE      SIGNATURE RESULT/VALUE FLAGS
au.com.codeconstruct.MCTP.Network1  interface -         -            -
.LearnEndpoint                      method    y         sb           -
.LocalEIDs                          property  ay        1 8          const

The LearnEndpoint method takes an EID, enumerates the endpoint, and populates a new endpoint object. The object path is returned, along with a bool indicating whether this was a newly-discovered endpoint or not.

How does that sound?

@jk-ozlabs
Copy link
Member

Basic process would be this:

start state:

$ busctl tree au.com.codeconstruct.MCTP1
└─/au
  └─/au/com
    └─/au/com/codeconstruct
      └─/au/com/codeconstruct/mctp1
        ├─/au/com/codeconstruct/mctp1/interfaces
        │ └─/au/com/codeconstruct/mctp1/interfaces/mctp0
        └─/au/com/codeconstruct/mctp1/networks
          └─/au/com/codeconstruct/mctp1/networks/1
            └─/au/com/codeconstruct/mctp1/networks/1/endpoints
              └─/au/com/codeconstruct/mctp1/networks/1/endpoints/8

enumerate directly-attached endpoint:

$ busctl call au.com.codeconstruct.MCTP1 \
    /au/com/codeconstruct/mctp1/interfaces/mctp0 \
    au.com.codeconstruct.MCTP.BusOwner1 \
    SetupEndpoint ay 1 0x1d
yisb 9 1 "/au/com/codeconstruct/mctp1/networks/1/endpoints/9" true
$ busctl tree au.com.codeconstruct.MCTP1
└─/au
  └─/au/com
    └─/au/com/codeconstruct
      └─/au/com/codeconstruct/mctp1
        ├─/au/com/codeconstruct/mctp1/interfaces
        │ └─/au/com/codeconstruct/mctp1/interfaces/mctp0
        └─/au/com/codeconstruct/mctp1/networks
          └─/au/com/codeconstruct/mctp1/networks/1
            └─/au/com/codeconstruct/mctp1/networks/1/endpoints
              ├─/au/com/codeconstruct/mctp1/networks/1/endpoints/8
              └─/au/com/codeconstruct/mctp1/networks/1/endpoints/9
$ busctl introspect au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/networks/1/endpoints/9
NAME                                TYPE      SIGNATURE RESULT/VALUE                           FLAGS
au.com.codeconstruct.MCTP.Endpoint1 interface -         -                                      -
.Recover                            method    -         -                                      -
.Remove                             method    -         -                                      -
.SetMTU                             method    u         -                                      -
.Connectivity                       property  s         "Available"                            emits-change
org.freedesktop.DBus.Introspectable interface -         -                                      -
.Introspect                         method    -         s                                      -
org.freedesktop.DBus.Peer           interface -         -                                      -
.GetMachineId                       method    -         s                                      -
.Ping                               method    -         -                                      -
org.freedesktop.DBus.Properties     interface -         -                                      -
.Get                                method    ss        v                                      -
.GetAll                             method    s         a{sv}                                  -
.Set                                method    ssv       -                                      -
.PropertiesChanged                  signal    sa{sv}as  -                                      -
xyz.openbmc_project.Common.UUID     interface -         -                                      -
.UUID                               property  s         "c39e2a40-e85e-11ef-8e9c-f02f74cfe867" const
xyz.openbmc_project.MCTP.Endpoint   interface -         -                                      -
.EID                                property  y         9                                      const
.NetworkId                          property  u         1                                      const
.SupportedMessageTypes              property  ay        2 0 1                                  const

enumerate bridged endpoint:

$ busctl call au.com.codeconstruct.MCTP1 \
    /au/com/codeconstruct/mctp1/networks/1 \
    au.com.codeconstruct.MCTP.Network1 \
    LearnEndpoint y 10
sb "/au/com/codeconstruct/mctp1/networks/1/endpoints/10" true
$ busctl tree au.com.codeconstruct.MCTP1
└─/au
  └─/au/com
    └─/au/com/codeconstruct
      └─/au/com/codeconstruct/mctp1
        ├─/au/com/codeconstruct/mctp1/interfaces
        │ └─/au/com/codeconstruct/mctp1/interfaces/mctp0
        └─/au/com/codeconstruct/mctp1/networks
          └─/au/com/codeconstruct/mctp1/networks/1
            └─/au/com/codeconstruct/mctp1/networks/1/endpoints
              ├─/au/com/codeconstruct/mctp1/networks/1/endpoints/10
              ├─/au/com/codeconstruct/mctp1/networks/1/endpoints/8
              └─/au/com/codeconstruct/mctp1/networks/1/endpoints/9
$ busctl introspect au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/networks/1/endpoints/10
NAME                                TYPE      SIGNATURE RESULT/VALUE                           FLAGS
au.com.codeconstruct.MCTP.Endpoint1 interface -         -                                      -
.Recover                            method    -         -                                      -
.Remove                             method    -         -                                      -
.SetMTU                             method    u         -                                      -
.Connectivity                       property  s         "Available"                            emits-change
org.freedesktop.DBus.Introspectable interface -         -                                      -
.Introspect                         method    -         s                                      -
org.freedesktop.DBus.Peer           interface -         -                                      -
.GetMachineId                       method    -         s                                      -
.Ping                               method    -         -                                      -
org.freedesktop.DBus.Properties     interface -         -                                      -
.Get                                method    ss        v                                      -
.GetAll                             method    s         a{sv}                                  -
.Set                                method    ssv       -                                      -
.PropertiesChanged                  signal    sa{sv}as  -                                      -
xyz.openbmc_project.Common.UUID     interface -         -                                      -
.UUID                               property  s         "c39e2a41-e85e-11ef-8e9c-f02f74cfe867" const
xyz.openbmc_project.MCTP.Endpoint   interface -         -                                      -
.EID                                property  y         10                                     const
.NetworkId                          property  u         1                                      const
.SupportedMessageTypes              property  ay        2 0 2                                  const

(note the different UUID and SupportedMessageTypes between the two endpoints)

The latter LearnEndpoint would require the route tables and neighbour entries to already (manually) be set up to support the bridged endpoints. We could add that later, but it does require some planning around how those are managed by mctpd.

@yikaitsaiww
Copy link
Author

It looks like there are no issues. This should correspond to our situation. Thank you.

@jk-ozlabs
Copy link
Member

Development branch is up, as dev/net-learn-endpoint: https://github.com/CodeConstruct/mctp/compare/dev/net-learn-endpoint

If you can give that some testing, that would be great.

@yikaitsaiww
Copy link
Author

Thank you very much! We will find time to test it and give you feedback.

@yikaitsaiww
Copy link
Author

Hi Jeremy,

I tested the branch. I mounted the directly-attached endpoint using AssignEndpointStatic, and all other bridged endpoints using LearnEndpoint, but it seems the MCTP tree is failed.

root@bmc:~# busctl tree au.com.codeconstruct.MCTP1
Failed to introspect object / of service au.com.codeconstruct.MCTP1: The name is not activatable
No objects discovered.
Feb 24 23:11:52 bmc mctpd[938]: __bus_mctp_link_find: owner_only 1, role 1
Feb 24 23:11:55 bmc systemd[1]: Stopped target MCTP infrastructure active.
Feb 24 23:11:56 bmc mctpd[938]: __bus_mctp_link_find: owner_only 1, role 1
Feb 24 23:11:57 bmc mctpd[938]: __bus_mctp_link_find: owner_only 1, role 1
Feb 24 23:11:57 bmc mctpd[938]: __bus_mctp_link_find: owner_only 1, role 1
Feb 24 23:11:57 bmc mctpd[938]: __bus_mctp_link_find: owner_only 1, role 1
Feb 24 23:11:57 bmc mctpd[938]: __bus_mctp_link_find: owner_only 1, role 1
Feb 24 23:11:57 bmc mctpd[938]: __bus_mctp_link_find: owner_only 1, role 1
Feb 24 23:11:57 bmc mctpd[938]: __bus_mctp_link_find: owner_only 1, role 1
Feb 24 23:11:57 bmc mctpd[938]: __bus_mctp_link_find: owner_only 1, role 1
Feb 24 23:11:57 bmc systemd[1]: Stopping MCTP device configuration...
Feb 24 23:12:00 bmc systemd[1]: xyz.openbmc_project.mctpreactor.service: Deactivated successfully.
Feb 24 23:12:00 bmc systemd[1]: Stopped MCTP device configuration.
Feb 24 23:12:00 bmc systemd[1]: xyz.openbmc_project.mctpreactor.service: Consumed 1.114s CPU time.
Feb 24 23:12:02 bmc systemd[1]: Stopping MCTP control protocol daemon...
Feb 24 23:12:04 bmc systemd[1]: mctpd.service: Deactivated successfully.
Feb 24 23:12:04 bmc systemd[1]: Stopped MCTP control protocol daemon.
Feb 24 23:12:04 bmc systemd[1]: mctpd.service: Consumed 1.739s CPU time.
Feb 24 23:12:04 bmc systemd[1]: Stopped target MCTP local network configuration.
Feb 24 23:13:06 bmc kernel: mctp: management component transport protocol core
Feb 24 23:13:06 bmc kernel: NET: Registered PF_MCTP protocol family
Feb 24 23:13:06 bmc kernel: MCTP I2C interface driver
Feb 24 23:13:07 bmc systemd[1]: mctpd.service: Dependency After=mctpd.service is dropped.
Feb 24 23:13:07 bmc systemd[1]: Reached target MCTP local network configuration.
Feb 24 23:13:19 bmc pldmd[598]: Failed to getSubtree call at path '/au/com/codeconstruct/mctp1' and interface 'xyz.openbmc_project.MCTP.Endpoint', error - sd_bus_call: xyz.openbmc_project.Common.Error.ResourceNotFound: The resource is not found.
Feb 24 23:13:26 bmc systemd[1]: Starting MCTP control protocol daemon...
Feb 24 23:13:31 bmc mctpd[928]: mctpd: emit_interface_added: error emitting, No such file or directory
Feb 24 23:13:32 bmc systemd[1]: mctpd.service: Main process exited, code=exited, status=1/FAILURE
Feb 24 23:13:32 bmc systemd[1]: mctpd.service: Failed with result 'exit-code'.
Feb 24 23:13:32 bmc systemd[1]: Failed to start MCTP control protocol daemon.
Feb 24 23:13:32 bmc systemd[1]: Dependency failed for MCTP device configuration.
Feb 24 23:13:32 bmc systemd[1]: xyz.openbmc_project.mctpreactor.service: Job xyz.openbmc_project.mctpreactor.service/start failed with result 'dependency'.
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi2c24: Link UP
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi2c24: Gained carrier
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi2c25: Link UP
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi2c25: Gained carrier
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi2c26: Link UP
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi2c26: Gained carrier
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi2c27: Link UP
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi2c27: Gained carrier
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi3c0: Link UP
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi3c0: Gained carrier
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi3c1: Link UP
Feb 24 23:13:33 bmc systemd-networkd[853]: mctpi3c1: Gained carrier
Feb 24 23:13:33 bmc systemd[1]: Reached target MCTP infrastructure active.
Feb 24 23:13:42 bmc systemd[1]: mctpd.service: Scheduled restart job, restart counter is at 1.
Feb 24 23:13:42 bmc systemd[1]: Starting MCTP control protocol daemon...
Feb 24 23:13:42 bmc mctp-config[1022]: Error from kernel: File exists (-17)
Feb 24 23:13:42 bmc mctp-config[1024]: Error from kernel: File exists (-17)
Feb 24 23:13:42 bmc mctp-config[1026]: Error from kernel: File exists (-17)
Feb 24 23:13:42 bmc mctp-config[1028]: Error from kernel: File exists (-17)
Feb 24 23:13:42 bmc mctp-config[1030]: Error from kernel: File exists (-17)
Feb 24 23:13:42 bmc mctp-config[1032]: Error from kernel: File exists (-17)
Feb 24 23:13:42 bmc mctpd[1034]: mctpd: emit_interface_added: error emitting, No such file or directory
Feb 24 23:13:43 bmc systemd[1]: mctpd.service: Main process exited, code=exited, status=1/FAILURE
Feb 24 23:13:43 bmc systemd[1]: mctpd.service: Failed with result 'exit-code'.
Feb 24 23:13:43 bmc systemd[1]: Failed to start MCTP control protocol daemon.
Feb 24 23:13:53 bmc systemd[1]: mctpd.service: Scheduled restart job, restart counter is at 2.
Feb 24 23:13:53 bmc systemd[1]: mctpd.service: Start request repeated too quickly.
Feb 24 23:13:53 bmc systemd[1]: mctpd.service: Failed with result 'exit-code'.
Feb 24 23:13:53 bmc systemd[1]: Failed to start MCTP control protocol daemon.

Then, I changed all directly-attached endpoints back to using AssignEndpointStatic, but unfortunately, the result remained the same: the MCTP tree is still failed.

I found that starting from this commit, mctpd: use object vtable for links · CodeConstruct/mctp@919285d, AssignEndpointStatic could no longer mount directly-attached endpoints

Feb 25 01:52:55 bmc busctl[8033]: Failed to get property EID on interface xyz.openbmc_project.MCTP.Endpoint: The name is not activatable
Feb 25 01:52:55 bmc busctl[8035]: Failed to get property EID on interface xyz.openbmc_project.MCTP.Endpoint: The name is not activatable
Feb 25 01:57:18 bmc sshd-remediate[8665]: SSH-2.0-OpenSSH_9.9 yikai_mctp_reactor_0225
Feb 25 01:59:16 bmc systemd[1]: Stopped target MCTP infrastructure active.
Feb 25 01:59:16 bmc systemd[1]: Stopped target MCTP local network configuration.
Feb 25 02:00:23 bmc kernel: mctp: management component transport protocol core
Feb 25 02:00:23 bmc kernel: NET: Registered PF_MCTP protocol family
Feb 25 02:00:23 bmc kernel: MCTP I2C interface driver
Feb 25 02:00:24 bmc systemd[1]: mctpd.service: Dependency After=mctpd.service is dropped.
Feb 25 02:00:24 bmc systemd[1]: Reached target MCTP local network configuration.
Feb 25 02:00:36 bmc pldmd[598]: Failed to getSubtree call at path '/au/com/codeconstruct/mctp1' and interface 'xyz.openbmc_project.MCTP.Endpoint', error - sd_bus_call: xyz.openbmc_project.Common.Error.ResourceNotFound: The resource is not found. 
Feb 25 02:00:43 bmc systemd[1]: Starting MCTP control protocol daemon...
Feb 25 02:00:48 bmc mctpd[931]: bus_mctp_network_find: find /au/com/codeconstruct/mctp1/networks/1
Feb 25 02:00:48 bmc mctpd[931]: mctpd: emit_interface_added: error emitting, No such file or directory
Feb 25 02:00:49 bmc systemd[1]: mctpd.service: Main process exited, code=exited, status=1/FAILURE
Feb 25 02:00:49 bmc systemd[1]: mctpd.service: Failed with result 'exit-code'.
Feb 25 02:00:49 bmc systemd[1]: Failed to start MCTP control protocol daemon.
Feb 25 02:00:49 bmc systemd[1]: Dependency failed for MCTP device configuration.
Feb 25 02:00:49 bmc systemd[1]: xyz.openbmc_project.mctpreactor.service: Job xyz.openbmc_project.mctpreactor.service/start failed with result 'dependency'.
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi2c24: Link UP
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi2c24: Gained carrier
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi2c25: Link UP
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi2c25: Gained carrier
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi2c26: Link UP
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi2c26: Gained carrier
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi2c27: Link UP
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi2c27: Gained carrier
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi3c0: Link UP
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi3c0: Gained carrier
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi3c1: Link UP
Feb 25 02:00:50 bmc systemd-networkd[853]: mctpi3c1: Gained carrier
Feb 25 02:00:50 bmc systemd[1]: Reached target MCTP infrastructure active.
Feb 25 02:00:59 bmc systemd[1]: mctpd.service: Scheduled restart job, restart counter is at 1.
Feb 25 02:00:59 bmc systemd[1]: Starting MCTP control protocol daemon...
Feb 25 02:00:59 bmc mctp-config[1023]: Error from kernel: File exists (-17)
Feb 25 02:00:59 bmc mctp-config[1025]: Error from kernel: File exists (-17)
Feb 25 02:00:59 bmc mctp-config[1027]: Error from kernel: File exists (-17)
Feb 25 02:00:59 bmc mctp-config[1030]: Error from kernel: File exists (-17)
Feb 25 02:01:00 bmc mctp-config[1032]: Error from kernel: File exists (-17)
Feb 25 02:01:00 bmc mctp-config[1034]: Error from kernel: File exists (-17)
Feb 25 02:01:00 bmc mctpd[1036]: bus_mctp_network_find: find /au/com/codeconstruct/mctp1/networks/1
Feb 25 02:01:00 bmc mctpd[1036]: mctpd: emit_interface_added: error emitting, No such file or directory
Feb 25 02:01:00 bmc systemd[1]: mctpd.service: Main process exited, code=exited, status=1/FAILURE
Feb 25 02:01:00 bmc systemd[1]: mctpd.service: Failed with result 'exit-code'.
Feb 25 02:01:00 bmc systemd[1]: Failed to start MCTP control protocol daemon.
Feb 25 02:01:10 bmc systemd[1]: mctpd.service: Scheduled restart job, restart counter is at 2.
Feb 25 02:01:10 bmc systemd[1]: mctpd.service: Start request repeated too quickly.
Feb 25 02:01:10 bmc systemd[1]: mctpd.service: Failed with result 'exit-code'.
Feb 25 02:01:10 bmc systemd[1]: Failed to start MCTP control protocol daemon.

In the previous commit mctpd: clean vtable definitions · CodeConstruct/mctp@68f083f, everything was still working normally as before. I'd like to ask if there are any package dependencies or anything else we should be aware of?

Thank you.

@jk-ozlabs
Copy link
Member

Looks like there may be a systemd dependency on the old dbus names, but that shouldn't be important for this test.

I suspect something wrong in the new dbus-handling code, so likely something wrong on my side. I'll take a look and update with a new branch.

@yikaitsaiww
Copy link
Author

Do you have any plans or an estimated timeline for when the updates might be available? Thank you very much for your assistance. 😀

@jk-ozlabs
Copy link
Member

I have just been traveling last week - I'll get something sorted before the end of the week.

@jk-ozlabs
Copy link
Member

In the meantime though, could you add --verbose to the mctpd arguments, and re-capture the logs above? That may give some extra debugging info.

@jk-ozlabs
Copy link
Member

actually, don't worry about that at this stage; we don't have any additional debugging data in the interface add path. I'll keep looking here :)

@jk-ozlabs
Copy link
Member

OK, I have added some extra debug info to that branch (you should see cfc5a39 there). If you can run with -v / --verbose and let me know what you see in the logs, that will help.

@nosoxon
Copy link
nosoxon commented Mar 21, 2025

Howdy! Also seeing this error emitting. Verbose logs from most recent commit (cfc5a39):

root@openbmc:~# mctp link
dev lo index 1 address 00:00:00:00:00:00 net 1 mtu 65536 up
dev mctpi2c2 index 5 address 0x08 net 1 mtu 254 down
dev mctpusb0 index 6 address none net 1 mtu 68 down
dev mctpusb1 index 7 address none net 1 mtu 68 up
root@openbmc:~# mctp addr
eid 8 net 1 dev mctpusb1
root@openbmc:~# mctpd --verbose
Adding interface #1 lo
net 1 added, path /au/com/codeconstruct/mctp1/networks/1
mctpd: emitting net add: /au/com/codeconstruct/mctp1/networks/1
mctpd: emitting interface add: /au/com/codeconstruct/mctp1/interfaces/lo
mctpd: Returning existing dbus error 'Unknown property.'. ignored errcode=-2 (No such file or directory)
mctpd: emit_interface_added: error emitting, No such file or directory

For context: with v2.1 I can SetupEndpoint my MCTP/USB bridge device, then manually allocate an EID pool to the bridge, and add bridge routing table entries to kernel routing table. pldmtool (and AF_MCTP socket connections in general) to devices downstream of the bridge work just fine.

@nosoxon
Copy link
nosoxon commented Mar 21, 2025

This did the trick for me. I am now able to call LearnEndpoint and my downstream endpoints enumerate in D-Bus!! Thanks for all the work to make this happen!

diff --git a/src/mctpd.c b/src/mctpd.c
index a7b262c..8292f3a 100644
--- a/src/mctpd.c
+++ b/src/mctpd.c
@@ -3855,14 +3855,8 @@ static int add_interface(struct ctx *ctx, int ifindex)
 
 	}
 
-	rc = emit_interface_added(link);
-	if (rc < 0)
-		return rc;
-
-
 	link->published = true;
-
-	return rc;
+	return emit_interface_added(link);
 
 err_free:
 	free(link);

@jk-ozlabs
Copy link
Member

Ah, super! I'll do some testing and incorporate that into the series. Let me know how any further testing goes, and I'll consider for merging.

@nosoxon
Copy link
nosoxon commented Mar 21, 2025

Worked great! After learning my downstream endpoints, mctpd and pldmd registered D-Bus objects for them and I achieved my goal of PLDM firmware updates to those endpoints.

My bridge is connected via your MCTP/USB kernel transport binding, so I've been manually adding routes then relearning the interface. Unknown ifindex errors are from resetting the MCTP bridge device. Let me know if there's any other logs or debug info that would be helpful to you!
20250321-mctpd-Network1.log

@jk-ozlabs
Copy link
Member

I've now done a few updates, and this support is in the dev/next branch, if you'd like to do any pre-merge testing with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants
0