Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
Macros | Functions
Class Of Service Configuration [OPENAPI_COS]

Macros

#define OPEN_COS_ALL_INTERFACES   0
 
#define OPEN_COS_QUEUE_ID_MIN   0
 
#define OPEN_MAX_CFG_DROP_PREC_LEVELS   4
 
#define OPEN_MIN_CFG_DROP_PREC_LEVELS   1
 

Functions

open_error_t openapiCosQueueIntfShapingPercentageIncrementGet (openapiClientHandle_t *client_handle, uint32_t *increment)
 Get the minimum increment allowed when percentage of link speed is used to express rates. More...
 
open_error_t openapiCosQueueIntfShapingRateGet (openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *rate)
 Get the COS egress shaping rate for an interface. More...
 
open_error_t openapiCosQueueIntfShapingRateSet (openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t rate)
 Set the COS egress shaping rate for an interface. More...
 
open_error_t openapiCosQueueIntfShapingRateUnitsGet (openapiClientHandle_t *client_handle, OPEN_RATE_UNIT_t *rateUnit)
 Get the units used to express rates. More...
 
open_error_t openapiCosQueueMaxIdGet (openapiClientHandle_t *client_handle, uint32_t *maxQueueId)
 Get the max cos queue ID value. More...
 
open_error_t openapiCosQueueWredDropParamsReset (openapiClientHandle_t *client_handle, uint32_t intfNum, uint8_t queueNum)
 Reset WRED and ECN drop configuration on a given queue for a given or all interfaces. More...
 
open_error_t openapiCosQueueWredDropParamsSet (openapiClientHandle_t *client_handle, uint32_t intfNum, uint8_t queueNum, uint8_t dropPrecedence, OPEN_BOOL_t ecnEnabled, int16_t wredMinThreshold, int16_t wredMaxThreshold, int16_t wredDropProbability)
 Set WRED and ECN drop configuration on a given queue for a given or all interfaces. More...
 
open_error_t openapiCosQueueWredSet (openapiClientHandle_t *client_handle, uint32_t intfNum, uint8_t queueNum, OPEN_BOOL_t enableWred)
 Enable or disable WRED for a given queue and for a given or all interfaces. More...
 
open_error_t openapiCosQueueWredStatsClear (openapiClientHandle_t *client_handle, uint32_t intfNum)
 Clear WRED and ECN counters for a given or all interfaces. More...
 
open_error_t openapiCosQueueWredStatsGet (openapiClientHandle_t *client_handle, uint32_t intfNum, uint64_t *dropCount, uint64_t *ecnMarked)
 Get WRED drop and ECN marked counters for a given or all interfaces. More...
 

Detailed Description

Function Documentation

open_error_t openapiCosQueueIntfShapingPercentageIncrementGet ( openapiClientHandle_t client_handle,
uint32_t *  increment 
)

Get the minimum increment allowed when percentage of link speed is used to express rates.

Parameters
[in]client_handleClient handle from registration API
[out]incrementminimum percentage increment
Return values
OPEN_E_NONEvalue returned successfully
OPEN_E_ERRORplatform does not use percentage to express rates
OPEN_E_PARAMinvalid parameter passed
Note
For platforms using rate expressed as percentages, the rates are expressed in whole percentage values. In some cases, there are restrictions on the values for the percentage parameter. For example, if this function returns 5 for the increment, only percentage values of 0, 5, 10, 15, ... , 95, 100 are accepted. In many cases, the value of increment is 1.

OpEN API Version: 1.14

open_error_t openapiCosQueueIntfShapingRateGet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
uint32_t *  rate 
)

Get the COS egress shaping rate for an interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNuminterface number
[out]rateshaping rate value
Return values
OPEN_E_NONEvalue returned successfully
OPEN_E_UNAVAILplatform does not support COS egress shaping
OPEN_E_FAILfailed to get shaping rate
OPEN_E_PARAMinvalid parameter passed
Note
The value for rate is interpreted based on the data returned from openapiCosQueueIntfSapingRateUnitsGet().

OpEN API Version: 1.14

open_error_t openapiCosQueueIntfShapingRateSet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
uint32_t  rate 
)

Set the COS egress shaping rate for an interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNuminterface number
[in]rateshaping rate value
Return values
OPEN_E_NONEvalue set successfully
OPEN_E_UNAVAILplatform does not support COS egress shaping
OPEN_E_FAILfailed to set shaping rate
OPEN_E_PARAMinvalid parameter passed
Note
The value for rate is interpreted based on the data returned from openapiCosQueueIntfSapingRateUnitsGet().

OpEN API Version: 1.14

open_error_t openapiCosQueueIntfShapingRateUnitsGet ( openapiClientHandle_t client_handle,
OPEN_RATE_UNIT_t rateUnit 
)

Get the units used to express rates.

Parameters
[in]client_handleClient handle from registration API
[out]rateUnitrate unit identifier
Return values
OPEN_E_NONEvalue returned successfully
OPEN_E_PARAMinvalid parameter passed
Note
Various platforms use different ways of expressing traffic rates. Examples of the rate unit are kilobytes per second (KBPS) and percentage of link speed. This function returns the unit used on the switch. The caller should use this information to correctly set parameter values for rates when using other APIs in this file.

OpEN API Version: 1.14

open_error_t openapiCosQueueMaxIdGet ( openapiClientHandle_t client_handle,
uint32_t *  maxQueueId 
)

Get the max cos queue ID value.

Parameters
[in]client_handleClient handle from registration API
[out]maxQueueIdQueue number
Return values
OPEN_E_NONEMax cos queue ID returned successfully
OPEN_E_PARAMInvalid parameter passed

OpEN API Version: 1.25

open_error_t openapiCosQueueWredDropParamsReset ( openapiClientHandle_t client_handle,
uint32_t  intfNum,
uint8_t  queueNum 
)

Reset WRED and ECN drop configuration on a given queue for a given or all interfaces.

Parameters
[in]client_handleClient handle from registration API
[in]intfNuminterface number
[in]queueNumqueue number
Return values
OPEN_E_NONEvalue set successfully
OPEN_E_UNAVAILplatform does not support WRED feature
OPEN_E_FAILfailed to reset drop params config
Note
If intfNum is zero then WRED drop configuration will be reset on all interfaces.
Refer openapiCosQueueMaxIdGet() for max cos queue ID value.
Refer OPEN_COS_QUEUE_ID_MIN for min cos queue ID value.

OpEN API Version: 1.14

open_error_t openapiCosQueueWredDropParamsSet ( openapiClientHandle_t client_handle,
uint32_t  intfNum,
uint8_t  queueNum,
uint8_t  dropPrecedence,
OPEN_BOOL_t  ecnEnabled,
int16_t  wredMinThreshold,
int16_t  wredMaxThreshold,
int16_t  wredDropProbability 
)

Set WRED and ECN drop configuration on a given queue for a given or all interfaces.

Parameters
[in]client_handleClient handle from registration API
[in]intfNuminterface number
[in]queueNumqueue number
[in]dropPrecedencedrop precedence
[in]ecnEnabledECN enabled
[in]wredMinThresholdWRED minimum threshold
[in]wredMaxThresholdWRED maximum threshold
[in]wredDropProbabilityWRED drop probability
Return values
OPEN_E_NONEvalue set successfully
OPEN_E_UNAVAILplatform does not support WRED or ECN feature
OPEN_E_FAILfailed to set or get drop params config
OPEN_E_PARAMinvalid parameter passed
Note
If intfNum is zero then WRED drop configuration will be applied on all interfaces.
Refer openapiCosQueueMaxIdGet() for max cos queue ID value.
Refer OPEN_COS_QUEUE_ID_MIN for min cos queue ID value.
Refer OPEN_MIN_CFG_DROP_PREC_LEVELS for minimum drop precedence levels
Refer OPEN_MAX_CFG_DROP_PREC_LEVELS for maximum drop precedence levels

OpEN API Version: 1.14

open_error_t openapiCosQueueWredSet ( openapiClientHandle_t client_handle,
uint32_t  intfNum,
uint8_t  queueNum,
OPEN_BOOL_t  enableWred 
)

Enable or disable WRED for a given queue and for a given or all interfaces.

Parameters
[in]client_handleClient handle from registration API
[in]intfNuminterface number
[in]queueNumqueue number
[in]enableWredOPEN_TRUE to enable WRED OPEN_FALSE to enable tail drop queue management
Return values
OPEN_E_NONEenabled WRED successfully
OPEN_E_FAILunable to enable WRED
Note
If intfNum is zero then WRED drop configuration will be enabled or disabled on all interfaces.
Refer openapiCosQueueMaxIdGet() for max cos queue ID value.
Refer OPEN_COS_QUEUE_ID_MIN for min cos queue ID value.

OpEN API Version: 1.14

open_error_t openapiCosQueueWredStatsClear ( openapiClientHandle_t client_handle,
uint32_t  intfNum 
)

Clear WRED and ECN counters for a given or all interfaces.

Parameters
[in]client_handleClient handle from registration API
[in]intfNuminterface number
Return values
OPEN_E_NONEcounters reset successfully
OPEN_E_FAILunable to reset counters
Note
If intfNum is zero then WRED stats will be cleared on all interfaces.

OpEN API Version: 1.14

open_error_t openapiCosQueueWredStatsGet ( openapiClientHandle_t client_handle,
uint32_t  intfNum,
uint64_t *  dropCount,
uint64_t *  ecnMarked 
)

Get WRED drop and ECN marked counters for a given or all interfaces.

Parameters
[in]client_handleClient handle from registration API
[in]intfNuminterface number
[out]dropCountWRED drop counters
[out]ecnMarkedECN marked counters
Return values
OPEN_E_NONEcounters retrieved successfully
OPEN_E_FAILunable to retrieve counters
Note
If intfNum is zero then WRED stats wil be retrieved on all interfaces.

OpEN API Version: 1.14