Merge "of_interface: Use vlan_tci instead of vlan_vid"

This commit is contained in:
Jenkins 2016-09-16 07:26:48 +00:00 committed by Gerrit Code Review
commit 82b180f37a
3 changed files with 19 additions and 12 deletions

View File

@ -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),

View File

@ -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)

View File

@ -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),