@@ -380,27 +380,6 @@ static bool process_negotiation_response(
380
380
return true;
381
381
}
382
382
383
- /*
384
- * Check and schedule to send an immediate packet
385
- * This is used to extend credtis to remote peer to keep the transport busy
386
- */
387
- static void check_and_send_immediate (struct smbd_connection * info )
388
- {
389
- if (info -> transport_status != SMBD_CONNECTED )
390
- return ;
391
-
392
- info -> send_immediate = true;
393
-
394
- /*
395
- * Promptly send a packet if our peer is running low on receive
396
- * credits
397
- */
398
- if (atomic_read (& info -> receive_credits ) <
399
- info -> receive_credit_target - 1 )
400
- queue_delayed_work (
401
- info -> workqueue , & info -> send_immediate_work , 0 );
402
- }
403
-
404
383
static void smbd_post_send_credits (struct work_struct * work )
405
384
{
406
385
int ret = 0 ;
@@ -450,8 +429,16 @@ static void smbd_post_send_credits(struct work_struct *work)
450
429
info -> new_credits_offered += ret ;
451
430
spin_unlock (& info -> lock_new_credits_offered );
452
431
453
- /* Check if we can post new receive and grant credits to peer */
454
- check_and_send_immediate (info );
432
+ /* Promptly send an immediate packet as defined in [MS-SMBD] 3.1.1.1 */
433
+ info -> send_immediate = true;
434
+ if (atomic_read (& info -> receive_credits ) <
435
+ info -> receive_credit_target - 1 ) {
436
+ if (info -> keep_alive_requested == KEEP_ALIVE_PENDING ||
437
+ info -> send_immediate ) {
438
+ log_keep_alive (INFO , "send an empty message\n" );
439
+ smbd_post_send_empty (info );
440
+ }
441
+ }
455
442
}
456
443
457
444
/* Called from softirq, when recv is done */
@@ -546,12 +533,6 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc)
546
533
info -> keep_alive_requested = KEEP_ALIVE_PENDING ;
547
534
}
548
535
549
- /*
550
- * Check if we need to send something to remote peer to
551
- * grant more credits or respond to KEEP_ALIVE packet
552
- */
553
- check_and_send_immediate (info );
554
-
555
536
return ;
556
537
557
538
default :
@@ -1311,25 +1292,6 @@ static void destroy_receive_buffers(struct smbd_connection *info)
1311
1292
mempool_free (response , info -> response_mempool );
1312
1293
}
1313
1294
1314
- /*
1315
- * Check and send an immediate or keep alive packet
1316
- * The condition to send those packets are defined in [MS-SMBD] 3.1.1.1
1317
- * Connection.KeepaliveRequested and Connection.SendImmediate
1318
- * The idea is to extend credits to server as soon as it becomes available
1319
- */
1320
- static void send_immediate_work (struct work_struct * work )
1321
- {
1322
- struct smbd_connection * info = container_of (
1323
- work , struct smbd_connection ,
1324
- send_immediate_work .work );
1325
-
1326
- if (info -> keep_alive_requested == KEEP_ALIVE_PENDING ||
1327
- info -> send_immediate ) {
1328
- log_keep_alive (INFO , "send an empty message\n" );
1329
- smbd_post_send_empty (info );
1330
- }
1331
- }
1332
-
1333
1295
/* Implement idle connection timer [MS-SMBD] 3.1.6.2 */
1334
1296
static void idle_connection_timer (struct work_struct * work )
1335
1297
{
@@ -1384,8 +1346,6 @@ void smbd_destroy(struct TCP_Server_Info *server)
1384
1346
1385
1347
log_rdma_event (INFO , "cancelling idle timer\n" );
1386
1348
cancel_delayed_work_sync (& info -> idle_timer_work );
1387
- log_rdma_event (INFO , "cancelling send immediate work\n" );
1388
- cancel_delayed_work_sync (& info -> send_immediate_work );
1389
1349
1390
1350
log_rdma_event (INFO , "wait for all send posted to IB to finish\n" );
1391
1351
wait_event (info -> wait_send_pending ,
@@ -1719,7 +1679,6 @@ static struct smbd_connection *_smbd_get_connection(
1719
1679
1720
1680
init_waitqueue_head (& info -> wait_send_queue );
1721
1681
INIT_DELAYED_WORK (& info -> idle_timer_work , idle_connection_timer );
1722
- INIT_DELAYED_WORK (& info -> send_immediate_work , send_immediate_work );
1723
1682
queue_delayed_work (info -> workqueue , & info -> idle_timer_work ,
1724
1683
info -> keep_alive_interval * HZ );
1725
1684
0 commit comments