File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,44 @@ struct smbdirect_socket {
206206 } reassembly ;
207207 } recv_io ;
208208
209+ /*
210+ * The state for Memory registrations on the client
211+ */
212+ struct {
213+ enum ib_mr_type type ;
214+
215+ /*
216+ * The list of free smbdirect_mr_io
217+ * structures
218+ */
219+ struct {
220+ struct list_head list ;
221+ spinlock_t lock ;
222+ } all ;
223+
224+ /*
225+ * The number of available MRs ready for memory registration
226+ */
227+ struct {
228+ atomic_t count ;
229+ wait_queue_head_t wait_queue ;
230+ } ready ;
231+
232+ /*
233+ * The number of used MRs
234+ */
235+ struct {
236+ atomic_t count ;
237+ } used ;
238+
239+ struct work_struct recovery_work ;
240+
241+ /* Used by transport to wait until all MRs are returned */
242+ struct {
243+ wait_queue_head_t wait_queue ;
244+ } cleanup ;
245+ } mr_io ;
246+
209247 /*
210248 * The state for RDMA read/write requests on the server
211249 */
@@ -269,6 +307,13 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
269307
270308 atomic_set (& sc -> rw_io .credits .count , 0 );
271309 init_waitqueue_head (& sc -> rw_io .credits .wait_queue );
310+
311+ spin_lock_init (& sc -> mr_io .all .lock );
312+ INIT_LIST_HEAD (& sc -> mr_io .all .list );
313+ atomic_set (& sc -> mr_io .ready .count , 0 );
314+ init_waitqueue_head (& sc -> mr_io .ready .wait_queue );
315+ atomic_set (& sc -> mr_io .used .count , 0 );
316+ init_waitqueue_head (& sc -> mr_io .cleanup .wait_queue );
272317}
273318
274319struct smbdirect_send_io {
You can’t perform that action at this time.
0 commit comments