Skip to content

MCTP Bridge Polling #85

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
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
5 changes: 5 additions & 0 deletions conf/mctpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ mode = "bus-owner"
[mctp]
message_timeout_ms = 30

# bus-owner configuration
[bus-owner]
max_pool_size = 15
ep_removal_thresold = 3 # Bridge poll: failure threshold before removing an endpoint

# Specify a UUID: not generally required - mctpd will query the system UUID
# where available.
# uuid = "21f0f554-7f7c-4211-9ca1-6d0f000ea9e7"
6 changes: 5 additions & 1 deletion docs/mctpd.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ busctl call au.com.codeconstruct.MCTP1 \

Similar to SetupEndpoint, but will always assign an EID rather than querying for
existing ones. Will return `new = false` when an endpoint is already known to
`mctpd`.
`mctpd`. If the endpoint is an MCTP bridge (indicated by requesting a pool size
in its Set Endpoint ID response), this method attempts to allocate a contiguous
range of EIDs for the bridge's downstream endpoints. If sufficient contiguous EIDs
are not available within the dynamic allocation pool for the network, only the
bridge's own EID will be assigned, and downstream EID allocation will fail.

#### `.AssignEndpointStatic`: `ayy` → `yisb`

Expand Down
28 changes: 28 additions & 0 deletions src/mctp-control-spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,28 @@ struct mctp_ctrl_resp_resolve_endpoint_id {
// ... uint8_t physical_address[N]
} __attribute__((__packed__));

typedef enum {
mctp_ctrl_cmd_alloc_eid_alloc_eid = 0,
mctp_ctrl_cmd_alloc_eid_force_alloc = 1,
mctp_ctrl_cmd_alloc_eid_get_alloc_info = 2,
mctp_ctrl_cmd_alloc_eid_reserved = 3
} mctp_ctrl_cmd_alloc_eid_op;

struct mctp_ctrl_cmd_alloc_eid {
struct mctp_ctrl_msg_hdr ctrl_hdr;
uint8_t alloc_eid_op;
uint8_t pool_size;
uint8_t start_eid;
} __attribute__((__packed__));

struct mctp_ctrl_resp_alloc_eid {
struct mctp_ctrl_msg_hdr ctrl_hdr;
uint8_t completion_code;
uint8_t status;
uint8_t eid_pool_size;
uint8_t eid_set;
} __attribute__((__packed__));

#define MCTP_CTRL_HDR_MSG_TYPE 0
#define MCTP_CTRL_HDR_FLAG_REQUEST (1 << 7)
#define MCTP_CTRL_HDR_FLAG_DGRAM (1 << 6)
Expand Down Expand Up @@ -308,3 +330,9 @@ struct mctp_ctrl_resp_resolve_endpoint_id {
#define GET_ROUTING_ENTRY_TYPE(field) \
(((field) >> MCTP_ROUTING_ENTRY_TYPE_SHIFT) & \
MCTP_ROUTING_ENTRY_TYPE_MASK)

/* MCTP Time Specification
* See DSP0283 v1.0.0 Table 4
*/
#define MCTP_TRECLAIM_US 5000000 // 5s TRECLAIM
#define MCTP_RESP_TIMEOUT 400000 //400ms MT2
Loading