sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
717 stars 1.38k forks source link

[Query] Can VLAN 1 be used? #8962

Open mdivyamohan opened 2 years ago

mdivyamohan commented 2 years ago

The SDK I am using has VLAN 1 as the default vlan. I want to use this vlan 1 on front panel ports. Is this possible/allowed?

Currently orchagent removes all ports from the default vlan. If I want to use vlan 1, I have to create vlan 1 and add vlan members from CLI command. The create_vlan() implementation of SAI would fail as vlan already exists in SDK, but I am ignoring this error in SAI and returning success to orchagent so that it works.

This works with coldboot.

Now, when attempting warmboot this is causing below error:

Oct 12 20:18:54.879099 warning SONIC syncd: :- performObjectSetTransition: Missing current attr SAI_VLAN_ATTR_VLAN_ID (conditional: 0) CAN'T be set to 1, flags: 0x13, FIXME
Oct 12 20:18:54.895313 notice SONIC syncd: :- applyViewTransition: loop removed 3 objects
Oct 12 20:18:54.895445 notice SONIC syncd: :- applyViewTransition: comparison logic took 0.023234 sec
Oct 12 20:18:54.895456 notice SONIC syncd: :- compareViews: ASIC operations to execute: 108
Oct 12 20:18:54.895859 notice SONIC syncd: :- compareViews: all temporary view objects were processed to FINAL state
Oct 12 20:18:54.896068 notice SONIC syncd: :- compareViews: all current view objects were processed to FINAL state
Oct 12 20:18:54.896613 warning SONIC syncd: :- dumpVidToAsicOperatioId: 108: SAI_OBJECT_TYPE_VLAN:oid:0x2600000000070f
Oct 12 20:18:54.896631 err SONIC syncd: :- checkMap: wrong number of vid/rid items in map, forgot to translate? R2V: 1791:1791, V2R: 1792:1791, FIXME
Oct 12 20:18:54.904955 err SONIC syncd: :- applyView: Exception: :- checkMap: wrong number of vid/rid items in map, forgot to translate? R2V: 1791:1791, V2R: 1792:1791, FIXME
Oct 12 20:18:54.906240 notice SONIC syncd: :- applyView: apply took 0.138621 sec

Problem is caused by vlan 1:

  "ASIC_STATE:SAI_OBJECT_TYPE_VLAN:oid:0x2600000000070f": {
    "type": "hash",
    "value": {
      "SAI_VLAN_ATTR_VLAN_ID": "1"
    }
  },

Could you please help on how to overcome this problem? Or is using vlan 1 prohibited?

prsunny commented 2 years ago

VLAN 1 is the system default Vlan ID. IMO, it shall not be used as user configuration. As you could see, in warmboot this is causing issue as the config is not validated.