@@ -626,15 +626,24 @@ sai_object_id_t QosOrch::initSystemAclTable()
626
626
attrs.push_back (attr);
627
627
628
628
status = sai_acl_api->create_acl_table (&acl_table_id, attrs.size (), &attrs[0 ]);
629
- if (status = = SAI_STATUS_SUCCESS)
629
+ if (status ! = SAI_STATUS_SUCCESS)
630
630
{
631
- SWSS_LOG_NOTICE (" Create system ACL table for ECN coloring" );
631
+ SWSS_LOG_ERROR (" Failed to create a system ACL table for ECN coloring, rv:%d" , status);
632
+ throw runtime_error (" Failed to create a system ACL table for ECN coloring" );
632
633
}
633
- else
634
+ SWSS_LOG_NOTICE (" Create a system ACL table for ECN coloring" );
635
+
636
+ attr.id = SAI_SWITCH_ATTR_DEFAULT_INGRESS_ACL_LIST;
637
+ attr.value .objlist .count = 1 ;
638
+ attr.value .objlist .list = &acl_table_id;
639
+
640
+ status = sai_switch_api->set_switch_attribute (&attr);
641
+ if (status != SAI_STATUS_SUCCESS)
634
642
{
635
- SWSS_LOG_ERROR (" Failed to create system ACL table. sai_acl_api->create_acl_table failed: %d" , status);
636
- throw runtime_error (" Failed to create system ACL table" );
643
+ SWSS_LOG_ERROR (" Failed to bind the system ACL table globally, rv: %d" , status);
644
+ throw runtime_error (" Failed to bind the system ACL table globally " );
637
645
}
646
+ SWSS_LOG_NOTICE (" Bind the system ACL table globally" );
638
647
639
648
return acl_table_id;
640
649
}
@@ -673,16 +682,13 @@ void QosOrch::initAclEntryForEcn(sai_object_id_t acl_table_id, sai_uint32_t prio
673
682
attr.value .aclaction .parameter .s32 = color;
674
683
attrs.push_back (attr);
675
684
676
- status = sai_acl_api->create_acl_entry (&acl_entry_id, attrs.size (), &attrs[0 ]);
677
- if (status == SAI_STATUS_SUCCESS)
678
- {
679
- SWSS_LOG_NOTICE (" Successfully created ACL entry for ECN coloring. dscp=%d, ecn=%d" , ecn_field, dscp_field);
680
- }
681
- else
685
+ status = sai_acl_api->create_acl_entry (&acl_entry_id, attrs.size (), attrs.data ());
686
+ if (status != SAI_STATUS_SUCCESS)
682
687
{
683
- SWSS_LOG_ERROR (" dscp=%d, ecn=%d. sai_acl_api->create_acl_entry() failed: %d " , ecn_field, dscp_field , status);
684
- throw runtime_error (" Failed to create color acl entry" );
688
+ SWSS_LOG_ERROR (" Failed to create a system ACL entry for ECN coloring, rv=%d " , status);
689
+ throw runtime_error (" Failed to create a system ACL entry for ECN coloring " );
685
690
}
691
+ SWSS_LOG_INFO (" Create a system ACL entry for ECN coloring" );
686
692
}
687
693
688
694
void QosOrch::initTableHandlers ()
0 commit comments