From a2b3344cdde0bf5a4f8e98e1c676a658c0c615b0 Mon Sep 17 00:00:00 2001 From: liat-grozovik <44433539+liat-grozovik@users.noreply.github.com> Date: Mon, 1 Feb 2021 14:34:21 +0200 Subject: [PATCH] spell check fixes (#1189) Signed-off-by: Liat Grozovik --- flexsai/p4/backend/json_stage/analyzer.h | 4 ++-- flexsai/p4/backend/json_stage/expression.h | 2 +- flexsai/p4/backend/json_stage/lower.cpp | 2 +- flexsai/p4/backend/json_stage/lower.h | 2 +- flexsai/p4/backend/json_stage/saiSwitch.cpp | 2 +- .../output_stage/SAI_templates/sai_template.h | 6 ++--- meta/saimetadatautils.c | 4 ++-- meta/saisanitycheck.c | 22 +++++++++---------- meta/saiserializetest.c | 18 +++++++-------- test/basic_router/basic_router.cpp | 6 ++--- test/basic_router/ip.cpp | 4 ++-- test/basic_router/nexthopgrp_mgr.cpp | 2 +- test/basic_router/route_mgr.cpp | 8 +++---- .../routing/sai_l3_neighbor_unit_test.cpp | 2 +- .../routing/sai_l3_nexthop_unit_test.cpp | 2 +- .../routing/sai_l3_nexthopgroup_unit_test.cpp | 2 +- test/sai_ut/routing/sai_l3_rif_unit_test.cpp | 2 +- test/saithrift/src/switch_sai_rpc_server.cpp | 2 +- 18 files changed, 46 insertions(+), 46 deletions(-) diff --git a/flexsai/p4/backend/json_stage/analyzer.h b/flexsai/p4/backend/json_stage/analyzer.h index 3d89c12f6..f90fdb18a 100644 --- a/flexsai/p4/backend/json_stage/analyzer.h +++ b/flexsai/p4/backend/json_stage/analyzer.h @@ -50,7 +50,7 @@ class CFG final : public IHasDbPrint { bool checkSame(const EdgeSet& other) const; /// Check if this destination appears in this edgeset. /// Importantly, a TableNode is a destination if it points to - /// the same table as an existin destination (pointer equality + /// the same table as an existing destination (pointer equality /// is not enough). bool isDestination(const CFG::Node* destination) const; }; @@ -178,7 +178,7 @@ class CFG final : public IHasDbPrint { void computeSuccessors() { for (auto n : allNodes) n->computeSuccessors(); } /// BMv2 is very restricted in the kinds of graphs it supports. - /// Thie method checks whether a CFG is implementable. + /// This method checks whether a CFG is implementable. bool checkImplementable() const; // Graphs that require cycles are not implementable on BMv2. // These can arise if a table is invoked multiple times. diff --git a/flexsai/p4/backend/json_stage/expression.h b/flexsai/p4/backend/json_stage/expression.h index ae6d9d507..45b4bcce4 100644 --- a/flexsai/p4/backend/json_stage/expression.h +++ b/flexsai/p4/backend/json_stage/expression.h @@ -86,7 +86,7 @@ class ExpressionConverter : public Inspector { * @param doFixup Insert masking operations for operands to ensure that the result * matches the specification. BMv2 does arithmetic using unbounded * precision, but the spec requires fixed precision, specified by the types. - * @param wrap Wrap the result into an additiona JSON expression block. + * @param wrap Wrap the result into an additional JSON expression block. * See the BMv2 JSON spec. * @param convertBool Wrap the result into a cast from boolean to data (b2d JSON). */ diff --git a/flexsai/p4/backend/json_stage/lower.cpp b/flexsai/p4/backend/json_stage/lower.cpp index be84a9b4e..c05001a42 100644 --- a/flexsai/p4/backend/json_stage/lower.cpp +++ b/flexsai/p4/backend/json_stage/lower.cpp @@ -153,7 +153,7 @@ struct VariableWriters { return result; } /** - This function returns a non-null value only if there is exaclty one writer statement. + This function returns a non-null value only if there is exactly one writer statement. In that case it returns the RHS of the assignment */ const IR::Expression* substitution() const { diff --git a/flexsai/p4/backend/json_stage/lower.h b/flexsai/p4/backend/json_stage/lower.h index f6ea2dd3d..32c71ee7f 100644 --- a/flexsai/p4/backend/json_stage/lower.h +++ b/flexsai/p4/backend/json_stage/lower.h @@ -120,7 +120,7 @@ class RemoveComplexExpressions : public Transform { const IR::Node* preorder(IR::P4Control* control) override; const IR::Node* postorder(IR::P4Control* control) override { if (newDecls.size() != 0) { - // prepend declarations + // prepare declarations newDecls.append(control->controlLocals); control->controlLocals = newDecls; } diff --git a/flexsai/p4/backend/json_stage/saiSwitch.cpp b/flexsai/p4/backend/json_stage/saiSwitch.cpp index 021a90c95..6f7694497 100644 --- a/flexsai/p4/backend/json_stage/saiSwitch.cpp +++ b/flexsai/p4/backend/json_stage/saiSwitch.cpp @@ -26,7 +26,7 @@ const char* Switch_Model::P4_PIPELINE_INGRESS_L2 = "ingressPort"; const char* Switch_Model::P4_PIPELINE_EGRESS_L2 = "egressPort"; const char* Switch_Model::P4_PIPELINE_INGRESS_L3 = "ingressRif"; const char* Switch_Model::P4_PIPELINE_EGRESS_L3 = "egressRif"; -// These string constatns must match those in the python transpiler +// These string constants must match those in the python transpiler const char* Switch_Model::JSON_PIPELINE_PARSER = "parse"; const char* Switch_Model::JSON_PIPELINE_DEPARSER = "deparse"; const char* Switch_Model::JSON_PIPELINE_INGRESS_L2 = "control_in_port"; diff --git a/flexsai/p4/backend/output_stage/SAI_templates/sai_template.h b/flexsai/p4/backend/output_stage/SAI_templates/sai_template.h index 1f0f15e6f..748520ed5 100644 --- a/flexsai/p4/backend/output_stage/SAI_templates/sai_template.h +++ b/flexsai/p4/backend/output_stage/SAI_templates/sai_template.h @@ -32,7 +32,7 @@ sai_status_t sai_ext_api_initialize(); /** * @brief Retrieve a pointer to the C-style method table for desired SAI - * extenstions functionality as specified by the given sai_ext_api_id. + * extensions functionality as specified by the given sai_ext_api_id. * * @param[in] sai_ext_api_id SAI EXT API ID * @param[out] api_method_table Caller allocated method table The table must @@ -45,11 +45,11 @@ sai_status_t sai_ext_api_query( _Out_ void** api_method_table); /** - * @brief Uninitialize sai extenstions + * @brief Uninitialize sai extensions * retrieved via sai_ext_api_query() cannot be used after this call. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ sai_status_t sai_ext_api_uninitialize(); -#endif /** __SAI_EXT_H_ */ \ No newline at end of file +#endif /** __SAI_EXT_H_ */ diff --git a/meta/saimetadatautils.c b/meta/saimetadatautils.c index 701cb9c3d..b7d169dd2 100644 --- a/meta/saimetadatautils.c +++ b/meta/saimetadatautils.c @@ -83,7 +83,7 @@ const sai_attr_metadata_t* sai_metadata_get_attr_metadata( const sai_attr_metadata_t* const* const md = sai_metadata_attr_by_object_type[objecttype]; /* - * Most obejct attributes are not flags, so we can use direct index to + * Most object attributes are not flags, so we can use direct index to * find attribute metadata, this should speed up search. */ @@ -244,7 +244,7 @@ bool sai_metadata_is_condition_met( const sai_attr_condition_t *condition = metadata->conditions[idx]; /* - * Conditons may only be on the same object type. + * Conditions may only be on the same object type. * * Default value may not exists if conditional object is marked as * MANDATORY_ON_CREATE. diff --git a/meta/saisanitycheck.c b/meta/saisanitycheck.c index 0c33b0f0d..8066733a5 100644 --- a/meta/saisanitycheck.c +++ b/meta/saisanitycheck.c @@ -774,7 +774,7 @@ void check_attr_allowed_object_types( ot == SAI_OBJECT_TYPE_FDB_FLUSH || ot == SAI_OBJECT_TYPE_HOSTIF_PACKET) { - /* switch object type is ment to be used only in non object id struct types */ + /* switch object type is meant to be used only in non object id struct types */ META_MD_ASSERT_FAIL(md, "switch object type can't be used as object type in any attribute"); } @@ -2379,7 +2379,7 @@ void check_attr_existing_objects( case SAI_ATTR_VALUE_TYPE_POINTER: /* - * Allow poniter for switch register read and write API's. + * Allow pointer for switch register read and write API's. */ break; default: @@ -2463,7 +2463,7 @@ void check_attr_brief_description( META_LOG_ENTER(); /* - * Purpose of this check is to see if brief description extracte from + * Purpose of this check is to see if brief description extract from * header is present and not too long. */ @@ -2594,7 +2594,7 @@ void check_attr_condition_met( /* * If there are multiple conditions, we need to provide fake values for all - * others to force return false to test each one separetly. + * others to force return false to test each one separately. */ uint32_t count = (uint32_t)md->conditionslength; @@ -2833,11 +2833,11 @@ void check_attr_extension_flag( if (md->attrid >= oi->attridend && md->attrid < CUSTOM_ATTR_RANGE_START) { - META_ASSERT_TRUE(md->isextensionattr, "atribute %s expected to be extension", md->attridname); + META_ASSERT_TRUE(md->isextensionattr, "attribute %s expected to be extension", md->attridname); } else { - META_ASSERT_FALSE(md->isextensionattr, "atribute %s not expected to be extension", md->attridname); + META_ASSERT_FALSE(md->isextensionattr, "attribute %s not expected to be extension", md->attridname); } } @@ -3003,7 +3003,7 @@ void check_object_infos() { /* * Attribute ID is in custom range, so it will not be in - * regural start .. end range. + * regular start .. end range. */ continue; @@ -4140,12 +4140,12 @@ void check_switch_attributes() const sai_attr_metadata_t *md = meta[index]; /* - * Gerabox attributes can be marked as mandatory on create. + * Gearbox attributes can be marked as mandatory on create. */ if (md->isoidattribute && md->ismandatoryoncreate) { - META_MD_ASSERT_FAIL(md, "Mandatroy on create can't be object id on SWITCH"); + META_MD_ASSERT_FAIL(md, "Mandatory on create can't be object id on SWITCH"); } if (md->isoidattribute && md->iscreateonly) @@ -4232,7 +4232,7 @@ void check_enum_to_attr_map( /* * Check whether attribute enum declared has equal number of items as the - * number of declared attributes. Item siwth @ignore flag shluld be + * number of declared attributes. Item swith @ignore flag should be * removed from enum and attribute should not be created. */ @@ -4287,7 +4287,7 @@ void check_object_ro_list( /* * We skip hostif table entry since there is no 1 object which can * identify all table entries. We would need to add one attribute for - * each used obect type port, lag, vlan etc. + * each used object type port, lag, vlan etc. */ return; diff --git a/meta/saiserializetest.c b/meta/saiserializetest.c index f3fe246df..6e7232bc8 100644 --- a/meta/saiserializetest.c +++ b/meta/saiserializetest.c @@ -556,15 +556,15 @@ void test_deserialize_ip4() sai_ip4_t ip; res = sai_deserialize_ip4("10.0.0.21", &ip); - ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expectes true, res: %d", res); - ASSERT_TRUE(ip == htonl(0x0a000015), "expectes true"); + ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expected true, res: %d", res); + ASSERT_TRUE(ip == htonl(0x0a000015), "expected true"); ASSERT_TRUE(memcmp(&ip, "\x0a\x00\x00\x15", 4) == 0, "expected true"); res = sai_deserialize_ip4("10.0.0.21\"", &ip); - ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expectes true, res: %d", res); + ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expected true, res: %d", res); res = sai_deserialize_ip4("10.0.0.21/", &ip); - ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expectes true, res: %d", res); + ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expected true, res: %d", res); res = sai_deserialize_ip4("1::ff", &ip); ASSERT_TRUE(res < 0, "expected negative number"); @@ -729,19 +729,19 @@ void test_deserialize_ip_address() sai_ip_address_t ip; res = sai_deserialize_ip_address("10.0.0.21", &ip); - ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expectes true, res: %d", res); - ASSERT_TRUE(ip.addr.ip4 == htonl(0x0a000015), "expectes true"); + ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expected true, res: %d", res); + ASSERT_TRUE(ip.addr.ip4 == htonl(0x0a000015), "expected true"); ASSERT_TRUE(memcmp(&ip.addr.ip4, "\x0a\x00\x00\x15", 4) == 0, "expected true"); ASSERT_TRUE(ip.addr_family == SAI_IP_ADDR_FAMILY_IPV4, "expected true"); res = sai_deserialize_ip_address("10.0.0.21\"", &ip); - ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expectes true, res: %d", res); + ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expected true, res: %d", res); res = sai_deserialize_ip_address("10.0.0.21/", &ip); - ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expectes true, res: %d", res); + ASSERT_TRUE(res > 0 && strlen("10.0.0.21") == res, "expected true, res: %d", res); res = sai_deserialize_ip_address("255.255.255.255", &ip); - ASSERT_TRUE(res > 0 && strlen("255.255.255.255") == res, "expectes true, res: %d", res); + ASSERT_TRUE(res > 0 && strlen("255.255.255.255") == res, "expected true, res: %d", res); res = sai_deserialize_ip_address("1.1.256.1", &ip); ASSERT_TRUE(res < 0, "expected negative number"); diff --git a/test/basic_router/basic_router.cpp b/test/basic_router/basic_router.cpp index 6c63b9629..539ae1487 100644 --- a/test/basic_router/basic_router.cpp +++ b/test/basic_router/basic_router.cpp @@ -432,7 +432,7 @@ bool basic_router_setup() return false; } - LOGG(TEST_DEBUG, SETL3, "virtual rounter id 0x%lx\n", g_vr_id); + LOGG(TEST_DEBUG, SETL3, "virtual router id 0x%lx\n", g_vr_id); LOGG(TEST_INFO, SETL3, "for each port, sai_port_api->set_port_attribute SAI_PORT_ATTR_ADMIN_STATE true\n"); @@ -531,7 +531,7 @@ bool basic_router_setup() LOGG(TEST_DEBUG, SETL3, "hif_id 0x%lx \n", hif_id); } - LOGG(TEST_DEBUG, SETL3, "--- end of loof of interface ---\n"); + LOGG(TEST_DEBUG, SETL3, "--- end of loop of interface ---\n"); for (i = 0; i < g_testcount; i++) { @@ -751,7 +751,7 @@ static void neighbor_removing() { neighbor_mgr->Show(); - LOGG(TEST_INFO, TESTCASE, "--- remving all neighbor entries ---\n"); + LOGG(TEST_INFO, TESTCASE, "--- removing all neighbor entries ---\n"); IpAddress ipAddr; diff --git a/test/basic_router/ip.cpp b/test/basic_router/ip.cpp index 5d544f0ca..34ddbdbe9 100644 --- a/test/basic_router/ip.cpp +++ b/test/basic_router/ip.cpp @@ -29,7 +29,7 @@ IpAddress::IpAddress(const std::string &ipstr) { if (inet_pton(AF_INET, ipstr.c_str(), &m_addr) != 1) { - std::string errmsg = "connot convert " + ipstr + " to ip address"; + std::string errmsg = "cannot convert " + ipstr + " to ip address"; throw std::invalid_argument(errmsg); } } @@ -118,7 +118,7 @@ IpPrefix::IpPrefix( if (m_maskLen < 0 || m_maskLen > 32) { - std::string errmsg = "connot convert " + ipStr + " to ip prefix"; + std::string errmsg = "cannot convert " + ipStr + " to ip prefix"; throw std::invalid_argument(errmsg); } diff --git a/test/basic_router/nexthopgrp_mgr.cpp b/test/basic_router/nexthopgrp_mgr.cpp index 83f6cdbc1..2c7876107 100644 --- a/test/basic_router/nexthopgrp_mgr.cpp +++ b/test/basic_router/nexthopgrp_mgr.cpp @@ -89,7 +89,7 @@ bool NextHopGrpMgr::Add(IpAddresses nextHops) if (!nbEntry) { - LOGG(TEST_ERR, NXTHG, "fail to find the NeiborEntry for nexthop %s\n", itnh->to_string().c_str()); + LOGG(TEST_ERR, NXTHG, "fail to find the neighbor entry for nexthop %s\n", itnh->to_string().c_str()); continue; } diff --git a/test/basic_router/route_mgr.cpp b/test/basic_router/route_mgr.cpp index 64d0a0be0..90d8c492a 100644 --- a/test/basic_router/route_mgr.cpp +++ b/test/basic_router/route_mgr.cpp @@ -104,7 +104,7 @@ bool RouteMgr::Add(IpPrefix prefix, IpAddresses nexthops) if (!nbEntry) { - LOGG(TEST_ERR, ROUTE, "fail to find the NeiborEntry for nexthop %s\n", itnh->to_string().c_str()); + LOGG(TEST_ERR, ROUTE, "fail to find the neighbor entry for nexthop %s\n", itnh->to_string().c_str()); continue; } @@ -114,7 +114,7 @@ bool RouteMgr::Add(IpPrefix prefix, IpAddresses nexthops) if (nhids.size() == 0) { - LOGG(TEST_DEBUG, ROUTE, "cannot find the any of nexthops %s in the neighbor table\n", nexthops.to_string().c_str()); + LOGG(TEST_DEBUG, ROUTE, "cannot find any of nexthops %s in the neighbor table\n", nexthops.to_string().c_str()); return false; } @@ -122,7 +122,7 @@ bool RouteMgr::Add(IpPrefix prefix, IpAddresses nexthops) { if (!m_nhgMgr->Add(nexthops)) { - LOGG(TEST_ERR, ROUTE, "fail to add next hop group %s\n", nexthops.to_string().c_str()); + LOGG(TEST_ERR, ROUTE, "fail to add nexthop group %s\n", nexthops.to_string().c_str()); return false; } @@ -130,7 +130,7 @@ bool RouteMgr::Add(IpPrefix prefix, IpAddresses nexthops) if (!nhgEntry) { - LOGG(TEST_ERR, ROUTE, "fail to retrieve next hop group %s\n", nexthops.to_string().c_str()); + LOGG(TEST_ERR, ROUTE, "fail to retrieve nexthop group %s\n", nexthops.to_string().c_str()); return false; } diff --git a/test/sai_ut/routing/sai_l3_neighbor_unit_test.cpp b/test/sai_ut/routing/sai_l3_neighbor_unit_test.cpp index bf366550d..3d9f73a4a 100644 --- a/test/sai_ut/routing/sai_l3_neighbor_unit_test.cpp +++ b/test/sai_ut/routing/sai_l3_neighbor_unit_test.cpp @@ -696,7 +696,7 @@ TEST_F (saiL3NeighborTest, invalid_attr_id) const char *p_ip_addr_str = "11.0.0.1"; const char *p_mac_str = "00:a1:a2:a3:a4:a5"; - /* Pass invalid attribtue id in list */ + /* Pass invalid attribute id in list */ status = sai_test_neighbor_create (port_rif_id, ip_af, p_ip_addr_str, (default_neighbor_attr_count + 1), SAI_NEIGHBOR_ATTR_DST_MAC_ADDRESS, diff --git a/test/sai_ut/routing/sai_l3_nexthop_unit_test.cpp b/test/sai_ut/routing/sai_l3_nexthop_unit_test.cpp index da46c693f..d6de4f05a 100644 --- a/test/sai_ut/routing/sai_l3_nexthop_unit_test.cpp +++ b/test/sai_ut/routing/sai_l3_nexthop_unit_test.cpp @@ -730,7 +730,7 @@ TEST_F (saiL3NextHopTest, invalid_attr_id) const unsigned int invalid_attr_pos = 3; const unsigned int invalid_attr_id = 0xffff; - /* Pass invalid attribtue id in list */ + /* Pass invalid attribute id in list */ status = sai_test_nexthop_create (&nh_id, (default_nh_attr_count + 1), SAI_NEXT_HOP_ATTR_TYPE, diff --git a/test/sai_ut/routing/sai_l3_nexthopgroup_unit_test.cpp b/test/sai_ut/routing/sai_l3_nexthopgroup_unit_test.cpp index 6d265508e..e4462218e 100644 --- a/test/sai_ut/routing/sai_l3_nexthopgroup_unit_test.cpp +++ b/test/sai_ut/routing/sai_l3_nexthopgroup_unit_test.cpp @@ -688,7 +688,7 @@ TEST_F (saiL3NextHopGroupTest, invalid_attr_id) const unsigned int invalid_attr_pos = 2; const unsigned int invalid_attr_id = 0xffff; - /* Pass invalid attribtue id in list */ + /* Pass invalid attribute id in list */ status = sai_test_nh_group_create (&group_id, p_nh_id_list, (default_nh_group_attr_count + 1), SAI_NEXT_HOP_GROUP_ATTR_TYPE, diff --git a/test/sai_ut/routing/sai_l3_rif_unit_test.cpp b/test/sai_ut/routing/sai_l3_rif_unit_test.cpp index 262b5ef0f..5b274cee0 100644 --- a/test/sai_ut/routing/sai_l3_rif_unit_test.cpp +++ b/test/sai_ut/routing/sai_l3_rif_unit_test.cpp @@ -523,7 +523,7 @@ TEST_F (saiL3RifTest, rif_create_with_mac_attr_on_vrf_with_mac_attr) } /* - * PORT RIF, VLAN RIF created without any optional paramters on VRF with + * PORT RIF, VLAN RIF created without any optional parameters on VRF with * SRC MAC, V4 and V6 admin state set. * * SRC MAC, V4 and V6 admin state attributes inherited by these RIF's from VRF. diff --git a/test/saithrift/src/switch_sai_rpc_server.cpp b/test/saithrift/src/switch_sai_rpc_server.cpp index f4f1b5ee4..0df9b3db3 100644 --- a/test/saithrift/src/switch_sai_rpc_server.cpp +++ b/test/saithrift/src/switch_sai_rpc_server.cpp @@ -199,7 +199,7 @@ class switch_sai_rpcHandler : virtual public switch_sai_rpcIf { sai_attrs = (sai_attribute_t *) calloc(thrift_attr_list.size(), sizeof(sai_attribute_t)); if (!sai_attrs) { - SAI_THRIFT_LOG_ERR("failed to allocate sai attibutes list"); + SAI_THRIFT_LOG_ERR("failed to allocate sai attributes list"); return NULL; }