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

Front panel port name regex #1777

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
38 changes: 36 additions & 2 deletions doc/sonic-port-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Scope of the change ##

- Micorsoft proposes to change SONiC port naming convention to [Linux Network Interface Naming](http://tdt.rocks/linux_network_interface_naming.html)
- Nvidia proposes to extend the front panel port name to supported different prefixs to be defined in a shared regex that will be implemented in phase 1.

## Current SONiC port naming convention ##
- Ethernet[0..(N-1)] where N=32 or 64
Expand All @@ -12,10 +13,27 @@
- The port name prefix 'Ethernet' is too long.
- The port numbering doesn't match front panel numbering.
- To support chassis scenario.
- To support distinguishing between different types of front panel ports in a maintainable fashion.
- Specifically, Nvidia is planning to bring up a system with 'service' ports (in addition to the regular ethernet data ports) - these
are lower speed ports that used for connection to accelerators, internal loopbacks and more.

## Proposal: new SONiC port naming convention ##
- et[sX]pY[abcd]
- et: SONiC choice of port name prefix. (em, en ...)
Phase 1 (prefix change only):
- Instead of "Ethernet" we can add "Ethernet|Service|etp" and use any of the options in the hw definitions file.
- Beside of changing the prefix (Ethernet), everything else will be kept.

- (FRONT_PANNEL_REGEX)[0..(N-1)] where N=32 or 64
- (FRONT_PANEL_REGEX)[0,4,...,4(N-1)]

where FRONT_PANEL_REGEX is a common regex that includes all the supported prefixes - e.g. "Ethernet|Service|et"
- Examples
- Etherent[0..N-3], Service[N-3..N-1] - system with two 'types' of ports
- et[0..N-1]

Phase 2 (chassis and breakout changes):

- (FRONT_PANNEL_REGEX)[sX]pY[abcd]
- FRONT_PANNEL_REGEX (e.g. ("et|Service"): SONiC choices of port name prefix. (em, en ...)
- Optional: sX, slot X, X = 1, 2, ... Usually X starts from 1.
- Mandatory: pY, front panel port Y, Usually Y starts from 1.
- Optional: [abcd], port breakout.
Expand All @@ -30,6 +48,21 @@
- Port channel naming convention

## Change stages ##
Phase 1
1. Update the schema.h with the new regex (currently just change to regex that only have "Ethernet")
2. Update SONiC code dependency of 'Ethernet' prefix to use the new regex instead:
- sonic-config-engine - portconfig.py
- sonic-py-common - interface.py
- sonic-py-swsssdk - port_util.py
- sonic-utilities - pfc / pfcwd / scripts (ipintutil, sfpshow) / sfputil / utilities_common (intf_filter.pym, platform_sfputil_helper)
- sonic_platform_base - sfputilbase.py
- sonic-platform-daemons - ycable
- portsyncd - linksync.cpp
- sonic-snmp - interface tables initiation
- sonic-device-data tests (hwsku|platform_json_checker)
3. On introducing a new prefix - just update the regex (and set the device hw configuration files), everything else should work

Phase2
1. Change port_config.ini alias column to use the new naming convention.
2. Break SONiC code dependency of 'Ethernet' prefix.
3. Break SONiC test dependency of 'Ethernet' prefix and/or 'Ethernet0'.
Expand All @@ -41,3 +74,4 @@
- When index starts from 1, there may or may not be a single entry waste depend on the implementation and programming language.
- e.g. C/C++ array index starts from 0.