forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/infiniband/hw/hfi1/user_sdma.h
....@@ -1,6 +1,7 @@
11 #ifndef _HFI1_USER_SDMA_H
22 #define _HFI1_USER_SDMA_H
33 /*
4
+ * Copyright(c) 2020 - Cornelis Networks, Inc.
45 * Copyright(c) 2015 - 2018 Intel Corporation.
56 *
67 * This file is provided under a dual BSD/GPLv2 license. When using or
....@@ -110,12 +111,6 @@
110111 SDMA_PKT_Q_DEFERRED,
111112 };
112113
113
-/*
114
- * Maximum retry attempts to submit a TX request
115
- * before putting the process to sleep.
116
- */
117
-#define MAX_DEFER_RETRY_COUNT 1
118
-
119114 #define SDMA_IOWAIT_TIMEOUT 1000 /* in milliseconds */
120115
121116 #define SDMA_DBG(req, fmt, ...) \
....@@ -139,7 +134,6 @@
139134 unsigned long unpinned;
140135 struct mmu_rb_handler *handler;
141136 atomic_t n_locked;
142
- struct mm_struct *mm;
143137 };
144138
145139 struct hfi1_user_sdma_comp_q {
....@@ -204,12 +198,12 @@
204198 s8 ahg_idx;
205199
206200 /* Writeable fields shared with interrupt */
207
- u64 seqcomp ____cacheline_aligned_in_smp;
208
- u64 seqsubmitted;
201
+ u16 seqcomp ____cacheline_aligned_in_smp;
202
+ u16 seqsubmitted;
209203
210204 /* Send side fields */
211205 struct list_head txps ____cacheline_aligned_in_smp;
212
- u64 seqnum;
206
+ u16 seqnum;
213207 /*
214208 * KDETH.OFFSET (TID) field
215209 * The offset can cover multiple packets, depending on the
....@@ -245,7 +239,7 @@
245239 struct list_head list;
246240 struct user_sdma_request *req;
247241 u16 flags;
248
- u64 seqnum;
242
+ u16 seqnum;
249243 };
250244
251245 int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt,
....@@ -256,4 +250,9 @@
256250 struct iovec *iovec, unsigned long dim,
257251 unsigned long *count);
258252
253
+static inline struct mm_struct *mm_from_sdma_node(struct sdma_mmu_node *node)
254
+{
255
+ return node->rb.handler->mn.mm;
256
+}
257
+
259258 #endif /* _HFI1_USER_SDMA_H */