Data Center Discovery and Capability (DCBX) OpEN API
This document provides a brief description of the Data Center Discovery and Capability Protocol (DCBX) OpEN API. DCBX is a protocol used for conveying capabilities and configuration of ETS and PFC features. This is done amongst neighboring peers to ensure consistent network configuration.
THE API provides the following services:
- Set the DCBX version.
- Get the configuration port number.
- Get the operational status of DCBX.
- Get the port role configuration.
- Get the DCBX version.
- Get the peer DCBX running version.
- Get the DCBX counters.
- Get the MAC address of remote DCBX device.
- Get the system description of the peer device.
- Determine if the interface is valid for DCBX.
- Check the peer is config source for the auto configuration.
- Get the timed-out and multi-peer counts for an interface.
- Gets the DCBX TLVs that need to be transmitted in the LLDP PDU.
- Get peer TLV supported mask.
- Get the Oper version supported by remote legacy DCBX device.
- Get the Max version supported by the remote legacy DCBX device.
- Get the current sequence number that is sent in
- Get the current ACK number that is sent by peer in DCBX
- Get the port local willing status.
- Get the local scheduler type.
- Get local ETS bandwidth.
- Get the application table.
- Get Peer application table.
- Get bit mask of DCBX TLVs enabled.
- Set bit mask of enabled DCBX TLVs.
- Set the port role for auto configuration.
Example C Application dcbx_example
dcbx_example.c is a sample application that exercises the APIs provided by the DCBX OpEN APIs.
./dcbx_example [-a appIndex] [-r role] [-v version] [-c caps] -i interface
-a appIndex – application index (openapiDcbxAppPriTableGet, default 0)
-r role – set port role. Use one of the following to specify the role:
1: OPEN_DCBX_PORT_ROLE_MANUAL
2: OPEN_DCBX_PORT_ROLE_AUTO_UPSTREAM
3: OPEN_DCBX_PORT_ROLE_AUTO_DOWNSTREAM
4: OPEN_DCBX_PORT_ROLE_AUTO_CFG_SRC
-v version – set version. Use one of the following to specify the version:
1: OPEN_DCBX_AUTO
2: OPEN_DCBX_IEEE
3: OPEN_DCBX_CIN
4: OPEN_DCBX_CEE
-c caps – set capabilities. Argument must be a base 10 integer that contains a bitmask of the following values:
1: OPEN_DCBX_CAP_PFC_BITMASK
2: OPEN_DCBX_CAP_ETS_CFG_BITMASK
4: OPEN_DCBX_CAP_ETS_REC_BITMASK
8: OPEN_DCBX_CAP_APP_PRI_BITMASK
16: OPEN_DCBX_CAP_CONTROL_BITMASK
-i interface – interface id (required argument)
Initialization
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits. A minimal run uses the -i argument to specify an interface. The various data about that interface (for each supported priority) is output by the application.
DCBX CLI/API Cross Reference
The mapping between the OpEN APIs and CLI commands is shown below.
CLI Command | OpEN API Functions
--------------------------------------—
show lldp tlv-select interface {all | <u/s/p> [detail]} | openapiDcbxPortConfigTLVsEnabledGet
lldp dcbx version | openapiDcbxVersionSet
lldp dcbx port-role | openapiDcbxAutoCfgPortRoleSet
lldp tlv-select dcbxp | DcbxPortConfigTLVsEnabledGet, DcbxPortConfigTLVsEnabledset
show lldp dcbx interface {all status| <u/s/p> [detail]} | openapiDcbxCfgSrcGet, openapiDcbxOperStatusGet, openapiDcbxAutoCfgPortRoleGet, openapiDcbxVersionGet, openapiDcbxPeerVersionGet, openapiDcbxCounterGet, openapiDcbxPeerMacGet, openapiDcbxPeerDescGet, openapiDcbxIsValidIntf, openapiDcbxAutoCfgPortRoleGet, openapiDcbxIntfIsCfgSrcGet, openapiDcbxTimedOutAndMultiPeerCountGet, openapiDcbxPortOperationalModeGet, openapiDcbxPeerTlvMaskGet, openapiDcbxPortLegacyRemOperVerGet, openapiDcbxPortLegacyRemMaxVerGet, openapiDcbxPortLegacyRemSeqNumGet, openapiDcbxPortLegacyRemRcvdAckNumGet, openapiDcbxPortWillingGet, openapiDcbxLocalEtsSchedGet, openapiDcbxLocalEtsBwGet, openapiDcbxAppPriTableGet, openapiDcbxPeerAppPriTableGet
show interface priority-flow-control | openapiIfPfcStatusGet, openapiIfPfcModeGet, openapiIfPfcPriorityModeGet, openapiPfcOprPriorityModeGet, openapiPfcOperLinkDelayAllowanceGet, openapiPfcPeerCfgCompatibleGet, openapiPfcPeerCompatibleCfgCountGet, openapiPfcPeerIncompatibleCfgCountGet, openapiIfPfcRxPriorityStatGet, openapiPfcTxPriorityStatGet, openapiIfPfcRxStatGet, openapiIfPfcTxStatGet