This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/sonic-config-engine
Tomer Shalvi 34c95327f5 [Mellanox] Adding a new field to CONFIG DB: "subport" (#18204)
- Why I did it
The field 'subport' represents the index of the split port within a physical port. For example, if a port is split into 4, the subport of the first logical port is 1, the subport of the second logical port is 2, and so on.
In xcvrd, the CMIS manager uses the subport to calculate the lane mask, which is used to control the data path per lane. In Nvidia platform, the subport is missing and is always set to 0. According to the xcvrd code, when subport=0, it will always correspond to the first logical port. Therefore, if we shut down any logical port that is not the first one, we will see the operational status of the first logical port also becomes down.
This PR aims to add the subport field to CONFIG DB and prevent such scenarios. This is applicable only for static default breakout mode. For DPB, subport calculation will happen on the fly (changes are not in Sonic yet).
(Subport HLD: HLD of subport: [link to the HLD document])

- How I did it
I have added the 'subport' field to all relevant Nvidia hwsku.json files (minigraph generation is based on them). Additionally, I introduced the new 'subport' field to portconfig.py, so that sonic-cfggen will be able to generate the minigraph with it. In this file, I also fixed an error that caused all attributes from hwsku.json to be applied only to the first logical ports associated with a physical port.
Furthermore, I updated hwsku_json_checker to include the new field and applied a fix to the sample_hwsku.json file. sample_hwsku.json is the file that sonic-config-engine's unit tests rely on for its tests. Previously, it only included attributes for the first logical port of a split physical port. For example, if Ethernet4, a 4-lane port, was split into 2 ports, then sample_hwsku.json included only the entry for Ethernet4, with no entry for Ethernet6. This misalignment with the structure of other hwsku.json files has been corrected as well.

- How to verify it
Ensure that each logical port has the correct value of 'subport' in CONFIG DB, and that shutting down a logical port affects only that port and not other ports in the split.
2024-03-21 13:01:13 +08:00
..
data [ACL] enable ACL FC when genereting config from minigraph but disable by default (#8908) 2021-11-11 09:07:54 +08:00
tests [Mellanox] Adding a new field to CONFIG DB: "subport" (#18204) 2024-03-21 13:01:13 +08:00
__init__.py [cfggen] Remove NatSorted 2020-09-30 07:07:43 -07:00
.gitignore [sonic-config-engine] Update .gitignore (#5223) 2020-08-20 11:09:10 -07:00
config_samples.py [CI][doc][build] Trim src folder files trailing blanks (#15162) 2023-05-24 10:01:43 -07:00
MANIFEST.in [config/acl] Support everflow config translation (#468) 2017-04-07 01:10:05 -07:00
minigraph.py Fix IPV6 forced-mgmt-route not work issue (#17299) (#18045) 2024-02-07 06:50:57 -08:00
openconfig_acl.py Fix openconfig_acl.py (#16303) 2023-08-30 10:46:21 -07:00
portconfig.py [Mellanox] Adding a new field to CONFIG DB: "subport" (#18204) 2024-03-21 13:01:13 +08:00
setup.py Check SONiC dependencies before installation. (#13850) 2023-03-02 08:20:39 +08:00
sonic_yang_cfg_generator.py [Yang][cfggen] update sonic-cfggen to generate config_db from Yang data (#7712) 2021-06-10 12:03:33 -07:00
sonic-acl-extension.yang [openconfig_acl] Allow setting ICMP type/code to 0 (#6932) 2021-03-02 14:32:00 -08:00
sonic-cfggen [202311][cherry-pick][NTP] Add NTP extended configuration (#17487) 2023-12-21 09:45:29 -08:00