Skip to content

vslib: add support for read-only port capabilities#1038

Merged
zhangyanzhao merged 2 commits intosonic-net:masterfrom
ds952811:portcap_anlt
May 16, 2022
Merged

vslib: add support for read-only port capabilities#1038
zhangyanzhao merged 2 commits intosonic-net:masterfrom
ds952811:portcap_anlt

Conversation

@ds952811
Copy link
Contributor

@ds952811 ds952811 commented May 5, 2022

This is part of HLD: sonic-net/SONiC#924, sonic-net/SONiC#925

What I did
Add port capability query for AutoNeg and Link-Training

Why I did it
Fix the VS test failure for the port AutoNeg and Link-Training capability queries

How I verified it
Ran the sonic-swss/tests/test_port_an.py to verify

@kcudnik
Copy link
Collaborator

kcudnik commented May 5, 2022

please fix compilation issues:

SwitchStateBase.cpp:1238:19: error: 'SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE' was not declared in this scope
         attr.id = SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SwitchStateBase.cpp:1238:19: note: suggested alternative: 'SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE'
         attr.id = SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE
SwitchStateBase.cpp: In member function 'virtual sai_status_t saivs::SwitchStateBase::refresh_read_only(const sai_attr_metadata_t*, sai_object_id_t)':
SwitchStateBase.cpp:2320:18: error: 'SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE' was not declared in this scope
             case SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE:
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SwitchStateBase.cpp:2320:18: note: suggested alternative: 'SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE'
             case SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE:
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE

@ds952811
Copy link
Contributor Author

ds952811 commented May 5, 2022

please fix compilation issues:

SwitchStateBase.cpp:1238:19: error: 'SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE' was not declared in this scope
         attr.id = SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SwitchStateBase.cpp:1238:19: note: suggested alternative: 'SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE'
         attr.id = SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE
SwitchStateBase.cpp: In member function 'virtual sai_status_t saivs::SwitchStateBase::refresh_read_only(const sai_attr_metadata_t*, sai_object_id_t)':
SwitchStateBase.cpp:2320:18: error: 'SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE' was not declared in this scope
             case SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE:
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SwitchStateBase.cpp:2320:18: note: suggested alternative: 'SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE'
             case SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE:
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE

It depends on the following PR in the SAI master branch, can I update the SAI submodule to use the latest commit of master branch?
opencomputeproject/SAI#1434

@kcudnik
Copy link
Collaborator

kcudnik commented May 6, 2022

yes, you can raise PR to update submodule

@prgeor prgeor requested a review from kcudnik May 9, 2022 17:49
@zhangyanzhao zhangyanzhao merged commit 8894dc7 into sonic-net:master May 16, 2022
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
* vslib: add support for read-only port capabilities

Signed-off-by: Dante Su <[email protected]>

* vslib: Drop LT capability query

Signed-off-by: Dante Su <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants