Topic Text   Topic Comments (0)   Topic Properties   Topic Information abhisri@jun...
Topic title: Review: sdk 6.3.4 integration.Gems layer changes. Tuesday May 27, 2014 06:00:10

Download topic text | View in monospace font | Tab width set to 8 (change to 4)

Files in topic:  
[Jump to] gems_review_diff.diff   {+543,-0}

[Add General Comment] to topic.

File gems_review_diff.diff (Revision 1.0) [Add File Comment] [Top]
 
1 ? acldiff.diff
2 ? diff.diff
3 ? diff1.diff
4 ? diff2.diff
5 ? gems_acl_back.c
6 ? gems_acl_diff.diff
7 Index: gems_acl.c
8 ===================================================================
9 RCS file: /sw/cvs/uno/fp/platform/broadcom/gems_acl.c,v
10 retrieving revision 1.2.2.31.6.9.6.13.4.1
11 diff -r1.2.2.31.6.9.6.13.4.1 gems_acl.c
12 1c1
13 < #ifdef APACHE_HYDRA //-------------------------------
14 ---
15 > #ifdef APACHE_HYDRA //-------------------------------
16 208a209,212
17 > int kbit_id;
18 > int kbit_onetag_id;
19 > int cos_id;
20 > int cos_onetag_id;
21 244a249,252
22 > int kbit_id;
23 > int kbit_onetag_id;
24 > int cos_id;
25 > int cos_onetag_id;
26 255c263,266
27 <
28 ---
29 > int kbit_id;
30 > int kbit_onetag_id;
31 > int cos_id;
32 > int cos_onetag_id;
33 381c392
34 < extern int bcm_esw_field_qualify_CpuCos(int unit, bcm_field_entry_t entry, int cpucos);
35 ---
36 > extern int bcm_esw_field_qualify_CpuQueue(int unit, bcm_field_entry_t entry, int cpucos);
37 607,612d617
38 < /*abhi*/
39 < /*data qualifier id, this will be used as input in bcm_field_qualify_data*/
40 < int kbit_id;
41 < int kbit_onetag_id;
42 < int cos_id;
43 < int cos_onetag_id;
44 898c903,907
45 < /*abhi*/
46 ---
47 > int kbit_id = -1;
48 > int kbit_onetag_id = -1;
49 > int cos_id = -1;
50 > int cos_onetag_id = -1;
51 >
52 904d912
53 < /*abhi: for cos udf */
54 1063,1064d1070
55 < /* kbit udf */
56 < /*abhi initialize the data qualifier*/
57 1068d1073
58 < /*abhi:multiplied by 4 as now the length is in bytes instead of words*/
59 1076d1080
60 < /*abhi initialize the data qualifier for one tag*/
61 1080,1081d1083
62 < /*abhi:multiplied by 4 as now the length is in bytes instead of words*/
63 < /* a plus one because vlan .1q tag is 1 word */
64 1089d1090
65 < /*abhi:init the packet format no tag*/
66 1097d1097
67 < /*abhi:init the packet format one tag */
68 1103d1102
69 < //bcm_field_udf_spec_t_init(&udf_spec);
70 1105,1106d1103
71 < /*abhi:attach pkt qualifier to data qualifier*/
72 < /* Attach the packet qualifier to the data qualifier */
73 1118d1114
74 < /*abhi:now add this to the qset */
75 1125,1148d1120
76 < #if 0
77 < r = bcm_field_udf_spec_set(GEMS_UNIT_0, &udf_spec,
78 < (BCM_FIELD_USER_L2_ETHERNET2 |
79 < BCM_FIELD_USER_VLAN_NOTAG |
80 < BCM_FIELD_USER_IP4_HDR_ONLY),
81 < ACL_UDF_KBIT_CHUNK);
82 < if (r == BCM_E_NONE) {
83 < r = bcm_field_udf_spec_set(GEMS_UNIT_0, &udf_spec,
84 < (BCM_FIELD_USER_L2_ETHERNET2 |
85 < BCM_FIELD_USER_VLAN_ONETAG |
86 < BCM_FIELD_USER_IP4_HDR_ONLY),
87 < ACL_UDF_KBIT_CHUNK+1);
88 < }
89 <
90 < if (r == BCM_E_NONE) {
91 < r = bcm_field_udf_create_id(GEMS_UNIT_0, &udf_spec,
92 < ACL_UDF_KBIT_ID);
93 < }
94 < if (r == BCM_E_NONE) {
95 < r = bcm_field_qset_add_udf(GEMS_UNIT_0, &qset,
96 < ACL_UDF_KBIT_ID);
97 < }
98 < #endif
99 < /* cos udf */
100 1150d1121
101 < /*abhi initialize the data qualifier*/
102 1154d1124
103 < /*abhi:multiplied by 4 as now the length is in bytes instead of words*/
104 1162d1131
105 < /*abhi initialize the data qualifier for one tag*/
106 1166,1167d1134
107 < /*abhi:multiplied by 4 as now the length is in bytes instead of words*/
108 < /* a plus one because vlan .1q tag is 1 word */
109 1175d1141
110 < /*abhi:init the packet format no tag*/
111 1183d1148
112 < /*abhi:init the packet format one tag */
113 1191,1192d1155
114 < /*abhi:attach pkt qualifier to data qualifier*/
115 < /* Attach the packet qualifier to the data qualifier */
116 1204d1166
117 < /*abhi:now add this to the qset */
118 1211,1234d1172
119 < #if 0
120 < bcm_field_udf_spec_t_init(&udf_spec);
121 < r = bcm_field_udf_spec_set(GEMS_UNIT_0, &udf_spec,
122 < (BCM_FIELD_USER_L2_ETHERNET2 |
123 < BCM_FIELD_USER_VLAN_NOTAG |
124 < BCM_FIELD_USER_IP4_HDR_ONLY),
125 < ACL_UDF_COS_CHUNK);
126 < if (r == BCM_E_NONE) {
127 < r = bcm_field_udf_spec_set(GEMS_UNIT_0, &udf_spec,
128 < (BCM_FIELD_USER_L2_ETHERNET2 |
129 < BCM_FIELD_USER_VLAN_ONETAG |
130 < BCM_FIELD_USER_IP4_HDR_ONLY),
131 < ACL_UDF_COS_CHUNK+1);
132 < }
133 <
134 < if (r == BCM_E_NONE) {
135 < r = bcm_field_udf_create_id(GEMS_UNIT_0, &udf_spec,
136 < ACL_UDF_COS_ID);
137 < }
138 < if (r == BCM_E_NONE) {
139 < r = bcm_field_qset_add_udf(GEMS_UNIT_0, &qset,
140 < ACL_UDF_COS_ID);
141 < }
142 < #endif
143 1408,1411c1346,1347
144 < /*
145 < * RIESLING_DEV_TODO: SDK 6.3.4 has depriciated this
146 < */
147 < //BCM_FIELD_QSET_ADD(qset, bcmFieldQualifyCpuCos);
148 ---
149 > BCM_FIELD_QSET_ADD(qset, bcmFieldQualifyCpuQueue);
150 > BCM_FIELD_QSET_ADD(qset, bcmFieldQualifyCpuQueue);
151 1438a1375,1383
152 > info->kbit_id = kbit_id;
153 > info->kbit_onetag_id = kbit_onetag_id;
154 > info->cos_id = cos_id;
155 > info->cos_onetag_id = cos_onetag_id;
156 > gnext->kbit_id = kbit_id;
157 > gnext->kbit_onetag_id = kbit_onetag_id;
158 > gnext->cos_id = cos_id;
159 > gnext->cos_onetag_id = cos_onetag_id;
160 > gnext->ag_type = type;
161 1672d1616
162 < /*abhi bcmFieldStatPackets replacement of BCM_FIELD_COUNTER_MODE_PACKETS*/
163 1675,1681d1618
164 < /*
165 < * example of pkt and byte counting
166 < * pass &gems_kbit_acl.stat_id to bcm_field_stat_create
167 < * num_stat = 2;
168 < * bcm_field_stat_t stat_arr[2] = {bcmFieldStatBytes, bcmFieldStatPackets};
169 < * don't forget to manage memory for stat_arr
170 < */
171 1702,1706d1638
172 < #if 0 /*abhi*/
173 < r = bcm_field_qualify_UserDefined(GEMS_UNIT_0, eid, ACL_UDF_KBIT_ID,
174 < data, mask);
175 < #endif
176 < /*abhi:bcm_field_qualify_UserDefined is depricated use bcm_field_qualify_data */
177 1708c1640
178 < kbit_id,
179 ---
180 > gems_kbit_acl.gs_group.kbit_id,
181 1714c1646
182 < kbit_onetag_id,
183 ---
184 > gems_kbit_acl.gs_group.kbit_onetag_id,
185 1720d1651
186 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
187 1724,1725d1654
188 < /*abhi: we should use the new sdk 6.2.8 bcm_field_entry_stat_attach
189 < * instead of bcm_field_action_add .See Field Stat Management in 56XX-PG628-RDS*/
190 1727,1732d1655
191 < /*abhi:commenting out bcm_filed_action_add,dont know what to do with BCM_FIELD_COUNTER_MODE_NO_YES
192 < * ,ask BRCM */
193 < #if 0
194 < r = bcm_field_action_add(GEMS_UNIT_0, eid, bcmFieldActionUpdateCounter,
195 < BCM_FIELD_COUNTER_MODE_NO_YES | BCM_FIELD_COUNTER_MODE_PACKETS, 0);
196 < #endif
197 1734d1656
198 < /*abhi:use stat_attach instead of action_add in sdk 6.2.8*/
199 1783,1789d1704
200 < #if 0
201 < /*abhi*/
202 < r = bcm_field_qualify_UserDefined(GEMS_UNIT_0, eid, ACL_UDF_COS_ID,
203 < cos_udf_data[ii],
204 < cos_udf_mask);
205 < #endif
206 < /*abhi: see notes on udf.. qualify two times ..for both single tagged and untagged traffic*/
207 1791c1706
208 < cos_id,
209 ---
210 > map->cd_group.cos_id,
211 1796c1711
212 < cos_onetag_id,
213 ---
214 > map->cd_group.cos_onetag_id,
215 1874,1880d1788
216 < /*
217 < * example of pkt and byte counting
218 < * pass &gems_hmo_acl.stat_id to bcm_field_stat_create
219 < * num_stat = 2;
220 < * bcm_field_stat_t stat_arr[2] = {bcmFieldStatBytes, bcmFieldStatPackets};
221 < * don't forget to manage memory for stat_arr
222 < */
223 1895d1802
224 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
225 1901,1904d1807
226 < #if 0
227 < r = bcm_field_action_add(GEMS_UNIT_0, eid, bcmFieldActionUpdateCounter,
228 < BCM_FIELD_COUNTER_MODE_NO_YES | BCM_FIELD_COUNTER_MODE_PACKETS, 0);
229 < #endif
230 1995,2007d1897
231 < /*
232 < * TBD:
233 < * rajeshc: commenting out since we really don't need to
234 < * qualify on the modid. This api has been depreciated.
235 < * We could alternatively qualify on the portID
236 < *
237 < * RIESLING change: we need a way to use this conditionally
238 < * so as not to break apache and lightning...
239 < */
240 < // r = bcm_field_qualify_SrcModid(GEMS_UNIT_0, eid,
241 < // bcm_my_modid,
242 < // GEMS_FIELD_MODID_MASK);
243 < //ACL_HANDLE_ERR(r, tid_acl_add_err);
244 2154d2043
245 < bcm_field_group_t group;
246 2157d2045
247 < //bcm_field_stat_t *stat_arr = NULL;
248 2160,2166d2047
249 < /*
250 < * example of pkt and byte counting
251 < * pass &ekacl->ek_ifp_group.stat_id to bcm_field_stat_create
252 < * num_stat = 2;
253 < * bcm_field_stat_t stat_arr[2] = {bcmFieldStatBytes, bcmFieldStatPackets};
254 < * don't forget to manage memory for stat_arr
255 < */
256 2201d2081
257 < group = ekacl->ek_ifp_group.gi_gid;
258 2211d2090
259 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
260 2216,2219d2094
261 < #if 0 /*abhi*/
262 < r = bcm_field_action_add(GEMS_UNIT_0, eid, bcmFieldActionUpdateCounter,
263 < BCM_FIELD_COUNTER_MODE_NO_YES | BCM_FIELD_COUNTER_MODE_PACKETS, 0);
264 < #endif
265 2251,2255c2126,2127
266 < /*
267 < * RIESLING_DEV_TODO: SDK 6.3.4 has depriciated this bcm_esw_field_qualify_CpuCos
268 < */
269 < //r = bcm_esw_field_qualify_CpuCos(GEMS_UNIT_0, eid, cos);
270 < //ACL_HANDLE_ERR(r, ek_acl_add_err);
271 ---
272 > r = bcm_esw_field_qualify_CpuQueue(GEMS_UNIT_0, eid, cos);
273 > ACL_HANDLE_ERR(r, ek_acl_add_err);
274 2287,2288d2158
275 < /* create a counter */
276 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
277 2293,2297d2162
278 < #if 0 /*abhi*/
279 < /* increment counter if matched */
280 < r = bcm_field_action_add(GEMS_UNIT_0, eid, bcmFieldActionUpdateCounter,
281 < BCM_FIELD_COUNTER_MODE_NO_YES | BCM_FIELD_COUNTER_MODE_PACKETS, 0);
282 < #endif
283 2698,2699d2562
284 < //bcm_field_stat_t *stat_arr = NULL;
285 < /*abhi bcmFieldStatPackets replacement of BCM_FIELD_COUNTER_MODE_PACKETS*/
286 2702,2708d2564
287 < /*
288 < * example of pkt and byte counting
289 < * pass &gems_mcast_acl.stat_id to bcm_field_stat_create
290 < * num_stat = 2;
291 < * bcm_field_stat_t stat_arr[2] = {bcmFieldStatBytes, bcmFieldStatPackets};
292 < * don't forget to manage memory for stat_arr
293 < */
294 2721d2576
295 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
296 2770,2773d2624
297 < #if 0/*abhi*/
298 < r = bcm_field_action_add(GEMS_UNIT_0, eid, bcmFieldActionUpdateCounter,
299 < BCM_FIELD_COUNTER_MODE_GREEN_NOTGREEN, 0);
300 < #endif
301 2837d2687
302 < /*abhi bcmFieldStatPackets replacement of BCM_FIELD_COUNTER_MODE_PACKETS*/
303 2840,2846d2689
304 < /*
305 < * example of pkt and byte counting
306 < * pass &gems_igmp_acl.stat_id to bcm_field_stat_create
307 < * num_stat = 2;
308 < * bcm_field_stat_t stat_arr[2] = {bcmFieldStatBytes, bcmFieldStatPackets};
309 < * don't forget to manage memory for stat_arr
310 < */
311 2866d2708
312 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
313 2901,2904d2742
314 < #if 0/*abhi*/
315 < r = bcm_field_action_add(GEMS_UNIT_0, eid, bcmFieldActionUpdateCounter,
316 < BCM_FIELD_COUNTER_MODE_GREEN_NOTGREEN, 0);
317 < #endif
318 3303,3308d3140
319 < /*
320 < * example of pkt and byte counting
321 < * num_stat = 2;
322 < * bcm_field_stat_t stat_arr[2] = {bcmFieldStatBytes, bcmFieldStatPackets};
323 < * don't forget to manage memory for stat_arr
324 < */
325 3337d3168
326 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
327 3350,3353d3180
328 < #if 0
329 < r = bcm_field_action_add(GEMS_UNIT_0, eid, bcmFieldActionUpdateCounter,
330 < BCM_FIELD_COUNTER_MODE_DEFAULT, 0);
331 < #endif
332 3391,3394c3218
333 < // r = bcm_field_counter_destroy(GEMS_UNIT_0,
334 < // gems_capture_acl.gs_entry0);
335 < // gems_capture_acl.gs_group.gi_gid
336 < r = bcm_field_counter_destroy(GEMS_UNIT_0,
337 ---
338 > r = bcm_field_stat_destroy(GEMS_UNIT_0,
339 3670d3493
340 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
341 3672d3494
342 < /*abhi:need to attach to the ACL too for the counter to count */
343 3683,3688d3504
344 < // rajeshc: Is this the correct method to share a counter
345 < // abhi:This should share the counter.(if any of the eid acl is hit, counter
346 < // will be incremented).
347 < // Quoting 56XX-PG628-R: "Application attaches statistics handle to
348 < // a field entry or a set of entries"
349 < // r = bcm_field_counter_share(GEMS_UNIT_0, counter->gc_eid, eid);
350 3745,3748d3560
351 < // r = bcm_field_counter_set(GEMS_UNIT_0,
352 < // counter->gc_eid,
353 < // 0,/* lower */
354 < // 0);
355 3785,3788d3596
356 < // r = bcm_field_counter_get(GEMS_UNIT_0,
357 < // counter->gc_eid,
358 < // 0, /* lower */
359 < // &value);
360 5682d5489
361 < //bcm_field_stat_t *stat_arr = NULL;
362 5685,5693d5491
363 < /*
364 < * example of pkt and byte counting
365 < * int32 stats_id = -1;
366 < * num_stat = 2;
367 < * bcm_field_stat_t stat_arr[2] = {bcmFieldStatBytes, bcmFieldStatPackets};
368 < * don't forget to manage memory for stat_arr
369 < */
370 <
371 < *gw_DA = priority;
372 5715d5512
373 < // r = bcm_field_counter_create(GEMS_UNIT_0, *gw_DA);
374 5723,5727d5519
375 < #if 0
376 < r = bcm_field_action_add(GEMS_UNIT_0, *gw_DA,
377 < bcmFieldActionUpdateCounter,
378 < BCM_FIELD_COUNTER_MODE_DEFAULT, 0);
379 < #endif
380 5731,5735d5522
381 < #if 0
382 < r = bcm_field_action_add(GEMS_UNIT_0, *gw_SA,
383 < bcmFieldActionUpdateCounter,
384 < BCM_FIELD_COUNTER_MODE_DEFAULT, 0);
385 < #endif
386 5758d5544
387 < //bcm_field_group_t group;
388 5761,5767d5546
389 < /*
390 < * example of pkt and byte counting
391 < * int32 stats_id = -1;
392 < * num_stat = 2;
393 < * bcm_field_stat_t stat_arr[2] = {bcmFieldStatBytes, bcmFieldStatPackets};
394 < * don't forget to manage memory for stat_arr
395 < */
396 5829d5607
397 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
398 5840,5844d5617
399 < #if 0
400 < r = bcm_field_action_add(GEMS_UNIT_0, eid,
401 < bcmFieldActionUpdateCounter,
402 < BCM_FIELD_COUNTER_MODE_DEFAULT, 0);
403 < #endif
404 6006,6009d5778
405 < // r = bcm_field_counter_get(GEMS_UNIT_0,
406 < // l2r_acl->fpr_mac_eid[ii][GEMS_L2R_INDEX_DA],
407 < // 0, /* lower */
408 < // &count);
409 6021,6024d5789
410 < // r = bcm_field_counter_set(GEMS_UNIT_0,
411 < // l2r_acl->fpr_mac_eid[ii][GEMS_L2R_INDEX_DA],
412 < // 0, /* lower */
413 < // 0);
414 6033,6036d5797
415 < // r = bcm_field_counter_get(GEMS_UNIT_0,
416 < // l2r_acl->fpr_drop_eid,
417 < // 0, /* lower */
418 < // &count);
419 6045,6048d5805
420 < // r = bcm_field_counter_set(GEMS_UNIT_0,
421 < // l2r_acl->fpr_drop_eid,
422 < // 0, /* lower */
423 < // 0);
424 6282,6283c6039,6041
425 < /*abhi:this functions should be replace by a new function gems_entry_stat_get */
426 < #if 0
427 ---
428 > int32 stat_id;
429 > int32 stat_size;
430 > bcm_field_stat_t stat_arr[2];
431 6286,6295c6044,6051
432 < /*
433 < * rajeshc: we do not have the stat_id to retrive counter information.
434 < * we need to get reference back to node ("e") from gems_acl_show_entry_insert
435 < * and insert the stat_id in there.
436 < * TBD: We need to make the above chnages, the following is commented to
437 < * allow compilation to proceed
438 < */
439 < if ((r = bcm_field_counter_get(GEMS_UNIT_0, eid, 0, val)) != BCM_E_NONE) {
440 < return (-1);
441 < }
442 ---
443 > r = bcm_field_entry_stat_get(GEMS_UNIT_0, eid, &stat_id);
444 > ACL_HANDLE_ERR(r, stat_err );
445 > r = bcm_field_stat_size(GEMS_UNIT_0, stat_id, &stat_size);
446 > ACL_HANDLE_ERR(r, stat_err );
447 > r = bcm_field_stat_config_get(GEMS_UNIT_0, stat_id, stat_size, stat_arr);
448 > ACL_HANDLE_ERR(r, stat_err );
449 > r = bcm_field_stat_multi_get(GEMS_UNIT_0, stat_id, stat_size, stat_arr, val);
450 > ACL_HANDLE_ERR(r, stat_err);
451 6297,6298c6053,6055
452 < #endif
453 < return (-1);
454 ---
455 >
456 > stat_err:
457 > return (r);
458 6345a6103
459 >
460 6885,6891d6642
461 < /*
462 < * example of pkt and byte counting
463 < * int32 stats_id = -1;
464 < * num_stat = 2;
465 < * bcm_field_stat_t stat_arr[2] = {bcmFieldStatBytes, bcmFieldStatPackets};
466 < * don't forget to manage memory for stat_arr
467 < */
468 6915,6922d6665
469 < // rajeshc: we need to conver the eid to gid or we need a method
470 < // where the gid is made available to the user in show commands
471 < // so that the gid can be passed instead of the eid to this command
472 < //
473 < // r = bcm_field_counter_create(GEMS_UNIT_0, eid);
474 < //
475 < // TDB: Hack to allow compilation to proceed abhi: need to find a bcm api, that gives group id from eid*/
476 < // abhi:leaving this for now..
477 6938,6945c6681
478 < // rajeshc: we need to convert eid to stat_id or a method
479 < // determined where the stat_id needs to be passed in for
480 < // the 'stat_get' to succeed.
481 < // TDB: Hack to allow compilation to succeed. Notice that we have
482 < // enabled both byte and packet counts, we should be able to get
483 < // both
484 < // abhi:leaving this for now..
485 < stats_id = eid;
486 ---
487 > bcm_field_entry_stat_get(GEMS_UNIT_0, eid, &stats_id);
488 Index: gems_riesling.c
489 ===================================================================
490 RCS file: /sw/cvs/uno/fp/platform/broadcom/Attic/gems_riesling.c,v
491 retrieving revision 1.1.4.3
492 diff -r1.1.4.3 gems_riesling.c
493 110c110
494 < /*
495 ---
496 >
497 113c113
498 < */
499 ---
500 >
501 121,124c121,124
502 < /*
503 < READ_WAMUDROPCNTTHDr(0, &counter);
504 < WRITE_WAMUDROPCNTTHDr(0, 0);
505 < */
506 ---
507 >
508 > READ_WAMUDROPCNTTHDIPKTr(0, &counter);
509 > WRITE_WAMUDROPCNTTHDIPKTr(0, 0);
510 >
511 132c132
512 < /*
513 ---
514 >
515 135c135
516 < */
517 ---
518 >
519 143c143
520 < /*
521 ---
522 >
523 146c146
524 < */
525 ---
526 >
527 154c154
528 < /*
529 ---
530 >
531 157c157
532 < */
533 ---
534 >
535 Index: gems_wlan.c
536 ===================================================================
537 RCS file: /sw/cvs/uno/fp/platform/broadcom/gems_wlan.c,v
538 retrieving revision 1.2.2.19.6.1.12.3.16.2
539 diff -r1.2.2.19.6.1.12.3.16.2 gems_wlan.c
540 424d423
541 < // rajeshc: commented to allow compilation to proceed, this is a trapeze specific flag
542 882d880
543 < // rajeshc: commented to allow compilation to proceed, this is a trapeze specific flag
 
  
Legend:
Removed 
Changed
 Added

[Add General Comment] to topic.