-
Notifications
You must be signed in to change notification settings - Fork 34
Support LocaEids property in au.com.codeconstruct.MCTP.Network1
#54
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
Conversation
|
I'm not trying to block the change here, but I feel we might want a holistic treatment of |
|
From some chatting on Discord, my suggested approach was that we have an EIDs property on the network object, where an application can always pick the first to acquire a suitable local EID that can route to the local stack. Since the host will accept any local destination EID, it will always be valid on any incoming interface. (the extension of that concept is that we may as well assign the same local EID to all interfaces, but that's entirely optional) We may have a scenario in future where an application may need to query a local EID that is bound to a specific interface, but I don't think that's what's happening here. |
It seems I missed your idea in the Discord Chat. I thought we will add the In case, we want to add the
I'm agree with you that when the interfaces are belong to the same network, this will be true. Although, this will make the routing table in both BMC, the bridge between BMC and terminus (if have) and the terminus are more complicated.
This option can only be applied when BMC is BO in all interfaces.
|
What do you think about adding the D-Bus interface "au.com.CodeConstruct.MCTP.Network1" in network object path as below Where:
|
|
Looks good, but maybe make it obvious that the |
Sure. |
|
ok, super. Also, just check the capitalisation on the interface name. |
cd541d6 to
41dd42a
Compare
41dd42a to
7515c3f
Compare
EIDs property to show local EIDsLocaEids property in au.com.codeconstruct.MCTP.Network1
| } | ||
|
|
||
| return ret_eids; | ||
| } |
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.
You have essentially the same logic repeated here. Just return the count and array from the one function.
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.
This has been re-introduced in the recent changes; does this iteration code need to appear twice?
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.
Yes.
We need to know the number of localEIDs first, then allocate ret_eids with number of localEIDs.
In the commit 17adff2, I tried to change combine find_local_eids_count_by_net and find_local_eids_by_net but eids is null event num is 1 in sd_bus_message_append_array(reply, 'y', eids, num);. That why I back to use two functions.
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.
Using two functions also makes the code is clearer.
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.
Using two functions also makes the code is clearer.
I disagree. You already have divergence between the two implementations (code formatting), as well as a bug duplicated in both (&ctx->peers[x] can never be null)
The number of local EIDs is fairly well constrained; does this even need to be calculated in advance? just malloc the whole 256 bytes, and iterate once.
but
eidsis null eventnumis 1 insd_bus_message_append_array(reply, 'y', eids, num);
not sure I understand this, can you rephrase?
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.
The number of local EIDs is fairly well constrained; does this even need to be calculated in advance? just malloc the whole 256 bytes, and iterate once.
I updated the latest code by malloc the localEIDs with 256 bytes as your suggest.
edc3f5f
Only need one functions and iterate once.
b8c4619 to
bb6d0c9
Compare
jk-ozlabs
left a comment
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.
Looks good. Just a wording change on the doc addition, but I can edit that as part of the merge (unless you happen to beat me to it!)
Thanks for the contribution!
|
The PULL is WIP |
|
OK, I'll wait on updates then! |
|
OK, if you're updating, then a couple of build warnings present. You may already be working on these, but just in case not: |
c0491a3 to
17adff2
Compare
2b795f6 to
47880d1
Compare
|
The code is good now. I tested the code. |
Add code to show the local EIDs in `LocalEIDs` property in `au.com.codeconstruct.MCTP.Network1` D-Bus interface of the D-Bus object path `/au/com/codeconstruct/mctp1/networks/<netId>`. ``` busctl introspect au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/networks/1 NAME TYPE SIGNATURE RESULT/VALUE FLAGS au.com.codeconstruct.MCTP.Network1 interface - - - .LocalEIDs property ay 1 8 const org.freedesktop.DBus.Introspectable interface - - - .Introspect method - s - ``` Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
47880d1 to
edc3f5f
Compare
jk-ozlabs
left a comment
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.
Looks good, thanks!
|
Merged as 6470f9e , along with a set of tests for the dbus interface. I had fixed up the commit title ( Thanks for the contribution! |
Add code to show the local EIDs in
EIDsproperty inau.com.CodeConstruct.MCTP.Interface1D-Bus interface.