Commit Graph

19 Commits

Author SHA1 Message Date
Oleksandr Kozodoi
8c10c01bd8
Updated format of generating BUFFER_QUEUE in buffers_defaults templates (#9850)
This PR includes necessary changes for correct generating BUFFER_QUEUE values in DB. Changes are based on the schema.md

Why I did it
Change format of generating BUFFER_QUEUE in DB according to schema.md and yang-model.

Old format:
    "BUFFER_QUEUE": {
        "Ethernet0,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet12,Ethernet120,Ethernet124,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet4,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet8,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96|queue": {
            "profile": "profile"
        },
        "Ethernet0,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet12,Ethernet120,Ethernet124,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet4,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet8,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96|queue": {
            "profile": "profile"
        }
    },
New format:
    "BUFFER_QUEUE": {
        "Ethernet0|queue": {
            "profile": "profile"
        },
        "Ethernet0|queue": {
            "profile": "profile"
        },
        "Ethernet4|queue": {
            "profile": "profile"
        },
        "Ethernet4|queue": {
            "profile": "profile"
        },
        "Ethernet8|queue": {
            "profile": "profile"
        },
        "Ethernet8|queue": {
            "profile": "profile"
        },
        ...
    }
How I did it
Updated structure of buffers_defaults jinja templates.

Signed-off-by: Oleksandr Kozodoi <oleksandrx.kozodoi@intel.com>
2022-04-13 09:11:01 -07:00
Vadym Yashchenko
8e616c153b
[BFN] Refactoring and adding some functions of Thermal class (set and get thresholds and etc.) (#10205)
* Revised set_high_thershold and set_low_thershold methobs in the thermal.py

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised set_low_thershold and set_high_thershold

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Added separated files with thermal thresholds, changed platform.json and
thermal.py

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised on code revieww

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Reverted thermal.py

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised ther python.py

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised due to code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Added fucntion for fix the problem of tofino sensor high critical threshold

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised due to code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised due to code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised due to code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised only for cab18-4

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised default thresholds

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised ther def thresholds

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised on code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised platform.json and thermal_thresholds.json

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Code review in PR to azure (trigger CI)

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Added handle of exception

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised exception handler

* Added psu-1 thermal names to platfrom.json

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Changed platform.json and thermal_thresholds.json in
x86_64-acton_as9516_32d-r0

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Removed indentation from json file

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>
2022-04-05 09:13:08 -07:00
Andriy Kokhan
31be203af6
[BFN] Updated x86_64-accton_as9516_32d-r0/platform.json (#10368)
Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>
2022-04-05 09:11:38 -07:00
Taras Keryk
a89f294fd5
[BFN] Implementation API for platform component (#10180)
* [BFN] Implementation API for platform component
	SONiC has a concept of "platform components"
	this may include - CPLD, FPGA, BIOS, BMC, etc.

	These changes are needed to read the version of the BIOS and BMC component.

	What I did
		Create components.py module
		Add funcion for reading componet version to thrift interface
	How I did it
		The previous implementaion didn't have platform components API, so fwutil return an empty list.
		After implementation of the platform component API, we have actual list of platform components and firmware versions

	How to verify it
		Run manually 'fwutil show status' or run unit tests

	Previous command output
		Chassis                   Module    Component    Version    Description
		------------------------  --------  -----------  ---------  -------------

	New command output
		Chassis                   Module    Component    Version    Description
                ------------------------  --------  -----------  ---------  -------------
                Chassis1		  N/A       BIOS         1.2.3	   Chassis BIOS
                                                    BMC          5.1	   Chassis BMC
Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>

* [BFN] Implementation API for platform component
            SONiC has a concept of "platform components"
            this may include - CPLD, FPGA, BIOS, BMC, etc.

            These changes are needed to read the version of the BIOS and BMC component.

            What I did
                    Create components.py module
                    Add funcion for reading componet version to thrift interface
            How I did it
                    The previous implementaion didn't have platform components API, so fwutil return an empty list.
                    After implementation of the platform component API, we have actual list of platform components and firmware versions

            How to verify it
                    Run manually 'fwutil show status' or run unit tests

            Previous command output
                    Chassis                   Module    Component    Version    Description
                    ------------------------  --------  -----------  ---------  -------------

            New command output
                    Chassis                   Module    Component    Version    Description
                    ------------------------  --------  -----------  ---------  -------------
                    Chassis1                  N/A       BIOS         1.2.3     Chassis BIOS
                                                        BMC          5.1       Chassis BMC

Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>

* [BFN] Implementation API for platform component
    get chassis name from json

* [BFN] Implementation API for platform component
      Updated platform and platrom_components json

* [BFN] Implementation API for platform component
      Fixed spaces in component.py

* [BFN] Implementation API for platform component
      Fixed exception in component.py

* Update chassis.py

* [BFN] Implementation API for platform component
      Fixed spaces in component.py, chassis.py

* [BFN] Implementation API for platform component: Fixed spaces in component.py, chassis.py

* Fixed exception in get_bios_version
2022-03-10 16:25:06 +05:30
Kostiantyn Yarovyi
bf5f9c2918
[BFN] Update configuration files (#9913)
* [Barefoot] update switch-tna-sai.conf file

* remove deprecated conf files

* [Barefoot] update switch-tna-sai.conf file for Accton wedge100bf_32qs platform

* pdated switch-tna-sai.conf
2022-03-09 09:57:08 +05:30
Andriy Kokhan
4037867b7d
[BFN] Updated platform plugins (#9540)
* [BFN] Updated platform APIs impl

Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>

* Extended BFN platform SFP APIs implementation

* Update sfp.py

* [BFN] Extended SFP platform plugin implementation

Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>

* [BFN] Extended Fans platform plugin implementation

* [BFN] divided classes Fan and  FanDrawer into 2 files

* Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

What I did
	Add get_model() function
	Add get_low_critical_threshold() function
	Change __get(...) function.
How I did it
	Differnece from previous implementation of __get(...) function is return real value or -9999.9 if value is not provided by thrift API

* Add get_presence() function and revised __get() function

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* [BFN] Updated PSU platform APIs impl

Signed-off-by: Dmytro Lytvynenko <dmytrox.lytvynenko@intel.com>

* Added BFN PSU cache (#9)

Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>

* [BFN]  Fans and Fantray platform APIs update (#7)

* [BFN] Updated SFP platform APIs (#10)

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>

* [BFN] Updated platform API for thermal (#8)

* Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revert "[BFN]  Fans and Fantray platform APIs update (#7)" (#11)

This reverts commit c62a733443be49cbe4ba2d06047aac7516f0495e.

* Add support health monitor system (#15)

Signed-off-by: Petro Bratash <petrox.bratash@intel.com>

* Update chassis.py

* [BFN] Updated FANs and FAN Tray platform API (#14)

* Fix fix_alignment (#17)

Signed-off-by: Petro Bratash <petrox.bratash@intel.com>

* [BFN] Improvement show environment (#16)

* Added PSU temperature skip into platform.json (#18)

Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>

* Do not skip psud on Newport

Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>

* [BFN] fix fan status from Not OK to Ok (#19)

* [BFN] Updated SFP platform plugin (#13)

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>

* [DPB] Fix typo for Ethernet0 2x200G[100G,40G] breakout mode (#21)

Signed-off-by: Mykola Gerasymenko <mykolax.gerasymenko@intel.com>

* [barefoot] Tmp fix vendor_rev (#22)

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>

* Fixed python issues in sonic_platform/fan_drawer.py

Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>

* Updated fan_drawer.py

* Fixing trailing white spaces in fan_drawer.py

* [BFN] Fix thrift for SFPs API

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>

* In platform.json, replaced 'false' with '0' to workaround ast.literal_eval() issue

Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>

* [Newport] Thermal manager  (#23)

* Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revert "In platform.json, replaced 'false' with '0' to workaround ast.literal_eval() issue"

This reverts commit 1e73127830.

* Removed 'controllable' options from platform.json to fix factory default config generation

Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>

* Update thermal_manager.py

* Migrated SFP plugin to sonic_xcvr API (#30)

Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>

Co-authored-by: KostiantynYarovyiBf <kostiantynx.yarovyi@intel.com>
Co-authored-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>
Co-authored-by: Dmytro Lytvynenko <dmytrox.lytvynenko@intel.com>
Co-authored-by: Volodymyr Boiko <volodymyrx.boiko@intel.com>
Co-authored-by: Petro Bratash <petrox.bratash@intel.com>
Co-authored-by: Mykola Gerasymenko <mykolax.gerasymenko@intel.com>
2022-01-17 11:16:20 +05:30
Mykola Gerasymenko
fba7a7f389
[barefoot] add platform.json and hwsku.json for Newport (#8964)
To support dynamic port breakout configurations on Newport platforms.

Signed-off-by: Mykola Gerasymenko <mykolax.gerasymenko@intel.com>
2021-11-18 10:23:46 -08:00
Kostiantyn Yarovyi
dc74fd456a
[Barefoot] [newport] TF2 update switch-tna-sai.conf to use pcie cpu instead of eth cpu (#9260)
Switch hostif frpom Eth to PCIe to improve performance
2021-11-18 10:22:59 -08:00
Qi Luo
add9b651b6
Add platform_asic file to each platform folder in sonic-device-data based package (#8542)
#### Why I did it
Add platform_asic file to each platform folder in sonic-device-data package. The file content will be used as the ground truth of mapping from PLATFORM_STRING to switch ASIC family.

One use case of the mapping is to prevent installing a wrong image, which targets for other ASIC platforms. For example, currently we have several ONIE images naming as sonic-*.bin, it's easy to mistakenly install the wrong image. With this mapping built into image, we could fetch the ONIE platform string, and figure out which ASIC it is using, and check we are installing the correct image.

After this PR merged, each platform vendor has to add one mandatory text file  `device/PLATFORM_VENDOR/PLATFORM_STRING/platform_asic`, with the content of the platform's switch ASIC family.

I will update https://github.com/Azure/SONiC/wiki/Porting-Guide after this PR is merged.

You can get a list of the ASIC platforms by `ls -b platform | cat`. Currently the options are
```
barefoot
broadcom
cavium
centec
centec-arm64
generic
innovium
marvell
marvell-arm64
marvell-armhf
mellanox
nephos
p4
vs
```

Also support
```
broadcom-dnx
```

#### How I did it

#### How to verify it
Test one image on DUT. And check the folders under `/usr/share/sonic/device`
2021-10-08 19:27:48 -07:00
Ashok Daparthi-Dell
6cbdf11e53
SONIC QOS YANG - Remove qos tables field value refernce format (#7752)
Depends on Azure/sonic-utilities#1626
Depends on Azure/sonic-swss#1754

QOS tables in config db used ABNF format i.e "[TABLE_NAME|name] to refer fieldvalue to other qos tables.

Example:
Config DB:
"Ethernet92|3": {
"scheduler": "[SCHEDULER|scheduler.1]",
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]"
},
"Ethernet0|0": {
"profile": "[BUFFER_PROFILE|ingress_lossy_profile]"
},
"Ethernet0": {
"dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]",
"pfc_enable": "3,4",
"pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]",
"tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]",
"tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]"
},

This format is not consistent with other DB schema followed in sonic.
And also this reference in DB is not required, This is taken care by YANG "leafref".

Removed this format from all platform files to consistent with other sonic db schema.
Example:
"Ethernet92|3": {
"scheduler": "scheduler.1",
"wred_profile": "AZURE_LOSSLESS"
},

Dependent pull requests:
#7752 - To modify platfrom files
#7281 - Yang model
Azure/sonic-utilities#1626 - DB migration
Azure/sonic-swss#1754 - swss change to remove ABNF format
2021-09-28 09:21:24 -07:00
Kostiantyn Yarovyi
690f6ad883
[show] add platform components in Newport, Montara, Mavericks for fix incomprehensible firmware Error print (#8690)
What I did:
     add platform components
 How I did it:
      In platform_components.json add chassis and empty component
How to verify it:
       Run show platform firmware updates
2021-09-14 07:34:00 -07:00
Volodymyr Boiko
3edb4f1ebe
[barefoot][device] Drop platform API 1.0 (#7716)
#### Why I did it
To get rid of obsolete code

#### How I did it
Removed plugins folder from device/barefoot

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
2021-05-26 11:55:25 -07:00
Volodymyr Boiko
e5255b3d39
[device][barefoot] Skip psud for Newport (#7200)
Temporary skip psud for Newport, for Barefoot needs.

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
2021-03-31 12:55:40 -07:00
Dmytro Shevchuk
d8627e6414
[yang] update yang model, add autoneg to sonic-port (#5963)
Dynamic Port Breakout fall in case "autoneg" field exist in config_db.

- How I did it
Added "autoneg" field in sonic-port yang model.

- How to verify it
Add "autoneg" field into config_db like this:

"Ethernet8": {
    "index": "2", 
    "lanes": "8,9,10,11", 
    "fec": "rs", 
    "pfc_asym": "off", 
    "mtu": "9100", 
    "alias": "Ethernet8", 
    "admin_status": "up", 
    "autoneg": "on", 
    "speed": "100000",
},
2021-03-30 08:27:58 -07:00
Volodymyr Boiko
b60d1fc526
[barefoot][device] Enable thermalctld (#7005)
Enable thermalctld on Barefoot platforms

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
2021-03-12 11:51:45 -08:00
Volodymyr Boiko
8ec75803a7
[barefoot][device][platform] Moved pcie.yaml (#6862)
To fix #6860

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
2021-02-23 13:16:42 -08:00
Myron Sosyak
f6d1c4a575
[barefoot] Fix y_profile_set to not reset link (#6238)
Y* profile is the name pattern for p4 programs that developed for the current platform. The difference between them is features enabled and resource reservation.

For this platform, it is expected to work on any Y profile. but after the latest changes, the first Y profile is always used.
2020-12-24 10:27:52 -08:00
Volodymyr Boiko
bba5df0523
[barefoot][platform] Fix symlinks and syncd.conf for Newport in platform/ (#5585)
Fix symlinks and syncd.conf for Newport in platform/ directory

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
2020-10-12 14:16:01 -07:00
Vitaliy Senchyshyn
3397e41aa8
[barefoot][platform] Update BFN platforms (#5356)
1. Added support of BFN newport new platform name.
2. Updated debian version for montara and mavericks platforms.
2020-09-16 10:34:49 -07:00