Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
To support this, the minimum meson version has been bumped to 0.60,
previously 0.59.

3. `mctpd` now supports autonomous periodic discovery on point-to-point
physical links (e.g. Serial, USB, KCS) operating in Bus Owner mode.
Background probing automatically discovers and assigns EIDs to endpoints
once the interface is brought UP, with support for per-interface probe
intervals and static EID reservations.

### Fixes

1. In v2.6. we lost the peer initial MTU sematics, which gave us a safe minimum
Expand Down
24 changes: 24 additions & 0 deletions conf/mctpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,27 @@ max_pool_size = 15
# Bus Owner/bridge polling interval (ms) to check endpoint accessibility.
# A value of 0 disables polling.
endpoint_poll_ms = 0

# Autonomous periodic discovery for point-to-point addressless interfaces (e.g. Serial, USB, KCS)
# Default is false.
auto_discovery = false

# Periodic probing interval (ms) for point-to-point interfaces (100 - 60000 ms)
probe_interval_ms = 1000

# Interface specific configuration examples:
#
# [[interface]]
# match = { phys-type = "serial" }
# role = "bus-owner"
# auto_discovery = true
# probe_interval_ms = 500
# static_eid = 8
#
# [[interface]]
# match = { phys-type = "usb" }
# role = "bus-owner"
# auto_discovery = true
# probe_interval_ms = 500
# static_eid = 9

50 changes: 45 additions & 5 deletions docs/mctpd.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,24 @@ Such periodic polling is common for all the briged endpoints among allocated
pool space [`.PoolStart` - `.PoolEnd`] of the bridge.
Polling could be provisioned to be disabled via setting the value as ```0```.

#### `auto_discovery`: Autonomous periodic probing on point-to-point links

* type: boolean
* default: `false`

Enables autonomous background probing (`Get Endpoint ID` 0x02) for addressless
point-to-point links (e.g. Serial, USB, KCS) running in `bus-owner` mode. When enabled,
`mctpd` automatically probes the link when brought `IFF_UP` until the endpoint
responds, assigns an EID, and transitions the link to `DISCOVERY_DISCOVERED`.

#### `probe_interval_ms`: Periodic probing interval for point-to-point links

* type: integer, in milliseconds
* default: 1000

Specifies the period between probe attempts on point-to-point links. Valid range is
`100` ms to `60000` ms.

### `[[interface]]`: per-interface configuration

The `[[interface]]` table allows configuration to be applied to specific
Expand All @@ -443,12 +461,34 @@ determines which MCTP interfaces the table applies to.
Matches are processed in the order they appear in the configuration file;
the first `[[interface]]` section that matches is applied.

Other content of the interface table is configuration to be applied. The
only setting currently supported is `role`, to set mctpd's role as
either bus-owner or endpoint on this interface.
Supported settings per interface:
* `role`: sets mctpd's role as either `bus-owner` or `endpoint` on this interface.
* `auto_discovery`: overrides global `auto_discovery` for this interface (`true`/`false`).
* `probe_interval_ms`: overrides global probe interval in milliseconds (`100` - `60000`).
* `static_eid`: assigns a fixed static EID (must be in `[8, dynamic_eid_start)`) upon successful probe response, preventing dynamic EID allocation collisions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please introduce the concept of static peer EIDs as a separate change, as it will have implications across all of the autodiscovery methods.

Also, the name static_eid is too ambiguous; currently it reads as if that is a static EID that gets assigned to the interface.

Why does the static EID need to be lower than the dynamic EID range, rather than just not within the range?


For example, to configure static EIDs and custom probe intervals on point-to-point links:

For example, to apply a `bus-owner` role globally, with interface-specific
`endpoint` roles for all i2c devices, and one particular (USB) device:
```toml
[bus-owner]
dynamic_eid_range = [16, 64]
auto_discovery = true
probe_interval_ms = 1000

[[interface]]
match = { phys-type = "serial" }
role = "bus-owner"
auto_discovery = true
probe_interval_ms = 500
static_eid = 8

[[interface]]
match = { phys-type = "usb" }
role = "bus-owner"
auto_discovery = true
probe_interval_ms = 500
static_eid = 9
```

```toml
role = "bus-owner"
Expand Down
Loading
Loading