1818
1919#define CHECK_STATUS_SUCCESS (s ) { if ((s) != SAI_STATUS_SUCCESS) return (s); }
2020
21- #define CHECK_STATUS_SUCCESS_MODE (s,m ) \
22- { \
23- if ((s) != SAI_STATUS_SUCCESS && m != SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR) return (s); \
24- } \
25-
2621#define VALIDATION_LIST (md,vlist ) \
2722{ \
2823 auto _status = meta_genetic_validation_list (md,vlist.count ,vlist.list ); \
@@ -628,14 +623,14 @@ sai_status_t Meta::bulkCreate(
628623 for (uint32_t idx = 0 ; idx < object_count; idx++) \
629624 { \
630625 sai_status_t status = meta_sai_validate_ ##ot (&ot[idx], true ); \
631- CHECK_STATUS_SUCCESS_MODE (status, mode); \
626+ CHECK_STATUS_SUCCESS (status); \
632627 sai_object_meta_key_t meta_key = { \
633628 .objecttype = (sai_object_type_t )SAI_OBJECT_TYPE_ ## OT, \
634629 .objectkey = { .key = { .ot = ot[idx] } } \
635630 }; \
636631 vmk.push_back (meta_key); \
637632 status = meta_generic_validation_create (meta_key, ot[idx].switch_id , attr_count[idx], attr_list[idx]); \
638- CHECK_STATUS_SUCCESS_MODE (status, mode); \
633+ CHECK_STATUS_SUCCESS (status); \
639634 } \
640635 auto status = m_implementation->bulkCreate (object_count, ot, attr_count, attr_list, mode, object_statuses); \
641636 for (uint32_t idx = 0 ; idx < object_count; idx++) \
@@ -672,14 +667,14 @@ sai_status_t Meta::bulkRemove(
672667 for (uint32_t idx = 0 ; idx < object_count; idx++) \
673668 { \
674669 sai_status_t status = meta_sai_validate_ ##ot (&ot[idx], false ); \
675- CHECK_STATUS_SUCCESS_MODE (status, mode); \
670+ CHECK_STATUS_SUCCESS (status); \
676671 sai_object_meta_key_t meta_key = { \
677672 .objecttype = (sai_object_type_t )SAI_OBJECT_TYPE_ ## OT, \
678673 .objectkey = { .key = { .ot = ot[idx] } } \
679674 }; \
680675 vmk.push_back (meta_key); \
681676 status = meta_generic_validation_remove (meta_key); \
682- CHECK_STATUS_SUCCESS_MODE (status, mode); \
677+ CHECK_STATUS_SUCCESS (status); \
683678 } \
684679 auto status = m_implementation->bulkRemove (object_count, ot, mode, object_statuses); \
685680 for (uint32_t idx = 0 ; idx < object_count; idx++) \
@@ -718,14 +713,14 @@ sai_status_t Meta::bulkSet(
718713 for (uint32_t idx = 0 ; idx < object_count; idx++) \
719714 { \
720715 sai_status_t status = meta_sai_validate_ ##ot (&ot[idx], false ); \
721- CHECK_STATUS_SUCCESS_MODE (status, mode); \
716+ CHECK_STATUS_SUCCESS (status); \
722717 sai_object_meta_key_t meta_key = { \
723718 .objecttype = (sai_object_type_t )SAI_OBJECT_TYPE_ ## OT, \
724719 .objectkey = { .key = { .ot = ot[idx] } } \
725720 }; \
726721 vmk.push_back (meta_key); \
727722 status = meta_generic_validation_set (meta_key, &attr_list[idx]); \
728- CHECK_STATUS_SUCCESS_MODE (status, mode); \
723+ CHECK_STATUS_SUCCESS (status); \
729724 } \
730725 auto status = m_implementation->bulkSet (object_count, ot, attr_list, mode, object_statuses); \
731726 for (uint32_t idx = 0 ; idx < object_count; idx++) \
@@ -1211,15 +1206,15 @@ sai_status_t Meta::bulkRemove(
12111206 {
12121207 sai_status_t status = meta_sai_validate_oid (object_type, &object_id[idx], SAI_NULL_OBJECT_ID, false );
12131208
1214- CHECK_STATUS_SUCCESS_MODE (status, mode );
1209+ CHECK_STATUS_SUCCESS (status);
12151210
12161211 sai_object_meta_key_t meta_key = { .objecttype = object_type, .objectkey = { .key = { .object_id = object_id[idx] } } };
12171212
12181213 vmk.push_back (meta_key);
12191214
12201215 status = meta_generic_validation_remove (meta_key);
12211216
1222- CHECK_STATUS_SUCCESS_MODE (status, mode );
1217+ CHECK_STATUS_SUCCESS (status);
12231218 }
12241219
12251220 auto status = m_implementation->bulkRemove (object_type, object_count, object_id, mode, object_statuses);
@@ -1273,15 +1268,15 @@ sai_status_t Meta::bulkSet(
12731268 {
12741269 sai_status_t status = meta_sai_validate_oid (object_type, &object_id[idx], SAI_NULL_OBJECT_ID, false );
12751270
1276- CHECK_STATUS_SUCCESS_MODE (status, mode );
1271+ CHECK_STATUS_SUCCESS (status);
12771272
12781273 sai_object_meta_key_t meta_key = { .objecttype = object_type, .objectkey = { .key = { .object_id = object_id[idx] } } };
12791274
12801275 vmk.push_back (meta_key);
12811276
12821277 status = meta_generic_validation_set (meta_key, &attr_list[idx]);
12831278
1284- CHECK_STATUS_SUCCESS_MODE (status, mode );
1279+ CHECK_STATUS_SUCCESS (status);
12851280 }
12861281
12871282 auto status = m_implementation->bulkSet (object_type, object_count, object_id, attr_list, mode, object_statuses);
@@ -1333,15 +1328,18 @@ sai_status_t Meta::bulkGet(
13331328 {
13341329 sai_status_t status = meta_sai_validate_oid (object_type, &object_id[idx], SAI_NULL_OBJECT_ID, false );
13351330
1336- CHECK_STATUS_SUCCESS_MODE (status, mode );
1331+ CHECK_STATUS_SUCCESS (status);
13371332
13381333 sai_object_meta_key_t meta_key = { .objecttype = object_type, .objectkey = { .key = { .object_id = object_id[idx] } } };
13391334
13401335 vmk.push_back (meta_key);
13411336
13421337 status = meta_generic_validation_get (meta_key, attr_count[idx], attr_list[idx]);
13431338
1344- CHECK_STATUS_SUCCESS_MODE (status, mode);
1339+ // FIXME: This macro returns on failure.
1340+ // When mode is SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR we should continue instead of return.
1341+ // This issue exists for all bulk operations.
1342+ CHECK_STATUS_SUCCESS (status);
13451343 }
13461344
13471345 auto status = m_implementation->bulkGet (object_type, object_count, object_id, attr_count, attr_list, mode, object_statuses);
@@ -1416,7 +1414,7 @@ sai_status_t Meta::bulkCreate(
14161414 {
14171415 sai_status_t status = meta_sai_validate_oid (object_type, &object_id[idx], switchId, true );
14181416
1419- CHECK_STATUS_SUCCESS_MODE (status, mode );
1417+ CHECK_STATUS_SUCCESS (status);
14201418
14211419 // this is create, oid's don't exist yet
14221420
@@ -1426,7 +1424,7 @@ sai_status_t Meta::bulkCreate(
14261424
14271425 status = meta_generic_validation_create (meta_key, switchId, attr_count[idx], attr_list[idx]);
14281426
1429- CHECK_STATUS_SUCCESS_MODE (status, mode );
1427+ CHECK_STATUS_SUCCESS (status);
14301428 }
14311429
14321430 auto status = m_implementation->bulkCreate (object_type, switchId, object_count, attr_count, attr_list, mode, object_id, object_statuses);
0 commit comments