Skip to content

Commit 2746a86

Browse files
mctp: implement asynchronous polling for bridge downstream EIDs
Add asynchronous polling mechanism for MCTP bridge downstream endpoints to discover them. The polling continues throughout the bridge's existence under the MCTP network and creates peer structures only when endpoints respond to poll successfully. - Update bus-owner config with polling related factors such as ep_removal_threshold, poll_timeout - Add bridge_eid_poll_context and bridge_endpoint_discovery structures - Implement setup_async_downstream_ep_poll() for polling initialization - Add send_bridge_poll_request() for periodic GET_ENDPOINT_ID messages - Add handle_bridge_poll_response() for response processing - Add handle_poll_timeout() with ep_removal_threshold failure handling - Add cleanup_bridge_polling() and cleanup_bridge_downstream_peers() The polling uses an asynchronous sender-response model where mctpd continuously polls downstream EIDs and creates peer structures upon successful responses. Failed endpoints are removed after reaching the failure threshold (ep_removal_threshold). Polling stops and all resources are cleaned up when bridges are removed. Signed-off-by: Faizan Ali <[email protected]>
1 parent cd91cc8 commit 2746a86

File tree

3 files changed

+512
-3
lines changed

3 files changed

+512
-3
lines changed

conf/mctpd.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ message_timeout_ms = 30
88
# bus-owner configuration
99
[bus-owner]
1010
max_pool_size = 15
11+
ep_removal_thresold = 3
12+
mctp_treclaim_interval_us = 5000000 # 5s
13+
poll_timeout_us = 400000 # 400ms MT2
1114

1215
# Specify a UUID: not generally required - mctpd will query the system UUID
1316
# where available.

src/mctp-control-spec.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,8 @@ struct mctp_ctrl_resp_alloc_eid {
330330
#define GET_ROUTING_ENTRY_TYPE(field) \
331331
(((field) >> MCTP_ROUTING_ENTRY_TYPE_SHIFT) & \
332332
MCTP_ROUTING_ENTRY_TYPE_MASK)
333+
334+
/* MCTP Time Specification
335+
* See DSP0283 v1.0.0 Table 4
336+
*/
337+
#define MCTP_TRECLAIM_US 5000000 // 5s

0 commit comments

Comments
 (0)