diff --git a/dash-pipeline/SAI/src/dashsai.cpp b/dash-pipeline/SAI/src/dashsai.cpp index bf9c99e18..91d7fad4a 100644 --- a/dash-pipeline/SAI/src/dashsai.cpp +++ b/dash-pipeline/SAI/src/dashsai.cpp @@ -239,7 +239,11 @@ sai_status_t DashSai::createSwitch( for (uint32_t i = 0; i < attr_count; i++) { - DASH_LOG_WARN("attr id %d is NOT IMPLEMENTED, ignored", attr_list[i].id); + auto *md = sai_metadata_get_attr_metadata(SAI_OBJECT_TYPE_SWITCH, attr_list[i].id); + + const char* attrName = md ? md->attridname : "unknown"; + + DASH_LOG_WARN("attr id %d %s is NOT IMPLEMENTED, ignored", attr_list[i].id, attrName); if (attr_list[i].id == SAI_SWITCH_ATTR_SWITCH_HARDWARE_INFO) { @@ -311,6 +315,10 @@ sai_status_t DashSai::setSwitchAttribute( DASH_LOG_ENTER(); DASH_CHECK_API_INITIALIZED(); + auto *md = sai_metadata_get_attr_metadata(SAI_OBJECT_TYPE_SWITCH, attr->id); + + const char* attrName = md ? md->attridname : "unknown"; + switch (attr->id) { case SAI_SWITCH_ATTR_SWITCH_STATE_CHANGE_NOTIFY: @@ -321,13 +329,13 @@ sai_status_t DashSai::setSwitchAttribute( case SAI_SWITCH_ATTR_QUEUE_PFC_DEADLOCK_NOTIFY: case SAI_SWITCH_ATTR_BFD_SESSION_STATE_CHANGE_NOTIFY: - DASH_LOG_NOTICE("setting dummy notification callback (attr id: %d)", attr->id); + DASH_LOG_NOTICE("setting dummy notification callback (attr id: %d %s)", attr->id, attrName); return SAI_STATUS_SUCCESS; default: - DASH_LOG_ERROR("set attr %d NOT IMPLEMENTED", attr->id); + DASH_LOG_ERROR("set attr %d %s NOT IMPLEMENTED", attr->id, attrName); return SAI_STATUS_NOT_IMPLEMENTED; } @@ -714,7 +722,11 @@ sai_status_t DashSai::create( *objectId = m_objectIdManager->allocateNewObjectId(objectType, m_switchId); - DASH_LOG_WARN("creating dummy object for object type %d: 0x%lx", objectType, *objectId); + auto* ot = sai_metadata_get_object_type_info(objectType); + + const char* otName = ot ? ot->objecttypename : "unknown"; + + DASH_LOG_WARN("creating dummy object for object type %d %s: 0x%lx", objectType, otName, *objectId); return SAI_STATUS_SUCCESS; } @@ -745,7 +757,11 @@ sai_status_t DashSai::set( if (objectType == SAI_OBJECT_TYPE_SWITCH) return setSwitchAttribute(objectId, attr); - DASH_LOG_WARN("dummy set: 0x%lx, attr id: %d", objectId, attr->id); + auto *md = sai_metadata_get_attr_metadata(objectType, attr->id); + + const char* attrName = md ? md->attridname : "unknown"; + + DASH_LOG_WARN("dummy set: 0x%lx, attr id: %d %s", objectId, attr->id, attrName); return SAI_STATUS_SUCCESS; } @@ -765,7 +781,11 @@ sai_status_t DashSai::get( if (objectType == SAI_OBJECT_TYPE_SWITCH) return getSwitchAttribute(objectId, attr_count, attr_list); - DASH_LOG_ERROR("not implemented for object type %d", objectType); + auto* ot = sai_metadata_get_object_type_info(objectType); + + const char* otName = ot ? ot->objecttypename : "unknown"; + + DASH_LOG_ERROR("not implemented for object type %d %s", objectType, otName); return SAI_STATUS_NOT_IMPLEMENTED; }