FLEXport

Flexport

FLEXport

Shortest form: flex.

Show or change the port layout of one or more Port Macros (PMs) while the switch runs (“flexport”). A Port Macro is a SerDes core with its MAC; on Trident 3 each one serves four physical lanes.

Arguments are PM<id>[=<pm_mode>[:<ports>]], one per Port Macro. Type the PM<id> keyword in full; case does not matter.

  • PM<id> alone shows the ports of that Port Macro: a PM<id>: line, then one line per port with its name, logical port, physical port, speed, lane count and encapsulation.

  • PM<id>=<pm_mode> deletes all ports of the Port Macro and creates the new set in one step. None removes all ports.

  • Showing and changing cannot be combined in one command; that prints <cmd>: Cannot get and set port resources in one command.

The built-in help lists only 8-lane modes (1x400G, 2x200G, 4x100G, 8x50G and so on), which belong to other chips. The shell actually picks the mode list from the type of the Port Macro. For 4-lane Port Macros it accepts 1x100G, 1x40G, 2x50G, 2x40G, 2x20G, 2x25G, 4x25G, 4x10G, 4x1G, 4x5G, 4x2.5G, the mixed modes 1x40G+1x20G, 1x20G+1x40G, 1x25G+1x50G, 1x50G+1x25G, 1x50G+2x25G, 2x25G+1x50G, 1x40G+2x10G, 2x10G+1x40G, 1x20G+2x10G and 2x10G+1x20G, and None. Each mode also has a HiGig form such as 1xHG[106] or 4xHG[27]; a mode containing HG selects HiGig2 encapsulation. An unsupported mode prints Flexport: Error: Unsupported mode <mode> on pm<id>.

The :<ports> suffix (for example :5-8 or :1,5) chooses the logical port numbers of the new ports. On Trident 3 the suffix and automatic port numbering may not be supported, so a change that needs new port numbers may fail.

Warning

Changing a Port Macro deletes and recreates ports in the SDK and the ASIC behind SONiC’s back. SONiC’s port table, SAI port objects, host interfaces and everything bound to the old ports (VLANs, router interfaces, buffers, ACLs) are not updated, traffic on the Port Macro stops, and later SAI calls for the deleted ports can fail inside syncd. Use it only on a switch you can restart, and restart syncd (or reload the configuration) afterwards. Changing the chip configuration live describes another way to change the port layout, using config portmap_* and init all (bcmsh.md (published as https://kamelnetworks.github.io/sonic/bcmsh.html)).

Unvalidated — Show the ports of Port Macro 0 (read-only)

drivshell> FLEXport PM0

Unvalidated — Split a Port Macro into four 25G ports (disruptive)

drivshell> FLEXport PM1=4x25G

Unvalidated — Example from the built-in help (8-lane Port Macros, not Trident 3)

drivshell> flexport pm0=none pm2=8x50g

Built-in help

FLEXport PM<id>[=<pm_mode>]
Parameters:
  PM<id>           - Port Macro to be flexed.
  <pm_mode>        - Port Macro mode:
                     Single Mode:
                       1x400G | 2x200G | 2x100G | 2x40G
                     Dual Mode:
                       4x100G | 4x50G | 4x40G
                     Quad Mode
                       8x50G | 8x25G | 8x10G
                     Clear ports on a Port Macro:
                       None
  [<port_numbers>] - New port numbers on a specific Port Macro.
                     If no port_number configured, new port numbers will
                     be picked from un-used ports.
Note: All the other modes not listed above are not
      supported on BCM Shell, even they may be
      supported via API configuration.

Example: flexport pm0=2x200G pm1=4x100G
Example: flexport pm0=none pm2=8x50g
Example: flexport pm0=4x100G:5-8
Example: flexport pm0=2x40G:1,5
Flex Port Macro(s) into a specific mode.
Remove all ports in a Port Macro if the <pm_mode> is configured as None.
If only PM<id> is specified, characteristics for that Port Macro is displayed.

Further reading

SDK-6.5.20 HSDK Getting Started Guide (GS-SDK6520-R), plus SDK-6.5.20/21/22 Release Notes (RN-SDK65xx-R).