This document provides a brief description of the Priority-based Flow Control OpEN API. Priority-based Flow Control (PFC) is defined by 802.1Qbb. it is a flow-control mechanism that allows frames to be paused based on their priority. specifies enhancement of transmission selection to support allocation of bandwidth amongst traffic classes. Should a given traffic class not use all of its allocated bandwidth, ETS allows that bandwidth to be used by other traffic classes.
THE API provides the following services:
- Get the count of incompatible configurations received from peer.
- Get the willingness of the peer.
- Get the MACSEC bypass capability of the peer.
- Get the capability of the peer.
- Get the advertised PFC Priority participation mode
- Get the peer priority mode for a priority.
- Enable an interface for PFC.
- Set the drop mode for the priority on an interface.
- Determine the minimum priority that can be configured in PFC
- Determine the maximum priority that can be configured in PFC.
- Clear the PFC stats on an interface.
- Get the active status on the interface.
- Get the PFC mode for an interface.
- Get the drop mode for the priority on an interface.
- Get the operational PFC Priority participation mode for
- Get the link delay allowance in bits for an interface.
- Determine if the peer configuration is compatible.
- Gets the count of compatible configurations received from peer.
- Get the PFC Rx Priority stat on an interface.
- Get the number of PFC packets transmitted.
- Get the PFC Rx stat on an interface.
- Get the PFC Tx stat on an interface.
- Enable/Disable deadlock detect for a priority on an interface.
- Get the deadlock detect mode for a priority on an interface.
- Set the deadlock detect interval.
- Get the deadlock detect interval.
- Set the deadlock recovery action.
- Get the deadlock recovery action.
- Set the deadlock detect time for a priority.
- Set the deadlock recovery time for a priority.
- Get the deadlock detect time and recovery time for a priority.
Example C Application pfc_example
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.
pfc_example
pfc_example.c is a sample application that exercises the APIs provided by the PFC OpEN APIs.
Sample Output
- Usage: ./pfc_ex <test#> <arg1> <arg2> ...
- Test 1: Enable(1)/Disable(0) pfc on an interface: ./pfc_ex 1 <intf> <mode>
- Test 2: Set PFC drop mode(drop - 0, noDrop - 1) for a given interface and priority: ./pfc_ex 2 <intf> <priority> <dropMode>
- Test 3: clear the PFC stats on an interface: ./pfc_ex 3 <intf>
- Test 4: Display PFC status for a given interface : ./pfc_ex 4 <intf>
- Test 5: Enable(1)/Disable(0) deadlock detect for the priority on an interface: ./pfc_ex 5 <intf> <priority> <mode>
- Test 6: Gets deadlock detect mode for an interface: ./pfc_ex 6 <intf>
- Test 7: Sets the deadlock detection interval[10ms - 0, 100ms - 1]: ./pfc_ex 7 <detect_interval>
- Test 8: Gets the deadlock detection interval: ./pfc_ex 8
- Test 9: Sets the deadlock recovery action[Transmit - 0, Drop - 1]: ./pfc_ex 9 <action>
- Test 10: Gets the deadlock recovery action: ./pfc_ex 10
- Test 11: Sets the deadlock detect time[0 - 1500]: ./pfc_ex 11 <priority> <detect_time>
- Test 12: Sets the deadlock recovery time[0 - 1500]: ./pfc_ex 12 <priority> <recovery_time>
- Test 13: Gets the deadlock detect time and recovery time for given priority: ./pfc_ex 13 <priority>
PFC CLI/API Cross Reference