@@ -418,10 +418,10 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc)
418418 return ;
419419 }
420420
421- if (atomic_dec_and_test (& info -> send_pending ))
422- wake_up (& info -> wait_send_pending );
421+ if (atomic_dec_and_test (& sc -> send_io . pending . count ))
422+ wake_up (& sc -> send_io . pending . zero_wait_queue );
423423
424- wake_up (& info -> wait_post_send );
424+ wake_up (& sc -> send_io . pending . dec_wait_queue );
425425
426426 mempool_free (request , sc -> send_io .mem .pool );
427427}
@@ -908,14 +908,14 @@ static int smbd_post_send_negotiate_req(struct smbd_connection *info)
908908 request -> sge [0 ].addr ,
909909 request -> sge [0 ].length , request -> sge [0 ].lkey );
910910
911- atomic_inc (& info -> send_pending );
911+ atomic_inc (& sc -> send_io . pending . count );
912912 rc = ib_post_send (sc -> ib .qp , & send_wr , NULL );
913913 if (!rc )
914914 return 0 ;
915915
916916 /* if we reach here, post send failed */
917917 log_rdma_send (ERR , "ib_post_send failed rc=%d\n" , rc );
918- atomic_dec (& info -> send_pending );
918+ atomic_dec (& sc -> send_io . pending . count );
919919 ib_dma_unmap_single (sc -> ib .dev , request -> sge [0 ].addr ,
920920 request -> sge [0 ].length , DMA_TO_DEVICE );
921921
@@ -1038,8 +1038,8 @@ static int smbd_post_send_iter(struct smbd_connection *info,
10381038 }
10391039
10401040wait_send_queue :
1041- wait_event (info -> wait_post_send ,
1042- atomic_read (& info -> send_pending ) < sp -> send_credit_target ||
1041+ wait_event (sc -> send_io . pending . dec_wait_queue ,
1042+ atomic_read (& sc -> send_io . pending . count ) < sp -> send_credit_target ||
10431043 sc -> status != SMBDIRECT_SOCKET_CONNECTED );
10441044
10451045 if (sc -> status != SMBDIRECT_SOCKET_CONNECTED ) {
@@ -1048,9 +1048,9 @@ static int smbd_post_send_iter(struct smbd_connection *info,
10481048 goto err_wait_send_queue ;
10491049 }
10501050
1051- if (unlikely (atomic_inc_return (& info -> send_pending ) >
1051+ if (unlikely (atomic_inc_return (& sc -> send_io . pending . count ) >
10521052 sp -> send_credit_target )) {
1053- atomic_dec (& info -> send_pending );
1053+ atomic_dec (& sc -> send_io . pending . count );
10541054 goto wait_send_queue ;
10551055 }
10561056
@@ -1157,8 +1157,8 @@ static int smbd_post_send_iter(struct smbd_connection *info,
11571157 atomic_sub (new_credits , & info -> receive_credits );
11581158
11591159err_alloc :
1160- if (atomic_dec_and_test (& info -> send_pending ))
1161- wake_up (& info -> wait_send_pending );
1160+ if (atomic_dec_and_test (& sc -> send_io . pending . count ))
1161+ wake_up (& sc -> send_io . pending . zero_wait_queue );
11621162
11631163err_wait_send_queue :
11641164 /* roll back send credits and pending */
@@ -1848,11 +1848,6 @@ static struct smbd_connection *_smbd_get_connection(
18481848 queue_delayed_work (info -> workqueue , & info -> idle_timer_work ,
18491849 msecs_to_jiffies (sp -> keepalive_interval_msec ));
18501850
1851- init_waitqueue_head (& info -> wait_send_pending );
1852- atomic_set (& info -> send_pending , 0 );
1853-
1854- init_waitqueue_head (& info -> wait_post_send );
1855-
18561851 INIT_WORK (& info -> post_send_credits_work , smbd_post_send_credits );
18571852 info -> new_credits_offered = 0 ;
18581853 spin_lock_init (& info -> lock_new_credits_offered );
@@ -2151,8 +2146,8 @@ int smbd_send(struct TCP_Server_Info *server,
21512146 * that means all the I/Os have been out and we are good to return
21522147 */
21532148
2154- wait_event (info -> wait_send_pending ,
2155- atomic_read (& info -> send_pending ) == 0 ||
2149+ wait_event (sc -> send_io . pending . zero_wait_queue ,
2150+ atomic_read (& sc -> send_io . pending . count ) == 0 ||
21562151 sc -> status != SMBDIRECT_SOCKET_CONNECTED );
21572152
21582153 if (sc -> status != SMBDIRECT_SOCKET_CONNECTED && rc == 0 )
0 commit comments