[VOL-2517] Using VLAN ANY (4096) to check for tagged ONU traffic instead of valid 4095
Change-Id: I889214acbdd44573df0a55323590991713377999
diff --git a/VERSION b/VERSION
index ca2d639..0bee604 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.3.3-dev
+2.3.3
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 3f5871b..570a5c7 100644
--- a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
+++ b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
@@ -63,6 +63,7 @@
from onu_tcont import OnuTCont
from pon_port import PonPort
from uni_port import UniPort, UniType
+from uni_port import RESERVED_TRANSPARENT_VLAN
from pyvoltha.common.tech_profile.tech_profile import TechProfile
from pyvoltha.adapters.extensions.omci.tasks.omci_test_request import OmciTestRequest
from pyvoltha.adapters.extensions.omci.omci_entities import AniG
@@ -787,7 +788,10 @@
self.log.debug('field-type-tunnel-id')
elif field.type == fd.VLAN_VID:
- _vlan_vid = field.vlan_vid & 0xfff
+ if field.vlan_vid == RESERVED_TRANSPARENT_VLAN and field.vlan_vid_mask == RESERVED_TRANSPARENT_VLAN:
+ _vlan_vid = RESERVED_TRANSPARENT_VLAN
+ else:
+ _vlan_vid = field.vlan_vid & 0xfff
self.log.debug('field-type-vlan-vid',
vlan=_vlan_vid)
@@ -865,10 +869,22 @@
self.log.error('unsupported-action-type',
action_type=action.type, in_port=_in_port)
- if _set_vlan_vid is None or _set_vlan_vid == 0:
- self.log.warn('ignorning-flow-that-does-not-set-vlanid')
+ # OMCI set vlan task can only filter and set on vlan header attributes. Any other openflow
+ # supported match and action criteria cannot be handled by omci and must be ignored.
+ if (_set_vlan_vid is None or _set_vlan_vid == 0) and _vlan_vid != RESERVED_TRANSPARENT_VLAN:
+ self.log.warn('ignoring-flow-that-does-not-set-vlanid', set_vlan_vid=_set_vlan_vid)
+ elif (_set_vlan_vid is None or _set_vlan_vid == 0) and _vlan_vid == RESERVED_TRANSPARENT_VLAN:
+ self.log.info('set-vlanid-any', uni_id=uni_id, uni_port=uni_port,
+ _set_vlan_vid=_vlan_vid,
+ _set_vlan_pcp=_set_vlan_pcp, match_vlan=_vlan_vid,
+ tp_id=tp_id)
+ self._add_vlan_filter_task(device, uni_id=uni_id, uni_port=uni_port,
+ _set_vlan_vid=_vlan_vid,
+ _set_vlan_pcp=_set_vlan_pcp, match_vlan=_vlan_vid,
+ tp_id=tp_id)
else:
- self.log.info('set-vlanid', uni_id=uni_id, uni_port=uni_port, set_vlan_vid=_set_vlan_vid, vlan_vid=_vlan_vid,tp_id=tp_id)
+ self.log.info('set-vlanid', uni_id=uni_id, uni_port=uni_port, match_vlan=_vlan_vid,
+ set_vlan_vid=_set_vlan_vid, _set_vlan_pcp=_set_vlan_pcp, ethType=_type)
self._add_vlan_filter_task(device, uni_id=uni_id, uni_port=uni_port,
_set_vlan_vid=_set_vlan_vid,
_set_vlan_pcp=_set_vlan_pcp, match_vlan=_vlan_vid,
@@ -963,7 +979,10 @@
in_port=_port)
elif field.type == fd.VLAN_VID:
- _vlan_vid = field.vlan_vid & 0xfff
+ if field.vlan_vid == RESERVED_TRANSPARENT_VLAN and field.vlan_vid_mask == RESERVED_TRANSPARENT_VLAN:
+ _vlan_vid = RESERVED_TRANSPARENT_VLAN
+ else:
+ _vlan_vid = field.vlan_vid & 0xfff
self.log.debug('field-type-vlan-vid',
vlan=_vlan_vid)
@@ -1002,6 +1021,7 @@
self.log.debug('field-type-tunnel-id',
tunnel_id=_tunnel_id)
+
else:
raise NotImplementedError('field.type={}'.format(
field.type))
@@ -1048,13 +1068,24 @@
# OMCI set vlan task can only filter and set on vlan header attributes. Any other openflow
# supported match and action criteria cannot be handled by omci and must be ignored.
- if _set_vlan_vid is None or _set_vlan_vid == 0:
- self.log.warn('ignoring-flow-that-does-not-set-vlanid')
+ if (_set_vlan_vid is None or _set_vlan_vid == 0) and _vlan_vid != RESERVED_TRANSPARENT_VLAN:
+ self.log.warn('ignoring-flow-that-does-not-set-vlanid', set_vlan_vid=_set_vlan_vid)
+ elif (_set_vlan_vid is None or _set_vlan_vid == 0) and _vlan_vid == RESERVED_TRANSPARENT_VLAN:
+ self.log.info('set-vlanid-any', uni_id=uni_id, uni_port=uni_port,
+ _set_vlan_vid=_vlan_vid,
+ _set_vlan_pcp=_set_vlan_pcp, match_vlan=_vlan_vid,
+ tp_id=tp_id)
+ self._add_vlan_filter_task(device, uni_id=uni_id, uni_port=uni_port,
+ _set_vlan_vid=_vlan_vid,
+ _set_vlan_pcp=_set_vlan_pcp, match_vlan=_vlan_vid,
+ tp_id=tp_id)
else:
- self.log.info('set-vlanid', uni_id=uni_id, uni_port=uni_port, match_vlan=_vlan_vid, set_vlan_vid=_set_vlan_vid, _set_vlan_pcp=_set_vlan_pcp, ethType=_type)
- self._add_vlan_filter_task(device, uni_id,
- uni_port=uni_port, match_vlan=_vlan_vid,
- _set_vlan_vid=_set_vlan_vid, _set_vlan_pcp=_set_vlan_pcp, tp_id=tp_id)
+ self.log.info('set-vlanid', uni_id=uni_id, uni_port=uni_port, match_vlan=_vlan_vid,
+ set_vlan_vid=_set_vlan_vid, _set_vlan_pcp=_set_vlan_pcp, ethType=_type)
+ self._add_vlan_filter_task(device, uni_id=uni_id, uni_port=uni_port,
+ _set_vlan_vid=_set_vlan_vid,
+ _set_vlan_pcp=_set_vlan_pcp, match_vlan=_vlan_vid,
+ tp_id=tp_id)
except Exception as e:
self.log.exception('failed-to-install-flow', e=e, flow=flow)
diff --git a/python/adapters/brcm_openomci_onu/omci/brcm_vlan_filter_task.py b/python/adapters/brcm_openomci_onu/omci/brcm_vlan_filter_task.py
index 20ec8e8..484ed45 100644
--- a/python/adapters/brcm_openomci_onu/omci/brcm_vlan_filter_task.py
+++ b/python/adapters/brcm_openomci_onu/omci/brcm_vlan_filter_task.py
@@ -23,11 +23,11 @@
from pyvoltha.adapters.extensions.omci.omci_me import \
VlanTaggingOperation, VlanTaggingFilterDataFrame, ExtendedVlanTaggingOperationConfigurationDataFrame
from uni_port import UniType
+from uni_port import RESERVED_TRANSPARENT_VLAN
from pon_port import DEFAULT_TPID
RC = ReasonCodes
OP = EntityOperations
-RESERVED_TRANSPARENT_VLAN = 4095
class BrcmVlanFilterException(Exception):
diff --git a/python/adapters/brcm_openomci_onu/uni_port.py b/python/adapters/brcm_openomci_onu/uni_port.py
index 045b8d3..7094022 100644
--- a/python/adapters/brcm_openomci_onu/uni_port.py
+++ b/python/adapters/brcm_openomci_onu/uni_port.py
@@ -27,6 +27,9 @@
VEIP = 'VirtualEthernetInterfacePoint'
# TODO: Add others as they become supported
+# ReservedVlan Transparent Vlan (Masked Vlan, VLAN_ANY in ONOS Flows)
+
+RESERVED_TRANSPARENT_VLAN = 4096
class UniPort(object):
"""Wraps southbound-port(s) support for ONU"""