]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/infiniband/sw/rxe/rxe_verbs.h
IB/rxe: Make counters thread safe
[linux.git] / drivers / infiniband / sw / rxe / rxe_verbs.h
index 831381b7788da971ea953b2db620ea0448555dbc..74e04801d34db1643bc398719c56f54a5943f8f4 100644 (file)
@@ -409,16 +409,16 @@ struct rxe_dev {
        spinlock_t              mmap_offset_lock; /* guard mmap_offset */
        int                     mmap_offset;
 
-       u64                     stats_counters[RXE_NUM_OF_COUNTERS];
+       atomic64_t              stats_counters[RXE_NUM_OF_COUNTERS];
 
        struct rxe_port         port;
        struct list_head        list;
        struct crypto_shash     *tfm;
 };
 
-static inline void rxe_counter_inc(struct rxe_dev *rxe, enum rxe_counters cnt)
+static inline void rxe_counter_inc(struct rxe_dev *rxe, enum rxe_counters index)
 {
-       rxe->stats_counters[cnt]++;
+       atomic64_inc(&rxe->stats_counters[index]);
 }
 
 static inline struct rxe_dev *to_rdev(struct ib_device *dev)