Commit 975628e
Take SAI API lock when registering switch event callback
Summary:
While trying to make sure no regression in Sai Replayer refactoring, noticed that a few SAI API calls are interleaving with each other. E.g.
```
memset(s_a,0,ATTR_SIZE*4096);
s_a[0].id=536870926;
rv=switch_api->set_switch_attribute(9840384019236126720U,s_a);
memset(s_a,0,ATTR_SIZE*4096);
s_a[0].id=120;
rv=switch_api->set_switch_attribute(9840384019236126720U,s_a);
rvCheck(rv,0,1952);
rvCheck(rv,0,1953);
```
This is because when we register callbacks, the call directly goes to SDK instead of going through Sai API.
To fix this, also take the SaiAPILock while registering callback.
Reviewed By: daiwei1983
Differential Revision:
D85835200
Privacy Context Container: L1297311
fbshipit-source-id: 91c5c23810be7988d2bc9cfb73df1a68c6bf2e291 parent 044547e commit 975628e
1 file changed
+27
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
345 | | - | |
346 | 344 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
351 | 358 | | |
352 | 359 | | |
353 | 360 | | |
354 | 361 | | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
363 | 376 | | |
364 | 377 | | |
365 | 378 | | |
| |||
0 commit comments