Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
openapi_pfc.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2017-2018 Broadcom.
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 * Licensed under the Apache License, Version 2.0 (the "License");
26 * you may not use this file except in compliance with the License.
27 * You may obtain a copy of the License at
28 *
29 * http://www.apache.org/licenses/LICENSE-2.0
30 *
31 * Unless required by applicable law or agreed to in writing, software
32 * distributed under the License is distributed on an "AS IS" BASIS,
33 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34 * See the License for the specific language governing permissions and
35 * limitations under the License.
36 *
37 **********************************************************************
38 *
39 * @filename openapi_pfc.h
40 *
41 * @purpose Priority-based Flow Control Configuration and Statistics APIs.
42 *
43 * @component OPEN
44 *
45 * @create 01/23/2017
46 *
47 * @end
48 *
49 **********************************************************************/
50 #ifndef OPENAPI_PFC_H_INCLUDED
51 #define OPENAPI_PFC_H_INCLUDED
52 
53 #include <stdio.h>
54 #include <stddef.h>
55 #include <sys/un.h>
56 
57 #include "openapi_common.h"
58 
59 typedef enum
60 {
61  OPEN_PFC_PRI_DROP_MODE = 0, /*<< priority drop mode */
62  OPEN_PFC_PRI_NODROP_MODE = 1 /*<< priority no drop mode */
63 } OPEN_PFC_PRI_DROP_MODE_t;
64 
65 typedef enum
66 {
67  OPEN_PFC_ACTION_DROP = 0, /*<< action drop */
68  OPEN_PFC_ACTION_NO_DROP = 1 /*<< action no drop */
69 } OPEN_PFC_ACTION_t;
70 
71 typedef enum
72 {
73  OPEN_PFC_FEATURE_SUPPORTED = 0, /*<< general support statement */
74  OPEN_PFC_PORT_PRIORITY_FLOW_CONTROL_FEATURE_ID = 1, /*<< port priority flow control feature */
75  OPEN_PFC_TX_STATS_FEATURE_ID = 2, /*<< tx stats feature */
76 } OPEN_PFC_FEATURE_IDS_t;
77 
78 typedef enum
79 {
80  OPEN_PFC_MODE_DISABLE = 0, /*<< PFC disable mode */
81  OPEN_PFC_MODE_ENABLE = 1 /*<< PFC enable mode */
82 } OPEN_PFC_MODE_t;
83 
84 typedef enum
85 {
86  OPEN_PFC_STATUS_ACTIVE = 0, /*<< PFC status active */
87  OPEN_PFC_STATUS_INACTIVE = 1 /*<< PFC status inactive */
88 } OPEN_PFC_STATUS_t;
89 
90 #define OPEN_QOS_PFC_PRIORITY_ALL 8
91 #define OPEN_QOS_PFC_PRIORITY_MIN 0
92 #define OPEN_QOS_PFC_PRIORITY_MAX (OPEN_QOS_PFC_PRIORITY_ALL-1)
93 
94 /*****************************************************************/
109  uint32_t ifNum,
110  uint32_t *incompatibleCfgCount);
111 
112 /*****************************************************************/
129  uint32_t ifNum,
130  OPEN_BOOL_t *willing);
131 
132 /*****************************************************************/
148  uint32_t ifNum,
149  OPEN_BOOL_t *mbcStatus);
150 
151 /*****************************************************************/
168  uint32_t ifNum,
169  uint32_t *numPfcCap);
170 
171 /*****************************************************************/
189  uint32_t ifNum,
190  uint32_t priority,
191  OPEN_PFC_PRI_DROP_MODE_t *mode);
192 
193 /*****************************************************************/
210  uint32_t ifNum,
211  uint32_t priority,
212  OPEN_PFC_PRI_DROP_MODE_t *mode);
213 
214 /*****************************************************************/
230  uint32_t ifNum,
231  OPEN_PFC_MODE_t mode);
232 
233 /*****************************************************************/
251  uint32_t ifNum,
252  uint32_t priority,
253  OPEN_PFC_PRI_DROP_MODE_t dropMode);
254 
255 /*****************************************************************/
268  uint32_t *minPrio);
269 
270 /*****************************************************************/
283  uint32_t *maxPrio);
284 
285 /*****************************************************************/
300  uint32_t ifNum);
301 
302 /*****************************************************************/
317  uint32_t ifNum,
318  OPEN_PFC_STATUS_t *status);
319 
320 /*****************************************************************/
336  uint32_t ifNum,
337  OPEN_PFC_MODE_t *mode);
338 
339 /*****************************************************************/
357  uint32_t ifNum,
358  uint32_t priority,
359  OPEN_PFC_PRI_DROP_MODE_t *mode);
360 
361 /*****************************************************************/
379  uint32_t ifNum,
380  uint32_t priority,
381  OPEN_PFC_PRI_DROP_MODE_t *mode);
382 
383 /*****************************************************************/
398  uint32_t ifNum,
399  uint32_t *allowance);
400 
401 /*****************************************************************/
417  uint32_t ifNum,
418  OPEN_BOOL_t *compatible);
419 
420 /*****************************************************************/
435  uint32_t ifNum,
436  uint32_t *count);
437 
438 /*****************************************************************/
456  uint32_t ifNum,
457  uint32_t priority,
458  uint32_t *stat);
459 
460 /*****************************************************************/
479  uint32_t ifNum,
480  uint32_t priority,
481  uint32_t *count);
482 
483 /*****************************************************************/
499  uint32_t ifNum,
500  uint32_t *count);
501 
502 /*****************************************************************/
518  uint32_t ifNum,
519  uint32_t *count);
520 
521 #endif /* OPENAPI_PFC_H_INCLUDED */
522 
open_error_t openapiPfcPeerIncompatibleCfgCountGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *incompatibleCfgCount)
Gets the count of incompatible configurations received from peer.
open_error_t openapiIfPfcRxStatGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *count)
Get the PFC Rx stat on an interface.
open_error_t openapiPfcPeerCompatibleCfgCountGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *count)
Gets the count of compatible configurations received from peer.
open_error_t openapiIfPfcPriorityModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t priority, OPEN_PFC_PRI_DROP_MODE_t *mode)
Get the drop mode for the priority on an interface.
open_error_t openapiPfcPeerMbcStatusGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *mbcStatus)
Get the MACSEC bypass capability of the peer.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiPfcPeerPriorityModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t priority, OPEN_PFC_PRI_DROP_MODE_t *mode)
Get the peer priority mode for a priority.
open_error_t openapiPfcPeerWillingGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *willing)
Get the willingness of the peer.
open_error_t openapiPfcMaxNoDropPriorityGet(openapiClientHandle_t *client_handle, uint32_t *maxPrio)
Returns the maximum priority that can be configured in PFC.
open_error_t openapiIfPfcTxStatGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *count)
Get the PFC Tx stat on an interface.
open_error_t openapiPfcAdvPriorityModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t priority, OPEN_PFC_PRI_DROP_MODE_t *mode)
Gets the advertised PFC Priority participation mode for the interface.
open_error_t openapiIfPfcStatusGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_PFC_STATUS_t *status)
Get the active status on the interface.
open_error_t openapiIfPfcModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_PFC_MODE_t *mode)
Get the pfc mode for the interface.
open_error_t openapiPfcTxPriorityStatGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t priority, uint32_t *count)
Gets the number of PFC packets transmitted per interface/priority.
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
open_error_t openapiIfPfcStatsClear(openapiClientHandle_t *client_handle, uint32_t ifNum)
Clear the PFC stats on an interface.
open_error_t openapiPfcPeerCapabilityGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *numPfcCap)
Get the capability of the peer.
open_error_t openapiIfPfcPriorityModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t priority, OPEN_PFC_PRI_DROP_MODE_t dropMode)
Set the drop mode for the priority on an interface.
open_error_t openapiIfPfcRxPriorityStatGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t priority, uint32_t *stat)
Get the PFC Rx Priority stat on an interface.
open_error_t openapiPfcOprPriorityModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t priority, OPEN_PFC_PRI_DROP_MODE_t *mode)
Gets the operational PFC Priority participation mode for the interface.
open_error_t openapiIfPfcModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_PFC_MODE_t mode)
Enable an interface for PFC.
open_error_t openapiPfcOperLinkDelayAllowanceGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *allowance)
Gets the link delay allowance in bits for the interface.
open_error_t openapiPfcPeerCfgCompatibleGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *compatible)
Indicates if the peer configuration is compatible.
open_error_t openapiPfcMinNoDropPriorityGet(openapiClientHandle_t *client_handle, uint32_t *minPrio)
Returns the minimum priority that can be configured in PFC.