Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7050_qx32/thermal_policy.json
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7050_qx32s/thermal_policy.json
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7060_cx32s/thermal_policy.json
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7060px4_32/thermal_policy.json
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7170_32c/thermal_policy.json
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7170_32cd/thermal_policy.json
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7170_64c/thermal_policy.json
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7260cx3_64/thermal_policy.json
4 changes: 4 additions & 0 deletions device/arista/x86_64-arista_common/pmon_daemon_control.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"skip_fancontrol": true
}

60 changes: 60 additions & 0 deletions device/arista/x86_64-arista_common/thermal_policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"thermal_control_algorithm": {
"run_at_boot_up": "true",
"fan_speed_when_suspend": "100"
},
"info_types": [
{
"type": "control_info"
},
{
"type": "fan_info"
},
{
"type": "thermal_info"
}
],
"policies": [
{
"name": "any thermal critical",
"conditions": [
{
"type": "thermal.any.critical"
}
],
"actions": [
{
"type": "fan.all.set_speed",
"speed": "100"
}
]
},
{
"name": "any thermal overheat",
"conditions": [
{
"type": "thermal.any.overheat"
}
],
"actions": [
{
"type": "fan.all.set_speed",
"speed": "100"
}
]
},
{
"name": "normal operations",
"conditions": [
{
"type": "normal"
}
],
"actions": [
{
"type": "thermal_control.control"
}
]
}
]
}
2 changes: 1 addition & 1 deletion platform/barefoot/sonic-platform-modules-arista
Submodule sonic-platform-modules-arista updated 61 files
+37 −8 arista/accessors/gpio.py
+23 −0 arista/accessors/psu.py
+23 −0 arista/cli/actions/linecard/provision.py
+12 −0 arista/cli/args/linecard/provision.py
+1 −1 arista/cli/args/linecard/setup.py
+16 −0 arista/components/cpld.py
+10 −6 arista/components/cpu/crow.py
+5 −6 arista/components/denali/card.py
+33 −3 arista/components/denali/linecard.py
+2 −0 arista/components/denali/supervisor.py
+6 −13 arista/components/psu/__init__.py
+35 −0 arista/components/psu/artesyn.py
+92 −0 arista/components/psu/delta.py
+34 −0 arista/components/psu/emerson.py
+37 −0 arista/components/psu/liteon.py
+8 −8 arista/components/scd.py
+4 −0 arista/core/card.py
+3 −0 arista/core/component.py
+4 −0 arista/core/cooling.py
+3 −0 arista/core/desc.py
+25 −0 arista/core/provision.py
+219 −0 arista/core/psu.py
+40 −252 arista/core/tests/inventory.py
+272 −0 arista/core/tests/mockinv.py
+6 −9 arista/core/tests/platforms.py
+131 −0 arista/core/tests/psu.py
+87 −0 arista/core/tests/thermal.py
+26 −0 arista/core/thermal_control.py
+6 −1 arista/core/types.py
+20 −3 arista/core/utils.py
+6 −1 arista/descs/psu.py
+3 −0 arista/descs/sensor.py
+21 −1 arista/drivers/i2c.py
+4 −2 arista/drivers/pci.py
+74 −1 arista/drivers/pmbus.py
+0 −28 arista/drivers/psu.py
+0 −0 arista/drivers/scd/__init__.py
+19 −44 arista/drivers/scd/driver.py
+56 −0 arista/drivers/scd/register.py
+12 −0 arista/drivers/scd/sram.py
+22 −8 arista/platforms/alhambra.py
+22 −43 arista/platforms/blackhawk.py
+27 −43 arista/platforms/clearlake.py
+46 −0 arista/platforms/cpu/crow.py
+18 −1 arista/platforms/cpu/rook.py
+6 −0 arista/platforms/cpu/woodpecker.py
+20 −38 arista/platforms/gardena.py
+6 −3 arista/platforms/linecard/clearwater.py
+2 −1 arista/platforms/linecard/clearwater2.py
+28 −47 arista/platforms/lodoga.py
+22 −30 arista/platforms/smartsville.py
+33 −47 arista/platforms/upperlake.py
+11 −3 arista/utils/sonic_platform/chassis.py
+20 −0 arista/utils/sonic_platform/sfp.py
+2 −25 arista/utils/sonic_platform/thermal_action.py
+8 −0 arista/utils/sonic_platform/thermal_info.py
+6 −2 src/scd-fan.c
+1 −0 src/scd-fan.h
+25 −19 src/scd-smbus.c
+2 −0 systemd/platform-arista-daemon.service
+2 −5 systemd/platform-arista-linecard.service
2 changes: 1 addition & 1 deletion platform/broadcom/sonic-platform-modules-arista
Submodule sonic-platform-modules-arista updated 61 files
+37 −8 arista/accessors/gpio.py
+23 −0 arista/accessors/psu.py
+23 −0 arista/cli/actions/linecard/provision.py
+12 −0 arista/cli/args/linecard/provision.py
+1 −1 arista/cli/args/linecard/setup.py
+16 −0 arista/components/cpld.py
+10 −6 arista/components/cpu/crow.py
+5 −6 arista/components/denali/card.py
+33 −3 arista/components/denali/linecard.py
+2 −0 arista/components/denali/supervisor.py
+6 −13 arista/components/psu/__init__.py
+35 −0 arista/components/psu/artesyn.py
+92 −0 arista/components/psu/delta.py
+34 −0 arista/components/psu/emerson.py
+37 −0 arista/components/psu/liteon.py
+8 −8 arista/components/scd.py
+4 −0 arista/core/card.py
+3 −0 arista/core/component.py
+4 −0 arista/core/cooling.py
+3 −0 arista/core/desc.py
+25 −0 arista/core/provision.py
+219 −0 arista/core/psu.py
+40 −252 arista/core/tests/inventory.py
+272 −0 arista/core/tests/mockinv.py
+6 −9 arista/core/tests/platforms.py
+131 −0 arista/core/tests/psu.py
+87 −0 arista/core/tests/thermal.py
+26 −0 arista/core/thermal_control.py
+6 −1 arista/core/types.py
+20 −3 arista/core/utils.py
+6 −1 arista/descs/psu.py
+3 −0 arista/descs/sensor.py
+21 −1 arista/drivers/i2c.py
+4 −2 arista/drivers/pci.py
+74 −1 arista/drivers/pmbus.py
+0 −28 arista/drivers/psu.py
+0 −0 arista/drivers/scd/__init__.py
+19 −44 arista/drivers/scd/driver.py
+56 −0 arista/drivers/scd/register.py
+12 −0 arista/drivers/scd/sram.py
+22 −8 arista/platforms/alhambra.py
+22 −43 arista/platforms/blackhawk.py
+27 −43 arista/platforms/clearlake.py
+46 −0 arista/platforms/cpu/crow.py
+18 −1 arista/platforms/cpu/rook.py
+6 −0 arista/platforms/cpu/woodpecker.py
+20 −38 arista/platforms/gardena.py
+6 −3 arista/platforms/linecard/clearwater.py
+2 −1 arista/platforms/linecard/clearwater2.py
+28 −47 arista/platforms/lodoga.py
+22 −30 arista/platforms/smartsville.py
+33 −47 arista/platforms/upperlake.py
+11 −3 arista/utils/sonic_platform/chassis.py
+20 −0 arista/utils/sonic_platform/sfp.py
+2 −25 arista/utils/sonic_platform/thermal_action.py
+8 −0 arista/utils/sonic_platform/thermal_info.py
+6 −2 src/scd-fan.c
+1 −0 src/scd-fan.h
+25 −19 src/scd-smbus.c
+2 −0 systemd/platform-arista-daemon.service
+2 −5 systemd/platform-arista-linecard.service
1 change: 1 addition & 0 deletions rules/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += --privileged -t
$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

# Mount Arista python library on Aboot images to be used by plugins
$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /run/arista:/run/arista:ro
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As part of the platform initialization, our platform library detects the hardware by performing some IO and stores this information in temporary cache files.
As of aristanetworks/sonic@b29d50b all of them are stored under /run/arista.
This currently cover platform eeproms as well as PSU metadata and essentially avoids performing IO and detection again in pmon processes. The detection mechanism being tied to the library initialization does not happen pmon which would be missing some component without the cache files. (e.g: psu temp sensors not showing up)
Codepath used by pmon processes and platform initialization: https://github.com/aristanetworks/sonic/blob/05a02d74c91fb1b91fbb4602bf8c77067da3ecf2/arista/core/psu.py#L39
Codepath used by platform initialization: https://github.com/aristanetworks/sonic/blob/05a02d74c91fb1b91fbb4602bf8c77067da3ecf2/arista/core/psu.py#L154

The idea is to later have a process that monitors for fru insertion/removal to load/unload the appropriate drivers as well as refreshing the cache files (e.g not all power supply use the same kernel driver, but a system can support multiple variants).
The bit that is still under thinking is how to restart the appropriate pmon processes that have an outdated state.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i suggest to use /var/run/platform_cache/arista to store you cache data, when you mount, just mount /var/run/platform_cache so that if other vendor has similiar ask later, we do not need to map again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can do that.
For now this was kept specific to the swi images with _aboot_RUN_OPT which means it was not polluting the ONIE image. I'll make the necessary changes in our driver code to use /var/run/platform_cache/<vendor> and mount /var/run/platform_cache:/var/run/platform_cache for all SONiC images.

Copy link
Collaborator

Choose a reason for hiding this comment

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

approved for now. let you work on it later.

$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python2.7/dist-packages/arista:/usr/lib/python2.7/dist-packages/arista:ro
$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python3/dist-packages/arista:/usr/lib/python3/dist-packages/arista:ro
$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python2.7/dist-packages/sonic_platform:/usr/lib/python2.7/dist-packages/sonic_platform:ro
Expand Down