Skip to content
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

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

Conversation

SerhiyBoikoPLV
Copy link

@SerhiyBoikoPLV SerhiyBoikoPLV commented Jul 19, 2024

What I did
Add support for PoE based on sonic-sairedis support of multiple switches

  • Add poeorch daemon to handle APPL_DB changes
  • Add poesyncd daemon to handle PoE config
  • Add poe config manager to parse PoE-related configs

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

Copy link

linux-foundation-easycla bot commented Jul 19, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.


SWSS_LOG_NOTICE("POE: Initialize");
if (!poe.isPoeEnabled()) {
SWSS_LOG_WARN("POE: not enabled");

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"

Copy link
Author

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

Copy link

@praveenraja1 praveenraja1 left a comment

Choose a reason for hiding this comment

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

Looks good

@prsunny prsunny requested a review from prgeor September 23, 2024 20:27
orchagent/main.cpp Outdated Show resolved Hide resolved
orchagent/main.cpp Outdated Show resolved Hide resolved
orchagent/poeorch.cpp Outdated Show resolved Hide resolved
lib/poecfg.cpp Outdated Show resolved Hide resolved
return false;
}

bool PoeConfig::loadDeviceConfig(const std::vector<FieldValueTuple> &ovalues)

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?

Copy link
Author

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);
}

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.

Copy link
Author

Choose a reason for hiding this comment

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

added warning logs

lib/poecfg.cpp Outdated Show resolved Hide resolved
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]>
@SerhiyBoikoPLV
Copy link
Author

@prgeor could you please review these changes?

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

Successfully merging this pull request may close these issues.

4 participants