Skip to content

Commit

Permalink
Remove unnecessary adding BPs to default VLAN on init (opencomputepro…
Browse files Browse the repository at this point in the history
…ject#193)

Signed-off-by: Yurii Lisovskyi <[email protected]>
Signed-off-by: selldinesh <[email protected]>
  • Loading branch information
yuriilisovskyi authored and selldinesh committed Oct 16, 2023
1 parent 225fbba commit 411482a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions common/sai_npu.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,14 @@ def set_sku_mode(self, sku):
# Remove existing ports
num_ports = len(self.dot1q_bp_oids)
for idx in range(num_ports):
self.remove_vlan_member(self.default_vlan_oid, self.dot1q_bp_oids[idx])
self.remove(self.dot1q_bp_oids[idx])
oid = self.get(self.port_oids[idx], ["SAI_PORT_ATTR_PORT_SERDES_ID"]).oid()
if oid != "oid:0x0":
oid = self.get_vlan_member(self.default_vlan_oid, self.dot1q_bp_oids[idx])
if oid:
self.remove(oid)
self.remove(self.dot1q_bp_oids[idx])
status, data = self.get(self.port_oids[idx], ["SAI_PORT_ATTR_PORT_SERDES_ID"], do_assert=False)
serdes_oid = data.oid()
if status == "SAI_STATUS_SUCCESS" and serdes_oid != "oid:0x0":
self.remove(serdes_oid)
self.remove(self.port_oids[idx])
self.port_oids.clear()
self.dot1q_bp_oids.clear()
Expand Down

0 comments on commit 411482a

Please sign in to comment.