VOL-1494: Set openflow port name for each UNI
This allows the adapter to individually name each
uni as its info is queried for the logical device
Practically speaking the onu will now set
the name to serialnumber-uniport, i.e:
port=4112, portName=BRCM33333333-1
port=4113, portName=BRCM33333333-2
port=4114, portName=BRCM33333333-3
port=4115, portName=BRCM33333333-4
port=4116, portName=BRCM33333333-5
This allows a per-uni lookup in sadis
Change-Id: I3225d96b4ab47db3a7b8d50a3b537b3e08d9fef7
diff --git a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
index 8a6cad6..ce74795 100644
--- a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
+++ b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
@@ -176,9 +176,14 @@
(port_no >> 8) & 0xff,
port_no & 0xff))
+ uni_port = self.uni_port(int(port_no))
+ name = device.serial_number + '-' + str(uni_port.mac_bridge_port_num)
+ self.log.debug('ofp_port_name', port_no=port_no, name=name)
+
return PortCapability(
port=LogicalPort(
ofp_port=ofp_port(
+ name=name,
hw_addr=hw_addr,
config=0,
state=OFPPS_LIVE,
@@ -214,10 +219,8 @@
device.reason = 'activating-onu'
# TODO NEW CORE: Need to either get logical device id from core or use regular device id
- # pm_metrics requires a logical device id
- #parent_device = yield self.adapter_agent.get_device(device.parent_id)
- #self.logical_device_id = parent_device.parent_id
- #assert self.logical_device_id, 'Invalid logical device ID'
+ # pm_metrics requires a logical device id. For now set to just device_id
+ self.logical_device_id = self.device_id
yield self.core_proxy.device_update(device)
@@ -1061,4 +1064,4 @@
assert intf_id < MAX_PONS_PER_OLT
assert onu_id < MAX_ONUS_PER_PON
assert uni_id < MAX_UNIS_PER_ONU
- return intf_id << 11 | onu_id << 4 | uni_id
\ No newline at end of file
+ return intf_id << 11 | onu_id << 4 | uni_id