diff --git a/lib/inc/sairedis.h b/lib/inc/sairedis.h index 514c930374f9..e70a03ad759d 100644 --- a/lib/inc/sairedis.h +++ b/lib/inc/sairedis.h @@ -95,7 +95,7 @@ typedef enum _sai_redis_switch_attr_t * to ".n" suffix, and when we reopen file, we will actually create new * one. * - * This attribute is only setting variable in memroy, it's safe to call + * This attribute is only setting variable in memory, it's safe to call * this from signal handler. * * @type bool diff --git a/lib/src/sai_redis_generic_create.cpp b/lib/src/sai_redis_generic_create.cpp index 5cba3362d44b..33092c365f96 100644 --- a/lib/src/sai_redis_generic_create.cpp +++ b/lib/src/sai_redis_generic_create.cpp @@ -93,7 +93,7 @@ sai_object_type_t sai_object_type_query( SWSS_LOG_ERROR("invalid object id 0x%lx", object_id); /* - * We can't throw here, since it would give no meaningfull message. + * We can't throw here, since it would give no meaningful message. * Throwing at one level up is better. */ @@ -356,7 +356,7 @@ sai_status_t internal_redis_bulk_generic_create( } /* - * We are adding number of entries to actualy add ':' to be compatible + * We are adding number of entries to actually add ':' to be compatible * with previous */ @@ -372,7 +372,7 @@ sai_status_t internal_redis_bulk_generic_create( } /* - * Capital 'C' stads for bulk CREATE operation. + * Capital 'C' stands for bulk CREATE operation. */ recordLine("C|" + str_object_type + joined); diff --git a/lib/src/sai_redis_generic_get.cpp b/lib/src/sai_redis_generic_get.cpp index e794848927b9..0c79293dc51d 100644 --- a/lib/src/sai_redis_generic_get.cpp +++ b/lib/src/sai_redis_generic_get.cpp @@ -23,7 +23,7 @@ sai_status_t internal_redis_get_process( sai_deserialize_status(str_sai_status, status); - // we could deserialize directly to user data, but list is alocated by deserializer + // we could deserialize directly to user data, but list is allocated by deserializer if (status == SAI_STATUS_SUCCESS) { SaiAttributeList list(object_type, values, false); @@ -117,7 +117,7 @@ void clear_oid_values( default: /* - * If in futre new attribute with object id will be added this + * If in future new attribute with object id will be added this * will make sure that we will need to add handler here. */ @@ -155,7 +155,7 @@ sai_status_t internal_redis_generic_get( /* * Since user may reuse buffers, then oid list buffers maybe not cleared - * and contain som garbage, let's clean them so we send all oids as null to + * and contain some garbage, let's clean them so we send all oids as null to * syncd. */ diff --git a/lib/src/sai_redis_generic_remove.cpp b/lib/src/sai_redis_generic_remove.cpp index 631438524bbd..372aa2f47f97 100644 --- a/lib/src/sai_redis_generic_remove.cpp +++ b/lib/src/sai_redis_generic_remove.cpp @@ -102,7 +102,7 @@ sai_status_t internal_redis_bulk_generic_remove( } /* - * We are adding number of entries to actualy add ':' to be compatible + * We are adding number of entries to actually add ':' to be compatible * with previous */ @@ -118,7 +118,7 @@ sai_status_t internal_redis_bulk_generic_remove( } /* - * Capital 'C' stads for bulk CREATE operation. + * Capital 'C' stands for bulk CREATE operation. */ recordLine("C|" + str_object_type + joined); diff --git a/lib/src/sai_redis_generic_set.cpp b/lib/src/sai_redis_generic_set.cpp index 14904d4218f8..1bd7ad80eb56 100644 --- a/lib/src/sai_redis_generic_set.cpp +++ b/lib/src/sai_redis_generic_set.cpp @@ -81,7 +81,7 @@ sai_status_t internal_redis_bulk_generic_set( } /* - * We are adding number of entries to actualy add ':' to be compatible + * We are adding number of entries to actually add ':' to be compatible * with previous */ @@ -97,7 +97,7 @@ sai_status_t internal_redis_bulk_generic_set( } /* - * Capital 'S' stads for bulk SET operation. + * Capital 'S' stands for bulk SET operation. */ recordLine("S|" + str_object_type + joined); diff --git a/lib/src/sai_redis_interfacequery.cpp b/lib/src/sai_redis_interfacequery.cpp index b39cde4bce38..42284dbadbf6 100644 --- a/lib/src/sai_redis_interfacequery.cpp +++ b/lib/src/sai_redis_interfacequery.cpp @@ -42,7 +42,7 @@ void clear_local_state() clear_notifications(); /* - * Initialize metatada database. + * Initialize metadata database. */ meta_init_db(); diff --git a/lib/src/sai_redis_record.cpp b/lib/src/sai_redis_record.cpp index 0931d3059392..45b525ce070d 100644 --- a/lib/src/sai_redis_record.cpp +++ b/lib/src/sai_redis_record.cpp @@ -37,7 +37,7 @@ void logfileReopen() /* * On log rotate we will use the same file name, we are assuming that - * logrotate deamon move filename to filename.1 and we will create new + * logrotate daemon move filename to filename.1 and we will create new * empty file here. */ diff --git a/meta/sai_extra_acl.cpp b/meta/sai_extra_acl.cpp index 58fd6150640d..fd5dc285c834 100644 --- a/meta/sai_extra_acl.cpp +++ b/meta/sai_extra_acl.cpp @@ -162,7 +162,7 @@ sai_status_t meta_pre_get_acl_entry_attribute( { SWSS_LOG_ENTER(); - // TODO for get we need to check if attrib was set previously ? + // TODO for get we need to check if attribute was set previously ? // like field or action, or can we get action that was not set? return SAI_STATUS_SUCCESS; diff --git a/meta/sai_extra_buffer.cpp b/meta/sai_extra_buffer.cpp index 37b7e207c9ea..8b9269760326 100644 --- a/meta/sai_extra_buffer.cpp +++ b/meta/sai_extra_buffer.cpp @@ -44,7 +44,7 @@ sai_status_t meta_pre_create_buffer_profile( SWSS_LOG_ENTER(); // TODO extra logic on checking profile buffer size may be needed - // TODO we need to query other attribute pool id assigned and check wheter mode is dynamic/static + // TODO we need to query other attribute pool id assigned and check whether mode is dynamic/static const sai_attribute_t* attr_shared_dynamic_th = get_attribute_by_id(SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH, attr_count, attr_list); @@ -80,7 +80,7 @@ sai_status_t meta_pre_set_buffer_profile_attr( { SWSS_LOG_ENTER(); - // TODO on set, changing buffer pool on profiles should noe be possible + // TODO on set, changing buffer pool on profiles should not be possible // to change dynamic to static on the fly // pool_id on profile should be create_only ? diff --git a/meta/sai_extra_mirror.cpp b/meta/sai_extra_mirror.cpp index e953a58d2e39..d9d3ea0a2541 100644 --- a/meta/sai_extra_mirror.cpp +++ b/meta/sai_extra_mirror.cpp @@ -57,7 +57,7 @@ sai_status_t meta_pre_set_mirror_session_attribute( // TODO we need to type to decide which parameters are safe to set // SAI_MIRROR_SESSION_ATTR_MONITOR_PORT: // TODO should changing port during mirror session should be possible ? - // what if new port is somehow incompattible with current session? + // what if new port is somehow incompatible with current session? // SAI_MIRROR_SESSION_ATTR_GRE_PROTOCOL_TYPE: // TODO validate GRE protocol return is_header_version_ok(1, attr); diff --git a/meta/sai_extra_schedulergroup.cpp b/meta/sai_extra_schedulergroup.cpp index ca3baa4c04d2..9d9f7d189b56 100644 --- a/meta/sai_extra_schedulergroup.cpp +++ b/meta/sai_extra_schedulergroup.cpp @@ -19,7 +19,7 @@ sai_status_t meta_pre_create_scheduler_group( return SAI_STATUS_INVALID_PARAMETER; } - // TODO level will require some additional validation to not crete loops + // TODO level will require some additional validation to not create loops uint8_t max_childs = attr_max_childs->value.u8; diff --git a/meta/sai_extra_tunnel.cpp b/meta/sai_extra_tunnel.cpp index 3a12f19bfe9e..b50909a4e248 100644 --- a/meta/sai_extra_tunnel.cpp +++ b/meta/sai_extra_tunnel.cpp @@ -77,10 +77,10 @@ sai_status_t meta_pre_create_tunnel( // TODO for GRE/VXLAN it may be different type (router interface, overlay/underlay // // TODO validate object on that list! if they exist - // shoud this list contain at least 1 element ? or can it be empty? + // should this list contain at least 1 element ? or can it be empty? // check for duplicates on list ? - ecn mappers - // TODO sai spec is inconsisten here, if this is mandatory attribute on some condition, + // TODO sai spec is inconsistent here, if this is mandatory attribute on some condition, // then it cannot have default value, dscp mode and ttl mode return SAI_STATUS_SUCCESS; @@ -145,7 +145,7 @@ sai_status_t meta_pre_create_tunnel_term_table_entry ( // TODO check is this conditional attribute, maybe this action is only // required for ip in ip tunnel types - // TODO additional checks may be required sinec this action tunnel id is used for + // TODO additional checks may be required since this action tunnel id is used for // decap so maybe this tunnel must have special attributes on creation set return SAI_STATUS_SUCCESS; diff --git a/meta/sai_extra_udf.cpp b/meta/sai_extra_udf.cpp index a9e0695da87a..dc1ab73dd6f0 100644 --- a/meta/sai_extra_udf.cpp +++ b/meta/sai_extra_udf.cpp @@ -9,7 +9,7 @@ sai_status_t meta_pre_create_udf( SWSS_LOG_ENTER(); // TODO validate offset value range - // TODO length must be quual to group attr length ? + // TODO length must be equal to group attr length ? // TODO extra validation may be required here on mask return SAI_STATUS_SUCCESS; diff --git a/meta/sai_extra_wred.cpp b/meta/sai_extra_wred.cpp index ded0024ba989..bf92e763199c 100644 --- a/meta/sai_extra_wred.cpp +++ b/meta/sai_extra_wred.cpp @@ -40,7 +40,7 @@ sai_status_t meta_pre_create_wred_profile( // green_min < green_max < yellow_min < yellow_max < red_min < red_max // This logic will be required also inside SET, so - // TODO need to be obrained from switch, also will be required during set + // TODO need to be obtained from switch, also will be required during set uint32_t max_buffer_size = 0x10000; // is this SAI_SWITCH_ATTR_TOTAL_BUFFER_SIZE ? // TODO change numbers to defines diff --git a/meta/sai_meta.cpp b/meta/sai_meta.cpp index fbd3f76a9f55..b7b094cdff59 100644 --- a/meta/sai_meta.cpp +++ b/meta/sai_meta.cpp @@ -83,7 +83,7 @@ static bool meta_unittests_get_and_erase_set_readonly_flag( if (!unittests_enabled) { - // explicityly to not produce false alarms + // explicitly to not produce false alarms SWSS_LOG_NOTICE("unittests are not enabled"); return false; } @@ -192,8 +192,8 @@ class SaiAttrWrapper SWSS_LOG_ENTER(); /* - * On destructor we need to call free to dealocate possible - * alocated list on constructor. + * On destructor we need to call free to deallocate possible + * allocated list on constructor. */ sai_deserialize_free_attribute_value(m_meta->attrvaluetype, m_attr); @@ -220,7 +220,7 @@ std::string get_attr_info(const sai_attr_metadata_t& md) /* * Attribute name will contain object type as well so we don't need to - * serialize object type separatly. + * serialize object type separately. */ return std::string(md.attridname) + ":" + sai_serialize_attr_value_type(md.attrvaluetype); @@ -596,7 +596,7 @@ sai_status_t meta_generic_validation_objlist( } /* - * We need oids set and object type to check whehter oids are not repeated + * We need oids set and object type to check whether oids are not repeated * on list and whether all oids are same object type. */ @@ -741,7 +741,7 @@ std::string construct_key( SWSS_LOG_ENTER(); /* - * Use map to make sure that keys will be always sorded by id. + * Use map to make sure that keys will be always sorted by id. */ std::map keys; @@ -878,9 +878,9 @@ sai_status_t meta_generic_validate_non_object_on_create( /* * Since non object id objects can contain several object id's inside - * object id strucutre, we need to check whether they all belong to the + * object id structure, we need to check whether they all belong to the * same switch (sine multiple switches can be present and whether all those - * objects are allowd respectivly on their members. + * objects are allowed respectively on their members. * * This check is required only on creation, since on set/get/remove we * check in object hash whether this object exists. @@ -894,7 +894,7 @@ sai_status_t meta_generic_validate_non_object_on_create( } /* - * This will be most utilzed for createing route entries. + * This will be most utilized for creating route entries. */ for (size_t j = 0; j < info->structmemberscount; ++j) @@ -1075,7 +1075,7 @@ sai_status_t meta_generic_validation_create( bool haskeys = false; - // check each attribute separetly + // check each attribute separately for (uint32_t idx = 0; idx < attr_count; ++idx) { const sai_attribute_t* attr = &attr_list[idx]; @@ -1468,7 +1468,7 @@ sai_status_t meta_generic_validation_create( return SAI_STATUS_FAILURE; } - // check if all mandatory attrributes were passed + // check if all mandatory attributes were passed for (auto mdp: metadata) { @@ -1588,7 +1588,7 @@ sai_status_t meta_generic_validation_create( { const auto& c = *md.conditions[index]; - // condtions may only be on the same object type + // conditions may only be on the same object type const auto& cmd = *sai_metadata_get_attr_metadata(meta_key.objecttype, c.attrid); const sai_attribute_value_t* cvalue = cmd.defaultvalue; @@ -1749,7 +1749,7 @@ sai_status_t meta_generic_validation_remove( { /* * We allow to remove switch object even if there are ROUTE_ENTRY - * created and refrencing this switch, since remove could be used + * created and referencing this switch, since remove could be used * in WARM boot scenario. */ @@ -2255,7 +2255,7 @@ sai_status_t meta_generic_validation_get( * attribute also oid, and then did a "set" on that value, and now * reference is not decreased since previous oid was not snooped. * - * TODO This concearn all attributes not only conditionals + * TODO This concern all attributes not only conditionals * * If attribute is conditional, we need to check if condition is * met, if not then this attribute is not mandatory so we can @@ -3180,7 +3180,7 @@ void meta_generic_validation_post_get_objlist( * when we doing get on acl field/action. But none of those are created * internally by switch. * - * TODO Similar stuff is with SET, when we will set oid obejct on existing + * TODO Similar stuff is with SET, when we will set oid object on existing * switch object, but we will not have it's previous value. We can check * whether default value is present and it's const NULL. */ @@ -3249,7 +3249,7 @@ void meta_generic_validation_post_get_objlist( if (!object_reference_exists(oid)) { // NOTE: there may happen that user will request multiple object lists - // and first list was retrived ok, but second failed with overflow + // and first list was retrieved ok, but second failed with overflow // then we may forget to snoop META_LOG_INFO(md, "returned get object on list [%u] oid 0x%lx object type %d does not exists in local DB (snoop)", i, oid, ot); @@ -3297,7 +3297,7 @@ void meta_generic_validation_post_get( switch_id = meta_extract_switch_id(meta_key, switch_id); /* - * TODO We should snoop attributes retrived from switch and put them to + * TODO We should snoop attributes retrieved from switch and put them to * local db if they don't exist since if attr is oid it may lead to * inconsistency when counting reference */ diff --git a/meta/sai_meta.h b/meta/sai_meta.h index e32d867e9ec5..aa6bf65aebf3 100644 --- a/meta/sai_meta.h +++ b/meta/sai_meta.h @@ -152,19 +152,19 @@ void meta_unittests_enable( _In_ bool enable); /** - * @brief Indicates whethre unittests are enabled; + * @brief Indicates whether unittests are enabled; */ bool meta_unittests_enabled(); /** - * @bried Allow to perform SET operation on READ_ONLY attribue only once. + * @brief Allow to perform SET operation on READ_ONLY attribute only once. * * This function relaxes metadata checking on SET operation, it allows to * perform SET api on READ_ONLY attribute only once on specific object type and - * specific attribue. + * specific attribute. * * Once means that SET operation is only relaxed for the very next SET call on - * that specific object type and attrirbute id. + * that specific object type and attribute id. * * Function is explicitly named ONCE, since it will force test developer to not * forget that SET check is relaxed, and not forget for future unittests. @@ -186,7 +186,7 @@ bool meta_unittests_enabled(); * It can be dangerous to set any readonly attribute to different values since * internal metadata logic maybe using that value and in some cases metadata * database may get out of sync and cause unexpected results in api calls up to - * application carash. + * application crash. * * This function is not thread safe. * diff --git a/meta/sai_serialize.h b/meta/sai_serialize.h index 5b2c8ccb0b21..cd7cda5cd864 100644 --- a/meta/sai_serialize.h +++ b/meta/sai_serialize.h @@ -138,7 +138,7 @@ std::string sai_serialize_ipmc_entry_type( std::string sai_serialize_qos_map_item( _In_ const sai_qos_map_t& qosmap); -// serialize ntf +// serialize notifications std::string sai_serialize_fdb_event_ntf( _In_ uint32_t count, @@ -230,7 +230,7 @@ void sai_deserialize_object_meta_key( _In_ const std::string &s, _Out_ sai_object_meta_key_t& meta_key); -// deserialize ntf +// deserialize notifications void sai_deserialize_fdb_event_ntf( _In_ const std::string& s, @@ -253,7 +253,7 @@ void sai_deserialize_free_attribute_value( _In_ const sai_attr_value_type_t type, _In_ sai_attribute_t &attr); -// deserialize free ntf +// deserialize free notifications void sai_deserialize_free_fdb_event_ntf( _In_ uint32_t count, diff --git a/meta/saiserialize.cpp b/meta/saiserialize.cpp index 79f03adda42a..2b1688c09c92 100644 --- a/meta/saiserialize.cpp +++ b/meta/saiserialize.cpp @@ -2656,7 +2656,7 @@ void sai_deserialize_object_meta_key( } -// deserialize ntf +// deserialize notifications void sai_deserialize_json_fdb_event_notification_data( _In_ const json& j, @@ -2876,7 +2876,7 @@ void sai_deserialize_free_attribute_value( } } -// deserialize free ntf +// deserialize free notifications void sai_deserialize_free_fdb_event( _In_ sai_fdb_event_notification_data_t& fdb_event) diff --git a/meta/tests.cpp b/meta/tests.cpp index b267d4af83f5..b5330500b57a 100644 --- a/meta/tests.cpp +++ b/meta/tests.cpp @@ -2093,7 +2093,7 @@ void test_route_entry_create() SWSS_LOG_NOTICE("create tests"); - // commneted out as there is no mandatory attribute + // commented out as there is no mandatory attribute // SWSS_LOG_NOTICE("zero attribute count (but there are mandatory attributes)"); // attr.id = SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID; // status = meta_sai_create_route_entry(&route_entry, 0, &attr, &dummy_success_sai_create_route_entry); diff --git a/saidiscovery/saidiscovery.cpp b/saidiscovery/saidiscovery.cpp index c55e3500d448..ef627b7c28d3 100644 --- a/saidiscovery/saidiscovery.cpp +++ b/saidiscovery/saidiscovery.cpp @@ -55,13 +55,13 @@ typedef std::chrono::duration> second_t; * @brief Discover all objects on given object ID. * * This method is only good after switch init since we are making - * assumptions that tere are no user created objects after initialization, - * like ACL and other obejct's we can discover using this approach. If - * vendor wil support sai_get_object_count and sai_get_object_key then + * assumptions that there are no user created objects after initialization, + * like ACL and other objects we can discover using this approach. If + * vendor will support sai_get_object_count and sai_get_object_key then * alter on we can use those methods. * * @param[in] id Object ID to be examined. - * @param[inout] discovered Map of already discovered obejcts. Map will be + * @param[inout] discovered Map of already discovered objects. Map will be * updated if new object will be found. * * @return Number of calls performed to SAI. @@ -242,7 +242,7 @@ int discover( (md->objecttype == SAI_OBJECT_TYPE_PORT && md->attrid == SAI_PORT_ATTR_GLOBAL_FLOW_CONTROL_MODE) || (md->objecttype == SAI_OBJECT_TYPE_SWITCH && md->attrid == SAI_SWITCH_ATTR_INIT_SWITCH)) { - // woakaround since return invalid values + // workaround since return invalid values continue; } @@ -637,7 +637,7 @@ int main(int argc, char **argv) double duration = std::chrono::duration_cast(end - m_start).count(); - SWSS_LOG_NOTICE("discovered obejcts: %zu took %.3lf sec, call count: %d", + SWSS_LOG_NOTICE("discovered objects: %zu took %.3lf sec, call count: %d", discovered.size(), duration, callCount); std::map map; diff --git a/saiplayer/saiplayer.cpp b/saiplayer/saiplayer.cpp index f57fbf348515..4f527cd925dd 100644 --- a/saiplayer/saiplayer.cpp +++ b/saiplayer/saiplayer.cpp @@ -18,9 +18,9 @@ extern "C" { #include /* - * Since this is player, we record actions from orch agent. No special case + * Since this is player, we record actions from orchagent. No special case * should be needed for switch in case it contains some oid values (like in - * syncd cold restart) since orch agent should never create switch with oid + * syncd cold restart) since orchagent should never create switch with oid * values set at creation time. */ @@ -928,7 +928,7 @@ sai_status_t handle_bulk_route( if (status != SAI_STATUS_SUCCESS) { /* - * Entire API failes, so no need to compare statuses. + * Entire API fails, so no need to compare statuses. */ return status; @@ -940,7 +940,7 @@ sai_status_t handle_bulk_route( { /* * If recorded statuses are different than received, throw - * excetion since data don't match. + * exception since data don't match. */ SWSS_LOG_THROW("recorded status is %s but returned is %s on %s", @@ -981,7 +981,7 @@ void processBulk( // timestamp|action|objecttype||objectid|attrid=value|...|status||objectid||objectid|attrid=value|...|status||... auto fields = tokenize(line, "||"); - auto first = fields.at(0); // timestamp|acion|objecttype + auto first = fields.at(0); // timestamp|action|objecttype std::string str_object_type = swss::tokenize(first, '|').at(2); diff --git a/syncd/syncd.cpp b/syncd/syncd.cpp index e359750d1a6e..0c0ced12693e 100644 --- a/syncd/syncd.cpp +++ b/syncd/syncd.cpp @@ -44,10 +44,10 @@ std::shared_ptr notifications; std::map gProfileMap; /** - * @brief Contais map of all created switches. + * @brief Contains map of all created switches. * - * This syncd implementation supports only one switch but it's writeen in - * a way that could be excented to use multple switches in t he future, some + * This syncd implementation supports only one switch but it's written in + * a way that could be extended to use multiple switches in the future, some * refactoring needs to be made in marked places. * * To support multiple switches VIDTORID and RIDTOVID db entries needs to be @@ -164,7 +164,7 @@ void sai_diag_shell( sai_status_t status; /* - * This is currently blocking API on broadcom, it will block untill we exit + * This is currently blocking API on broadcom, it will block until we exit * shell. */ @@ -304,7 +304,7 @@ sai_object_id_t redis_create_virtual_object_id( /* * Switch id is deterministic and it comes from sairedis so make check here - * that we will not use this for createing switch VIDs. + * that we will not use this for creating switch VIDs. */ if (object_type == SAI_OBJECT_TYPE_SWITCH) @@ -351,7 +351,7 @@ void remove_rid_and_vid_from_local( } /* - * This method will create VID for actual RID retrived from device when doing + * This method will create VID for actual RID retrieved from device when doing * GET api and snooping while in init view mode. * * This function should not be used to create VID for SWITCH object type. @@ -430,7 +430,7 @@ sai_object_id_t translate_rid_to_vid( /* * TODO: This must be ATOMIC. * - * TODO: To support multiple swiches we need this map per switch; + * TODO: To support multiple switches we need this map per switch; */ g_redisClient->hset(RIDTOVID, str_rid, str_vid); @@ -471,7 +471,7 @@ void translate_rid_to_vid_list( * We receive real id's here, if they are new then create new VIDs for them * and put in db, if entry exists in db, use it. * - * NOTE: switch_id is VID of switch on which those RIDs are probided. + * NOTE: switch_id is VID of switch on which those RIDs are provided. */ for (uint32_t i = 0; i < attr_count; i++) @@ -524,7 +524,7 @@ void translate_rid_to_vid_list( default: /* - * If in futre new attribute with object id will be added this + * If in future new attribute with object id will be added this * will make sure that we will need to add handler here. */ @@ -600,7 +600,7 @@ sai_object_id_t translate_vid_to_rid( /* * We got this RID from redis db, so put it also to local db so it will be - * faster to retrive it late on. + * faster to retrieve it late on. */ local_vid_to_rid[vid] = rid; @@ -677,7 +677,7 @@ void translate_vid_to_rid_list( default: /* - * If in futre new attribute with object id will be added this + * If in future new attribute with object id will be added this * will make sure that we will need to add handler here. */ @@ -729,7 +729,7 @@ void snoop_get_oid( if (vid == SAI_NULL_OBJECT_ID) { /* - * If snooped ois is NULL then we don't need take any action. + * If snooped oid is NULL then we don't need take any action. */ return; @@ -737,8 +737,8 @@ void snoop_get_oid( /* * We need use redis version of object type query here since we are - * operating on VID value, and syncd is compiled agains real SAI - * implementation which has diffrent function sai_object_type_query. + * operating on VID value, and syncd is compiled against real SAI + * implementation which has different function sai_object_type_query. */ sai_object_type_t object_type = redis_sai_object_type_query(vid); @@ -840,7 +840,7 @@ void snoop_get_response( default: /* - * If in futre new attribute with object id will be added this + * If in future new attribute with object id will be added this * will make sure that we will need to add handler here. */ @@ -1064,7 +1064,7 @@ void on_switch_create( } /* - * All needed data to populate switch schould be obtained inside SaiSwitch + * All needed data to populate switch should be obtained inside SaiSwitch * constructor, like getting all queues, ports, etc. */ @@ -1083,7 +1083,7 @@ void on_switch_remove( SWSS_LOG_ENTER(); /* - * On remove switch there should be extra action all local obejcts and + * On remove switch there should be extra action all local objects and * redis object should be removed on remove switch local and redis db * objects should be cleared. * @@ -1099,7 +1099,7 @@ void on_switch_remove( /** * @brief Determines whether attribute is "workaround" attribute for SET API. * - * Some attributes are not supported on SET API od different platforms. + * Some attributes are not supported on SET API on different platforms. * For example SAI_SWITCH_ATTR_SRC_MAC_ADDRESS. * * @param[in] objecttype Object type. @@ -1160,7 +1160,7 @@ sai_status_t handle_generic( meta_key.objectkey.key.object_id = object_id; /* - * We need to do translate vid/rid except for create, sinec create will + * We need to do translate vid/rid except for create, since create will * create new RID value, and we will have to map them to VID we received in * create query. */ @@ -1361,7 +1361,6 @@ void translate_vid_to_rid_non_object_id( { SWSS_LOG_ENTER(); - // TODO use metadat utils auto info = sai_metadata_get_object_type_info(meta_key.objecttype); for (size_t j = 0; j < info->structmemberscount; ++j) @@ -1696,7 +1695,7 @@ sai_status_t notifySyncd( clearTempView(); /* - * TODO: Currently as WARN to be easier to spoot, later should be NOTICE. + * TODO: Currently as WARN to be easier to spot, later should be NOTICE. */ SWSS_LOG_WARN("syncd switched to INIT VIEW mode, all op will be saved to TEMP view"); @@ -1708,7 +1707,7 @@ sai_status_t notifySyncd( g_asicInitViewMode = false; /* - * TODO: Currently as WARN to be easier to spoot, later should be NOTICE. + * TODO: Currently as WARN to be easier to spot, later should be NOTICE. */ SWSS_LOG_WARN("syncd received APPLY VIEW, will translate"); @@ -1720,7 +1719,7 @@ sai_status_t notifySyncd( if (status == SAI_STATUS_SUCCESS) { /* - * We succesfully applied new view, VID mapping could change, so we + * We successfully applied new view, VID mapping could change, so we * need to clear local db, and all new VIDs will be queried using * redis. */ @@ -1731,7 +1730,7 @@ sai_status_t notifySyncd( else { /* - * Apply view failed. It can fail in 2 ways, eather nothing was + * Apply view failed. It can fail in 2 ways, ether nothing was * executed, on asic, or asic is inconsistent state then we should * die or hang */ @@ -1886,7 +1885,7 @@ void on_switch_create_in_init_view( /* * We can have multiple switches here, but each switch is identified by * SAI_SWITCH_ATTR_SWITCH_HARDWARE_INFO. This attribute is treated as key, - * so each switch will have diferent hardware info. + * so each switch will have different hardware info. * * Currently we assume that we have only one switch. * @@ -1894,15 +1893,15 @@ void on_switch_create_in_init_view( * * - we have multiple switches already existing, and in init view mode user * will create the same switches, then since switch id are deterministic - * we can match them byt hardware info and by switch id, it may happen + * we can match them by hardware info and by switch id, it may happen * that switch id will be different if user will create switches in * different order, this case will be not supported unless special logic * will be written to handle that case. * - * - if user creted switches but non of switch has the same hardware info + * - if user created switches but non of switch has the same hardware info * then it means we need to create actual switch here, since user will - * want to query switch ports etc values, thats why on create switch is - * special case, and thats why we need to keep track of all switches + * want to query switch ports etc values, that's why on create switch is + * special case, and that's why we need to keep track of all switches * * Since we are creating switch here, we are sure that this switch don't * have any oid attributes set, so we can pass all attributes @@ -1911,7 +1910,7 @@ void on_switch_create_in_init_view( /* * Multiple switches scenario with changed order: * - * Ff orhagent will create the same switch with the same hardware info but + * If orchagent will create the same switch with the same hardware info but * with different order since switch id is deterministic, then VID of both * switches will not match: * @@ -1928,7 +1927,7 @@ void on_switch_create_in_init_view( * There are no switches currently, so we need to create this switch so * user in init mode could query switch properties using GET api. * - * We assume that none of attributes is obejct id attribute. + * We assume that none of attributes is object id attribute. * * This scenario can happen when you start syncd on empty database and * then you quit and restart it again. @@ -2105,7 +2104,7 @@ sai_status_t processEventInInitViewMode( if (!info->isnonobjectid) { /* - * If object is existing obejct (like bridge port, vlan member) + * If object is existing object (like bridge port, vlan member) * user may want to remove them, but this is temporary view, * and when we receive apply view, we will populate existing * objects to temporary view (since not all of them user may @@ -2188,7 +2187,7 @@ sai_status_t processEventInInitViewMode( if (switches.size() == 1) { /* - * We are in init view mode, but eather switch already + * We are in init view mode, but ether switch already * existed or first command was creating switch and user * created switch. * @@ -2348,7 +2347,7 @@ sai_status_t processBulkEvent( const std::vector &values = kfvFieldsValues(kco); // key = str_object_id - // val = attrid=attrval|... + // val = attrid=attrvalue|... std::vector object_ids; @@ -2464,7 +2463,7 @@ sai_status_t processFdbFlush( /* * Attribute list can't be const since we will use it to translate VID to - * RID inplace. + * RID in place. */ sai_attribute_t *attr_list = list.get_attr_list(); @@ -2498,7 +2497,7 @@ sai_status_t processEvent( { /* * In init mode we put all data to TEMP view and we snoop. We need to - * specify temporary view prefis in consumer since consumer puts data + * specify temporary view prefix in consumer since consumer puts data * to redis db. */ @@ -2593,7 +2592,7 @@ sai_status_t processEvent( /* * Attribute list can't be const since we will use it to translate VID to - * RID inplace. + * RID in place. */ sai_attribute_t *attr_list = list.get_attr_list(); @@ -2608,7 +2607,7 @@ sai_status_t processEvent( if (object_type == SAI_OBJECT_TYPE_SWITCH && (api == SAI_COMMON_API_CREATE || api == SAI_COMMON_API_SET)) { /* - * We don't need to clear those pointers on switch remove (evan last), + * We don't need to clear those pointers on switch remove (even last), * since those pointers will reside inside attributes, also sairedis * will internally check whether pointer is null or not, so we here * will receive all notifications, but redis only those that were set. @@ -3342,7 +3341,7 @@ void onSyncdStart(bool warmStart) * Also this will make sure that current switch id is the same as * before restart. * - * If we want to support multiple switches, this needs to be addjusted. + * If we want to support multiple switches, this needs to be adjusted. */ performWarmRestart(); @@ -3378,7 +3377,7 @@ void sai_meta_log_syncd( _In_ const char *format, ...) { - // SWSS_LOG_ENTER() is ommited since this is logging for metadata + // SWSS_LOG_ENTER() is omitted since this is logging for metadata char buffer[0x1000]; @@ -3462,7 +3461,7 @@ int syncd_main(int argc, char **argv) std::shared_ptr flexCounterGroup = std::make_shared(dbFlexCounter.get(), FLEX_COUNTER_GROUP_TABLE); /* - * At the end we cant use producer consumer concept since if one proces + * At the end we cant use producer consumer concept since if one process * will restart there may be something in the queue also "remove" from * response queue will also trigger another "response". */ @@ -3570,7 +3569,7 @@ int syncd_main(int argc, char **argv) /* * This is actual a bad design, since selectable may pick up * multiple events from the queue, and after restart those - * events will be forgoten since they were consumed already and + * events will be forgotten since they were consumed already and * this may lead to forget populate object table which will * lead to unable to find some objects. */ diff --git a/syncd/syncd_applyview.cpp b/syncd/syncd_applyview.cpp index d1205b11719e..a0dbb8fea45b 100644 --- a/syncd/syncd_applyview.cpp +++ b/syncd/syncd_applyview.cpp @@ -635,7 +635,7 @@ class AsicView } /** - * @brief Release existing VID links (references) based on given obejct. + * @brief Release existing VID links (references) based on given object. * * All OID attributes will be scanned and released. * @@ -729,9 +729,9 @@ class AsicView } /** - * @brief Bind existing VID links (references) based on given obejct. + * @brief Bind existing VID links (references) based on given object. * - * All OID attributes will be scanned and binded. + * All OID attributes will be scanned and bound. * * @param[in] obj Object which will be used to obtain attributes and oids */ @@ -1335,7 +1335,7 @@ class AsicView * and group is in use by some route, then remove fails since * group cant be empty. * - * Of course this does'nt guarantee that remove all routes will + * Of course this doesn't guarantee that remove all routes will * be at the beginning, also it may happen that default route * will be removed first which maybe not allowed. */ @@ -1441,7 +1441,7 @@ class AsicView /* * This last operation id that decreased VID reference to zero * can be before or after current iterator, so it may be not - * found on list from curernt iterator to list end. This will + * found on list from current iterator to list end. This will * mean that we can insert this remove at current iterator * position. * @@ -1577,7 +1577,7 @@ class AsicView case SAI_OBJECT_TYPE_ROUTER_INTERFACE: break; - // skip object we have no intrest into + // skip object we have no interest into default: continue; } @@ -1615,7 +1615,7 @@ class AsicView * * Since asic resources are limited like number of routes or buffer * pools, so if we don't match object, at first we created new object - * and then remove previous one. This scenarion may not be possible in + * and then remove previous one. This scenario may not be possible in * case of limited resources. Advantage here is that this approach is * making sure that asic data plane disruption will be minimal. But we * need to switch to remove object first and then create new one. This @@ -1623,7 +1623,7 @@ class AsicView * but in this case we can have some asic data plane disruption. * * This asic operation id will be used to figure out what operation - * reduced object reference to zero, se we could move remove operation + * reduced object reference to zero, so we could move remove operation * right after this operation instead of the executing all remove * actions after all set/create. * @@ -1633,9 +1633,9 @@ class AsicView /** * @brief VID to asic operation id map. * - * Map where key is VID that opints to last asic operation id that + * Map where key is VID that points to last asic operation id that * decreased reference on that VID to zero. This mean that if object - * witht that VID will be removed, we can move remove operation right + * with that VID will be removed, we can move remove operation right * after asic operation id pointed by this VID. */ std::map m_vidToAsicOperationId; @@ -2365,7 +2365,7 @@ int findAllChildsInDependencyTreeCount( if (meta->objecttype == obj->getObjectType()) { /* - * Skip kiips on scheduler group. + * Skip loops on scheduler group. * Mirror session has loop on port, but we break port in next condition. */ @@ -2412,9 +2412,9 @@ std::shared_ptr findCurrentBestMatchForLag( */ /* - * Find not processed LAG members, in both views, since lag member contais + * Find not processed LAG members, in both views, since lag member contains * LAG and PORT, then it should not be processed before LAG itself. But - * since PORT objects on LAG members should be matched at the beggining of + * since PORT objects on LAG members should be matched at the beginning of * comparison logic, then we can find batching LAG members based on the * same VID, since it will be the same in both views. */ @@ -2423,7 +2423,7 @@ std::shared_ptr findCurrentBestMatchForLag( /* * First we need to find at least 1 LAG member that belongs to temporary - * object so we could extrac port object. + * object so we could extract port object. */ sai_object_id_t tmpLagVid = temporaryObj->getVid(); @@ -2511,7 +2511,7 @@ std::shared_ptr findCurrentBestMatchForNextHopGroup( /* * For next hop group, let's try find matching NHG which will be based on * NHG set as SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID in route_entry. We assume - * that each class IPv4 and IPv6 will have different NGH, and each IP + * that each class IPv4 and IPv6 will have different NHG, and each IP * prefix will only be assigned to one NHG. */ @@ -2651,7 +2651,7 @@ std::shared_ptr findCurrentBestMatchForAclTableGroup( * Port didn't work, try to find match by LAG, but lag will be tricky, * since it will be not matched since if this unprocessed acl table group * is processed right now, then if it's assigned to lag then by design we - * go recursivly be attributes to match attributes first. + * go recursively be attributes to match attributes first. */ // TODO this could be helper method, since we will need this for router interface @@ -2754,7 +2754,7 @@ std::shared_ptr findCurrentBestMatchForAclTable( if (tmpAclTableId->getOid() != temporaryObj->getVid()) { - // this is not the expected alc table group member + // this is not the expected acl table group member continue; } @@ -2785,7 +2785,7 @@ std::shared_ptr findCurrentBestMatchForAclTable( auto curInACL = curPort->getSaiAttr(SAI_PORT_ATTR_INGRESS_ACL); /* - * We found current InACL, now let's find acl table group members + * We found current ingress acl, now let's find acl table group members * that use this acl table group. */ @@ -2886,7 +2886,7 @@ std::shared_ptr findCurrentBestMatchForRouterInterface( } /* - * At this point we have both tunnels which ip mathces + * At this point we have both tunnels which ip matches. */ if (tmpTunnel->hasAttr(SAI_TUNNEL_ATTR_UNDERLAY_INTERFACE) && @@ -3107,7 +3107,7 @@ std::shared_ptr findCurrentBestMatchForPolicer( sai_object_id_t curTrapGroupVid = curTrapGroupAttr->getOid(); /* - * If calue is not set, it should point to SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP + * If value is not set, it should point to SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP */ if (curTrapGroupVid == SAI_NULL_OBJECT_ID) @@ -3153,7 +3153,7 @@ std::shared_ptr findCurrentBestMatchForHostifTrapGroup( * For hostif trap group we can see on which hostif trap group is set. * Hostif trap have SAI_HOSTIF_TRAP_ATTR_TRAP_TYPE attribute which is KEY * and there can be only one trap of that type. we can use that to match - * hostif trap groug. + * hostif trap group. */ const auto tmpTraps = temporaryView.getObjectsByObjectType(SAI_OBJECT_TYPE_HOSTIF_TRAP); @@ -3480,10 +3480,10 @@ std::shared_ptr findCurrentBestMatchForGenericObject( */ /* - * Since our system design is to restart orch agent withourt restarting - * syncd and recreating objects and reassign new VIDs created inside orch - * agent, in our most cases values of objects will not change. This will - * cause to make our comparison logic here fairly simple: + * Since our system design is to restart orchagent without restarting syncd + * and recreating objects and reassign new VIDs created inside orchagent, + * in our most cases values of objects will not change. This will cause to + * make our comparison logic here fairly simple: * * Find all objects that have the same equal attributes on current object * and choose the one with the most attributes that match current and @@ -3767,7 +3767,7 @@ std::shared_ptr findCurrentBestMatchForGenericObject( /* * But at this point also let's try find best candidate using graph paths, - * since if some attributes are missmatched (like for example more ACLs are + * since if some attributes are mismatched (like for example more ACLs are * created) this can lead to choose wrong LAG and have implications on * router interface and so on. So matching by graph path here could be * more precise. @@ -3808,7 +3808,7 @@ std::shared_ptr findCurrentBestMatchForGenericObject( * - select object at random, or * - use heuristic/smart lookup for inside graph * - * Smart lookup would be for example searching wheter current object is + * Smart lookup would be for example searching whether current object is * pointing to the same PORT as temporary object (since ports are matched * at the beginning). For different types of objects we need different type * of logic and we can start adding that when needed and when missing we @@ -3931,7 +3931,7 @@ bool exchangeTemporaryVidToCurrentVid( * * @param currentView Current view. * @param temporaryView Temporary view. - * @param temporaryObj Temporary obejct. + * @param temporaryObj Temporary object. * * @return Best match object if found or nullptr. */ @@ -4014,7 +4014,7 @@ std::shared_ptr findCurrentBestMatchForNeighborEntry( * * @param currentView Current view. * @param temporaryView Temporary view. - * @param temporaryObj Temporary obejct. + * @param temporaryObj Temporary object. * * @return Best match object if found or nullptr. */ @@ -4095,7 +4095,7 @@ std::shared_ptr findCurrentBestMatchForRouteEntry( * * @param currentView Current view. * @param temporaryView Temporary view. - * @param temporaryObj Temporary obejct. + * @param temporaryObj Temporary object. * * @return Best match object if found or nullptr. */ @@ -4436,7 +4436,7 @@ void bringNonRemovableObjectToDefaultState( /** * @brief Indicates whether object can be removed. * - * This methos should be used on oid objects, all non oid objects (like route, + * This method should be used on oid objects, all non oid objects (like route, * neighbor, etc.) can be safely removed. * * @param currentObj Current object to be examined. @@ -4540,7 +4540,7 @@ void removeExistingObjectFromCurrentView( { /* * Asic remove object is decreasing reference count on non object ID if - * current obejct is non object id, release existing links only looks + * current object is non object id, release existing links only looks * into attributes. */ @@ -4830,7 +4830,7 @@ void createNewObjectFromTemporaryObject( * There should be no such action here, since this scenario would mean that * there is default switch object in temporary view, but not in current * view. All default objects are put to ASIC state table when switch is - * created. So what can heppen is oposite scenario. + * created. So what can happen is opposite scenario. */ /* @@ -4973,7 +4973,7 @@ void createNewObjectFromTemporaryObject( /* * Move both object status to FINAL since both objects were processed - * succesfuly and object was created. + * successfully and object was created. */ currentObj->setObjectStatus(SAI_OBJECT_STATUS_FINAL); @@ -5015,7 +5015,7 @@ void UpdateObjectStatus( * objects are not processed, then RID also exists since current * object was selected as current best match. Other options are * object was removed, but the it could not be selected, or object - * was created, but then is in FINAL state so also couldn't be + * was created, but then is in FINAL state so also could not be * selected here. */ @@ -5384,7 +5384,7 @@ bool performObjectSetTransition( { /* * This should not happen, since this mean, that attribute is - * crete only, object is matched, nad attribute value is + * create only, object is matched, and attribute value is * different! DB is broken? */ @@ -5466,9 +5466,9 @@ bool performObjectSetTransition( * view, those attributes were put by snoop logic. Since we * skipping only read-only attributes then we snoop create-only * also, but on "existing" objects this will cause problem and - * during apply logic we need to skip this attribute sinec we + * during apply logic we need to skip this attribute since we * won't be able to SET it anyway on matched object, and value - * is the same as current obejct. + * is the same as current object. */ SWSS_LOG_INFO("Skipping create only attr on matched object: %s:%s", @@ -5530,7 +5530,7 @@ bool performObjectSetTransition( * values based on get results, so this will not be needed. * * And even if we will have dependency tree, those values may not be - * synced becasue of remove etc, so we will need to check if default + * synced because of remove etc, so we will need to check if default * values actually exists. */ @@ -5599,7 +5599,7 @@ bool performObjectSetTransition( { /* * This attribute can hold reference to user created - * objects which maybe required to be destroyed, thats why + * objects which maybe required to be destroyed, that's why * we need to bring real value. What if real value were * removed? */ @@ -5681,9 +5681,9 @@ bool performObjectSetTransition( * view, those attributes were put by snoop logic. Since we * skipping only read-only attributes then we snoop create-only * also, but on "existing" objects this will cause problem and - * during apply logic we need to skip this attribute sinec we + * during apply logic we need to skip this attribute since we * won't be able to SET it anyway on matched object, and value - * is the same as current obejct. + * is the same as current object. */ SWSS_LOG_INFO("Skipping create only attr on matched object: %s:%s", @@ -5881,8 +5881,8 @@ void processObjectForViewTransition( * then we can just right away create this object since all keys objects * were removed by finding best match * - * In both cases logic is the same, someone needs to figure out wheter - * updating object and set is possible or wheter we leave object alone, or + * In both cases logic is the same, someone needs to figure out whether + * updating object and set is possible or whether we leave object alone, or * we delete it before creating new one object. * * Preferably this logic could be in both but that duplicates compare @@ -5936,7 +5936,7 @@ void processObjectForViewTransition( * that would be better approach. It could be actually param of comparison * logic. * - * NOTE: this function is called twice if first time will be successfull + * NOTE: this function is called twice if first time will be successful * then logs will be doubled in syslog. */ @@ -5998,7 +5998,7 @@ void processObjectForViewTransition( } /* - * First pass was successfull, so we can do update on current object, lets do that now! + * First pass was successful, so we can do update on current object, lets do that now! */ if (temporaryObj->isOidObject() && (temporaryObj->getObjectStatus() != SAI_OBJECT_STATUS_MATCHED)) @@ -6157,7 +6157,7 @@ void applyViewTransition( * * TODO what about remove? can they be removed first ? * - * There is another issue that when we are removind next hop group member + * There is another issue that when we are removing next hop group member * and it's the last next hop group member in group where group is still in * use by some group, then we can't remove it, we need to first remove * route that uses this group, this puts this task in conflict when @@ -6231,9 +6231,9 @@ void applyViewTransition( * that bridge port remove will be before vlan member remove and it will * fail. Similar problem is on hard reinit when removing existing objects. * - * TODO we need dependency tree during sai discovery! but if we put thsoe + * TODO we need dependency tree during sai discovery! but if we put those * to redis it will cause another problem, since some of those attributes - * are creat only, so object will be selected to "SET" after vid processing + * are create only, so object will be selected to "SET" after vid processing * but it wont be able to set create only attributes, we would need to skip * those. * @@ -6314,7 +6314,7 @@ void executeOperationsOnAsic( _In_ AsicView ¤tView, _In_ AsicView &temporaryView); -// TODO find better way to acces this +// TODO find better way to access this extern std::set initViewRemovedVidSet; void populateExistingObjects( @@ -6327,12 +6327,12 @@ void populateExistingObjects( /* * We should transfer existing objects from current view to temporary view. * But not all objects, since user could remove some default removable - * obejcts like vlan member, bridge port etc. We collected those removed + * objects like vlan member, bridge port etc. We collected those removed * objects to initViewRemovedVidSet and we will use this as a reference to * transfer objects to temporary view. * * TODO: still sairedis metadata database have no idea about existing - * obejcts so user can create object which already exists like vlan 1 if he + * objects so user can create object which already exists like vlan 1 if he * didn't queried it yet. We need to transfer all dependency tree to * sairedis after switch create. */ @@ -6411,9 +6411,9 @@ void populateExistingObjects( * assigned anywhere and this will be memory leak. * * Also a bunch of new asic operations will be generated for setting - * new user created buffer profile. Thats why we need default existing + * new user created buffer profile. That's why we need default existing * vid list to distinguish between user created and default switch - * created obejcts. + * created objects. * * For default existing objects, we don't need to copy attributes, since * if user didn't set them, we want them to be back to default values. @@ -6594,9 +6594,9 @@ sai_status_t syncdApplyView() /* * This method contains 2 stages. * - * First stage is non destructive, when orch agent will build new view, and + * First stage is non destructive, when orchagent will build new view, and * there will be bug in comparison logic in first stage, then syncd will - * send failure when doing apply view to orch agent but it will still be + * send failure when doing apply view to orchagent but it will still be * running. No asic operations are performed during this stage. * * Second stage is destructive, so if there will be bug in comparison logic diff --git a/syncd/syncd_hard_reinit.cpp b/syncd/syncd_hard_reinit.cpp index 46ce2d4df231..f31e255301e9 100644 --- a/syncd/syncd_hard_reinit.cpp +++ b/syncd/syncd_hard_reinit.cpp @@ -8,8 +8,8 @@ /* * To support multiple switches here we need to refactor this to a class - * similar to SaiSwitch, and then have separate vid/rid map and ecah class will - * be recreating only one switch and handling that + * similar to SaiSwitch, and then have separate vid/rid map and each class will + * be recreating only one switch and handling that. */ typedef std::unordered_map StringHash; @@ -225,8 +225,8 @@ void checkAllIds() * Now we must check whether we need to remove some objects like VLAN * members etc. * - * TODO: Should this be done at start, before other oprations? - * We are able to determine which objets are missing from rid map + * TODO: Should this be done at start, before other operations? + * We are able to determine which objects are missing from rid map * as long as id's between restart don't change. */ @@ -246,7 +246,7 @@ void checkAllIds() * hold all id's, it only will hold defaults. But this swill mean, that we * need to remove those VLAN members from ASIC. * - * We could just call discover again, but thats too long, we just needto + * We could just call discover again, but that's too long, we just need to * remove removed objects since we need Existing objects for ApplyView. * * Order matters here, we can't remove bridge before removing all bridge @@ -340,7 +340,7 @@ void processSwitches() /* * Sanity check in metadata make sure that there are no mandatory on create - * and create only attributes that are obejct id attributes, sinec we would + * and create only attributes that are object id attributes, since we would * need create those objects first but we need switch first. So here we * selecting only MANDATORY_ON_CREATE and CREATE_ONLY attributes to create * switch. @@ -636,7 +636,7 @@ sai_object_id_t processSingleVid( /* * Now let's determine whether this object need to be created. Default - * obejcts like default virtual router, queues or cpu can't be created. + * objects like default virtual router, queues or cpu can't be created. * When object exists on the switch (even VLAN member) it will not be * created, but matched. We just need to watch for RO/CO attributes. * @@ -753,7 +753,7 @@ sai_object_id_t processSingleVid( { /* * If we will be performing this on default existing created - * object then it may happen taht during snoop in previous + * object then it may happen that during snoop in previous * iteration we put some attribute that is create only, then * this set will fail and we need to skip this set. * @@ -1112,8 +1112,8 @@ void readAsicState() */ /* - * To support multiple switchies this needs to be refactores since we need - * a class with hard reinit, per switch + * To support multiple switches this needs to be refactored since we need + * a class with hard reinit, per switch. */ g_vidToRidMap = redisGetVidToRidMap(); @@ -1225,7 +1225,7 @@ void performWarmRestart() /* * There should be no case when we are doing warm restart and there is no - * switch defined, we will throw at sucha case. + * switch defined, we will throw at such a case. * * This case could be possible when no switches were created and only api * was initialized, but we will skip this scenario and address is when we @@ -1245,7 +1245,7 @@ void performWarmRestart() } /* - * Here wa have only one switch defined, let's extract his vid and rid. + * Here we have only one switch defined, let's extract his vid and rid. */ /* diff --git a/syncd/syncd_notifications.cpp b/syncd/syncd_notifications.cpp index 3e078eda58fe..1af5b05f0e42 100644 --- a/syncd/syncd_notifications.cpp +++ b/syncd/syncd_notifications.cpp @@ -261,7 +261,7 @@ void process_on_fdb_event( translate_rid_to_vid_list(SAI_OBJECT_TYPE_FDB_ENTRY, fdb->fdb_entry.switch_id, fdb->attr_count, fdb->attr); /* - * Currently because of bcrm bug, we need to install fdb entries in + * Currently because of brcm bug, we need to install fdb entries in * asic view and currently this event don't have fdb type which is * required on creation. */ @@ -451,7 +451,7 @@ void processNotification( } // condition variable will be used to notify processing thread -// that some notiffication arrived +// that some notification arrived std::condition_variable cv; @@ -509,11 +509,12 @@ bool ntf_queue_t::enqueue( std::string notification = kfvKey(item); /* - * If the queue exceeds the limit, then drop all further FDB events - * This is a temporary solution to handle high memory usage by syncd and the - * ntf-Q keeps growing. The permanent solution would be to make this stateful - * so that only the *latest* event is published. + * If the queue exceeds the limit, then drop all further FDB events This is + * a temporary solution to handle high memory usage by syncd and the + * notification queue keeps growing. The permanent solution would be to + * make this stateful so that only the *latest* event is published. */ + if (queueStats() < limit || notification != "fdb_event") { std::lock_guard lock(queue_mutex); diff --git a/syncd/syncd_saiswitch.cpp b/syncd/syncd_saiswitch.cpp index 36607e795143..e90369fd6dbd 100644 --- a/syncd/syncd_saiswitch.cpp +++ b/syncd/syncd_saiswitch.cpp @@ -88,7 +88,7 @@ std::string SaiSwitch::saiGetHardwareInfo() const /* * TODO: We should have THROW here, but currently getting hardware info * is not supported, so we just return empty string like it's not set. - * Later on basing on this entry we will distinquish whether previous + * Later on basing on this entry we will distinguish whether previous * switch and next switch are the same. */ SWSS_LOG_WARN("failed to get switch hardware info: %s", @@ -189,7 +189,7 @@ std::string SaiSwitch::getRedisLanesKey() const /* * Each switch will have it's own lanes in format LANES:oid:0xYYYYYYYY. * - * NOTE: To support multple switches LANES needs to be made per switch. + * NOTE: To support multiple switches LANES needs to be made per switch. * * return std::string(LANES) + ":" + sai_serialize_object_id(m_switch_vid); */ @@ -501,7 +501,7 @@ void SaiSwitch::removeExistingObject( * * @param attr_id Attribute id to obtain oid from it. * - * @return Valid object id (riD) if present, SAI_NULL_OBJECT_ID on failure. + * @return Valid object id (rid) if present, SAI_NULL_OBJECT_ID on failure. */ sai_object_id_t SaiSwitch::helperGetSwitchAttrOid( _In_ sai_attr_id_t attr_id) @@ -627,7 +627,7 @@ bool SaiSwitch::isColdBootDiscoveredRid( auto coldBootDiscoveredVids = getColdBootDiscoveredVids(); /* - * If obejct was discovered in cold boot, it must have valid RID assigned, + * If object was discovered in cold boot, it must have valid RID assigned, * except objects that were removed like VLAN_MEMBER. */ @@ -748,7 +748,7 @@ void SaiSwitch::saiDiscover( /* * NOTE: This method is only good after switch init since we are making - * assumptions that tere are no ACL after initialization. + * assumptions that there are no ACL after initialization. * * NOTE: Input set could be a map of sets, this way we will also have * dependency on each oid. @@ -779,7 +779,7 @@ void SaiSwitch::saiDiscover( /* * We will ignore STP ports by now, since when removing bridge port, then * associated stp port is automatically removed, and we don't use STP in - * out solution. This causing inconsestincy with redis ASIC view vs + * out solution. This causing inconsistency with redis ASIC view vs * actual ASIC asic state. * * TODO: This needs to be solved by sending discovered state to sairedis @@ -843,7 +843,7 @@ void SaiSwitch::saiDiscover( md->attrid == SAI_BRIDGE_PORT_ATTR_RIF_ID) { /* - * We know that bridge port is binded on PORT, no need + * We know that bridge port is bound on PORT, no need * to query those attributes. */ @@ -1040,7 +1040,7 @@ std::set SaiSwitch::getColdBootDiscoveredVids() const /* * Normally we should throw here, but we want to keep backward - * compatybility and don't break anything. + * compatibility and don't break anything. */ SWSS_LOG_WARN("cold boot discovered VIDs set is empty, using discovered set"); @@ -1093,11 +1093,11 @@ void SaiSwitch::helperSaveDiscoveredObjectsToRedis() * There is a problem: * * After switch creation, on the switch objects are created internally like - * VLAN members, queys, SGs etc. Some of those obejct's are removable. + * VLAN members, queues, SGs etc. Some of those objects are removable. * User can decide that he don't want VLAN members and he will remove them. - * Those obejcts will be removed from ASIC view in redis as well. + * Those objects will be removed from ASIC view in redis as well. * - * Now after hard reinit, syncd will picku up what is in the db and it will + * Now after hard reinit, syncd will pick up what is in the db and it will * try to recreate ASIC state. First it will create switch, and this * switch will create those VLAN members again inside ASIC and it will try * to put them back to the DB, since we need to keep track of all default @@ -1107,8 +1107,7 @@ void SaiSwitch::helperSaveDiscoveredObjectsToRedis() * not. Since we are performing syncd hard reinit and recreating switch * that there was something in the DB already. And basing on that we can * deduce that we don't need to put again all our discovered objects to the - * DB, since some of thsoe obects could be removed as statet at the - * beginning. + * DB, since some of those objects could be removed at the beginning. * * Hard reinit is performed before taking any action from the redis queue. * But when user will decide to create switch, table consumer will put that @@ -1125,11 +1124,11 @@ void SaiSwitch::helperSaveDiscoveredObjectsToRedis() * PS. This is not the best way to solve this problem, but works. * * TODO: Some of those objects could be removed, like vlan members etc, we - * could actually put those objects back, but only those obejcts which we + * could actually put those objects back, but only those objects which we * would consider non removable, and this is hard to determine now. A * method getNonRemovableObjects would be nice, then we could put those * objects to the view every time, and not put only discovered objects that - * reflect removable obejcts liek vlan member. + * reflect removable objects like vlan member. */ auto keys = g_redisClient->keys(ASIC_STATE_TABLE ":*"); @@ -1168,7 +1167,7 @@ void SaiSwitch::helperSaveDiscoveredObjectsToRedis() * would put lots of objects into redis DB (ports, queues, scheduler_groups * etc), and since this is cold boot, we can put those discovered objects * to cold boot objects map to redis DB. This will become handy when doing - * warm boot and figureing out which object is default created and which is + * warm boot and figuring out which object is default created and which is * user created, since after warm boot user could previously assign buffer * profile on ingress priority group and this buffer profile will be * discovered by sai discovery logic. @@ -1226,7 +1225,7 @@ sai_object_id_t SaiSwitch::getDefaultValueForOidAttr( /* * NOTE: If real ID will change during hard restarts, then we need to remap all * VID/RID, but we can only do that if we will save entire tree with all - * dependencises. + * dependencies. */ SaiSwitch::SaiSwitch( @@ -1244,7 +1243,7 @@ SaiSwitch::SaiSwitch( /* * Discover put objects to redis needs to be called before checking lane - * map and ports, since it will deduce whether put discoverd objects to + * map and ports, since it will deduce whether put discovered objects to * redis to not interfere with possible user created objects previously. * * TODO: When user will use sairedis we need to send discovered view diff --git a/syncd/syncd_saiswitch.h b/syncd/syncd_saiswitch.h index 847d177a842c..506a79dc5c25 100644 --- a/syncd/syncd_saiswitch.h +++ b/syncd/syncd_saiswitch.h @@ -11,7 +11,7 @@ extern "C" { * Defines maximum elements that can be obtained from the OID list when * performing list attribute query (discovery) on the switch. * - * This vlaue will be used to allocate memory on the stack for obtaining object + * This value will be used to allocate memory on the stack for obtaining object * list, and should be big enough to obtain list for all ports on the switch * and vlan members. */ @@ -70,7 +70,7 @@ class SaiSwitch _In_ sai_object_id_t rid) const; /** - * @brfief Indicates whether RID is one of default switch objects + * @brief Indicates whether RID is one of default switch objects * like CPU port, default virtual router etc. * * @param rid Real object id to examine. @@ -83,14 +83,14 @@ class SaiSwitch /** * @brief Indicates whether object can't be removed. * - * Checks whether object can be removed. All non discovered obejcts can + * Checks whether object can be removed. All non discovered objects can * be removed. All objects from internal attribute can't be removed. * * Currently there are some hard coded object types that can't be * removed like queues, ingress PG, ports. This may not be true for * some vendors. * - * @param rid Real obejct ID to be examined. + * @param rid Real object ID to be examined. * * @return True if object can't be removed from switch. */ @@ -125,7 +125,7 @@ class SaiSwitch * specified, since attribute queried by this method are explicitly * declared in SaiSwitch constructor. * - * @param attr_id Switch attrbute to query. + * @param attr_id Switch attribute to query. * * @return Valid RID or specified switch attribute received from * switch. This value can be also SAI_NULL_OBJECT_ID if switch don't @@ -177,7 +177,7 @@ class SaiSwitch _In_ sai_attr_id_t attr_id); /** - * @biref Get cold boot discovered VIDs. + * @brief Get cold boot discovered VIDs. * * @return Set of cold boot discovered VIDs after cold boot. */ @@ -207,7 +207,7 @@ class SaiSwitch sai_object_id_t m_switch_vid; /** - * @brief Swtich real ID assigned by SAI SDK. + * @brief Switch real ID assigned by SAI SDK. */ sai_object_id_t m_switch_rid; @@ -226,7 +226,7 @@ class SaiSwitch */ /** - * @brief Map of default RIDs retrived from Switch object. + * @brief Map of default RIDs retrieved from Switch object. * * It will contain RIDs like CPU port, default virtual router, default * trap group. etc. Those objects here should be considered non @@ -262,7 +262,7 @@ class SaiSwitch /** * @brief Get MAC address. * - * Intended use is to get switch default MAC addres, for comparison + * Intended use is to get switch default MAC address, for comparison * logic, when we will try to bring it's default value, in case user * changed original switch MAC address. * @@ -297,7 +297,7 @@ class SaiSwitch * @brief Put cold boot discovered VIDs to redis DB. * * This method will only be called after cold boot and it will save - * only VIDs that are present on the switch after swtich is initialized + * only VIDs that are present on the switch after switch is initialized * so it will contain only discovered objects. In case of warm boot * this method will not be called. */ @@ -313,13 +313,13 @@ class SaiSwitch _In_ sai_attr_id_t attr_id); /** - * @brief Discover objects on the swtich. + * @brief Discover objects on the switch. * - * Method will query recursivly all OID attributes (oid and list) on + * Method will query recursively all OID attributes (oid and list) on * the given object. * * This method should be called only once inside constructor right - * after switch has beed breated to obtain actual ASIC view. + * after switch has been created to obtain actual ASIC view. * * @param rid Object to discover other objects. * @param processed Set of already processed objects. This set will be diff --git a/syncd/tests.cpp b/syncd/tests.cpp index 95887696cdd0..cac9667f7740 100644 --- a/syncd/tests.cpp +++ b/syncd/tests.cpp @@ -522,7 +522,7 @@ void test_bulk_route_set() } // TODO we need to add consumer producer test here to see - // if after consume we get pop we get expectd parameters + // if after consume we get pop we get expected parameters // Remove route entry status = sai_bulk_remove_route_entry(count, routes.data(), SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR, statuses.data()); diff --git a/tests/Makefile.am b/tests/Makefile.am index 5b9234188b3e..7fc33dfb3008 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -22,4 +22,4 @@ vssyncd_SOURCES = \ vssyncd_CPPFLAGS = $(DBGFLAGS) $(AM_CPPFLAGS) $(CFLAGS_COMMON) $(SAIFLAGS) vssyncd_LDADD = -lhiredis -lswsscommon $(SAILIB) -lpthread -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -ldl -TESTS = mlnx.pl brcm.pl swsslogentercheck.sh +TESTS = aspellcheck.pl mlnx.pl brcm.pl swsslogentercheck.sh diff --git a/tests/aspell.en.pws b/tests/aspell.en.pws new file mode 100644 index 000000000000..47adc794b12b --- /dev/null +++ b/tests/aspell.en.pws @@ -0,0 +1,230 @@ +personal_ws-1.1 en 0 +acl +ACL +ACLs +api +API +apis +APIs +ApplyView +arp +asic +ASIC +asicCreateObject +ASICs +asicSet +asicview +AsicView +attr +ATTR +ATTR +AttrHash +attrid +attridname +attrs +attrvalue +bool +Bool +brcm +broadcom +candidateObjects +childs +COLDVIDS +config +const +CONST +consts +countOnly +cout +cpu +CreateObject +currentObj +currentObject +currentView +deallocate +decap +deserialize +deserializer +destructor +Destructor +didn +doesn +dscp +ecn +ECN +eg +EIO +encap +endl +enum +ethernet +fdb +FDB +fdbs +FDBs +filename +FIXME +FlexCounter +getInstance +getSwitchId +github +GRE +gSwitchId +hardcoded +hasEqualAttribute +hostif +HSV +https +hw +inattr +ini +init +INIT +inout +INSEG +ip +IP +ipmc +IPv +isobjectid +isoidattribute +KEYs +librediscommon +libsairedis +linux +logrotate +lookup +LOOPBACK +lua +MCAST +md +metadata +mlnx +mpls +mutex +mutexes +namespace +namespaces +NHG +nhgm +nlog +nullptr +OA +ObjectAttrHash +objectHash +ObjectHash +objectid +objectkey +objecttype +oid +oids +OIDs +ok +orch +orchagent +param +params +performTransition +policer +PORTs +ptr +qos +queueCounterIds +queueId +QUEUEs +queueStats +readonly +redis +Redis +refactor +refactored +refactoring +reimplement +reinit +RID +RIDs +RIDTOVID +RO +RPC +runtime +sai +SaiAttr +saibuffer +saiDiscovery +SaiObj +sairedis +saiswitch +SaiSwitch +SAITHRIFT +sanitycheck +sdk +SDK +selectable +setMinPrio +setPortCounterList +setQueueCounterList +SGs +sleeptime +soAll +SONiC +splitted +src +SRC +ss +stateful +stdint +stdlib +stp +STP +str +struct +structs +structure +subport +swid +Switch +switchid +SwitchState +swss +syncd +sys +syslog +tapfd +temporaryObj +temporaryVid +temporaryView +TestCase +timestamp +tmp +TODO +torvalds +ttl +uint +uninitialize +unistd +unittest +unittests +unix +untagged +updatable +upgradable +util +utils +versa +veth +vEthernetX +vid +VID +VIDCOUNTER +vidReference +vids +VIDs +VIDTORID +vlan +vlans +VLANS +vxlan +VXLAN +workaroung +xoff +xon diff --git a/tests/aspellcheck.pl b/tests/aspellcheck.pl new file mode 100755 index 000000000000..5dc75eabf249 --- /dev/null +++ b/tests/aspellcheck.pl @@ -0,0 +1,171 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use diagnostics; + +use Term::ANSIColor; + +our $errors = 0; +our $warnings = 0; + +sub LogInfo +{ + print color('bright_green') . "@_" . color('reset') . "\n"; +} + +sub LogWarning +{ + $warnings++; + print color('bright_yellow') . "WARNING: @_" . color('reset') . "\n"; +} + +sub LogError +{ + $errors++; + print color('bright_red') . "ERROR: @_" . color('reset') . "\n"; +} + +sub GetSourceFilesAndHeaders +{ + my @files = `find .. -name "*.cpp" -o -name "*.h"`; + #my @files = `find .. -name "syncd.cpp"`; + + return @files; +} + +sub ReadFile +{ + my $filename = shift; + + local $/ = undef; + + # first search file in meta directory + + open FILE, $filename or die "Couldn't open file $filename: $!"; + + binmode FILE; + + my $string = ; + + close FILE; + + return $string; +} + +sub ExtractComments +{ + my $input = shift; + + my $comments = ""; + + # good enough comments extractor C/C++ source + + while ($input =~ m!(".*?")|//.*?[\r\n]|/\*.*?\*/!s) + { + $input = $'; + + $comments .= $& if not $1; + } + + return $comments; +} + +sub RunAspell +{ + my $hash = shift; + + my %wordsToCheck = %{ $hash }; + + if (not -e "/usr/bin/aspell") + { + LogError "ASPELL IS NOT PRESENT, please install aspell"; + return; + } + + LogInfo "Running Aspell"; + + my @keys = sort keys %wordsToCheck; + + my $count = @keys; + + my $all = "@keys"; + + LogInfo "Words to check: $count"; + + my @result = `echo "$all" | /usr/bin/aspell -l en -a -p ./aspell.en.pws 2>&1`; + + for my $res (@result) + { + if ($res =~ /error/i) + { + LogError "aspell error: $res"; + last; + } + + next if not $res =~ /^\s*&\s*(\S+)/; + + my $word = $1; + + chomp $res; + + my $where = "??"; + + if (not defined $wordsToCheck{$word}) + { + for my $k (@keys) + { + if ($k =~ /(^$word|$word$)/) + { + $where = $wordsToCheck{$k}; + last; + } + + $where = $wordsToCheck{$k} if ($k =~ /$word/); + } + } + else + { + $where = $wordsToCheck{$word}; + } + + LogWarning "Word '$word' is misspelled $where"; + } +} + +my @files = GetSourceFilesAndHeaders(); + +my %wordsToCheck = (); + +for my $file (@files) +{ + chomp $file; + next if $file =~ m!/SAI/!; + next if $file =~ m!/config.h!; + + my $data = ReadFile $file; + + my $comments = ExtractComments $data; + + $comments =~ s!github.com\S+! !g; + $comments =~ s!l2mc! !g; + $comments =~ s!\s+\d+(th|nd) ! !g; + $comments =~ s!(/\*|\*/)! !g; + $comments =~ s!//! !g; + $comments =~ s!\s+\*\s+! !g; + $comments =~ s![^a-zA-Z0-9_]! !g; + + my @words = split/\s+/,$comments; + + for my $w (@words) + { + next if $w =~ /_/; + next if $w =~ /xYYY+/; + + $wordsToCheck{$w} = $file; + } +} + +RunAspell(\%wordsToCheck); + +exit 1 if ($warnings > 0 or $errors > 0); diff --git a/vslib/inc/sai_vs.h b/vslib/inc/sai_vs.h index 3c03fc8ff64e..5b15886be0c6 100644 --- a/vslib/inc/sai_vs.h +++ b/vslib/inc/sai_vs.h @@ -17,13 +17,13 @@ extern "C" { * * Bool flag, (true/false). If set to true, then during create host interface * sai object also tap device will be created and mac address will be assigned. - * For this operation root privilages will be required. + * For this operation root privileges will be required. * * By default this flag is set to false. */ #define SAI_KEY_VS_HOSTIF_USE_TAP_DEVICE "SAI_VS_HOSTIF_USE_TAP_DEVICE" -// TODO probaby should be per switch +// TODO probably should be per switch #define SAI_VALUE_VS_SWITCH_TYPE_BCM56850 "SAI_VS_SWITCH_TYPE_BCM56850" #define SAI_VALUE_VS_SWITCH_TYPE_MLNX2700 "SAI_VS_SWITCH_TYPE_MLNX2700" @@ -57,7 +57,7 @@ extern "C" { /** * @def SAI_VS_UNITTEST_ENABLE * - * Notificatio operation for enabling unittests. + * Notification operation for enabling unittests. */ #define SAI_VS_UNITTEST_ENABLE_UNITTESTS "enable_unittests" diff --git a/vslib/inc/sai_vs_state.h b/vslib/inc/sai_vs_state.h index 239e0ccea576..e9d95ad82e6e 100644 --- a/vslib/inc/sai_vs_state.h +++ b/vslib/inc/sai_vs_state.h @@ -52,8 +52,8 @@ class SaiAttrWrap SWSS_LOG_ENTER(); /* - * On destructor we need to call free to dealocate possible - * alocated list on constructor. + * On destructor we need to call free to deallocate possible + * allocated list on constructor. */ sai_deserialize_free_attribute_value(m_meta->attrvaluetype, m_attr); @@ -92,7 +92,7 @@ class SaiAttrWrap }; /** - * @brief AttrHash key is attribute ID, value is actuall attribute + * @brief AttrHash key is attribute ID, value is actual attribute */ typedef std::map> AttrHash; diff --git a/vslib/src/sai_vs_fdb.cpp b/vslib/src/sai_vs_fdb.cpp index 470cc61bd311..3a6974d25abd 100644 --- a/vslib/src/sai_vs_fdb.cpp +++ b/vslib/src/sai_vs_fdb.cpp @@ -11,7 +11,7 @@ bool doesFdbEntryNotMatchFlushAttr( SWSS_LOG_ENTER(); /* - * Since ther may be combination of flush attributes + * Since there may be combination of flush attributes * that user requested to flush, so when one attribute * is different, then this fdb entry should NOT be flushed. */ @@ -170,10 +170,10 @@ sai_status_t internal_vs_flush_fdb_entries( * 1 in that case we need to mark data in special way reusing current * attributes. * - * Since flush event is considered like regulat fdb event, data inside will + * Since flush event is considered like regular fdb event, data inside will * be special. Indication that this is flush event will be by actual event * type and consolidation will marked as MAC address 00:00:00:00:00:00. - * In that case user reciving notification will know that flush event is + * In that case user receiving notification will know that flush event is * consolidated event and not actual fdb entry. * * To indicate what entry type was flushed, entry_type field in fdb_entry @@ -194,7 +194,7 @@ sai_status_t internal_vs_flush_fdb_entries( * event is handling. * * All other attributes in consolidated fdb event notification are - * irreleant. + * irrelevant. */ sai_attribute_t attr; diff --git a/vslib/src/sai_vs_generic_create.cpp b/vslib/src/sai_vs_generic_create.cpp index 570946c38305..2c91110f6a76 100644 --- a/vslib/src/sai_vs_generic_create.cpp +++ b/vslib/src/sai_vs_generic_create.cpp @@ -113,8 +113,8 @@ sai_object_type_t sai_object_type_query( SWSS_LOG_ERROR("invalid object id 0x%lx", object_id); /* - * We can't throw here since it would not give meaningfull message. - * Tthrowing at one level up is better. + * We can't throw here since it would not give meaningful message. + * Throwing at one level up is better. */ return SAI_OBJECT_TYPE_NULL; @@ -197,7 +197,7 @@ sai_object_id_t vs_create_real_object_id( int index = vs_get_switch_id_index(switch_id); - // count from zero for each type separetly + // count from zero for each type separately uint64_t real_id = real_ids[object_type]++; sai_object_id_t object_id = vs_construct_object_id(object_type, index, real_id); @@ -432,7 +432,7 @@ void vs_update_local_metadata( /* * Create every non object id except switch. Switch object was already - * created above, and non object ids like route may contain other obejct + * created above, and non object ids like route may contain other object * id's inside *_entry struct, and since metadata is checking reference of * those objects, they must exists first. */ diff --git a/vslib/src/sai_vs_generic_get.cpp b/vslib/src/sai_vs_generic_get.cpp index 5a433e6f3a8d..a57d485ed26f 100644 --- a/vslib/src/sai_vs_generic_get.cpp +++ b/vslib/src/sai_vs_generic_get.cpp @@ -90,7 +90,7 @@ sai_status_t internal_vs_generic_get( /* * Read only attributes may require recalculation. * Metadata makes sure that non object id's can't have - * read only attributes. So here is defenetly OID. + * read only attributes. So here is definitely OID. */ sai_object_id_t oid; diff --git a/vslib/src/sai_vs_hostintf.cpp b/vslib/src/sai_vs_hostintf.cpp index 6b758226d729..8c4ae086d831 100644 --- a/vslib/src/sai_vs_hostintf.cpp +++ b/vslib/src/sai_vs_hostintf.cpp @@ -159,7 +159,7 @@ void findBridgeVlanForPortVlan( /* * The bridge port lookup process is two steps: * - * - use (vlan_id, phyiscal port_id) to match any .1D bridge port created. + * - use (vlan_id, physical port_id) to match any .1D bridge port created. * If there is match, then quit, found=true * * - use (physical port_id) to match any .1Q bridge created. if there is a @@ -979,7 +979,7 @@ sai_status_t vs_create_hostif_int( g_switch_state_map.at(switch_id)->setIfNameToPortId(vname, obj_id); // TODO what about FDB entries notifications, they also should - // be generated if new mac addres will show up on the interface/arp table + // be generated if new mac address will show up on the interface/arp table // TODO IP address should be assigned when router interface is created @@ -1011,7 +1011,7 @@ sai_status_t vs_create_hostif( &vs_create_hostif_int); } -// TODO set must also be supported when we change oper status up/down +// TODO set must also be supported when we change operational status up/down // and probably also generate notification then VS_REMOVE(HOSTIF,hostif); diff --git a/vslib/src/sai_vs_interfacequery.cpp b/vslib/src/sai_vs_interfacequery.cpp index 6d68fa21f008..c827beb297dd 100644 --- a/vslib/src/sai_vs_interfacequery.cpp +++ b/vslib/src/sai_vs_interfacequery.cpp @@ -444,7 +444,7 @@ void fdbAgingThreadProc() } /** - * @brief Serviec method table. + * @brief Service method table. * * We could use this table to choose switch vendor. */ @@ -457,7 +457,7 @@ void clear_local_state() SWSS_LOG_NOTICE("clearing local state"); /* - * Initialize metatada database. + * Initialize metadata database. */ meta_init_db(); diff --git a/vslib/src/sai_vs_switch_BCM56850.cpp b/vslib/src/sai_vs_switch_BCM56850.cpp index 6c6a7380b511..95a1bd140d7c 100644 --- a/vslib/src/sai_vs_switch_BCM56850.cpp +++ b/vslib/src/sai_vs_switch_BCM56850.cpp @@ -486,7 +486,7 @@ static sai_status_t create_ingress_priority_groups() { SWSS_LOG_ENTER(); - // TODO prioirity groups size may change when we will modify pg or ports + // TODO priority groups size may change when we will modify pg or ports SWSS_LOG_INFO("create priority groups"); @@ -557,7 +557,7 @@ static sai_status_t create_scheduler_group_tree( // 3..c - have both QUEUES, each one 2 - // sg 0 (2 groups) + // scheduler group 0 (2 groups) { sai_object_id_t sg_0 = sgs.at(0); @@ -583,7 +583,7 @@ static sai_status_t create_scheduler_group_tree( uint32_t queue_index = 0; - // sg 1 (8 groups) + // scheduler group 1 (8 groups) { sai_object_id_t sg_1 = sgs.at(1); @@ -637,7 +637,7 @@ static sai_status_t create_scheduler_group_tree( } } - // sg 2 (2 groups) + // scheduler group 2 (2 groups) { sai_object_id_t sg_2 = sgs.at(2); @@ -1089,7 +1089,7 @@ static sai_status_t refresh_ingress_priority_group( /* * TODO Currently we don't have index in groups, so we don't know how to * sort. Returning success, since assuming that we will not create more - * ingreess priority groups. + * ingress priority groups. */ return SAI_STATUS_SUCCESS; @@ -1105,7 +1105,7 @@ static sai_status_t refresh_qos_queues( /* * TODO Currently we don't have index in groups, so we don't know how to * sort. Returning success, since assuming that we will not create more - * ingreess priority groups. + * ingress priority groups. */ return SAI_STATUS_SUCCESS; @@ -1121,7 +1121,7 @@ static sai_status_t refresh_scheduler_groups( /* * TODO Currently we don't have index in groups, so we don't know how to * sort. Returning success, since assuming that we will not create more - * ingreess priority groups. + * ingress priority groups. */ return SAI_STATUS_SUCCESS; diff --git a/vslib/src/sai_vs_switch_MLNX2700.cpp b/vslib/src/sai_vs_switch_MLNX2700.cpp index 19240e3e17ca..efe61d09789d 100644 --- a/vslib/src/sai_vs_switch_MLNX2700.cpp +++ b/vslib/src/sai_vs_switch_MLNX2700.cpp @@ -514,7 +514,7 @@ static sai_status_t create_scheduler_group_tree( // 2.. - have both QUEUES, each one 2 - // sg 0 (8 childs) + // scheduler group 0 (8 childs) { sai_object_id_t sg_0 = sgs.at(0); @@ -1078,7 +1078,7 @@ static sai_status_t refresh_ingress_priority_group( /* * TODO Currently we don't have index in groups, so we don't know how to * sort. Returning success, since assuming that we will not create more - * ingreess priority groups. + * ingress priority groups. */ return SAI_STATUS_SUCCESS; @@ -1094,7 +1094,7 @@ static sai_status_t refresh_qos_queues( /* * TODO Currently we don't have index in groups, so we don't know how to * sort. Returning success, since assuming that we will not create more - * ingreess priority groups. + * ingress priority groups. */ return SAI_STATUS_SUCCESS; @@ -1110,7 +1110,7 @@ static sai_status_t refresh_scheduler_groups( /* * TODO Currently we don't have index in groups, so we don't know how to * sort. Returning success, since assuming that we will not create more - * ingreess priority groups. + * ingress priority groups. */ return SAI_STATUS_SUCCESS; diff --git a/vslib/src/tests.cpp b/vslib/src/tests.cpp index bc70d74cffa0..267f931413bb 100644 --- a/vslib/src/tests.cpp +++ b/vslib/src/tests.cpp @@ -760,7 +760,7 @@ int main() test_set_stats_via_redis(); - // make proper unitinialize to close unittest thread + // make proper uninitialize to close unittest thread sai_api_uninitialize(); return 0;