Browse Source

[iscsi] Eliminate polling while waiting for window to open

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
bce34e87df
1 changed files with 26 additions and 3 deletions
  1. 26
    3
      src/net/tcp/iscsi.c

+ 26
- 3
src/net/tcp/iscsi.c View File

1304
  *
1304
  *
1305
  */
1305
  */
1306
 
1306
 
1307
+/**
1308
+ * Pause TX engine
1309
+ *
1310
+ * @v iscsi		iSCSI session
1311
+ */
1312
+static void iscsi_tx_pause ( struct iscsi_session *iscsi ) {
1313
+	process_del ( &iscsi->process );
1314
+}
1315
+
1316
+/**
1317
+ * Resume TX engine
1318
+ *
1319
+ * @v iscsi		iSCSI session
1320
+ */
1321
+static void iscsi_tx_resume ( struct iscsi_session *iscsi ) {
1322
+	process_add ( &iscsi->process );
1323
+}
1324
+
1307
 /**
1325
 /**
1308
  * Start up a new TX PDU
1326
  * Start up a new TX PDU
1309
  *
1327
  *
1324
 	iscsi->tx_state = ISCSI_TX_BHS;
1342
 	iscsi->tx_state = ISCSI_TX_BHS;
1325
 
1343
 
1326
 	/* Start transmission process */
1344
 	/* Start transmission process */
1327
-	process_add ( &iscsi->process );
1345
+	iscsi_tx_resume ( iscsi );
1328
 }
1346
 }
1329
 
1347
 
1330
 /**
1348
 /**
1405
 	struct iscsi_bhs_common *common = &iscsi->tx_bhs.common;
1423
 	struct iscsi_bhs_common *common = &iscsi->tx_bhs.common;
1406
 
1424
 
1407
 	/* Stop transmission process */
1425
 	/* Stop transmission process */
1408
-	process_del ( &iscsi->process );
1426
+	iscsi_tx_pause ( iscsi );
1409
 
1427
 
1410
 	switch ( common->opcode & ISCSI_OPCODE_MASK ) {
1428
 	switch ( common->opcode & ISCSI_OPCODE_MASK ) {
1411
 	case ISCSI_OPCODE_DATA_OUT:
1429
 	case ISCSI_OPCODE_DATA_OUT:
1468
 
1486
 
1469
 		/* Check for window availability, if needed */
1487
 		/* Check for window availability, if needed */
1470
 		if ( tx_len && ( xfer_window ( &iscsi->socket ) == 0 ) ) {
1488
 		if ( tx_len && ( xfer_window ( &iscsi->socket ) == 0 ) ) {
1471
-			/* Cannot transmit at this point; stop processing */
1489
+			/* Cannot transmit at this point; pause
1490
+			 * processing and wait for window to reopen
1491
+			 */
1492
+			iscsi_tx_pause ( iscsi );
1472
 			return;
1493
 			return;
1473
 		}
1494
 		}
1474
 
1495
 
1696
 /** iSCSI socket interface operations */
1717
 /** iSCSI socket interface operations */
1697
 static struct interface_operation iscsi_socket_operations[] = {
1718
 static struct interface_operation iscsi_socket_operations[] = {
1698
 	INTF_OP ( xfer_deliver, struct iscsi_session *, iscsi_socket_deliver ),
1719
 	INTF_OP ( xfer_deliver, struct iscsi_session *, iscsi_socket_deliver ),
1720
+	INTF_OP ( xfer_window_changed, struct iscsi_session *,
1721
+		  iscsi_tx_resume ),
1699
 	INTF_OP ( xfer_vredirect, struct iscsi_session *, iscsi_vredirect ),
1722
 	INTF_OP ( xfer_vredirect, struct iscsi_session *, iscsi_vredirect ),
1700
 	INTF_OP ( intf_close, struct iscsi_session *, iscsi_close ),
1723
 	INTF_OP ( intf_close, struct iscsi_session *, iscsi_close ),
1701
 };
1724
 };

Loading…
Cancel
Save