@@ -157,8 +157,6 @@ struct smb_direct_transport {
157
157
mempool_t * recvmsg_mempool ;
158
158
struct kmem_cache * recvmsg_cache ;
159
159
160
- wait_queue_head_t wait_send_payload_pending ;
161
- atomic_t send_payload_pending ;
162
160
wait_queue_head_t wait_send_pending ;
163
161
atomic_t send_pending ;
164
162
@@ -386,8 +384,6 @@ static struct smb_direct_transport *alloc_transport(struct rdma_cm_id *cm_id)
386
384
spin_lock_init (& t -> empty_recvmsg_queue_lock );
387
385
INIT_LIST_HEAD (& t -> empty_recvmsg_queue );
388
386
389
- init_waitqueue_head (& t -> wait_send_payload_pending );
390
- atomic_set (& t -> send_payload_pending , 0 );
391
387
init_waitqueue_head (& t -> wait_send_pending );
392
388
atomic_set (& t -> send_pending , 0 );
393
389
@@ -417,8 +413,6 @@ static void free_transport(struct smb_direct_transport *t)
417
413
wake_up_interruptible (& t -> wait_send_credits );
418
414
419
415
ksmbd_debug (RDMA , "wait for all send posted to IB to finish\n" );
420
- wait_event (t -> wait_send_payload_pending ,
421
- atomic_read (& t -> send_payload_pending ) == 0 );
422
416
wait_event (t -> wait_send_pending ,
423
417
atomic_read (& t -> send_pending ) == 0 );
424
418
@@ -873,13 +867,8 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc)
873
867
smb_direct_disconnect_rdma_connection (t );
874
868
}
875
869
876
- if (sendmsg -> num_sge > 1 ) {
877
- if (atomic_dec_and_test (& t -> send_payload_pending ))
878
- wake_up (& t -> wait_send_payload_pending );
879
- } else {
880
- if (atomic_dec_and_test (& t -> send_pending ))
881
- wake_up (& t -> wait_send_pending );
882
- }
870
+ if (atomic_dec_and_test (& t -> send_pending ))
871
+ wake_up (& t -> wait_send_pending );
883
872
884
873
/* iterate and free the list of messages in reverse. the list's head
885
874
* is invalid.
@@ -911,21 +900,12 @@ static int smb_direct_post_send(struct smb_direct_transport *t,
911
900
{
912
901
int ret ;
913
902
914
- if (wr -> num_sge > 1 )
915
- atomic_inc (& t -> send_payload_pending );
916
- else
917
- atomic_inc (& t -> send_pending );
918
-
903
+ atomic_inc (& t -> send_pending );
919
904
ret = ib_post_send (t -> qp , wr , NULL );
920
905
if (ret ) {
921
906
pr_err ("failed to post send: %d\n" , ret );
922
- if (wr -> num_sge > 1 ) {
923
- if (atomic_dec_and_test (& t -> send_payload_pending ))
924
- wake_up (& t -> wait_send_payload_pending );
925
- } else {
926
- if (atomic_dec_and_test (& t -> send_pending ))
927
- wake_up (& t -> wait_send_pending );
928
- }
907
+ if (atomic_dec_and_test (& t -> send_pending ))
908
+ wake_up (& t -> wait_send_pending );
929
909
smb_direct_disconnect_rdma_connection (t );
930
910
}
931
911
return ret ;
@@ -1326,8 +1306,8 @@ static int smb_direct_writev(struct ksmbd_transport *t,
1326
1306
* that means all the I/Os have been out and we are good to return
1327
1307
*/
1328
1308
1329
- wait_event (st -> wait_send_payload_pending ,
1330
- atomic_read (& st -> send_payload_pending ) == 0 );
1309
+ wait_event (st -> wait_send_pending ,
1310
+ atomic_read (& st -> send_pending ) == 0 );
1331
1311
return ret ;
1332
1312
}
1333
1313
0 commit comments