[ovs-dev] [bug 7759 05/11] dpif-linux: Use get_32aligned_u64() in an appropriate place.

Ben Pfaff blp at nicira.com
Wed Oct 5 11:27:40 PDT 2011


---
 lib/dpif-linux.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index 4ddd464..79e84d6 100644
--- a/lib/dpif-linux.c
+++ b/lib/dpif-linux.c
@@ -102,9 +102,9 @@ struct dpif_linux_flow {
 
     /* Attributes.
      *
-     * The 'stats' and 'used' members point to 64-bit data that might only be
-     * aligned on 32-bit boundaries, so get_unaligned_u64() should be used to
-     * access their values.
+     * The 'stats' member points to 64-bit data that might only be aligned on
+     * 32-bit boundaries, so get_unaligned_u64() should be used to access its
+     * values.
      *
      * If 'actions' is nonnull then OVS_FLOW_ATTR_ACTIONS will be included in
      * the Netlink version of the command, even if actions_len is zero. */
@@ -115,7 +115,7 @@ struct dpif_linux_flow {
     uint32_t upcall_pid;                /* OVS_FLOW_ATTR_UPCALL_PID. */
     const struct ovs_flow_stats *stats; /* OVS_FLOW_ATTR_STATS. */
     const uint8_t *tcp_flags;           /* OVS_FLOW_ATTR_TCP_FLAGS. */
-    const uint64_t *used;               /* OVS_FLOW_ATTR_USED. */
+    const ovs_32aligned_u64 *used;      /* OVS_FLOW_ATTR_USED. */
     bool clear;                         /* OVS_FLOW_ATTR_CLEAR. */
 };
 
@@ -1762,7 +1762,7 @@ dpif_linux_flow_get_stats(const struct dpif_linux_flow *flow,
         stats->n_packets = 0;
         stats->n_bytes = 0;
     }
-    stats->used = flow->used ? get_unaligned_u64(flow->used) : 0;
+    stats->used = flow->used ? get_32aligned_u64(flow->used) : 0;
     stats->tcp_flags = flow->tcp_flags ? *flow->tcp_flags : 0;
 }
 
-- 
1.7.2.5




More information about the dev mailing list