-
Notifications
You must be signed in to change notification settings - Fork 500
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
Add support for VLAN Stacking/Translation API #1400
base: master
Are you sure you want to change the base?
Conversation
f635bd9
to
88cf04e
Compare
Should we also extend saiacl.h to allow pop / swap ? |
Need to have a SAI specific doc for this. And also describe how this fits to SAI behavioral model. |
a0fecbc
to
40b5c0c
Compare
I add a document about this new PR and also add a vlan stack stage into the pipeline. |
please fix errors:
|
inc/saivlan.h
Outdated
SAI_VLAN_STACK_MATCH_TYPE_INNER, | ||
|
||
SAI_VLAN_STACK_MATCH_TYPE_OUTER, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please enhance this to match multi-tag also. To start with a double-tag matching.
ex: SAI_VLAN_STACK_MATCH_TYPE_MULTI with stack depth 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't fully understand the operation you mentioned.
Can you check if the current design is enough for your desire? Or can you give me some examples about your mentioned operation.
35c95b5
to
a6dbc76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please address comments
e80c2f2
to
673db3c
Compare
Hi @rlhui @ashutosh-agrawal @itaibaz @kcudnik , |
please wait for others to apprive |
a857fd1
to
c9f13f6
Compare
inc/saitypes.h
Outdated
@@ -1335,6 +1350,9 @@ typedef union _sai_attribute_value_t | |||
|
|||
/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_LATCH_STATUS */ | |||
sai_latch_status_t latchstatus; | |||
|
|||
/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_VLAN_STACKING_VID */ | |||
sai_vlan_stacking_vid_t vlanstackingvid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a new type ?
Can we not add more attributes instead for the inner and outer vlan. ?
Not adding a new type to the union helps avoid all the meta changes in SAI and also simplifies meta changes in sonic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If considering this situation, I think change to use individual attributes can achieve the same thing.
Will change to use your listed example in next commit.
inc/saivlan.h
Outdated
* @type sai_vlan_stacking_vid_t | ||
* @flags MANDATORY_ON_CREATE | CREATE_ONLY | ||
*/ | ||
SAI_VLAN_STACK_ATTR_ORIGINAL_VLAN_ID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid meta changes can we use the foll:
SAI_VLAN_STACK_ATTR_ORIGINAL_VLAN_ID_OUTER
SAI_VLAN_STACK_ATTR_ORIGINAL_VLAN_ID_INNER
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Please check.
inc/saivlan.h
Outdated
@@ -657,7 +821,10 @@ typedef struct _sai_vlan_api_t | |||
sai_get_vlan_stats_fn get_vlan_stats; | |||
sai_get_vlan_stats_ext_fn get_vlan_stats_ext; | |||
sai_clear_vlan_stats_fn clear_vlan_stats; | |||
|
|||
sai_create_vlan_stack_fn create_vlan_stack; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vlan stack/translation is a different stage in the pipeline.
It involves tag manipulations only.
Should we be modifying the sai_vlan_api_t ?
Instead Is it better to add a new API sai_vlan_stack_api_t and add
the vlan_stack related functions there ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is also an option. But if I do so, the sai_vlan_stack_api_t should be put in another header file, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that would be another header file. However since we this is another stage in the pipeline it should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @srj102 ,
I have split the vlan stack into another header file. Please check if it helps.
5e32dd9
to
a70db3f
Compare
- Define SAI layer VLAN Stacking API in saivlanstack.h Able to support vlan translation and QinQ function - Add document to descript the function of the vlan stack - Add pipeline model for vlan stacking Signed-off-by: kuanyu_chen <kuanyu_chen@edge-core.com>
Hi @ashutosh-agrawal @srj102 @prvattem |
* @flags CREATE_AND_SET | ||
* @default 0xFF | ||
*/ | ||
SAI_VLAN_STACK_ATTR_VLAN_APPLIED_PRI, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to _PRI, the CFI bit in vlan tag should be handled.
Use cases: https://github.com/Azure/SONiC/blob/f7920604b77525bd8a13432214fd8d4a5423933c/doc/vlan_stacking/vlan_stacking_HLD.md#vlan-stacking-deployment-use-cases
Examples:
https://github.com/Azure/SONiC/blob/f7920604b77525bd8a13432214fd8d4a5423933c/doc/vlan_stacking/vlan_stacking_HLD.md#sai-api