Skip to content

show mac display wrong information for tagged vlan  #894

Closed
@Junchao-Mellanox

Description

@Junchao-Mellanox

Description

Steps to reproduce the issue

  1. Add a tagged vlan
  2. Add a vlan member to it
  3. Save config and reboot
  4. Issue "show mac"

Describe the results you received

admin@sonic:~$ show mac
Failed to get Vlan id for bvid oid:0x26000000000013

invalid literal for int() with base 16: 'oid:0x26000000000013'

Describe the results you expected

It should show the correct fdb entry.

Additional information you deem important (e.g. issue happens only occasionally)

This is always reproducible. And here is the related data in ASIC db:

admin@sonic:~$ redis-cli -n 1
127.0.0.1:6379[1]> keys ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:*
1) "ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x26000000000013\",\"mac\":\"EC:0D:9A:C3:B1:00\",\"switch_id\":\"oid:0x21000000000000\"}"
127.0.0.1:6379[1]> keys ASIC_STATE:SAI_OBJECT_TYPE_VLAN:*
1) "ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000005c1"
2) "ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x26000000000647"
3) "ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x26000000000013"
4) "ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x260000000005c0"
127.0.0.1:6379[1]> hgetall ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x26000000000013
1) "NULL"
2) "NULL"

According to the code in fanshow, I think we might have a few problems:

  1. bvid value "oid:0x26000000000013" cannot be converted to an int value, we might need do it like:
int(fdb["bvid"][oid_pfx:], 16)
  1. Even if we convert it as above, we will display the integer value of an oid to the "Vlan" column. Not sure if it is a good idea.
  2. I am not sure why there is a vlan entry in ASIC DB whose key/value is "NULL"/"NULL". Maybe is for the default vlan?

Output of show version

SONiC Software Version: SONiC.201911.80-827aab79
Distribution: Debian 9.12
Kernel: 4.9.0-11-2-amd64
Build commit: 827aab79
Build date: Tue Apr 28 04:09:04 UTC 2020
Built by: johnar@jenkins-worker-8

Platform: x86_64-mlnx_msn2100-r0
HwSKU: ACS-MSN2100
ASIC: mellanox
Serial Number: MT1851X13655
Uptime: 08:01:02 up 57 min,  1 user,  load average: 0.68, 0.40, 0.55

Docker images:
REPOSITORY                    TAG                  IMAGE ID            SIZE
docker-syncd-mlnx             201911.80-827aab79   460bca0bf4b1        383MB
docker-syncd-mlnx             latest               460bca0bf4b1        383MB
docker-router-advertiser      201911.80-827aab79   16c0820ef408        283MB
docker-router-advertiser      latest               16c0820ef408        283MB
docker-sonic-mgmt-framework   201911.80-827aab79   589a1f619061        422MB
docker-sonic-mgmt-framework   latest               589a1f619061        422MB
docker-platform-monitor       201911.80-827aab79   6f95ab58f81b        628MB
docker-platform-monitor       latest               6f95ab58f81b        628MB
docker-fpm-frr                201911.80-827aab79   051f94c9fe59        327MB
docker-fpm-frr                latest               051f94c9fe59        327MB
docker-sflow                  201911.80-827aab79   00a8e232d52b        307MB
docker-sflow                  latest               00a8e232d52b        307MB
docker-lldp-sv2               201911.80-827aab79   7c33ccec4241        304MB
docker-lldp-sv2               latest               7c33ccec4241        304MB
docker-dhcp-relay             201911.80-827aab79   e3273113f651        293MB
docker-dhcp-relay             latest               e3273113f651        293MB
docker-database               201911.80-827aab79   d7efde7ed482        283MB
docker-database               latest               d7efde7ed482        283MB
docker-teamd                  201911.80-827aab79   2489501d9bbf        307MB
docker-teamd                  latest               2489501d9bbf        307MB
docker-snmp-sv2               201911.80-827aab79   f18e81125d34        340MB
docker-snmp-sv2               latest               f18e81125d34        340MB
docker-orchagent              201911.80-827aab79   e07a3afec267        325MB
docker-orchagent              latest               e07a3afec267        325MB
docker-nat                    201911.80-827aab79   04cff4f32dc6        309MB
docker-nat                    latest               04cff4f32dc6        309MB
docker-sonic-telemetry        201911.80-827aab79   8175d18b53c0        344MB
docker-sonic-telemetry        latest               8175d18b53c0        344MB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions