Skip to contentSkip to conversation

RDMA/rxe: Fix error type of mmap_offset

PATCH Applied Jiewei Ke 2 participants 2 messages Dec 27, 2019 – Jan 3, 2020

Subsystems (2)
lore
Share & tools
lore

Jiewei Ke

author
#0 lore raw

PATCH 1/1 RDMA/rxe: Fix error type of mmap_offset

The type of mmap_offset should be u64 instead of int to match the type of mminfo.offset. If otherwise, after we create several thousands of CQs, it will run into overflow issue.

---
 drivers/infiniband/sw/rxe/rxe_verbs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_verbs.h +1 -1
index 95834206c80c..92de39c4a7c1 100644
@@ -408,7 +408,7 @@ struct rxe_dev {
 	struct list_head	pending_mmaps;
 
 	spinlock_t		mmap_offset_lock; /* guard mmap_offset */
-	int			mmap_offset;
+	u64			mmap_offset;
 
 	atomic64_t		stats_counters[RXE_NUM_OF_COUNTERS];
 
Signature · 1 line
2.11.0
#1 lore raw
Quoted 8 lines · Jiewei Ke

The type of mmap_offset should be u64 instead of int to match the type of mminfo.offset. If otherwise, after we create several thousands of CQs, it will run into overflow issue.

---
 drivers/infiniband/sw/rxe/rxe_verbs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason