@@ -284,13 +284,9 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc)
284
284
request -> sge [i ].length ,
285
285
DMA_TO_DEVICE );
286
286
287
- if (request -> has_payload ) {
288
- if (atomic_dec_and_test (& request -> info -> send_payload_pending ))
289
- wake_up (& request -> info -> wait_send_payload_pending );
290
- } else {
291
- if (atomic_dec_and_test (& request -> info -> send_pending ))
292
- wake_up (& request -> info -> wait_send_pending );
293
- }
287
+ if (atomic_dec_and_test (& request -> info -> send_pending ))
288
+ wake_up (& request -> info -> wait_send_pending );
289
+
294
290
295
291
mempool_free (request , request -> info -> request_mempool );
296
292
}
@@ -749,7 +745,6 @@ static int smbd_post_send_negotiate_req(struct smbd_connection *info)
749
745
request -> sge [0 ].addr ,
750
746
request -> sge [0 ].length , request -> sge [0 ].lkey );
751
747
752
- request -> has_payload = false;
753
748
atomic_inc (& info -> send_pending );
754
749
rc = ib_post_send (info -> id -> qp , & send_wr , NULL );
755
750
if (!rc )
@@ -919,7 +914,7 @@ static void smbd_destroy_header(struct smbd_connection *info,
919
914
920
915
/* Post the send request */
921
916
static int smbd_post_send (struct smbd_connection * info ,
922
- struct smbd_request * request , bool has_payload )
917
+ struct smbd_request * request )
923
918
{
924
919
struct ib_send_wr send_wr ;
925
920
int rc , i ;
@@ -944,24 +939,13 @@ static int smbd_post_send(struct smbd_connection *info,
944
939
send_wr .opcode = IB_WR_SEND ;
945
940
send_wr .send_flags = IB_SEND_SIGNALED ;
946
941
947
- if (has_payload ) {
948
- request -> has_payload = true;
949
- atomic_inc (& info -> send_payload_pending );
950
- } else {
951
- request -> has_payload = false;
952
- atomic_inc (& info -> send_pending );
953
- }
942
+ atomic_inc (& info -> send_pending );
954
943
955
944
rc = ib_post_send (info -> id -> qp , & send_wr , NULL );
956
945
if (rc ) {
957
946
log_rdma_send (ERR , "ib_post_send failed rc=%d\n" , rc );
958
- if (has_payload ) {
959
- if (atomic_dec_and_test (& info -> send_payload_pending ))
960
- wake_up (& info -> wait_send_payload_pending );
961
- } else {
962
- if (atomic_dec_and_test (& info -> send_pending ))
963
- wake_up (& info -> wait_send_pending );
964
- }
947
+ if (atomic_dec_and_test (& info -> send_pending ))
948
+ wake_up (& info -> wait_send_pending );
965
949
smbd_disconnect_rdma_connection (info );
966
950
rc = - EAGAIN ;
967
951
} else
@@ -1001,7 +985,7 @@ static int smbd_post_send_sgl(struct smbd_connection *info,
1001
985
request -> num_sge ++ ;
1002
986
}
1003
987
1004
- rc = smbd_post_send (info , request , data_length );
988
+ rc = smbd_post_send (info , request );
1005
989
if (!rc )
1006
990
return 0 ;
1007
991
@@ -1413,8 +1397,6 @@ void smbd_destroy(struct TCP_Server_Info *server)
1413
1397
log_rdma_event (INFO , "wait for all send posted to IB to finish\n" );
1414
1398
wait_event (info -> wait_send_pending ,
1415
1399
atomic_read (& info -> send_pending ) == 0 );
1416
- wait_event (info -> wait_send_payload_pending ,
1417
- atomic_read (& info -> send_payload_pending ) == 0 );
1418
1400
1419
1401
/* It's not posssible for upper layer to get to reassembly */
1420
1402
log_rdma_event (INFO , "drain the reassembly queue\n" );
@@ -1751,8 +1733,6 @@ static struct smbd_connection *_smbd_get_connection(
1751
1733
init_waitqueue_head (& info -> wait_send_pending );
1752
1734
atomic_set (& info -> send_pending , 0 );
1753
1735
1754
- init_waitqueue_head (& info -> wait_send_payload_pending );
1755
- atomic_set (& info -> send_payload_pending , 0 );
1756
1736
1757
1737
INIT_WORK (& info -> disconnect_work , smbd_disconnect_rdma_work );
1758
1738
INIT_WORK (& info -> post_send_credits_work , smbd_post_send_credits );
@@ -2226,8 +2206,8 @@ int smbd_send(struct TCP_Server_Info *server,
2226
2206
* that means all the I/Os have been out and we are good to return
2227
2207
*/
2228
2208
2229
- wait_event (info -> wait_send_payload_pending ,
2230
- atomic_read (& info -> send_payload_pending ) == 0 );
2209
+ wait_event (info -> wait_send_pending ,
2210
+ atomic_read (& info -> send_pending ) == 0 );
2231
2211
2232
2212
return rc ;
2233
2213
}
0 commit comments