Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[meta] Make sai switch pointers attr list stable #2111

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meta/parse.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5188,7 +5188,7 @@ sub CreateSwitchPointersAttributesList
my @pointers = keys %NOTIFICATIONS;
push @pointers, values %ATTR_TO_CALLBACK;

for my $name (sort @pointers)
for my $name (GetSwitchPointersInOrder(@pointers))
{
next if not $name =~ /^sai_(\w+)_fn/;

Expand Down
6 changes: 6 additions & 0 deletions meta/saisanitycheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -5499,9 +5499,15 @@ void check_switch_pointers_list()

size_t i;

sai_attr_id_t id = 0;

for (i = 0; i < sai_metadata_switch_pointers_attr_count; ++i)
{
META_ASSERT_NOT_NULL(sai_metadata_switch_pointers_attr[i]);

META_ASSERT_TRUE(id <= sai_metadata_switch_pointers_attr[i]->attrid, "sai_metadata_switch_pointers_attr attr pointers expected to increase")

id = sai_metadata_switch_pointers_attr[i]->attrid;
}

/* check for NULL guard */
Expand Down
Loading