Hi Joe, On Fri, Feb 07, 2014 at 04:39:55PM -0800, Joe Stringer wrote: > Signed-off-by: Joe Stringer <joestrin...@nicira.com> > --- > This test currently fails, and for some reason we're seeing a VLAN > tagged packet arrive at the monitor. The expected result is not 100% > correct, but it's a lot closer than what OVS is currently doing. > --- > tests/ofproto-dpif.at | 33 +++++++++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > > diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at > index 8dcd7b9..7e36ec7 100644 > --- a/tests/ofproto-dpif.at > +++ b/tests/ofproto-dpif.at > @@ -1121,6 +1121,7 @@ ON_EXIT([kill `cat ovs-ofctl.pid`]) > AT_CAPTURE_FILE([ofctl_monitor.log]) > AT_DATA([flows.txt], [dnl > dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller > +dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller > ]) > AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt]) > > @@ -1155,6 +1156,38 @@ > mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54: > 00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00 > ]) > > +dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be > +dnl copied exactly, except for the BOS bit. > +AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm > --detach --pidfile 2> ofctl_monitor.log]) > + > +for i in 1 2 3; do > + ovs-appctl netdev-dummy/receive p1 > 'in_port(1),eth(src=40:44:44:44:00:01,dst=50:54:00:00:00:07),eth_type(0x8100),mpls(label=10,tc=0,ttl=64,bos=1)'
I believe that the reason you are seeing a VLAN tagged packet come out is that you are sending a VLAN tagged packet in. This is because of eth_type(0x8100), which I believe should be eth_type(0x8847). > +done > +OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit]) > + > +AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl > +OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 > (unbuffered) > +mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 > +00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00 > +00000010 a0 40 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 > +00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 > +00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 The packet dump below starts with "40 45" after the MPLS label stack, but I believe it and all the data after it should be zero. This is because the input packet only has an L2 header followed by an MPLS LSE. This will be padded to 64 bytes with zeroes by OVS when it is received. > +dnl > +OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 > (unbuffered) > +mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 > +00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00 > +00000010 a0 40 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 > +00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 > +00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 > +dnl > +OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 > (unbuffered) > +mpls,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1 > +00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00 > +00000010 a0 40 00 00 a1 40 45 00-00 28 00 00 00 00 40 06 > +00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00 > +00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00 > +]) > + > OVS_VSWITCHD_STOP > AT_CLEANUP I will post an updated version of this patch with the changes outlined above: with these changes it passes :) In the course of looking at this I realised there is a bug which can be exercised by a variant of this patch. The bug is that push_mpls() only updates the ethertype if the input packet is not MPLS. But this does not take into account that there are two MPLS ethertypes and an MPLS push may change a packet from one to another. I will post a patch that fixes that problem and adds a test-case for it. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev