diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_tun.py b/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_tun.py index 706c00394e7..8f903b6acba 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_tun.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_tun.py @@ -90,15 +90,15 @@ class OVSTunnelBridge(ovs_bridge.OVSAgentBridge, # addresses (assumes that lvid has already been set by a previous flow) # Once remote mac addresses are learnt, output packet to patch_int flow_specs = [ - ofpp.NXFlowSpecMatch(src=('vlan_vid', 0), - dst=('vlan_vid', 0), + ofpp.NXFlowSpecMatch(src=('vlan_tci', 0), + dst=('vlan_tci', 0), n_bits=12), ofpp.NXFlowSpecMatch(src=('eth_src', 0), dst=('eth_dst', 0), n_bits=48), ofpp.NXFlowSpecLoad(src=0, - dst=('vlan_vid', 0), - n_bits=12), + dst=('vlan_tci', 0), + n_bits=16), ofpp.NXFlowSpecLoad(src=('tunnel_id', 0), dst=('tunnel_id', 0), n_bits=64), diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_ryuapp.py b/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_ryuapp.py index a219b6bb59a..ea22bd7fc72 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_ryuapp.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_ryuapp.py @@ -19,7 +19,9 @@ import functools import ryu.app.ofctl.api # noqa from ryu.base import app_manager from ryu.lib import hub +from ryu.lib import type_desc from ryu.ofproto import ofproto_v1_3 +from ryu.ofproto import oxm_fields from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \ import br_int @@ -47,6 +49,11 @@ class OVSNeutronAgentRyuApp(app_manager.RyuApp): # Start Ryu event loop thread super(OVSNeutronAgentRyuApp, self).start() + # patch ryu + ofproto_v1_3.oxm_types.append( + oxm_fields.NiciraExtended0('vlan_tci', 4, type_desc.Int2)) + oxm_fields.generate(ofproto_v1_3.__name__) + def _make_br_cls(br_cls): return functools.partial(br_cls, ryu_app=self) diff --git a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_br_tun.py b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_br_tun.py index 6c10c725be1..7a10169873b 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_br_tun.py +++ b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_br_tun.py @@ -104,16 +104,16 @@ class OVSTunnelBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase, priority=1, specs=[ ofpp.NXFlowSpecMatch( - dst=('vlan_vid', 0), + dst=('vlan_tci', 0), n_bits=12, - src=('vlan_vid', 0)), + src=('vlan_tci', 0)), ofpp.NXFlowSpecMatch( dst=('eth_dst', 0), n_bits=48, src=('eth_src', 0)), ofpp.NXFlowSpecLoad( - dst=('vlan_vid', 0), - n_bits=12, + dst=('vlan_tci', 0), + n_bits=16, src=0), ofpp.NXFlowSpecLoad( dst=('tunnel_id', 0), @@ -210,16 +210,16 @@ class OVSTunnelBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase, priority=1, specs=[ ofpp.NXFlowSpecMatch( - dst=('vlan_vid', 0), + dst=('vlan_tci', 0), n_bits=12, - src=('vlan_vid', 0)), + src=('vlan_tci', 0)), ofpp.NXFlowSpecMatch( dst=('eth_dst', 0), n_bits=48, src=('eth_src', 0)), ofpp.NXFlowSpecLoad( - dst=('vlan_vid', 0), - n_bits=12, + dst=('vlan_tci', 0), + n_bits=16, src=0), ofpp.NXFlowSpecLoad( dst=('tunnel_id', 0),