xref: /openbmc/docs/designs/mctp/mctp.md (revision f4febd00)
114081020SJeremy Kerr# OpenBMC platform communication channel: MCTP & PLDM
214081020SJeremy Kerr
314081020SJeremy KerrAuthor: Jeremy Kerr <jk@ozlabs.org> <jk>
414081020SJeremy Kerr
514081020SJeremy Kerr## Problem Description
614081020SJeremy Kerr
7*f4febd00SPatrick WilliamsCurrently, we have a few different methods of communication between host and
8*f4febd00SPatrick WilliamsBMC. This is primarily IPMI-based, but also includes a few hardware-specific
9*f4febd00SPatrick Williamsside-channels, like hiomap. On OpenPOWER hardware at least, we've definitely
10*f4febd00SPatrick Williamsstarted to hit some of the limitations of IPMI (for example, we have need
11*f4febd00SPatrick Williamsfor >255 sensors), as well as the hardware channels that IPMI typically uses.
1214081020SJeremy Kerr
13*f4febd00SPatrick WilliamsThis design aims to use the Management Component Transport Protocol (MCTP) to
14*f4febd00SPatrick Williamsprovide a common transport layer over the multiple channels that OpenBMC
15*f4febd00SPatrick Williamsplatforms provide. Then, on top of MCTP, we have the opportunity to move to
16*f4febd00SPatrick Williamsnewer host/BMC messaging protocols to overcome some of the limitations we've
17*f4febd00SPatrick Williamsencountered with IPMI.
1814081020SJeremy Kerr
1914081020SJeremy Kerr## Background and References
2014081020SJeremy Kerr
21*f4febd00SPatrick WilliamsSeparating the "transport" and "messaging protocol" parts of the current stack
22*f4febd00SPatrick Williamsallows us to design these parts separately. Currently, IPMI defines both of
23*f4febd00SPatrick Williamsthese; we currently have BT and KCS (both defined as part of the IPMI 2.0
24*f4febd00SPatrick Williamsstandard) as the transports, and IPMI itself as the messaging protocol.
2514081020SJeremy Kerr
26*f4febd00SPatrick WilliamsSome efforts of improving the hardware transport mechanism of IPMI have been
27*f4febd00SPatrick Williamsattempted, but not in a cross-implementation manner so far. This does not
28*f4febd00SPatrick Williamsaddress some of the limitations of the IPMI data model.
2914081020SJeremy Kerr
30*f4febd00SPatrick WilliamsMCTP defines a standard transport protocol, plus a number of separate physical
31*f4febd00SPatrick Williamslayer bindings for the actual transport of MCTP packets. These are defined by
32*f4febd00SPatrick Williamsthe DMTF's Platform Management Working group; standards are available at:
3314081020SJeremy Kerr
3414081020SJeremy Kerrhttps://www.dmtf.org/standards/pmci
3514081020SJeremy Kerr
3614081020SJeremy KerrThe following diagram shows how these standards map to the areas of
3714081020SJeremy Kerrfunctionality that we may want to implement for OpenBMC. The DSP numbers
3814081020SJeremy Kerrprovided are references to DMTF standard documents.
3914081020SJeremy Kerr
4014081020SJeremy Kerr![](mctp-standards.svg)
4114081020SJeremy Kerr
42*f4febd00SPatrick WilliamsOne of the key concepts here is that separation of transport protocol from the
43*f4febd00SPatrick Williamsphysical layer bindings; this means that an MCTP "stack" may be using either a
44*f4febd00SPatrick WilliamsI2C, PCI, Serial or custom hardware channel, without the higher layers of that
45*f4febd00SPatrick Williamsstack needing to be aware of the hardware implementation. These higher levels
46*f4febd00SPatrick Williamsonly need to be aware that they are communicating with a certain entity, defined
47*f4febd00SPatrick Williamsby an Entity ID (MCTP EID). These entities may be any element of the platform
48*f4febd00SPatrick Williamsthat communicates over MCTP - for example, the host device, the BMC, or any
49*f4febd00SPatrick Williamsother system peripheral - static or hot-pluggable.
5014081020SJeremy Kerr
51*f4febd00SPatrick WilliamsThis document is focused on the "transport" part of the platform design. While
52*f4febd00SPatrick Williamsthis does enable new messaging protocols (mainly PLDM), those components are not
53*f4febd00SPatrick Williamscovered in detail much; we will propose those parts in separate design efforts.
54*f4febd00SPatrick WilliamsFor example, the PLDM design at [pldm-stack.md].
5514081020SJeremy Kerr
56*f4febd00SPatrick WilliamsAs part of the design, the references to MCTP "messages" and "packets" are
57*f4febd00SPatrick Williamsintentional, to match the definitions in the MCTP standard. MCTP messages are
58*f4febd00SPatrick Williamsthe higher-level data transferred between MCTP endpoints, which packets are
59*f4febd00SPatrick Williamstypically smaller, and are what is sent over the hardware. Messages that are
60*f4febd00SPatrick Williamslarger than the hardware Maximum Transmit Unit (MTU) are split into individual
61*f4febd00SPatrick Williamspackets by the transmit implementation, and reassembled at the receive
62*f4febd00SPatrick Williamsimplementation.
6314081020SJeremy Kerr
6414081020SJeremy Kerr## Requirements
6514081020SJeremy Kerr
6614081020SJeremy KerrAny channel between host and BMC should:
6714081020SJeremy Kerr
6814081020SJeremy Kerr- Have a simple serialisation and deserialisation format, to enable
6914081020SJeremy Kerr  implementations in host firmware, which have widely varying runtime
7014081020SJeremy Kerr  capabilities
7114081020SJeremy Kerr
72*f4febd00SPatrick Williams- Allow different hardware channels, as we have a wide variety of target
73*f4febd00SPatrick Williams  platforms for OpenBMC
7414081020SJeremy Kerr
75*f4febd00SPatrick Williams- Be usable over simple hardware implementations, but have a facility for higher
76*f4febd00SPatrick Williams  bandwidth messaging on platforms that require it.
7714081020SJeremy Kerr
7814081020SJeremy Kerr- Ideally, integrate with newer messaging protocols
7914081020SJeremy Kerr
8014081020SJeremy Kerr## Proposed Designs
8114081020SJeremy Kerr
8214081020SJeremy KerrThe MCTP infrastrcuture in OpenBMC is implemented in two approaches:
8314081020SJeremy Kerr
84*f4febd00SPatrick Williams- A userspace-based approach, using a core library, plus a demultiplexing
85*f4febd00SPatrick Williams  daemon. This is described in [MCTP Userspace](mctp-userspace.md).
86785a64ffSJeremy Kerr
87*f4febd00SPatrick Williams  This is in use by a few platforms, but should be avoided for new designs.
8814081020SJeremy Kerr
8914081020SJeremy Kerr- A kernel-based approach, using a sockets API for client and server
90*f4febd00SPatrick Williams  applications. This approach is recommended for new designs, and is described
91*f4febd00SPatrick Williams  in [MCTP Kernel](mctp-kernel.md)
9214081020SJeremy Kerr
93*f4febd00SPatrick WilliamsDesign details for both approaches are covered in their relevant documents, but
94*f4febd00SPatrick Williamsboth share the same Problem Description, Background and Requirements,
95*f4febd00SPatrick WilliamsAlternatives and Impacts sections as defined by this document.
9614081020SJeremy Kerr
9714081020SJeremy Kerr## Alternatives Considered
9814081020SJeremy Kerr
99*f4febd00SPatrick WilliamsThere have been two main alternatives to an MCTP implementation in OpenBMC:
10014081020SJeremy Kerr
101*f4febd00SPatrick WilliamsContinue using IPMI, but start making more use of OEM extensions to suit the
102*f4febd00SPatrick Williamsrequirements of new platforms. However, given that the IPMI standard is no
103*f4febd00SPatrick Williamslonger under active development, we would likely end up with a large amount of
104*f4febd00SPatrick Williamsplatform-specific customisations. This also does not solve the hardware channel
105*f4febd00SPatrick Williamsissues in a standard manner.
10614081020SJeremy Kerr
107*f4febd00SPatrick WilliamsRedfish between host and BMC. This would mean that host firmware needs a HTTP
108*f4febd00SPatrick Williamsclient, a TCP/IP stack, a JSON (de)serialiser, and support for Redfish schema.
109*f4febd00SPatrick WilliamsWhile this may be present in some environments (for example, UEFI-based
110*f4febd00SPatrick Williamsfirmware), this is may not be feasible for all host firmware implementations
111*f4febd00SPatrick Williams(for example, OpenPOWER). It's possible that we could run a simplified Redfish
112*f4febd00SPatrick Williamsstack - indeed, MCTP has a proposal for a Redfish-over-MCTP channel (DSP0218),
113*f4febd00SPatrick Williamswhich uses simplified serialisation format and no requirement on HTTP. However,
114*f4febd00SPatrick Williamsthis may involve a large amount of complexity in host firmware.
11514081020SJeremy Kerr
11614081020SJeremy Kerr## Impacts
11714081020SJeremy Kerr
118*f4febd00SPatrick WilliamsDevelopment would be required to implement the MCTP transport, plus any new
119*f4febd00SPatrick Williamsusers of the MCTP messaging (eg, a PLDM implementation). These would somewhat
120*f4febd00SPatrick Williamsduplicate the work we have in IPMI handlers.
12114081020SJeremy Kerr
122*f4febd00SPatrick WilliamsWe'd want to keep IPMI running in parallel, so the "upgrade" path should be
123*f4febd00SPatrick Williamsfairly straightforward.
12414081020SJeremy Kerr
125*f4febd00SPatrick WilliamsDesign and development needs to involve potential host, management controllers
126*f4febd00SPatrick Williamsand managed device implementations.
127