123 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3=================4Devlink Line card5=================6 7Background8==========9 10The ``devlink-linecard`` mechanism is targeted for manipulation of11line cards that serve as a detachable PHY modules for modular switch12system. Following operations are provided:13 14 * Get a list of supported line card types.15 * Provision of a slot with specific line card type.16 * Get and monitor of line card state and its change.17 18Line card according to the type may contain one or more gearboxes19to mux the lanes with certain speed to multiple ports with lanes20of different speed. Line card ensures N:M mapping between21the switch ASIC modules and physical front panel ports.22 23Overview24========25 26Each line card devlink object is created by device driver,27according to the physical line card slots available on the device.28 29Similar to splitter cable, where the device might have no way30of detection of the splitter cable geometry, the device31might not have a way to detect line card type. For that devices,32concept of provisioning is introduced. It allows the user to:33 34 * Provision a line card slot with certain line card type35 36 - Device driver would instruct the ASIC to prepare all37 resources accordingly. The device driver would38 create all instances, namely devlink port and netdevices39 that reside on the line card, according to the line card type40 * Manipulate of line card entities even without line card41 being physically connected or powered-up42 * Setup splitter cable on line card ports43 44 - As on the ordinary ports, user may provision a splitter45 cable of a certain type, without the need to46 be physically connected to the port47 * Configure devlink ports and netdevices48 49Netdevice carrier is decided as follows:50 51 * Line card is not inserted or powered-down52 53 - The carrier is always down54 * Line card is inserted and powered up55 56 - The carrier is decided as for ordinary port netdevice57 58Line card state59===============60 61The ``devlink-linecard`` mechanism supports the following line card states:62 63 * ``unprovisioned``: Line card is not provisioned on the slot.64 * ``unprovisioning``: Line card slot is currently being unprovisioned.65 * ``provisioning``: Line card slot is currently in a process of being provisioned66 with a line card type.67 * ``provisioning_failed``: Provisioning was not successful.68 * ``provisioned``: Line card slot is provisioned with a type.69 * ``active``: Line card is powered-up and active.70 71The following diagram provides a general overview of ``devlink-linecard``72state transitions::73 74 +-------------------------+75 | |76 +----------------------------------> unprovisioned |77 | | |78 | +--------|-------^--------+79 | | |80 | | |81 | +--------v-------|--------+82 | | |83 | | provisioning |84 | | |85 | +------------|------------+86 | |87 | +-----------------------------+88 | | |89 | +------------v------------+ +------------v------------+ +-------------------------+90 | | | | ----> |91 +----- provisioning_failed | | provisioned | | active |92 | | | | <---- |93 | +------------^------------+ +------------|------------+ +-------------------------+94 | | |95 | | |96 | | +------------v------------+97 | | | |98 | | | unprovisioning |99 | | | |100 | | +------------|------------+101 | | |102 | +-----------------------------+103 | |104 +-----------------------------------------------+105 106 107Example usage108=============109 110.. code:: shell111 112 $ devlink lc show [ DEV [ lc LC_INDEX ] ]113 $ devlink lc set DEV lc LC_INDEX [ { type LC_TYPE | notype } ]114 115 # Show current line card configuration and status for all slots:116 $ devlink lc117 118 # Set slot 8 to be provisioned with type "16x100G":119 $ devlink lc set pci/0000:01:00.0 lc 8 type 16x100G120 121 # Set slot 8 to be unprovisioned:122 $ devlink lc set pci/0000:01:00.0 lc 8 notype123