Skip to content

Do not configure physical attributes on port channels in portconfig#2456

Merged
liat-grozovik merged 2 commits intosonic-net:masterfrom
stephenxs:fix-lag-config
Nov 8, 2022
Merged

Do not configure physical attributes on port channels in portconfig#2456
liat-grozovik merged 2 commits intosonic-net:masterfrom
stephenxs:fix-lag-config

Conversation

@stephenxs
Copy link
Collaborator

@stephenxs stephenxs commented Oct 26, 2022

What I did

portconfig is a utility designed to configure various attributes on a physical port or a port channel.
It should reject the operation that a user wants to configure an attribute that will be inserted into CONFIG_DB.PORT table on a port channel. Otherwise, it will generate an entry for the port channel, which causes orchagent to be aborted.

Eg. the following commands

admin@sonic:~$ sudo config portchannel add PortChannel0001
admin@sonic:~$ sudo config interface speed PortChannel0001 100000

will cause the following error

Oct 26 04:50:27.055970 sonic ERR swss#orchagent: :- meta_sai_validate_oid: oid is set to null object id on SAI_OBJECT_TYPE_PORT
Oct 26 04:50:27.055970 sonic ERR swss#orchagent: :- getPortSupportedSpeeds: Failed to get a list of supported speeds for port PortChannel0001 id=0. Error=-5
Oct 26 04:50:27.057062 sonic ERR swss#orchagent: :- set: switch id oid:0x0 doesn't exist
Oct 26 04:50:27.057062 sonic ERR swss#orchagent: :- handleSaiSetStatus: Encountered failure in set operation, exiting orchagent, SAI API: SAI_API_PORT, status: SAI_STATUS_INVALID_PARAMETER
Oct 26 04:50:27.606521 sonic INFO swss#supervisord 2022-10-26 01:50:27,605 INFO exited: orchagent (terminated by SIGABRT (core dumped); not expected)

After the fix, configuring physical attributes on a port channel will be rejected

admin@sonic:~$ sudo config portchannel add PortChannel0001
admin@sonic:~$ sudo config interface speed PortChannel0001 100000
Invalid port PortChannel0001

Signed-off-by: Stephen Sun stephens@nvidia.com

How I did it

How to verify it

Unit test

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
@stephenxs stephenxs marked this pull request as ready for review October 27, 2022 23:44
@stephenxs
Copy link
Collaborator Author

@prgeor kindly reminder to review this PR. thanks.

@prsunny prsunny requested a review from prgeor November 7, 2022 17:47
@liat-grozovik liat-grozovik merged commit d5a6da3 into sonic-net:master Nov 8, 2022
@stephenxs stephenxs deleted the fix-lag-config branch November 8, 2022 12:36
yxieca pushed a commit that referenced this pull request Nov 10, 2022
…2456)

- What I did
portconfig is a utility designed to configure various attributes on a physical port or a port channel.
It should reject the operation that a user wants to configure an attribute that will be inserted into CONFIG_DB.PORT table on a port channel. Otherwise, it will generate an entry for the port channel, which causes orchagent to be aborted.

Eg. the following commands will cause an error

admin@sonic:~$ sudo config portchannel add PortChannel0001
admin@sonic:~$ sudo config interface speed PortChannel0001 100000

After the fix, configuring physical attributes on a port channel will be rejected

- How I did it

- How to verify it
Unit test

Signed-off-by: Stephen Sun <stephens@nvidia.com>
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
…onic-net#2456)

- What I did
portconfig is a utility designed to configure various attributes on a physical port or a port channel.
It should reject the operation that a user wants to configure an attribute that will be inserted into CONFIG_DB.PORT table on a port channel. Otherwise, it will generate an entry for the port channel, which causes orchagent to be aborted.

Eg. the following commands will cause an error

admin@sonic:~$ sudo config portchannel add PortChannel0001
admin@sonic:~$ sudo config interface speed PortChannel0001 100000

After the fix, configuring physical attributes on a port channel will be rejected

- How I did it

- How to verify it
Unit test

Signed-off-by: Stephen Sun <stephens@nvidia.com>
mdanish-kh pushed a commit to mdanish-kh/sonic-utilities that referenced this pull request Nov 23, 2022
…onic-net#2456)

- What I did
portconfig is a utility designed to configure various attributes on a physical port or a port channel.
It should reject the operation that a user wants to configure an attribute that will be inserted into CONFIG_DB.PORT table on a port channel. Otherwise, it will generate an entry for the port channel, which causes orchagent to be aborted.

Eg. the following commands will cause an error

admin@sonic:~$ sudo config portchannel add PortChannel0001
admin@sonic:~$ sudo config interface speed PortChannel0001 100000

After the fix, configuring physical attributes on a port channel will be rejected

- How I did it

- How to verify it
Unit test

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants