From 49fc439de3c983e71b57ae11af552f88961a909f Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Wed, 14 May 2014 16:19:34 +0900 Subject: [PATCH] ofproto-dpif-upcall: Use atomic_long in struct udpif Some concern has been raised by Ben Pfaff that atomic_uint64_t may not be portable. Accordingly, use atomic_ulong instead of atomic_uint64_t in struct ofproto. This is in preparation for removing atomic_uint64_t entirely. Cc: YAMAMOTO Takashi Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif-upcall.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index f15e9162c..193f4cd4f 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -125,7 +125,7 @@ struct udpif { atomic_uint flow_limit; /* Datapath flow hard limit. */ /* n_flows_mutex prevents multiple threads updating these concurrently. */ - atomic_uint64_t n_flows; /* Number of flows in the datapath. */ + atomic_ulong n_flows; /* Number of flows in the datapath. */ atomic_llong n_flows_timestamp; /* Last time n_flows was updated. */ struct ovs_mutex n_flows_mutex; }; @@ -217,7 +217,7 @@ static void udpif_start_threads(struct udpif *, size_t n_handlers, size_t n_revalidators); static void *udpif_upcall_handler(void *); static void *udpif_revalidator(void *); -static uint64_t udpif_get_n_flows(struct udpif *); +static unsigned long udpif_get_n_flows(struct udpif *); static void revalidate(struct revalidator *); static void revalidator_sweep(struct revalidator *); static void revalidator_purge(struct revalidator *); @@ -484,11 +484,11 @@ udpif_flush_all_datapaths(void) } -static uint64_t +static unsigned long udpif_get_n_flows(struct udpif *udpif) { long long int time, now; - uint64_t flow_count; + unsigned long flow_count; now = time_msec(); atomic_read(&udpif->n_flows_timestamp, &time); @@ -1600,7 +1600,7 @@ upcall_unixctl_show(struct unixctl_conn *conn, int argc OVS_UNUSED, atomic_read(&udpif->flow_limit, &flow_limit); ds_put_format(&ds, "%s:\n", dpif_name(udpif->dpif)); - ds_put_format(&ds, "\tflows : (current %"PRIu64")" + ds_put_format(&ds, "\tflows : (current %lu)" " (avg %u) (max %u) (limit %u)\n", udpif_get_n_flows(udpif), udpif->avg_n_flows, udpif->max_n_flows, flow_limit); ds_put_format(&ds, "\tdump duration : %lldms\n", udpif->dump_duration); -- 2.20.1