-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sairedis/syncd] Implement bulk get support #1509
base: master
Are you sure you want to change the base?
Changes from 6 commits
34ea88b
2fcdd29
e4b0f58
65c38b7
922068e
1c8389e
2989f1a
a6b72e3
ea6740f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1280,9 +1280,57 @@ | |
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
SWSS_LOG_ERROR("not implemented, FIXME"); | ||
PARAMETER_CHECK_IF_NOT_NULL(object_statuses); | ||
|
||
return SAI_STATUS_NOT_IMPLEMENTED; | ||
for (uint32_t idx = 0; idx < object_count; idx++) | ||
{ | ||
object_statuses[idx] = SAI_STATUS_NOT_EXECUTED; | ||
} | ||
|
||
PARAMETER_CHECK_OBJECT_TYPE_VALID(object_type); | ||
PARAMETER_CHECK_POSITIVE(object_count); | ||
PARAMETER_CHECK_IF_NOT_NULL(attr_count); | ||
PARAMETER_CHECK_IF_NOT_NULL(attr_list); | ||
|
||
if (sai_metadata_get_enum_value_name(&sai_metadata_enum_sai_bulk_op_error_mode_t, mode) == nullptr) | ||
{ | ||
SWSS_LOG_ERROR("mode value %d is not in range on %s", mode, sai_metadata_enum_sai_bulk_op_error_mode_t.name); | ||
|
||
return SAI_STATUS_INVALID_PARAMETER; | ||
} | ||
|
||
std::vector<sai_object_meta_key_t> vmk; | ||
|
||
for (uint32_t idx = 0; idx < object_count; idx++) | ||
{ | ||
sai_status_t status = meta_sai_validate_oid(object_type, &object_id[idx], SAI_NULL_OBJECT_ID, false); | ||
|
||
CHECK_STATUS_SUCCESS(status); | ||
|
||
sai_object_meta_key_t meta_key = { .objecttype = object_type, .objectkey = { .key = { .object_id = object_id[idx] } } }; | ||
|
||
vmk.push_back(meta_key); | ||
|
||
status = meta_generic_validation_get(meta_key, attr_count[idx], attr_list[idx]); | ||
|
||
// FIXME: This macro returns on failure. | ||
// When mode is SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR we should continue instead of return. | ||
// This issue exists for all bulk operations. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we fix it here for this api ? since GET operation is specific, so maybe some attributes maybe not implemented and they will definitely return failure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please clarify? Attribute may be not implemented with SET as well. |
||
CHECK_STATUS_SUCCESS(status); | ||
} | ||
|
||
auto status = m_implementation->bulkGet(object_type, object_count, object_id, attr_count, attr_list, mode, object_statuses); | ||
|
||
for (uint32_t idx = 0; idx < object_count; idx++) | ||
{ | ||
if (object_statuses[idx] == SAI_STATUS_SUCCESS) | ||
{ | ||
sai_object_id_t switch_id = switchIdQuery(object_id[idx]); | ||
meta_generic_validation_post_get(vmk[idx], switch_id, attr_count[idx], attr_list[idx]); | ||
} | ||
} | ||
|
||
return status; | ||
} | ||
|
||
sai_status_t Meta::bulkCreate( | ||
|
Check notice
Code scanning / CodeQL
FIXME comment Note