From a6d0a27a182c85bf9867202d14397b91b19768e2 Mon Sep 17 00:00:00 2001 From: zzhiyuan Date: Fri, 17 Dec 2021 08:43:25 -0800 Subject: [PATCH] [Arista] Increase switch PCIe timeout for 7060-cx32s (#9248) Co-authored-by: Zhi Yuan (Carl) Zhao Why I did it Arista 7060 platform has a rare and unreproduceable PCIe timeout that could possibly be solved with increasing the switch PCIe timeout value. To do this we'll call a script for this platform to increase the PCIe timeout on boot-up. No issues would be expected from the setpci command. From the PCIe spec: "Software is permitted to change the value in this field at any time. For Requests already pending when the Completion Timeout Value is changed, hardware is permitted to use either the new or the old value for the outstanding Requests, and is permitted to base the start time for each Request either on when this value was changed or on when each request was issued. " How I did it Add "platform-init" support in swss docker similar to how "hwsku-init" is called, only this would be for any device belonging to a platform. Then the script would reside in device data folder. Additionally, add pciutils dependency to docker-orchagent so it can run the setpci commands. How to verify it On bootup of an Arista 7060, can execute: lspci -vv -s 01:00.0 | grep -i "devctl2" In order to check that the timeout has changed. --- device/arista/x86_64-arista_7060_cx32s/platform-init | 3 +++ dockers/docker-orchagent/Dockerfile.j2 | 1 + dockers/docker-orchagent/docker-init.sh | 5 +++++ 3 files changed, 9 insertions(+) create mode 100755 device/arista/x86_64-arista_7060_cx32s/platform-init diff --git a/device/arista/x86_64-arista_7060_cx32s/platform-init b/device/arista/x86_64-arista_7060_cx32s/platform-init new file mode 100755 index 000000000000..e31a7a0db4c7 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/platform-init @@ -0,0 +1,3 @@ +# Increase PCIe timeout value to 210ms +setpci -s01:00.0 CAP_EXP+0x28.B=6 +setpci -s01:00.1 CAP_EXP+0x28.B=6 diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 5ad150a2bdfe..1cab72c48f1f 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -19,6 +19,7 @@ RUN apt-get update && \ bridge-utils \ conntrack \ ndppd \ + pciutils \ # Needed for installing netifaces Python package build-essential \ python3-dev diff --git a/dockers/docker-orchagent/docker-init.sh b/dockers/docker-orchagent/docker-init.sh index d395f2076e47..86070ff24db9 100755 --- a/dockers/docker-orchagent/docker-init.sh +++ b/dockers/docker-orchagent/docker-init.sh @@ -17,6 +17,11 @@ CFGGEN_PARAMS=" \ " VLAN=$(sonic-cfggen $CFGGEN_PARAMS) +# Executed platform specific initialization tasks. +if [ -x /usr/share/sonic/platform/platform-init ]; then + /usr/share/sonic/platform/platform-init +fi + # Executed HWSKU specific initialization tasks. if [ -x /usr/share/sonic/hwsku/hwsku-init ]; then /usr/share/sonic/hwsku/hwsku-init