Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Enumerate policies on start #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paulfertser
Copy link

Continuation of the accidentally-closed github pull request #1.

Some NM requests return additional information along with the
non-success Completion Code. E.g. 0xC2 (get NM policy) returns the next
valid policy ID for faster enumeration.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
To ensure consistency between the set of policies used by NM and the set
presented via D-Bus fetch all the existing policies on daemon startup
and create the corresponding objects on the bus.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
@paulfertser
Copy link
Author

Hello @wdembinski ,
Anything else I missed? What should be my next step?

@wdembinski
Copy link
Contributor

Hey Paul
I'll prepare patch on downstream. Once approved, upstream will be automatically bumped with changes. There's nothing to do on your site. In the case of any additional changes required in that review, I'll let you know.

@paulfertser
Copy link
Author

Hi Wojciech,
Thank you very much for the update.
One thing I have some hesitations about is the "OEM policy". In my limited (just our platform) testing I see it always present and disabled, and trying to add/modify it always resulted in NM returning an error. I couldn't find anything relevant in the documentation, so decided to just skip it to be able to proceed. However I can imagine in some cases the need for it to be exposed, depending on the real semantics (which I have no idea about yet).
I'll be happy to provide any additional clarifications regarding the code or motivation behind it.
Thank you.

@jjatkiewicz
Copy link

Hi @paulfertser
I prepared a patch on downstream, but I changed a bit implementation. I removed class storedPolicies and I have moved this functionality to the new method in the Domian class. Instead of iterator I used a simple loop to find an existing policies. Is that OK with you?

@paulfertser
Copy link
Author

paulfertser commented Dec 20, 2021 via email

@jjatkiewicz
Copy link

@paulfertser Your code is correct :) I think that my solution is more concise. I agree with your suggest about iterator, but in this case I think that using iterator is more difficult to understand code. Our aims is check policy id from 1 to 255.
It's great that you've added reading the next valid policy Id from Non-Success CC. This significantly speeds up finding of existing policies.

I also thought this class I created might come useful later for some other related purpose?
Do you know what we can use this class for in the future? In this moment I can't see. Additionally, changes to this file are very rare.

@wdembinski
Copy link
Contributor

@paulfertser Your code lists node-manager policies only on startup. If anything changes in node-manager (policy removed, policy updated), DBus information will be outdated. We see 2 options here: i) implement periodical refresh, ii) implement on-demand refresh. What do you think would be better? Have you considered such scenario? Do you need a list of those policies only during startup?

@paulfertser
Copy link
Author

paulfertser commented Dec 21, 2021 via email

@wdembinski
Copy link
Contributor

Node Manager on PCH can be also accessed via IPMI. Refer to https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/intel-power-node-manager-v3-spec.pdf. This is version 3.0 of Node Manager, you need to check what version you are using on your platform. Maybe that approach would be better for you? You can also access IPMI from BMC.

@paulfertser
Copy link
Author

paulfertser commented Dec 21, 2021 via email

@wdembinski
Copy link
Contributor

That's right but we only provide a limited set of functionality required for other components within OpenBMC. To access all features of Node Manager in your case, you need to use IPMI.

"When working on this I assumed that only node-manager-proxy can be
changing the policies, as I am not aware of any other mechanisms to do
that."
That's a wrong assumption. It can be also accessed with IPMI interface - so, if you are sure that nothing on your platform accesses it that way, that's ok. Otherwise, once data is collected during startup, it can be outdated later - because of any application with access to IPMI which communicates with Node Manager.

@paulfertser
Copy link
Author

paulfertser commented Dec 21, 2021 via email

@jjatkiewicz
Copy link

Hi @paulfertser,
as written by @wdembinski, "node-manager-proxy provide only a limited set of functionality required for other components within OpenBMC". Using IPMI your are able to manage NM policies on PCH. To answer your question, yes, in some cases node-manager-proxy isn't used - direct communicate with ME is made via IPMI.
We discussed about your pull request, but we don't have enough resources to fully extended node-manager-proxy now.

@paulfertser
Copy link
Author

paulfertser commented Feb 3, 2022 via email

@paulfertser
Copy link
Author

It's been more than a month since your last reply, did this fall through the cracks?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants