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] Skip objects on (de)serialize acl field data mask #1273

Merged
merged 1 commit into from
Jul 7, 2021
Merged
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
20 changes: 20 additions & 0 deletions meta/serialize.pm
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,22 @@ sub EmitSerializeHeader
WriteSource "EMIT(\"{\");\n";
}

sub WriteSkipForMask
{
# mask is special, since it's combined with field data, but there
# is not field corresponded to object or object list so we can skip
# them in serialize and deserialize

WriteSource "else if (meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_OBJECT_ID)";
WriteSource "{";
WriteSource "/* skip */";
WriteSource "}";
WriteSource "else if (meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_OBJECT_LIST)";
WriteSource "{";
WriteSource "/* skip */";
WriteSource "}";
}

sub EmitSerializeFooter
{
my $refStructInfoEx = shift;
Expand All @@ -463,6 +479,8 @@ sub EmitSerializeFooter
{
my $name = $refStructInfoEx->{name};

WriteSkipForMask() if $name eq "sai_acl_field_data_mask_t";

# NOTE: if it's union, we must check if we serialized something
# (not always true for acl mask)

Expand Down Expand Up @@ -1061,6 +1079,8 @@ sub EmitDeserializeFooter
{
my $name = $refStructInfoEx->{name};

WriteSkipForMask() if $name eq "sai_acl_field_data_mask_t";

# if it's union, we must check if we serialized something
# (not always true for acl mask)

Expand Down