Add support for VLAN Stacking/Translation API#1400
Add support for VLAN Stacking/Translation API#1400kuanyu99 wants to merge 1 commit intoopencomputeproject:masterfrom
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.
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.
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
kcudnik
left a comment
There was a problem hiding this comment.
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
| 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.
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.
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.
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
inc/saivlan.h
Outdated
| 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.
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.
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.
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.
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.
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