Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.9.0.2
openapi_instru_bst.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2016-2019 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 **********************************************************************
26 *
27 * @filename openapi_instru_bst.h
28 *
29 * @purpose Instrumentation Specific APIs
30 *
31 * @component OPEN
32 *
33 * @create 01/22/2015
34 *
35 * @end
36 *
37 **********************************************************************/
38 
39 
40 #ifndef OPENAPI_BST_H_INCLUDED
41 #define OPENAPI_BST_H_INCLUDED
42 #include <string.h>
43 #include <stdio.h>
44 #include <stdbool.h>
45 
46 #include "openapi_common.h"
47 
48 /* These data structures are used for OpEN API only */
49 
51 #define OPEN_ASIC_ICOS_MAX_PORTS 300
52 #define OPEN_ASIC_MAX_PORTS OPEN_ASIC_ICOS_MAX_PORTS
53 
55 #define OPEN_ASIC_ICOS_BST_MAX_PORTS 300
56 #define OPEN_ASIC_BST_MAX_PORTS OPEN_ASIC_ICOS_BST_MAX_PORTS
57 
58 #define OPEN_ASIC_MAX_UC_QUEUES 16384
59 
60 #define OPEN_ASIC_MAX_UC_QUEUE_GROUPS 4096
61 
62 #define OPEN_ASIC_MAX_MC_QUEUES 1040
63 
64 #define OPEN_ASIC_MAX_SERVICE_POOLS 4
65 
66 #define OPEN_ASIC_MAX_COMMON_POOLS 1
67 
68 #define OPEN_ASIC_MAX_CPU_QUEUES 8
69 
70 #define OPEN_ASIC_MAX_RQE_QUEUES 11
71 
72 #define OPEN_ASIC_MAX_RQE_QUEUE_POOLS 4
73 
74 #define OPEN_ASIC_MAX_PRIORITY_GROUPS 8
75 
76 #define OPEN_SYSTEM_NUM_COS_PORT 8
77 
79 #define OPEN_ASIC_MAX_INGRESS_SERVICE_POOLS \
80  (OPEN_ASIC_MAX_SERVICE_POOLS + OPEN_ASIC_MAX_COMMON_POOLS)
81 
82 #define OPEN_ASIC_MAX_UC_MC_QUEUES (OPEN_ASIC_MAX_UC_QUEUES + OPEN_ASIC_MAX_MC_QUEUES)
83 
84 #define OPEN_BST_INVALID_THRESHOLD_FIELD_32 0xFFFFFFFF
85 #define OPEN_BST_INVALID_THRESHOLD_FIELD 0xFFFFFFFFFFFFFFFFLL
86 
87 typedef struct
88 {
89  int portMap[OPEN_ASIC_ICOS_MAX_PORTS + 1];
90  int lportMap[OPEN_ASIC_ICOS_MAX_PORTS + 1];
92 
93 typedef struct
94 {
96  int numPorts;
120 
122 typedef struct
123 {
124  uint64_t bufferCount;
126 
128 typedef struct
129 {
131  {
132  uint32_t umShareBufferCount;
133  uint32_t umHeadroomBufferCount;
134  } data[OPEN_ASIC_BST_MAX_PORTS][OPEN_ASIC_MAX_PRIORITY_GROUPS];
135 
137 
139 typedef struct
140 {
142  {
143  uint32_t umShareBufferCount;
144  } data[OPEN_ASIC_BST_MAX_PORTS][OPEN_ASIC_MAX_INGRESS_SERVICE_POOLS];
145 
147 
149 typedef struct
150 {
152  {
153  uint64_t umShareBufferCount;
155 
157 
159 typedef struct
160 {
162  {
163  uint32_t ucShareBufferCount;
164  uint32_t umShareBufferCount;
165  uint32_t mcShareBufferCount;
166  uint32_t mcShareQueueEntries;
167  } data[OPEN_ASIC_BST_MAX_PORTS][OPEN_ASIC_MAX_SERVICE_POOLS];
168 
170 
172 typedef struct
173 {
175  {
176  uint64_t umShareBufferCount;
177  uint64_t mcShareBufferCount;
178  uint64_t mcShareQueueEntries;
180 
182 
184 typedef struct
185 {
187  {
188  uint64_t ucBufferCount;
189  uint64_t port;
190  } data[OPEN_ASIC_MAX_UC_MC_QUEUES];
191 
193 
195 typedef struct
196 {
198  {
199  uint64_t ucBufferCount;
201 
203 
205 typedef struct
206 {
208  {
209  uint64_t mcBufferCount;
210  uint64_t mcQueueEntries;
211  uint64_t port; /* to indicate the port number using this queue */
212  } data[OPEN_ASIC_MAX_UC_MC_QUEUES];
213 
215 
217 typedef struct
218 {
220  {
221  uint64_t cpuBufferCount;
222  uint64_t cpuQueueEntries;
223  } data[OPEN_ASIC_MAX_CPU_QUEUES];
224 
226 
228 typedef struct
229 {
231  {
232  uint64_t rqeBufferCount;
233  uint64_t rqeQueueEntries;
234  } data[OPEN_ASIC_MAX_RQE_QUEUES];
235 
237 
240 typedef struct
241 {
244 
249 
256 
258 
260 typedef struct
261 {
264 
269 
278 
280 
281 
283 typedef enum
284 {
285  OPEN_BST_MODE_CURRENT = 1,
286  OPEN_BST_MODE_PEAK = 2
288 
290 typedef struct
291 {
294 
297  bool enableIngressStatsMonitoring;
298  bool enableEgressStatsMonitoring;
299 
302 
304 
306 typedef enum
307 {
308  OPEN_BST_TRIGGER_DEVICE = 1,
309  OPEN_BST_TRIGGER_INGRESS = 2,
310  OPEN_BST_TRIGGER_EGRESS = 4
312 
313 #define BVIEW_MAX_STRING_NAME_LEN 256
314 /* Trigger info */
315 typedef struct
316 {
317  char realm[BVIEW_MAX_STRING_NAME_LEN];
318  char counter[BVIEW_MAX_STRING_NAME_LEN];
319  int port;
320  int queue;
322 
324 typedef struct
325 {
326  uint64_t ucShareThreshold;
327  uint64_t umShareThreshold;
328  uint64_t mcShareThreshold;
329  uint64_t mcShareQueueEntriesThreshold;
331 
333 typedef struct
334 {
335  uint64_t threshold;
337 
339 typedef struct
340 {
341  uint64_t umShareThreshold;
342  uint64_t umHeadroomThreshold;
344 
346 typedef struct
347 {
348  uint64_t umShareThreshold;
350 
352 typedef struct
353 {
354  uint64_t umShareThreshold;
356 
358 typedef struct
359 {
360  uint64_t umShareThreshold;
361  uint64_t mcShareThreshold;
363 
365 typedef struct
366 {
367  uint64_t ucBufferThreshold;
369 
371 typedef struct
372 {
373  uint64_t ucBufferThreshold;
375 
377 typedef struct
378 {
379  uint64_t mcBufferThreshold;
380  uint64_t mcQueueThreshold;
382 
384 typedef struct
385 {
386  uint64_t cpuBufferThreshold;
387  uint64_t cpuQueueThreshold;
389 
391 typedef struct
392 {
393  uint64_t rqeBufferThreshold;
394  uint64_t rqeQueueThreshold;
396 
398 typedef struct
399 {
400  bool ucastQValid;
401  bool mcastQValid;
402  int ucastHwQNum[OPEN_SYSTEM_NUM_COS_PORT];
403  int mcastHwQNum[OPEN_SYSTEM_NUM_COS_PORT];
405 
407 typedef struct
408 {
409  OPEN_SYSTEM_PORT_COSQ_HWQ_MAP_t portInfo[OPEN_ASIC_MAX_PORTS + 1];
411 
414  OPEN_BST_DEVICE_THRESHOLD = 1,
415  OPEN_BST_EGRESS_PORT_SP_THRESHOLD,
416  OPEN_BST_EGRESS_SP_THRESHOLD,
417  OPEN_BST_EGRESS_UC_QUEUE_THRESHOLD,
418  OPEN_BST_EGRESS_UC_QUEUEGROUPS_THRESHOLD,
419  OPEN_BST_EGRESS_MC_QUEUE_THRESHOLD,
420  OPEN_BST_EGRESS_CPU_QUEUE_THRESHOLD,
421  OPEN_BST_EGRESS_RQE_QUEUE_THRESHOLD,
422  OPEN_BST_INGRESS_PORT_PG_THRESHOLD,
423  OPEN_BST_INGRESS_PORT_SP_THRESHOLD,
424  OPEN_BST_INGRESS_SP_THRESHOLD
426 
427 
429 typedef struct _open_bst_error_data_
430 {
431  bool valid;
432  unsigned int rv;
434  int index1;
435  int index2;
437 
439 typedef struct
440 {
441  bool ucastQValid;
442  bool mcastQValid;
443  int ucastCosIndex; /* Unicast cosq index of this port*/
444  int ucastHwQNum[OPEN_SYSTEM_NUM_COS_PORT];
445  int mcastCosIndex; /* Multicast cosq index of this port */
446  int mcastHwQNum[OPEN_SYSTEM_NUM_COS_PORT];
448 
450 typedef struct
451 {
452  OPEN_SYSTEM_PORT_COSQ_HWQ_MAP_V2_t portInfo[OPEN_ASIC_MAX_PORTS + 1];
454 
457  void *handle, OPEN_BST_TRIGGER_INFO_t *info);
458 
459 /*****************************************************************/
473  int asic,
474  OPEN_ASIC_CAPABILITIES_t *asicCap);
475 
476 /*****************************************************************/
490  int asic,
491  OPEN_BST_CONFIG_t *bstCfg);
492 
493 /*****************************************************************/
507  int asic,
508  OPEN_BST_CONFIG_t *bstCfg);
509 
510 /*****************************************************************/
527  int asic,
531  time_t *time);
532 
533 /*****************************************************************/
550  int asic,
551  open_buffdesc *compSnapshot,
552  time_t *time);
553 
554 /*****************************************************************/
573  int asic,
577 
578 /*****************************************************************/
593  int asic,
595  time_t *time);
596 
597 /*****************************************************************/
612  int asic,
614  time_t *time);
615 
616 /*****************************************************************/
631  int asic,
633  time_t *time);
634 
635 /*****************************************************************/
650  int asic,
652  time_t *time);
653 
654 /*****************************************************************/
669  int asic,
671  time_t *time);
672 
673 /*****************************************************************/
688  int asic,
690  time_t *time);
691 
692 /*****************************************************************/
707  int asic,
709  time_t *time);
710 
711 /*****************************************************************/
726  int asic,
728  time_t *time);
729 
730 /*****************************************************************/
745  int asic,
747  time_t *time);
748 
749 /*****************************************************************/
764  int asic,
766  time_t *time);
767 
768 /*****************************************************************/
783  int asic,
785  time_t *time);
786 
787 /*****************************************************************/
801  int asic,
803 
804 /*****************************************************************/
821  int asic, int port, int pg,
823 
824 /*****************************************************************/
841  int asic, int port, int sp,
843 
844 /*****************************************************************/
860  int asic, int sp,
862 
863 /*****************************************************************/
889  int asic, int port, int sp,
891 
892 /*****************************************************************/
907  int asic, int sp,
909 
910 /*****************************************************************/
934  int asic, int ucQueue,
936 
937 /*****************************************************************/
961  int asic, int ucQueueGrp,
963 
964 /*****************************************************************/
980  int asic, int mcQueue,
982 
983 /*****************************************************************/
999  int asic, int cpuQueue,
1001 
1002 /*****************************************************************/
1018  int asic, int rqeQueue,
1020 
1021 /*****************************************************************/
1034  int asic);
1035 
1036 /*****************************************************************/
1049  int asic);
1050 
1051 /*****************************************************************/
1068  int asic,
1072  time_t *time);
1073 
1074 /*****************************************************************/
1091  int asic, open_buffdesc *compSnapshot,
1092  time_t *time);
1093 
1094 
1095 /*****************************************************************/
1111  int asic,
1112  int enable,
1113  int pid,
1114  int *clientId);
1115 
1116 /*****************************************************************/
1136  int asic,
1137  int clientId,
1138  OPEN_BST_TRIGGER_CALLBACK_t openCallback,
1139  void *context);
1140 
1141 /*****************************************************************/
1159  int asic,
1160  OPEN_BST_TRIGGER_CALLBACK_t openCallback,
1161  void *context);
1162 
1163 /*****************************************************************/
1177  int asic,
1178  OPEN_ASIC_PORT_MAP_t *data);
1179 
1180 /**********************************************************************/
1196  int asic, int port, int queue,
1197  uint64_t *dropCount);
1198 
1199 
1200 /*****************************************************************/
1216  int asic, int port, int queue,
1217  uint64_t *dropCount);
1218 
1219 /*****************************************************************/
1234  int asic, int port,
1235  uint64_t *dropCount);
1236 
1237 /*****************************************************************/
1250  int asic);
1251 
1252 /*****************************************************************/
1274  int asic, int realmMask,
1275  open_buffdesc *compSnapshot);
1276 
1277 /*****************************************************************/
1291  int asic);
1292 
1293 /*****************************************************************/
1310  int asic, int realmMask,
1311  open_buffdesc *compSnapshot,
1312  OPEN_BST_ERROR_DATA_t *errorData);
1313 
1314 #endif
1315