Description
When a MAC move happens from remote end point to local, the ASIC DB update doesn't reflect the current state of the MAC address.
This may be due to the fact that mac update to ASIC DB is done using hset of list of fields obtained in the notification but it doesn't remove the existing fields.
https://github.com/Azure/sonic-sairedis/blob/f50dba7c2a3fa07428aabe1384f9b10c0b9f1937/syncd/RedisClient.cpp#L565
Before the MAC move
127.0.0.1:6379[1]> hgetall "ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x2600000000078e\",\"mac\":\"86:4F:D9:01:00:D2\",\"switch_id\":\"oid:0x21000000000000\"}"
1) "SAI_FDB_ENTRY_ATTR_TYPE"
2) "SAI_FDB_ENTRY_TYPE_DYNAMIC"
3) "SAI_FDB_ENTRY_ATTR_ALLOW_MAC_MOVE"
4) "true"
5) "SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID"
6) "oid:0x3a00000000078f"
7) "SAI_FDB_ENTRY_ATTR_ENDPOINT_IP"
8) "12.0.0.2"
9) "SAI_FDB_ENTRY_ATTR_PACKET_ACTION"
10) "SAI_PACKET_ACTION_FORWARD"
127.0.0.1:6379[1]>
MAC move event
2022-07-21.01:23:31.016612|n|fdb_event|[{"fdb_entry":"{\"bvid\":\"oid:0x26000000000c68\",\"mac\":\"5A:E0:86:35:02:3E\",\"switch_id\":\"oid:0x21000000000000\"}","fdb_event":"SAI_FDB_EVENT_MOVE","list":[{"id":"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID","value":"oid:0x3a000000000c69"},{"id":"SAI_FDB_ENTRY_ATTR_TYPE","value":"SAI_FDB_ENTRY_TYPE_DYNAMIC"},{"id":"SAI_FDB_ENTRY_ATTR_PACKET_ACTION","value":"SAI_PACKET_ACTION_FORWARD"}]}]|
After the MAC move
127.0.0.1:6379[1]> hgetall "ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bvid\":\"oid:0x26000000000c68\",\"mac\":\"5A:E0:86:35:02:3E\",\"switch_id\":\"oid:0x21000000000000\"}"
1) "SAI_FDB_ENTRY_ATTR_TYPE"
2) "SAI_FDB_ENTRY_TYPE_DYNAMIC"
3) "SAI_FDB_ENTRY_ATTR_ALLOW_MAC_MOVE"
4) "true"
5) "SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID"
6) "oid:0x3a000000000c69"
7) "SAI_FDB_ENTRY_ATTR_ENDPOINT_IP"
8) "12.0.0.2"
9) "SAI_FDB_ENTRY_ATTR_PACKET_ACTION"
10) "SAI_PACKET_ACTION_FORWARD"
Steps to reproduce the issue:
- MAC move from remote to local.
- Check if the fields are updated in ASIC DB properly.
Describe the results you received:
The fields are not properly updated.
Describe the results you expected:
The fields should be properly updated.
Output of show version:
SONiC Software Version: SONiC.master.370-4fb6cf03e_Internal
Distribution: Debian 11.3
Kernel: 5.10.0-12-2-amd64
Build commit: 4fb6cf03e
Build date: Tue Jul 5 08:28:28 UTC 2022
Built by: sw-r2d2-bot@r-build-sonic-ci02-244
Platform: x86_64-mlnx_msn3420-r0
HwSKU: ACS-MSN3420
ASIC: mellanox
ASIC Count: 1
Serial Number: MT2019X13878
Model Number: MSN3420-CB2FO
Hardware Revision: A1
Uptime: 02:30:58 up 6:40, 1 user, load average: 0.69, 0.74, 0.87
Date: Thu 21 Jul 2022 02:30:58
Docker images:
REPOSITORY TAG IMAGE ID SIZE
docker-macsec latest 2d9447c3e23f 460MB
docker-dhcp-relay latest f99691ffb6da 451MB
docker-syncd-mlnx latest f140fd933603 991MB
docker-syncd-mlnx master.370-4fb6cf03e_Internal f140fd933603 991MB
docker-sonic-telemetry latest a5257d5d0f9d 522MB
docker-sonic-telemetry master.370-4fb6cf03e_Internal a5257d5d0f9d 522MB
docker-router-advertiser latest f2a879e1a04d 442MB
docker-router-advertiser master.370-4fb6cf03e_Internal f2a879e1a04d 442MB
docker-platform-monitor latest 205a6186e0ac 994MB
docker-platform-monitor master.370-4fb6cf03e_Internal 205a6186e0ac 994MB
docker-orchagent latest f4a0b52c8f56 476MB
docker-orchagent master.370-4fb6cf03e_Internal f4a0b52c8f56 476MB
docker-mux latest ed2b817bd52c 490MB
docker-mux master.370-4fb6cf03e_Internal ed2b817bd52c 490MB
docker-database latest a9ee6bd703a6 442MB
docker-database master.370-4fb6cf03e_Internal a9ee6bd703a6 442MB
docker-teamd latest 3aedfac22e52 427MB
docker-teamd master.370-4fb6cf03e_Internal 3aedfac22e52 427MB
docker-sonic-mgmt-framework latest 020f72a9284b 556MB
docker-sonic-mgmt-framework master.370-4fb6cf03e_Internal 020f72a9284b 556MB
docker-snmp latest 5cdc307ec95d 456MB
docker-snmp master.370-4fb6cf03e_Internal 5cdc307ec95d 456MB
docker-sflow latest feded85a0f31 428MB
docker-sflow master.370-4fb6cf03e_Internal feded85a0f31 428MB
docker-nat latest dae3c27e75da 430MB
docker-nat master.370-4fb6cf03e_Internal dae3c27e75da 430MB
docker-lldp latest ff1fa590d900 452MB
docker-lldp master.370-4fb6cf03e_Internal ff1fa590d900 452MB
docker-fpm-frr latest 357d2d39f11f 456MB
docker-fpm-frr master.370-4fb6cf03e_Internal 357d2d39f11f 456MB
Output of show techsupport:
(paste your output here or download and attach the file here )
Additional information you deem important (e.g. issue happens only occasionally):
Description
When a MAC move happens from remote end point to local, the ASIC DB update doesn't reflect the current state of the MAC address.
This may be due to the fact that mac update to ASIC DB is done using hset of list of fields obtained in the notification but it doesn't remove the existing fields.
https://github.com/Azure/sonic-sairedis/blob/f50dba7c2a3fa07428aabe1384f9b10c0b9f1937/syncd/RedisClient.cpp#L565
Before the MAC move
MAC move event
After the MAC move
Steps to reproduce the issue:
Describe the results you received:
The fields are not properly updated.
Describe the results you expected:
The fields should be properly updated.
Output of
show version:Output of
show techsupport:Additional information you deem important (e.g. issue happens only occasionally):