@@ -349,7 +349,7 @@ static int smbd_conn_upcall(
349349 sc -> status = SMBDIRECT_SOCKET_DISCONNECTED ;
350350 wake_up_all (& sc -> status_wait );
351351 wake_up_all (& sc -> recv_io .reassembly .wait_queue );
352- wake_up_all (& info -> wait_send_queue );
352+ wake_up_all (& sc -> send_io . credits . wait_queue );
353353 break ;
354354
355355 default :
@@ -473,7 +473,7 @@ static bool process_negotiation_response(
473473 log_rdma_event (ERR , "error: credits_granted==0\n" );
474474 return false;
475475 }
476- atomic_set (& info -> send_credits , le16_to_cpu (packet -> credits_granted ));
476+ atomic_set (& sc -> send_io . credits . count , le16_to_cpu (packet -> credits_granted ));
477477
478478 atomic_set (& info -> receive_credits , 0 );
479479
@@ -651,12 +651,12 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc)
651651 le16_to_cpu (data_transfer -> credits_requested );
652652 if (le16_to_cpu (data_transfer -> credits_granted )) {
653653 atomic_add (le16_to_cpu (data_transfer -> credits_granted ),
654- & info -> send_credits );
654+ & sc -> send_io . credits . count );
655655 /*
656656 * We have new send credits granted from remote peer
657657 * If any sender is waiting for credits, unblock it
658658 */
659- wake_up (& info -> wait_send_queue );
659+ wake_up (& sc -> send_io . credits . wait_queue );
660660 }
661661
662662 log_incoming (INFO , "data flags %d data_offset %d data_length %d remaining_data_length %d\n" ,
@@ -1021,8 +1021,8 @@ static int smbd_post_send_iter(struct smbd_connection *info,
10211021
10221022wait_credit :
10231023 /* Wait for send credits. A SMBD packet needs one credit */
1024- rc = wait_event_interruptible (info -> wait_send_queue ,
1025- atomic_read (& info -> send_credits ) > 0 ||
1024+ rc = wait_event_interruptible (sc -> send_io . credits . wait_queue ,
1025+ atomic_read (& sc -> send_io . credits . count ) > 0 ||
10261026 sc -> status != SMBDIRECT_SOCKET_CONNECTED );
10271027 if (rc )
10281028 goto err_wait_credit ;
@@ -1032,8 +1032,8 @@ static int smbd_post_send_iter(struct smbd_connection *info,
10321032 rc = - EAGAIN ;
10331033 goto err_wait_credit ;
10341034 }
1035- if (unlikely (atomic_dec_return (& info -> send_credits ) < 0 )) {
1036- atomic_inc (& info -> send_credits );
1035+ if (unlikely (atomic_dec_return (& sc -> send_io . credits . count ) < 0 )) {
1036+ atomic_inc (& sc -> send_io . credits . count );
10371037 goto wait_credit ;
10381038 }
10391039
@@ -1162,7 +1162,7 @@ static int smbd_post_send_iter(struct smbd_connection *info,
11621162
11631163err_wait_send_queue :
11641164 /* roll back send credits and pending */
1165- atomic_inc (& info -> send_credits );
1165+ atomic_inc (& sc -> send_io . credits . count );
11661166
11671167err_wait_credit :
11681168 return rc ;
@@ -1843,7 +1843,6 @@ static struct smbd_connection *_smbd_get_connection(
18431843 goto allocate_cache_failed ;
18441844 }
18451845
1846- init_waitqueue_head (& info -> wait_send_queue );
18471846 INIT_DELAYED_WORK (& info -> idle_timer_work , idle_connection_timer );
18481847 queue_delayed_work (info -> workqueue , & info -> idle_timer_work ,
18491848 msecs_to_jiffies (sp -> keepalive_interval_msec ));
0 commit comments