[ovs-dev] [PATCH v3] ipfix: support tunnel information for Flow IPFIX

Ben Pfaff blp at ovn.org
Fri Jun 10 22:30:12 UTC 2016


On Fri, Jun 10, 2016 at 07:57:49PM +0800, Benli Ye wrote:
> Add support to export tunnel information for flow-based IPFIX.

Thanks a lot for the new version.

There is an easier way to create the records we want in OVSDB,
especially if we apply the patch I just sent:
        https://patchwork.ozlabs.org/patch/633979/
I'm appending an incremental that you can fold in.  It also includes a
fix to the documentation formatting.

Now that you added the test, I understand better what's going on in
adjust_sample_action().  It actually moves the set_tunnel action around
so that it precedes the sample action.  That's awkward, and it's not
really what I had in mind.  My intent was that sampling would emit the
set_tunnel action itself, e.g. by calling commit_odp_tunnel_action()
(and probably xlate_commit_actions() too).  Is there some reason that
won't work?

Thanks,

Ben.

--8<--------------------------cut here-------------------------->8--

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index b2644f1..7647d5f 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -5836,22 +5836,16 @@ OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
                     options:remote_ip=1.1.1.2 options:local_ip=2.2.2.3 \
                     options:key=6 ofport_request=2\
                     -- add-port br0 p3 -- set Interface p3 type=dummy \
-                    ofport_request=3])
+                    ofport_request=3 \
+                    -- --id=@br0 get Bridge br0 \
+                    -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
+                    -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
+		    [<0>
+<1>
+])
 
 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
 
-dnl Retrieve uuid of br0.
-AT_CHECK([ovs-vsctl list bridge br0], [0], [stdout])
-bridge_uuid=`awk 'NR==1 {print $3}' stdout`
-
-AT_CHECK([ovs-vsctl -- create Flow_Sample_Collector_Set id=1 bridge=$bridge_uuid], [0], [stdout])
-dnl Retrieve uuid of the first record of Flow_Sample_Collector_Set.
-collector_set_uuid=`awk 'NR==1 {print $1}' stdout`
-
-dnl Sample packet using flow-based sampling.
-AT_CHECK([ovs-vsctl -- set Flow_Sample_Collector_Set $collector_set_uuid ipfix=@i -- \
-          --id=@i create IPFIX targets=\"127.0.0.1:4739\"], [0], [ignore])
-
 dnl Add openflow sample action without sampling_port.
 AT_DATA([flows.txt], [dnl
 in_port=3, actions=sample(probability=65535,collector_set_id=1),output:1
@@ -5901,7 +5895,7 @@ Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,f
 
 dnl Remove the flow which contains sample action.
 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
-AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set $collector_set_uuid], [0], [ignore])
+AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set 1], [0], [ignore])
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in
index b60db79..54ad2b0 100644
--- a/utilities/ovs-ofctl.8.in
+++ b/utilities/ovs-ofctl.8.in
@@ -2306,6 +2306,7 @@ port.  When this option is omitted, or specified as \fBNONE\fB, IPFIX
 does not differentiate between ingress packets and egress packets and
 does not export egress tunnel information.  This option was added in
 Open vSwitch 2.5.90.
+.RE
 .IP
 Refer to \fBovs\-vswitchd.conf.db\fR(8) for more details on
 configuring sample collector sets.



More information about the dev mailing list