Skip to content

Commit

Permalink
Merge branch 'opencomputeproject:master' into nhg-with-members
Browse files Browse the repository at this point in the history
  • Loading branch information
erohsik committed May 29, 2024
2 parents 0486cb0 + 767c325 commit d390586
Show file tree
Hide file tree
Showing 15 changed files with 306 additions and 21 deletions.
3 changes: 3 additions & 0 deletions inc/saiport.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ typedef enum _sai_port_breakout_mode_type_t
/** 4 lanes breakout Mode */
SAI_PORT_BREAKOUT_MODE_TYPE_4_LANE = 2,

/** 8 lanes breakout Mode */
SAI_PORT_BREAKOUT_MODE_TYPE_8_LANE = 3,

/** Breakout mode max count */
SAI_PORT_BREAKOUT_MODE_TYPE_MAX
} sai_port_breakout_mode_type_t;
Expand Down
1 change: 1 addition & 0 deletions meta/ancestry.825c835.history

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion meta/ancestry.eaf2812.history

This file was deleted.

4 changes: 3 additions & 1 deletion meta/ancestry.pl
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ sub BuildCommitHistory
next if $enumName eq "SAI_API_MAX";
next if $enumName eq "SAI_OBJECT_TYPE_MAX";
next if $enumName eq "SAI_PORT_INTERFACE_TYPE_MAX";
next if $enumName eq "SAI_PORT_BREAKOUT_MODE_TYPE_MAX";

LogError "wrong initializer on $enumName $enumValue" if not $enumValue =~ /^0x[0-9a-f]{8}$/;

Expand Down Expand Up @@ -207,6 +208,7 @@ sub BuildCommitHistory
{
#print "elsif (defined $enumName $IGNORED{$enumName} and $IGNORED{$enumName} eq $HISTORY{$enumTypeName}{$enumName}{name})";

next if $HISTORY{$enumTypeName}{$enumValue} eq "SAI_PORT_BREAKOUT_MODE_TYPE_MAX";
LogWarning "Both enums have the same value $enumName and $HISTORY{$enumTypeName}{$enumValue} = $enumValue";
}
}
Expand Down Expand Up @@ -238,7 +240,7 @@ sub CleanData

eval($history) or die "failed to eval history file: $optionHistoryFile";

die "history file $optionHistoryFile not complete, missing too many keys" if scalar keys %HISTORY < 280;
die "history file $optionHistoryFile not complete, missing too many keys" if scalar keys %HISTORY < 314;

LogInfo "loaded history from $optionHistoryFile";
}
Expand Down
4 changes: 2 additions & 2 deletions meta/checkancestry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function create_commit_list()

function check_enum_history()
{
perl ancestry.pl -H "ancestry.eaf2812.history" $LIST
perl ancestry.pl -H "ancestry.825c835.history" $LIST
}

#
Expand All @@ -122,7 +122,7 @@ function check_enum_history()
# the processing time will increase too much

BEGIN_COMMIT=3132018 # from this commit we are backward compatible
BEGIN_COMMIT=eaf2812 # to this commit we have history file
BEGIN_COMMIT=825c835 # to this commit we have history file
END_COMMIT=HEAD

clean_temp_dir
Expand Down
2 changes: 2 additions & 0 deletions meta/checkheaders.pl
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ sub CheckHash
{
# ignore attributes end, since those will shift
next if $key =~ /^SAI_\w+_ATTR_END$/;
next if $key =~ /^SAI_\w+_ATTR_CUSTOM_RANGE_END$/;

next if $key eq "SAI_IN_DROP_REASON_END";
next if $key eq "SAI_ACL_TABLE_ATTR_FIELD_END";
Expand All @@ -194,6 +195,7 @@ sub CheckHash
next if $key eq "SAI_OBJECT_TYPE_MAX";
next if $key eq "SAI_API_MAX";
next if $key eq "SAI_PORT_INTERFACE_TYPE_MAX";
next if $key eq "SAI_PORT_BREAKOUT_MODE_TYPE_MAX";

# NOTE: some other attributes/enum with END range could be added
}
Expand Down
9 changes: 8 additions & 1 deletion meta/checkstructs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function create_commit_list()

function check_structs_history()
{
perl structs.pl $LIST
perl structs.pl -H "structs.825c835.history" $LIST
}

#
Expand All @@ -117,7 +117,14 @@ function check_structs_history()

# BEGIN_COMMIT is the commit from we want structs to be backward compatible

# since checking structs history is taking longer time each commit, we will
# use history file to load all the history from previous processed commits, in
# this way we just load entire history to perl directly and save time on
# processing all those previous commits, this process can be repeated later on if
# the processing time will increase too much

BEGIN_COMMIT=97a1e02 # v1.11.0
BEGIN_COMMIT=825c835 # to this commit we have history file
END_COMMIT=HEAD

clean_temp_dir
Expand Down
1 change: 1 addition & 0 deletions meta/parse.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,7 @@ sub ProcessSingleObjectType
WriteSource ".isresourcetype = $isresourcetype,";
WriteSource ".isdeprecated = $isdeprecated,";
WriteSource ".isconditionrelaxed = $isrelaxed,";
WriteSource ".iscustom = $attr >= 0x10000000";

WriteSource "};";

Expand Down
7 changes: 7 additions & 0 deletions meta/saimetadatatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,13 @@ typedef struct _sai_attr_metadata_t
*/
bool isconditionrelaxed;

/**
* @brief Indicates whether attribute is custom attribute.
*
* Custom attribute values begins with SAI_XXX_ATTR_CUSTOM_RANGE_START.
*/
bool iscustom;

} sai_attr_metadata_t;

/*
Expand Down
2 changes: 1 addition & 1 deletion meta/saimetadatautils.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const sai_attr_metadata_t* sai_metadata_get_attr_metadata(

const sai_object_type_info_t* oi = sai_metadata_all_object_type_infos[objecttype];

if (!oi->enummetadata->containsflags && attrid < oi->enummetadata->valuescount)
if (!oi->enummetadata->containsflags && attrid < oi->attridend)
{
return md[attrid];
}
Expand Down
Loading

0 comments on commit d390586

Please sign in to comment.