Skip to content

Commit 1d33a3e

Browse files
committed
vpp: support binding multiple ACL tables by priority (#1732)
why currently vpp doesn't support binding multiple ACL tables. Each table is appended with default permit-all rules. With multiple tables, this may cause acl matched by such rules and skip the actual rule to make in the tables after this one. what this PR does remove the default permit-all rules for each table If a table is empty, create a dummy rule that won't match any traffic because vpp doesn't allow empty table. The dummy rule matches dest-ip to 0.0.0.0/32 sort all the tables by priority in the table group. vpp doesn't support parallel matching added catch-all acl group to the end. vpp default behavior of no match is drop but sonic is accept. Fix sonic-vpp crashing due to race condition during stats pull. If the interface to get stats has been removed, stat_segment_ls_r returns null. Signed-off-by: Yue Gao <yuega2@cisco.com>
1 parent feaa910 commit 1d33a3e

3 files changed

Lines changed: 204 additions & 82 deletions

File tree

vslib/vpp/SwitchVpp.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@ namespace saivs
622622
std::map<sai_object_id_t, std::list<sai_object_id_t>> m_acl_tbl_grp_ports_map;
623623
std::map<sai_object_id_t, vpp_ace_cntr_info_t> m_ace_cntr_info_map;
624624

625+
uint32_t m_acl_default_swindex = 0;
626+
bool m_acl_default_created = false;
627+
625628
protected: // VPP
626629

627630
sai_status_t createAclEntry(
@@ -804,9 +807,11 @@ namespace saivs
804807
_In_ uint32_t attr_count,
805808
_In_ const sai_attribute_t *attr_list);
806809

807-
sai_status_t aclDefaultAllowConfigure(
810+
sai_status_t emptyAclCreate(
808811
_In_ sai_object_id_t tbl_oid);
809812

813+
sai_status_t aclDefaultCreate();
814+
810815
sai_status_t acl_rule_range_get(
811816
_In_ const sai_object_list_t *range_list,
812817
_Out_ sai_u32_range_t *range_limit_list,

0 commit comments

Comments
 (0)