-
Notifications
You must be signed in to change notification settings - Fork 20
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
mctpd: Add mctp/links/<linkName>
D-Bus object
#39
mctpd: Add mctp/links/<linkName>
D-Bus object
#39
Conversation
Import a copy of the tomlc99 parser, somewhat temporarily, from upstream commit 5221b3d. We import the toml.[ch] sources, the LICENSE, and add a short readme for the upstream reference. Signed-off-by: Jeremy Kerr <[email protected]>
This change adds a basic configuration interface, using a simple toml syntax. This allows configuration of the existing mctpd parameters: bus-owner mode, the mctp timeout, and the UUID. We ship a small example configuration under conf/. Signed-off-by: Jeremy Kerr <[email protected]>
Thanks! We'll need to check whether this is compatible with the existing layout where the top-level |
I started writing some notes on the interface changes, but that expanded beyond just this change, so they're now in #40. However, I'd rather not drag out this change too long, so already have progress on implementing the changes in #40, which should be quick to adapt to most design changes that may arise there. So, I'll add a couple of review comments on this, just for top-level API things for now; we can cover implementation details soon. It's my goal that we would then rebase this change on to the dbus api rework that comes out of #40. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, we'll just need to synchronise with the dbus API changes.
Rather than requiring a -c FILE argument, allow a default configuration file of /etc/mctpd.conf. We don't error if this is absent, to allow running with the existing defaults. Signed-off-by: Jeremy Kerr <[email protected]>
e280eed
to
3f01e54
Compare
3f01e54
to
b9b32f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, thanks!
I have a few comments inline, but a lot of those are more questions to improve my understanding of your approach here.
We have these repeated, move to a common location. Signed-off-by: Jeremy Kerr <[email protected]>
…ig values Rather than hard-coding the mode types in the config parsing, move these to an array of role descriptions, and parse from that. This will be used in an upcoming change where we parse roles from dbus properties too. Signed-off-by: Jeremy Kerr <[email protected]>
This change implements the dbus interface rework specified in CodeConstruct#40. Essentially: this uses more standard bus, object and path names, and moves away from the xyz.openbmc_project namespace, and use au.com.codeconstruct (all lowercase) there instead, as we're not specificially an OpenBMC project. We also put collections of things (networks and endpoints) under a specifically-named object path, so we can introduce new collections alongside (interfaces) without compatibility issues This means: - the bus owner name is now au.com.codeconstruct.MCTP1 - interfaces are namespaced and versioned: - au.com.codeconstruct.MCTP.Endpoint1 - au.com.codeconstruct.MCTP.BusOwner1 - the top-level entrypoint path is versioned, as `/au/com/codeconstruct/mctp1` - the endpoint object tree is structured as `/au/com/codeconstruct/mctp1/networks/<n>/endpoints/<e>` Signed-off-by: Jeremy Kerr <[email protected]>
We'll be modifying this for the new Role-based interfaces which exist on the link/interface objects, so use a temporary name for now. Signed-off-by: Jeremy Kerr <[email protected]>
99b84c3
to
9ed35ed
Compare
fd3dd47
to
671d0cb
Compare
9901b83
to
ee3ea15
Compare
Enumerate the parent D-Bus object path `.../mctp1/networks` for the network paths `.../mctp1/networks/<NetID>` and `.../mctp1/networks/<NetID>/endpoints` for the endpoints path `.../mctp1/networks/<NetID>/endpoints/<EID>`. Tested: Check the MCTP D-Bus interface: ``` busctl tree au.com.codeconstruct.MCTP1 `- /au `- /au/com `- /au/com/codeconstruct `- /au/com/codeconstruct/mctp1 `- /au/com/codeconstruct/mctp1/networks `- /au/com/codeconstruct/mctp1/networks/1 `- /au/com/codeconstruct/mctp1/networks/1/endpoints `- /au/com/codeconstruct/mctp1/networks/1/endpoints/8 ``` Signed-off-by: Thu Nguyen <[email protected]>
For upcoming mctpd changes, we will need a facility for storing dbus-specific information on each link. This change adds a void * userdata pointer to the links, and accessors for callers to get/set this pointer. For convenience, we also pass this pointer on change events, allowing for a quick way to release/update the userdata on link delete/change. WIP: untested. Signed-off-by: Jeremy Kerr <[email protected]>
ee3ea15
to
2bc1292
Compare
2bc1292
to
5a777d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! A couple of really minor things, but I think we're almost ready to go here. I'll start some testing on my side too.
A couple of new warnings have been introduced:
but those should be straightforward fixes |
5a777d6
to
70a5b3e
Compare
I fixed it. |
Seems to be one more remaining though:
|
1. Create the MCTP interfaces D-Bus objects for the existing MCTP links at `/xyz/openbmc_project/mctp1/interfaces/<name>`. When the MCTP links is removed from/added to the system, the D-Bus object will also be removed/added. 2. Create the au.com.CodeConstruct.MCTP.Link1 D-Bus interface for MCTP interface D-Bus objects. The D-Bus interface includes the `Role` property which reports BMC roles in the MCTP link. The possible value of `Role` are `BusOwner`, `Endpoint` and `Unknown`. 3. Because the BMC `Role` in the MCTP interface is fixed. The `Role` property is changeable value but it can only be changed when the current configured value is `Unknown`. Ex: ``` busctl tree au.com.codeconstruct.MCTP1 `- /au `- /au/com `- /au/com/codeconstruct `- /au/com/codeconstruct/mctp1 |- /au/com/codeconstruct/mctp1/interfaces | |- /au/com/codeconstruct/mctp1/interfaces/lo | `- /au/com/codeconstruct/mctp1/interfaces/mctpi2c3 `- /au/com/codeconstruct/mctp1/networks `- /au/com/codeconstruct/mctp1/networks/1 `- /au/com/codeconstruct/mctp1/networks/1/endpoints `- /au/com/codeconstruct/mctp1/networks/1/endpoints/8 busctl introspect au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/interfaces/mctpi2c3 NAME TYPE SIGNATURE RESULT/VALUE FLAGS au.com.CodeConstruct.MCTP.Link1 interface - - - .Role property s "Endpoint" emits-change writable org.freedesktop.DBus.Introspectable interface - - - .Introspect method - s - org.freedesktop.DBus.Peer interface - - - .GetMachineId method - s - .Ping method - - - org.freedesktop.DBus.Properties interface - - - .Get method ss v - .GetAll method s a{sv} - .Set method ssv - - .PropertiesChanged signal sa{sv}as - - busctl set-property au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/interfaces/mctpi2c3 au.com.CodeConstruct.MCTP.Link1 Role s BusOwner busctl get-property au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/interfaces/mctpi2c3 au.com.CodeConstruct.MCTP.Link1 Role s "BusOwner" ``` Signed-off-by: Thu Nguyen <[email protected]>
70a5b3e
to
1315ccc
Compare
I updated code. |
9ed35ed
to
d441a00
Compare
So this PR got auto-closed on merge of the pre-req dbus-rework branch, but we still do want the change. I have rebased the remaining change and created #44 to continue the interface objects work. |
Ah, seems like the auto-close was because the |
/xyz/openbmc_project/mctp/links/<linkName>
. When the MCTP links is removed from/added to the system, the D-Bus object will also be removed/added.Role
property which reports BMC roles in the link. The possible value ofRole
areBusOwner
,Endpoint
andUnknown
.Role
in the MCTP link is fixed. TheRole
property is changeable value but it can only be changed when the current configured value isUnknown
.Ex: