How to breakout a port - louishot/SONiC GitHub Wiki

Overview Port split feature allows to extend number of available switch ports by splitting one port up to 4 sub-ports (1 per lane) with the less max speed

Example of supported split options:

1x100G -> 2x50G 1x100G -> 4x25G NOTE: you can set the speed to any value supported by the h/w as long as it does not exceed the max allowed as of the number of lanes.

NOTE: currently SONiC supports only port split configuration during init configuration

Configuration Port breakout can be configured only in port_config.ini configuration file

SWSS creates ports according to the described ports in this file Only ports that are specified in the file will be created Example of port_config.ini:

vim /usr/share/sonic/device/x86_64-mlnx_msn2700-r0/ACS-MSN2700/port_config.ini

name lanes speed

Ethernet0 0,1,2,3 ... NOTE: port_config.ini should not contain blank lines because according to current behavior SONiC will throw an error an abort

Speed column For non breakout cables speed is not required. It will use the default per platform. In the above example 100G will be used as speed is not provided. For breakout cables speed is mandatory. If not available, ports will not be created Speed is in MB such as 100000 stands for 100G How to breakout a port? To breakout a port (e.g. Ethernet0) into 2 ports just need to:

Add new port to the list in port_config.ini (e.g. Ethernet2) Reallocate hardware lanes (e.g. Ethernet0 – 0,1; Ethernet2 – 2,3) Set speed (e.g. 50000 for each interface) Apply configuration For example

port_config.ini changes vim /usr/share/sonic/device/x86_64-mlnx_msn2700-r0/ACS-MSN2700/port_config.ini

name lanes speed

Ethernet0 0,1 50000 Ethernet1 2,3 50000 ... NOTE: The max speed must not exceed the max supported in HW. On such case ports will not be created.

How to apply changes in port_config.ini? The following options are valid:

Align and Load Minigraph by executing sudo sonic-cfggen -H -k Accton-AS7712-32X --preset t1 -p /usr/share/sonic/platform/Accton-AS7712-32X/port_config.ini > tmp.json

Accton-AS7712-32X is HwSKU which from show platform summary

Align config_db json with the changes done in port_config.ini and reload the configuration by executing ‘sudo config reload‘. Once configuration is completed, defaults port’s attributes are used. For example MTU, speed and admin mode. In case non-default values are required need to configure for each (sub)ports. The ports' attribute configuration can be done as for any other non breakout port

Through the mingraph.xml In config_db.json configuration file Using Linux CLI commands or SONiC CLI commands (depends on what is available per attribute) Mellanox platforms cable breakout options For more information about Mellanox platforms please check http://www.mellanox.com/related-docs/user_manuals/1U_HW_UM_SN2000_Switch_Family.pdf and search for 'Splitting Options'.

NOTE: In some platforms when splitting a port to 4, it can only be done on odd ports (1,3 etc) and the adjacent even port will be disabled. In these cases, the adjacent even port must be removed from the port_config.ini.

Useful Links https://github.com/Azure/SONiC/wiki/Port-Breakout-and-Speed-Requirements https://github.com/Azure/SONiC/wiki/Port-Breakout-High-Level-Design https://github.com/Azure/SONiC/wiki/Port-Speed-Configuration