Skip to content
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

[debug dump util] Vlan Module Added #1877

Merged
merged 6 commits into from
Nov 10, 2021

Conversation

raphaelt-nvidia
Copy link
Contributor

Signed-off-by: Raphael Tryster raphaelt@nvidia.com

What I did

Implemented vlan and vlan_member modules for debug dump utility.

How I did it

Used infrastructure and followed examples in
#1666
#1667
#1668
#1669
#1670

How to verify it

On switch: dump state vlan <vlan_name>
dump state vlan_member '<vlan_name|<member_name>'
Unit test: pytest-3 dump_tests/module_tests/vlan_test.py (same test file covers both vlan and vlan_member)

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

N/A

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

dump state vlan <vlan_name> and all variants supported by debug dump utility.

Example:

dump state vlan Vlan4
{
"Vlan4": {
"CONFIG_DB": {
"keys": [
{
"VLAN|Vlan4": {
"vlanid": "4"
}
}
],
"tables_not_found": []
},
"APPL_DB": {
"keys": [
{
"VLAN_TABLE:Vlan4": {
"admin_status": "up",
"host_ifname": "",
"mac": "ec:0d:9a:c3:b1:00",
"mtu": "9100"
}
}
],
"tables_not_found": []
},
"ASIC_DB": {
"keys": [
{
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000005dd": {
"SAI_VLAN_ATTR_VLAN_ID": "4"
}
}
],
"tables_not_found": [],
"vidtorid": {
"oid:0x260000000005dd": "oid:0x400000026"
}
},
"STATE_DB": {
"keys": [
{
"VLAN_TABLE|Vlan4": {
"state": "ok"
}
}
],
"tables_not_found": []
}
}
}

dump state vlan_member '<vlan_name>|<member_name>' and all variants supported by debug dump utility.

Note the required use of quotes. This is because without them, the linux infrastructure interprets '|' as a command separator. Multiple vlan|member pairs can be enclosed in the same quotes.

Examples:

dump state vlan_member 'Vlan3|Ethernet0'
{
"Vlan3|Ethernet0": {
"CONFIG_DB": {
"keys": [
{
"VLAN_MEMBER|Vlan3|Ethernet0": {
"tagging_mode": "tagged"
}
}
],
"tables_not_found": []
},
"APPL_DB": {
"keys": [
{
"VLAN_MEMBER_TABLE:Vlan3:Ethernet0": {
"tagging_mode": "tagged"
}
}
],
"tables_not_found": []
},
"ASIC_DB": {
"keys": [
{
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN_MEMBER:oid:0x270000000005df": {
"SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005de",
"SAI_VLAN_MEMBER_ATTR_VLAN_ID": "oid:0x260000000005dc",
"SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE": "SAI_VLAN_TAGGING_MODE_TAGGED"
}
},
{
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000005de": {
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true",
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW",
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x100000000037a",
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT"
}
}
],
"tables_not_found": [],
"vidtorid": {
"oid:0x270000000005df": "oid:0x30027",
"oid:0x3a0000000005de": "oid:0x3a"
}
},
"STATE_DB": {
"keys": [
{
"VLAN_MEMBER_TABLE|Vlan3|Ethernet0": {
"state": "ok"
}
}
],
"tables_not_found": []
}
}
}

dump state vlan_member 'Vlan3|Ethernet8,Vlan4|Ethernet16'
{
"Vlan3|Ethernet8": {
"CONFIG_DB": {
"keys": [
{
"VLAN_MEMBER|Vlan3|Ethernet8": {
"tagging_mode": "tagged"
}
}
],
"tables_not_found": []
},
"APPL_DB": {
"keys": [
{
"VLAN_MEMBER_TABLE:Vlan3:Ethernet8": {
"tagging_mode": "tagged"
}
}
],
"tables_not_found": []
},
"ASIC_DB": {
"keys": [
{
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN_MEMBER:oid:0x270000000005e1": {
"SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005e0",
"SAI_VLAN_MEMBER_ATTR_VLAN_ID": "oid:0x260000000005dc",
"SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE": "SAI_VLAN_TAGGING_MODE_TAGGED"
}
},
{
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000005e0": {
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true",
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW",
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x10000000002f6",
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT"
}
}
],
"tables_not_found": [],
"vidtorid": {
"oid:0x270000000005e1": "oid:0x100030027",
"oid:0x3a0000000005e0": "oid:0x10000003a"
}
},
"STATE_DB": {
"keys": [
{
"VLAN_MEMBER_TABLE|Vlan3|Ethernet8": {
"state": "ok"
}
}
],
"tables_not_found": []
}
},
"Vlan4|Ethernet16": {
"CONFIG_DB": {
"keys": [
{
"VLAN_MEMBER|Vlan4|Ethernet16": {
"tagging_mode": "tagged"
}
}
],
"tables_not_found": []
},
"APPL_DB": {
"keys": [
{
"VLAN_MEMBER_TABLE:Vlan4:Ethernet16": {
"tagging_mode": "tagged"
}
}
],
"tables_not_found": []
},
"ASIC_DB": {
"keys": [
{
"ASIC_STATE:SAI_OBJECT_TYPE_VLAN_MEMBER:oid:0x270000000005e3": {
"SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000005e2",
"SAI_VLAN_MEMBER_ATTR_VLAN_ID": "oid:0x260000000005dd",
"SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE": "SAI_VLAN_TAGGING_MODE_TAGGED"
}
},
{
"ASIC_STATE:SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a0000000005e2": {
"SAI_BRIDGE_PORT_ATTR_ADMIN_STATE": "true",
"SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE": "SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW",
"SAI_BRIDGE_PORT_ATTR_PORT_ID": "oid:0x1000000000338",
"SAI_BRIDGE_PORT_ATTR_TYPE": "SAI_BRIDGE_PORT_TYPE_PORT"
}
}
],
"tables_not_found": [],
"vidtorid": {
"oid:0x270000000005e3": "oid:0x200040027",
"oid:0x3a0000000005e2": "oid:0x20000003a"
}
},
"STATE_DB": {
"keys": [
{
"VLAN_MEMBER_TABLE|Vlan4|Ethernet16": {
"state": "ok"
}
}
],
"tables_not_found": []
}
}
}

raphaelt-nvidia and others added 5 commits August 10, 2021 18:48
Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
…nd Vivek's comments

Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
…y Sud

Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
Signed-off-by: raphaelt <raphaelt@contoso.com>
Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Oct 13, 2021

This pull request introduces 2 alerts when merging 256403f into 9ab20fd - view on LGTM.com

new alerts:

  • 2 for Unused import

Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
@raphaelt-nvidia
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@raphaelt-nvidia
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

@SuvarnaMeenakshi could you please help review?

@liat-grozovik liat-grozovik changed the title [Debug Dump Util] Vlan Module Added [debug dump util] Vlan Module Added Nov 8, 2021
Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@SuvarnaMeenakshi SuvarnaMeenakshi merged commit 5e95fc3 into sonic-net:master Nov 10, 2021
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.

5 participants