diff options
author | Benli Ye <daniely@vmware.com> | 2016-05-27 23:32:40 +0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-06-05 21:41:00 -0700 |
commit | f7a8b4d4a8991504537c1b71583aeaa243a31f69 (patch) | |
tree | 87eb05cda6e37b906c93f757925c506d0fd3b934 /ofproto | |
parent | 6da515463fd30d4ab8dcda1d3d6ba24e02060ce4 (diff) | |
download | openvswitch-f7a8b4d4a8991504537c1b71583aeaa243a31f69.tar.gz |
ipfix: Bug fix for configuring IPFIX for flows
There are two kinds of IPFIX: bridge level IPFIX and flow level
IPFIX. Now if we only configure flow level IPFIX, even if there
is no bridge IPFIX configuration, the datapath flow will contain
a sample action for bridge IPFIX. Fix it.
Steps to configure flow level IPFIX:
1) Create a new record in Flow_Sample_Collector_Set table:
'ovs-vsctl -- create Flow_Sample_Collector_Set id=1 bridge="Bridge UUID"'
2) Add IPFIX configuration which is referred by corresponding
row in Flow_Sample_Collector_Set table:
'ovs-vsctl -- set Flow_Sample_Collector_Set
"Flow_Sample_Collector_Set UUID" ipfix=@i -- --id=@i create IPFIX
targets=\"IP:4739\" obs_domain_id=123 obs_point_id=456
cache_active_timeout=60 cache_max_flows=13'
3) Add sample action to the flows:
'ovs-ofctl add-flow mybridge in_port=1,
actions=sample'('probability=65535,collector_set_id=1,
obs_domain_id=123,obs_point_id=456')',output:LOCAL'
Before this fix, if you only configure flow IPFIX, the datapath flow is:
id(0),in_port(2),eth_type(0x0806), packets:0, bytes:0, used:never,
actions:sample(sample=0.0%,actions(userspace(pid=4294960835,
ipfix(output_port=4294967295)))),sample(sample=100.0%,
actions(userspace(pid=4294960835,flow_sample(probability=65535,
collector_set_id=1,obs_domain_id=123,obs_point_id=456)))),
sample(sample=0.0%,actions(userspace(pid=4294960835,
ipfix(output_port=1)))),1
The datapath flow should only contain the sample action like below:
id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:871,
used:0.656s, actions:sample(sample=100.0%,actions(userspace(pid=4294962911,
flow_sample(probability=65535,collector_set_id=1,obs_domain_id=123,
obs_point_id=456)))),1
Signed-off-by: Benli Ye <daniely@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/ofproto-dpif-ipfix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ofproto/ofproto-dpif-ipfix.c b/ofproto/ofproto-dpif-ipfix.c index 59cd88429..79ba234ca 100644 --- a/ofproto/ofproto-dpif-ipfix.c +++ b/ofproto/ofproto-dpif-ipfix.c @@ -903,7 +903,7 @@ bool dpif_ipfix_get_bridge_exporter_input_sampling(const struct dpif_ipfix *di) OVS_EXCLUDED(mutex) { - bool ret = true; + bool ret = false; ovs_mutex_lock(&mutex); if (di->bridge_exporter.options) { ret = di->bridge_exporter.options->enable_input_sampling; @@ -916,7 +916,7 @@ bool dpif_ipfix_get_bridge_exporter_output_sampling(const struct dpif_ipfix *di) OVS_EXCLUDED(mutex) { - bool ret = true; + bool ret = false; ovs_mutex_lock(&mutex); if (di->bridge_exporter.options) { ret = di->bridge_exporter.options->enable_output_sampling; |