Skip to content

Commit 8a22c88

Browse files
mctpd: add endpoint polling interval configuration
Refering to DSP0236 sec 8.17.6 Reclaiming EIDs from hot-plug devices Requirement: The bus owner/bridge needs to periodically poll GET_ENDPOINT_ID control command to check if downstream endpoint is accessible. Once it's established that endpoin is accessible, polling needs to stop. Introduce new endpoint polling configuration to be used as periodic interval for sending poll command GET_ENDPOINT_ID by bus owner/bridge. Signed-off-by: Faizan Ali <faizana@nvidia.com>
1 parent 5211a29 commit 8a22c88

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

conf/mctpd.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ message_timeout_ms = 30
1616
dynamic_eid_range = [8, 254]
1717

1818
max_pool_size = 15
19+
20+
# Bus Owner/bridge polling interval (ms) to check endpoint accessibility.
21+
endpoint_poll_ms = 2500 # 2.5 sec

src/mctpd.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ struct ctx {
237237

238238
// maximum pool size for assumed MCTP Bridge
239239
uint8_t max_pool_size;
240+
241+
// bus owner/bridge polling interval in usecs for
242+
// checking endpoint's accessibility.
243+
uint64_t endpoint_poll;
240244
};
241245

242246
static int emit_endpoint_added(const struct peer *peer);
@@ -4535,6 +4539,20 @@ static int parse_config_bus_owner(struct ctx *ctx, toml_table_t *bus_owner)
45354539
return rc;
45364540
}
45374541

4542+
val = toml_int_in(bus_owner, "endpoint_poll_ms");
4543+
if (val.ok) {
4544+
uint64_t i = val.u.i;
4545+
if ((i > 100 * 1000) ||
4546+
(i * 1000) < (MCTP_I2C_TSYM_TRECLAIM_MIN_US / 2)) {
4547+
warnx("endpoint polling interval invalid (%u - %u ms)",
4548+
(MCTP_I2C_TSYM_TRECLAIM_MIN_US / 2) / 1000,
4549+
100 * 1000);
4550+
return -1;
4551+
}
4552+
4553+
ctx->endpoint_poll = i * 1000;
4554+
}
4555+
45384556
return 0;
45394557
}
45404558

@@ -4608,6 +4626,7 @@ static void setup_config_defaults(struct ctx *ctx)
46084626
ctx->max_pool_size = 15;
46094627
ctx->dyn_eid_min = eid_alloc_min;
46104628
ctx->dyn_eid_max = eid_alloc_max;
4629+
ctx->endpoint_poll = 2500000; //2.5s
46114630
}
46124631

46134632
static void free_config(struct ctx *ctx)

0 commit comments

Comments
 (0)