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

Provide support for platform hooks in swss.sh #7352

Closed
wants to merge 1 commit into from
Closed

Provide support for platform hooks in swss.sh #7352

wants to merge 1 commit into from

Conversation

VenkatCisco
Copy link
Contributor

Why I did it

This is a platform agnostic & vendor agnostic change to files/scripts/swss.sh to check if 'platform' entry exists in the DEVICE_METADATA table. If it exits it checks if there is a file to source and hence does the needful.

How I did it

This is a PR followup from the code-review discussion we had with Guhon/Rita and team. This also addresses one of the comment that was raised to convert to sourcing a file instead of executing the same., so the logic within is run in the same shell.

How to verify it

Verify on the device to ensure any files sourced via the swss.sh hooks are getting executed.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@VenkatCisco VenkatCisco marked this pull request as ready for review April 28, 2021 23:02
@VenkatCisco VenkatCisco requested a review from lguohan as a code owner April 28, 2021 23:02
# entry exists in the DEVICE_METADATA table. If it exits then
# source the script to perform platform specific checks
PLATFORM_DIR=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
F="/usr/share/sonic/device/$PLATFORM_DIR/scripts/swss.sh"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the platform script need to handle stop/wait cases as well ? Another suggestion would be to pass additional parameters like warmboot/fastboot flags, network namespace etc to this script..

@judyjoseph
Copy link
Contributor

@VenkatCisco, I have merged a PR #7513 from 201911. This was how we used to parse/extract the PCI-id's from the acis.conf file and populate in DEVICE_METADATA in case of multi-asic platforms.

@VenkatCisco
Copy link
Contributor Author

VenkatCisco commented May 17, 2021

@VenkatCisco, I have merged a PR #7513 from 201911. This was how we used to parse/extract the PCI-id's from the acis.conf file and populate in DEVICE_METADATA in case of multi-asic platforms.

HI Judy, as per our earlier review, Guhon & you suggested to use $sonic_asic_platform instead of $PLATFORM_DIR. Accordingly, I have already incorporated those changes in our cisco branch. The diffs are 2 lines as below.

F="/usr/share/sonic/device/$sonic_asic_platform/swss.sh"
[ -e $F ] && source $F start $DEV

Looks ok, I see that the script platform/cisco-8000/device/cisco-8000/swss.sh updates the pci_ID in DEVICE_METADATA:asic_id. So do we really need a separate script to be invoked from syncd.sh ( #7331) ?

@VenkatCisco
Copy link
Contributor Author

tracked via #7621.

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.

2 participants