-
Notifications
You must be signed in to change notification settings - Fork 662
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
[show] Fix 'show mac' output, when FDB entry with Vlan 1 is present #1368
Conversation
Dear @prsunny, The issue sonic-net/sonic-buildimage#894 is pretty similar to sonic-net/sonic-buildimage#6367. Could I ask you to check could we solve the issue with this changes? |
Based on your configuration, IMO, the FDB should be on the 'untagged' vlan, i.e Vlan40 as a port can be untagged in only one Vlan. Displaying as "untagged" looks to be incomplete. |
Dear @prsunny, Actually, the system has two different FDB entries for the same MAC address in case with tagged Vlan: entry, linked to Vlan40 and entry with link to default Vlan(I have updated PR overview comment. Now, there are 3 FDB entries, 2 of which belongs to the same MAC address).
|
In the first place, how is fdb learnt on a non-configured Vlan? During initialization all ports are removed from default vlan. Secondly, providing the info as "untagged" can have implications. For. e.g, how can user flush this entry as there is no Vlan associated. |
@prsunny, I was wrong in my understanding of the situation. In fact, when you link Ethernet port with tagged Vlan, as in my case, the port could either receive tagged and untagged traffic. In tagged case, the traffic routes to the Vlan, but in untagged case the traffic will be automatically assigned to Native Vlan and routed there. For this traffic, the FDB entry with default Vlan is being created(and marked as Untagged in Answering on your questions:
The system does not create FDB entries till you link the port with a Vlan.
I agree with you. According to my proposition above, maybe, we could skip such FDB entries and not to show them with |
@prsunny, could I ask you to pay some attention on my last comment? |
@maksymbelei95 When You add a port to a vlan as untagged, It means that any untagged packet packets entering that port should be part of that VLAN (Bridge domain). Any interface can be an "untagged" member of only 1 Bridging domain (VLAN). |
* Skip records of FDB entries, which are linked to default Vlan 1, to prevent exception throwing while performing command 'show mac' or 'fdbshow'. Signed-off-by: Maksym Belei <[email protected]>
@maksymbelei95 |
@maksymbelei95 Could you also fix the 201911 branch? I tried cherry-pick and it does not work, since there are some other code changes happen on master. |
…1368) * Skip records of FDB entries, which are linked to default Vlan 1, to prevent exception throwing while performing command 'show mac' or 'fdbshow'. Signed-off-by: Maksym Belei <[email protected]>
…1507) * Skip records of FDB entries, which are linked to default Vlan 1, to prevent exception throwing while performing command 'show mac' or 'fdbshow'. #### What I did Resolves #894 Fixed "show mac" command execution failure in case, when the system has an FDB entry, which is linked to default Vlan 1. The failure is caused by throwing exception, while trying to get int from None type object. #### How I did it The condition has added to src/sonic-utilities/scripts/fdbshow script to handle and skip FDB entries, for which the system can not get Vlan ID. #### How to verify it Configure your system to receive both tagged and untagged traffic. For example, you could use the next steps: Do configuration on DUT sudo config portchannel add PortChannel0002 sudo config portchannel member add PortChannel0002 Ethernet68 sudo config vlan add 40 sudo config vlan member add 40 PortChannel0002 sudo config interface ip add Vlan40 40.0.0.1/24 Do configuration on Linux host sudo ip link add bond0 type bond sudo ip link set dev bond0 type bond mode 4 sudo ip link set enp5s0f1 down sudo ip link set enp5s0f1 master bond0 sudo ip link set enp5s0f1 up sudo ip link set bond0 up sudo ip link add link bond0 name bond0.40 type vlan id 40 sudo ip link set bond0.40 up sudo ip addr add 40.0.0.3/24 dev bond0.40 Do ping from linux host to DUT IP 40.0.0.1 Do command "show mac" on DUT "show mac" command should not be finished with the next message: int() argument must be a string, a bytes-like object or a number, not 'NoneType'. Instead, the normal output of the command should be shown. #### Additional information Cherry-pick of #1368. Pay attention, additional change is required. HEAD of https://github.com/Azure/sonic-py-swsssdk submodule of buildimage should be updated and be pointed to the top of 201911 branch, because current head of the submodule causes KeyError exception raising inside function `get_vlan_id_from_bvid` of `port_util.py` module: ``` SAI_VLAN_ATTR_VLAN_ID ('SAI_VLAN_ATTR_VLAN_ID',) Failed to get Vlan id for bvid oid:0x26000000000013 ``` The raising has already fixed on the top of 201911 branch of the submodule.
to prevent exception throwing while performing
command 'show mac' or 'fdbshow'.
Signed-off-by: Maksym Belei [email protected]
- What I did
Resolves #894
Fixed "show mac" command execution failure in case, when the system has an FDB entry, which is linked to default Vlan 1.
The failure is caused by throwing exception, while trying to get int from None type object.
- How I did it
The condition has added to src/sonic-utilities/scripts/fdbshow script to handle and skip FDB entries, for which the system can not get Vlan ID.
- How to verify it
Configure your system to receive both tagged and untagged traffic. For example, you could use the next steps:
sudo config portchannel add PortChannel0002
sudo config portchannel member add PortChannel0002 Ethernet68
sudo config vlan add 40
sudo config vlan member add 40 PortChannel0002
sudo config interface ip add Vlan40 40.0.0.1/24
sudo ip link add bond0 type bond
sudo ip link set dev bond0 type bond mode 4
sudo ip link set enp5s0f1 down
sudo ip link set enp5s0f1 master bond0
sudo ip link set enp5s0f1 up
sudo ip link set bond0 up
sudo ip link add link bond0 name bond0.40 type vlan id 40
sudo ip link set bond0.40 up
sudo ip addr add 40.0.0.3/24 dev bond0.40
"show mac" command should not be finished with the next message:
int() argument must be a string, a bytes-like object or a number, not 'NoneType'
. Instead, the normal output of the command should be shown.