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

Add a template function that returns list of asics on module #185

Merged
merged 3 commits into from
Jun 21, 2021

Conversation

ngoc-do
Copy link
Contributor

@ngoc-do ngoc-do commented Apr 22, 2021

Signed-off-by: ngocdo ngocdo@arista.com

Add a generic function that returns a list of asics on module. Vendors will implement their own for their platform.

The function could be used for collecting fabric asic info in each module and populating into CHASSIS_STATE_DB (sonic-net/sonic-platform-daemons#175). To simplify the change, all fabric cards in system should be identical in terms of number of asics in a card.

Signed-off-by: ngocdo <ngocdo@arista.com>
sonic_platform_base/module_base.py Outdated Show resolved Hide resolved
sonic_platform_base/module_base.py Outdated Show resolved Hide resolved
sonic_platform_base/module_base.py Outdated Show resolved Hide resolved
sonic_platform_base/module_base.py Outdated Show resolved Hide resolved
sonic_platform_base/module_base.py Outdated Show resolved Hide resolved
sonic_platform_base/module_base.py Outdated Show resolved Hide resolved
sonic_platform_base/module_base.py Outdated Show resolved Hide resolved
sonic_platform_base/module_base.py Outdated Show resolved Hide resolved
sonic_platform_base/module_base.py Outdated Show resolved Hide resolved
@anshuv-mfst
Copy link

@judyjoseph - please review and approve.

@anamehra
Copy link

anamehra commented Jun 2, 2021

If we are considering FCs with different number of asics, a CLI to display asics associated to a Fabric card will be a good enhancement. Is there a plan for that?

@ngoc-do
Copy link
Contributor Author

ngoc-do commented Jun 4, 2021

If we are considering FCs with different number of asics, a CLI to display asics associated to a Fabric card will be a good enhancement. Is there a plan for that?

I think it may not be a trivial work. If we just start from here and the cli just reads CHASSIS_STATE_DB and shows asic information, it's not a problem. But having a consistent design seems a different thing. Some systems don't have CHASSIS_STATE_DB, but have fabric. At some point, I'm sure we want the cli to show not just fabric, but NPU asics too.

So the cli topic will be discussed later, and out of the scope of this PR.

@ngoc-do
Copy link
Contributor Author

ngoc-do commented Jun 4, 2021

@judyjoseph Please review and approve this PR. It's a blocker for another one (sonic-net/sonic-platform-daemons#175).

@judyjoseph judyjoseph requested a review from jleveque June 4, 2021 16:30
@judyjoseph
Copy link
Contributor

@ngoc-do also please update the PR description that this CHASSIS_ASIC_TABLE is introduced predominantly for FABRIC cards where the number of asic per car remains same.

@ngoc-do
Copy link
Contributor Author

ngoc-do commented Jun 4, 2021

@ngoc-do also please update the PR description that this CHASSIS_ASIC_TABLE is introduced predominantly for FABRIC cards where the number of asic per car remains same.

Done.

@judyjoseph
Copy link
Contributor

@ngoc-do, Could you resolve the conflict in this file ?

@judyjoseph
Copy link
Contributor

@jleveque, Please could you check if the comments are addressed, we could proceed to merge if ok.

@anshuv-mfst
Copy link

@judyjoseph - can you please merge asap please, needed for 202106 release

@ngoc-do
Copy link
Contributor Author

ngoc-do commented Jun 21, 2021

@judyjoseph - can you please merge asap please, needed for 202106 release

I will resolve conflict.

@ngoc-do
Copy link
Contributor Author

ngoc-do commented Jun 21, 2021

Conflict has been resolved. Please help merge. Thanks @judyjoseph.

@judyjoseph judyjoseph merged commit 4533f82 into sonic-net:master Jun 21, 2021
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jul 22, 2021
To include:
> e168f1d 2021-07-19 pettershao-ragilenetworks: [python coverage] fix result color bar (sonic-net/sonic-platform-common#202)
> 87c81de 2021-07-13 Prince George: Fix Xcvrd crash due to invalid key access in type_of_media_interface, host_electrical_interface, connector_dict (sonic-net/sonic-platform-common#206)
> 4533f82 2021-06-21 ngoc-do: Add a template function that returns list of asics on module (sonic-net/sonic-platform-common#185)
> 1e860c5 2021-06-18 Aravind Mani: Fix decode error when parsing EEPROM fields (sonic-net/sonic-platform-common#199)
> 93641f3 2021-06-17 Sujin Kang: Unifying the platform api for get_pcie_aer_stats with PcieBase (sonic-net/sonic-platform-common#197)
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
To include:
> e168f1d 2021-07-19 pettershao-ragilenetworks: [python coverage] fix result color bar (sonic-net/sonic-platform-common#202)
> 87c81de 2021-07-13 Prince George: Fix Xcvrd crash due to invalid key access in type_of_media_interface, host_electrical_interface, connector_dict (sonic-net/sonic-platform-common#206)
> 4533f82 2021-06-21 ngoc-do: Add a template function that returns list of asics on module (sonic-net/sonic-platform-common#185)
> 1e860c5 2021-06-18 Aravind Mani: Fix decode error when parsing EEPROM fields (sonic-net/sonic-platform-common#199)
> 93641f3 2021-06-17 Sujin Kang: Unifying the platform api for get_pcie_aer_stats with PcieBase (sonic-net/sonic-platform-common#197)
judyjoseph pushed a commit that referenced this pull request Aug 20, 2021
Add a generic function that returns a list of asics on module. Vendors will implement their own for their platform.

The function could be used for collecting fabric asic info in each module and populating into CHASSIS_STATE_DB (sonic-net/sonic-platform-daemons#175). To simplify the change, all fabric cards in system should be identical in terms of number of asics in a card.
mlorrillere added a commit to mlorrillere/sonic-buildimage that referenced this pull request Apr 18, 2022
Asic PCI ID (PCI address) is collected by chassisd (inside pmon -
sonic-net/sonic-platform-daemons#175) and saved in CHASSIS_STATE_DB (in
redis_chassis). CHASSIS_STATE_DB is accessible by swss containers.

At docker-init.sh (script is called after swss container is created and before
anything that could run in swss like orchagent...), we wait until asic PCI ID
of the corresponding asic is populated by chassisd. We then update asic_id in
CONFIG_DB of asic's database.

A system supporting dynamic asic PCI ID identification requires to have a file
(empty) use_pci_id_chassis in its platform dir.

When orchagent runs, it has correct asic PCI ID in its CONFIG_DB.

Together with this PR:

sonic-net/sonic-platform-daemons#175
sonic-net/sonic-platform-common#185

Signed-off-by: Maxime Lorrillere <mlorrillere@arista.com>
arlakshm pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Apr 25, 2022
… CONFIG_DB (#9681)

Asic PCI ID (PCI address) is collected by chassisd (inside pmon -
sonic-net/sonic-platform-daemons#175) and saved in CHASSIS_STATE_DB (in
redis_chassis). CHASSIS_STATE_DB is accessible by swss containers.

At docker-init.sh (script is called after swss container is created and before
anything that could run in swss like orchagent...), we wait until asic PCI ID
of the corresponding asic is populated by chassisd. We then update asic_id in
CONFIG_DB of asic's database.

A system supporting dynamic asic PCI ID identification requires to have a file
(empty) use_pci_id_chassis in its platform dir.

When orchagent runs, it has correct asic PCI ID in its CONFIG_DB.

Together with this PR:

sonic-net/sonic-platform-daemons#175
sonic-net/sonic-platform-common#185

Signed-off-by: Maxime Lorrillere <mlorrillere@arista.com>

Co-authored-by: Maxime Lorrillere <mlorrillere@arista.com>
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-platform-common that referenced this pull request Oct 25, 2024
…ic-net#185)

* [xcvrd] add support for logging mux_metrics events into state DB

Description
This PR adds support for logging events for change requests received by xcvrd from swss into state DB.
a typical log would look like this:
1) "xcvrd_switch_standby_start"
2) "2021-05-13 10:01:15.690835"
3) "xcvrd_switch_standby_end"
4) "2021-05-13 10:01:15.696051"

where the key-value pairs signify the type of event requested out of
active/standby/unknown and the timestamp associated with the event.

Motivation and Context
This is required for xcvrd to log the events which it receives in form of requests from swss or any other module into the DB. The timestamp will be useful for debugging the timeline of an event processing from a perspective of other modules as well as xcvrd itself.

How Has This Been Tested?
ran the changes on starlab testbed, by changing the file in the container.

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants