@@ -483,8 +483,8 @@ class SaiObj
483
483
};
484
484
485
485
typedef std::unordered_map<sai_object_id_t , sai_object_id_t > ObjectIdMap;
486
- typedef std::unordered_map <std::string, std::shared_ptr<SaiObj>> StrObjectIdToSaiObjectHash;
487
- typedef std::unordered_map <sai_object_id_t , std::shared_ptr<SaiObj>> ObjectIdToSaiObjectHash;
486
+ typedef std::map <std::string, std::shared_ptr<SaiObj>> StrObjectIdToSaiObjectHash;
487
+ typedef std::map <sai_object_id_t , std::shared_ptr<SaiObj>> ObjectIdToSaiObjectHash;
488
488
489
489
/* *
490
490
* @brief Class represents ASIC view
@@ -2916,7 +2916,7 @@ std::shared_ptr<SaiObj> findCurrentBestMatchForAclTable(
2916
2916
{
2917
2917
if (c.obj ->getVid () == curAclTableId->getOid ())
2918
2918
{
2919
- SWSS_LOG_INFO (" found ALC table candidate %s using port %s" ,
2919
+ SWSS_LOG_INFO (" found ACL table candidate %s using port %s" ,
2920
2920
c.obj ->str_object_id .c_str (),
2921
2921
tmpPort->str_object_id .c_str ());
2922
2922
@@ -2927,6 +2927,53 @@ std::shared_ptr<SaiObj> findCurrentBestMatchForAclTable(
2927
2927
}
2928
2928
}
2929
2929
2930
+ // try using pre match in this case
2931
+
2932
+ const auto tmpMembers = temporaryView.getNotProcessedObjectsByObjectType (SAI_OBJECT_TYPE_ACL_TABLE_GROUP_MEMBER);
2933
+
2934
+ for (auto tmpAclTableGroupMember: tmpMembers)
2935
+ {
2936
+ auto tmpAclTableIdAttr = tmpAclTableGroupMember->getSaiAttr (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_ID);
2937
+
2938
+ if (tmpAclTableIdAttr->getOid () != temporaryObj->getVid ())
2939
+ continue ;
2940
+
2941
+ auto tmpAclTableGroupIdAttr = tmpAclTableGroupMember->getSaiAttr (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_GROUP_ID);
2942
+
2943
+ auto tmpAclTableGroup = temporaryView.oOids .at (tmpAclTableGroupIdAttr->getOid ());
2944
+
2945
+ auto it = temporaryView.preMatchMap .find (tmpAclTableGroup->getVid ());
2946
+
2947
+ if (it == temporaryView.preMatchMap .end ())
2948
+ continue ;
2949
+
2950
+ auto curAclTableGroupMembers = currentView.getNotProcessedObjectsByObjectType (SAI_OBJECT_TYPE_ACL_TABLE_GROUP_MEMBER);
2951
+
2952
+ for (auto curAclTableGroupMember: curAclTableGroupMembers)
2953
+ {
2954
+ auto curAclTableGroupIdAttr = curAclTableGroupMember->getSaiAttr (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_GROUP_ID);
2955
+
2956
+ if (curAclTableGroupIdAttr->getOid () != it->second )
2957
+ continue ;
2958
+
2959
+ // we got acl table group member current that uses same acl table group as temporary
2960
+
2961
+ auto curAclTableIdAttr = curAclTableGroupMember->getSaiAttr (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_ID);
2962
+
2963
+ for (auto c: candidateObjects)
2964
+ {
2965
+ if (c.obj ->getVid () == curAclTableIdAttr->getOid ())
2966
+ {
2967
+ SWSS_LOG_INFO (" found ACL table candidate %s using pre match ACL TABLE GROUP %s" ,
2968
+ c.obj ->str_object_id .c_str (),
2969
+ tmpAclTableGroup->str_object_id .c_str ());
2970
+
2971
+ return c.obj ;
2972
+ }
2973
+ }
2974
+ }
2975
+ }
2976
+
2930
2977
SWSS_LOG_NOTICE (" failed to find best candidate for ACL_TABLE using port" );
2931
2978
2932
2979
return nullptr ;
@@ -6166,7 +6213,7 @@ void processObjectForViewTransition(
6166
6213
return ;
6167
6214
}
6168
6215
6169
- SWSS_LOG_DEBUG (" processing: %s:%s" , temporaryObj->str_object_type .c_str (), temporaryObj->str_object_id .c_str ());
6216
+ SWSS_LOG_INFO (" processing: %s:%s" , temporaryObj->str_object_type .c_str (), temporaryObj->str_object_id .c_str ());
6170
6217
6171
6218
procesObjectAttributesForViewTransition (currentView, temporaryView, temporaryObj);
6172
6219
@@ -7233,7 +7280,17 @@ void createPreMatchMap(
7233
7280
createPreMatchMapForObject (cur, tmp, cObj, tObj, processed);
7234
7281
}
7235
7282
7236
- SWSS_LOG_NOTICE (" preMatch map size: %zu" , tmp.preMatchMap .size ());
7283
+ size_t count = 0 ;
7284
+
7285
+ for (auto & ok: tmp.soOids )
7286
+ {
7287
+ if (ok.second ->getObjectStatus () != SAI_OBJECT_STATUS_MATCHED)
7288
+ count++;
7289
+ }
7290
+
7291
+ SWSS_LOG_NOTICE (" preMatch map size: %zu, tmp oid obj: %zu" ,
7292
+ tmp.preMatchMap .size (),
7293
+ count);
7237
7294
}
7238
7295
7239
7296
sai_status_t syncdApplyView ()
0 commit comments