forked from sonic-net/DASH
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sai-gen] Support merging SAI specs. (sonic-net#577)
This change added the SAI spec merging support. This is to ensure any new SAI attribute changes will follow the rules below to help ABI compatibility: - All new attributes or action enum values will be added in the end of the list. - Existing attributes will be updated inline. In the future, we can add more check here, e.g., type changed in non-compatible way and etc. - All old attributes will be marked as deprecated instead of removed. Recently, the tunnel APIs are added, but because it merged with the SAI spec PR together without rebase, it is not captured in the previous SAI spec. With SAI spec merging, we can see the changes are showing up in the expected sequence. This would be an example that demos the several usages of SAI spec.
- Loading branch information
Showing
18 changed files
with
284 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
!!python/object:utils.sai_spec.sai_api_group.SaiApiGroup | ||
name: dash_tunnel | ||
description: '' | ||
sai_apis: | ||
- !!python/object:utils.sai_spec.sai_api.SaiApi | ||
name: dash_tunnel | ||
description: '' | ||
is_object: true | ||
enums: [] | ||
structs: [] | ||
attributes: | ||
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute | ||
name: SAI_DASH_TUNNEL_DIP | ||
description: Action parameter DIP | ||
type: sai_ip_address_t | ||
attr_value_field: ipaddr | ||
default: 0.0.0.0 | ||
isresourcetype: false | ||
flags: CREATE_AND_SET | ||
object_name: null | ||
allow_null: false | ||
valid_only: null | ||
deprecated: null | ||
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute | ||
name: SAI_DASH_TUNNEL_DASH_ENCAPSULATION | ||
description: Action parameter DASH_ENCAPSULATION | ||
type: sai_dash_encapsulation_t | ||
attr_value_field: s32 | ||
default: SAI_DASH_ENCAPSULATION_VXLAN | ||
isresourcetype: false | ||
flags: CREATE_AND_SET | ||
object_name: null | ||
allow_null: false | ||
valid_only: null | ||
deprecated: null | ||
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute | ||
name: SAI_DASH_TUNNEL_TUNNEL_KEY | ||
description: Action parameter TUNNEL_KEY | ||
type: sai_uint32_t | ||
attr_value_field: u32 | ||
default: '0' | ||
isresourcetype: false | ||
flags: CREATE_AND_SET | ||
object_name: null | ||
allow_null: false | ||
valid_only: null | ||
deprecated: null | ||
stats: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from typing import Dict, List | ||
|
||
|
||
class SaiApiP4MetaAction: | ||
def __init__(self, name: str, id: int): | ||
self.name: str = name | ||
self.id: int = id | ||
self.attr_param_id: Dict[str, int] = {} | ||
|
||
|
||
class SaiApiP4MetaTable: | ||
def __init__(self, id: int): | ||
self.id: int = id | ||
self.actions: Dict[str, SaiApiP4MetaAction] = {} | ||
|
||
|
||
class SaiApiP4Meta: | ||
def __init__(self): | ||
self.tables: List[SaiApiP4MetaTable] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.