-
Notifications
You must be signed in to change notification settings - Fork 537
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
[swss] Add support for PoE feature #3238
base: master
Are you sure you want to change the base?
Conversation
|
||
SWSS_LOG_NOTICE("POE: Initialize"); | ||
if (!poe.isPoeEnabled()) { | ||
SWSS_LOG_WARN("POE: not enabled"); |
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.
For non-poe platforms we may not want log a warning message. Maybe we can skip this log if "!platformHasPoe"
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.
added an additional check, so that if the platform does not not support PoE (doesn't have a poe_config.json file present) then we do not print anything
acc1489
to
17ff200
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.
Looks good
17ff200
to
f3377d8
Compare
return false; | ||
} | ||
|
||
bool PoeConfig::loadDeviceConfig(const std::vector<FieldValueTuple> &ovalues) |
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 loadDeviceConfig, loadPseConfig, and loadPortConfig functions always return true, even though some fields might be missing or invalid.
Could you add error handling that logs and returns false?
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.
added exception handling (for std::stoul()) and error logs
type = token.at(0); | ||
idx = token.at(1); | ||
} | ||
|
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.
if token.size() is not 1 or 2, this is and error that should be logged and handled.
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.
added warning logs
f3377d8
to
143edcc
Compare
@prgeor could you please review these changes? |
3bbd09b
to
81e81ff
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.
LGTM
Add poesyncd daemon Parse PoE-related configs *What I did* Add support for PoE based on sonic-sairedis support of multiple switches. *How I verified it* Builds and tests using VS builds. Signed-off-by: Serhiy Boiko <[email protected]>
Signed-off-by: Serhiy Boiko <[email protected]>
81e81ff
to
e97143f
Compare
What I did
Add support for PoE based on sonic-sairedis support of multiple switches
This PR depends on sonic-net/sonic-swss-common#894
Why I did it
How I verified it
Builds and tests using VS builds.
Details if related