LGTM, thanks!

Acked-by: Romain Lenglet <[email protected]>
-- 
Romain Lenglet

On September 10, 2015 at 6:41:42 PM, Joe Stringer ([email protected]) 
wrote:

Rather than describing this intention after the fact, encode this  
meaning in the name of a function.  

Signed-off-by: Joe Stringer <[email protected]>  
---  
ofproto/ofproto-dpif-ipfix.c | 10 ++++++++--  
1 file changed, 8 insertions(+), 2 deletions(-)  

diff --git a/ofproto/ofproto-dpif-ipfix.c b/ofproto/ofproto-dpif-ipfix.c  
index b4d3ea0..48ff827 100644  
--- a/ofproto/ofproto-dpif-ipfix.c  
+++ b/ofproto/ofproto-dpif-ipfix.c  
@@ -1674,6 +1674,12 @@ dpif_ipfix_sample(struct dpif_ipfix_exporter *exporter,  
ipfix_cache_update(exporter, entry);  
}  

+static bool  
+bridge_exporter_enabled(struct dpif_ipfix *di)  
+{  
+ return di->bridge_exporter.probability > 0;  
+}  
+  
void  
dpif_ipfix_bridge_sample(struct dpif_ipfix *di, const struct dp_packet *packet, 
 
const struct flow *flow,  
@@ -1822,7 +1828,7 @@ dpif_ipfix_run(struct dpif_ipfix *di) OVS_EXCLUDED(mutex) 
 

ovs_mutex_lock(&mutex);  
get_export_time_now(&export_time_usec, &export_time_sec);  
- if (di->bridge_exporter.probability > 0) { /* Bridge exporter enabled. */  
+ if (bridge_exporter_enabled(di)) {  
dpif_ipfix_cache_expire(  
&di->bridge_exporter.exporter, false, export_time_usec,  
export_time_sec);  
@@ -1842,7 +1848,7 @@ dpif_ipfix_wait(struct dpif_ipfix *di) 
OVS_EXCLUDED(mutex)  
struct dpif_ipfix_flow_exporter_map_node *flow_exporter_node;  

ovs_mutex_lock(&mutex);  
- if (di->bridge_exporter.probability > 0) { /* Bridge exporter enabled. */  
+ if (bridge_exporter_enabled(di)) {  
if (ipfix_cache_next_timeout_msec(  
&di->bridge_exporter.exporter, &next_timeout_msec)) {  
poll_timer_wait_until(next_timeout_msec);  
--  
2.1.4  

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to