diff options
Diffstat (limited to 'net/smc/smc_tx.c')
-rw-r--r-- | net/smc/smc_tx.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c index 3c656beb8820..3866573288dd 100644 --- a/net/smc/smc_tx.c +++ b/net/smc/smc_tx.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include "smc_cdc.h" | 24 | #include "smc_cdc.h" |
25 | #include "smc_tx.h" | 25 | #include "smc_tx.h" |
26 | 26 | ||
27 | #define SMC_TX_WORK_DELAY HZ | ||
28 | |||
27 | /***************************** sndbuf producer *******************************/ | 29 | /***************************** sndbuf producer *******************************/ |
28 | 30 | ||
29 | /* callback implementation for sk.sk_write_space() | 31 | /* callback implementation for sk.sk_write_space() |
@@ -406,7 +408,8 @@ int smc_tx_sndbuf_nonempty(struct smc_connection *conn) | |||
406 | goto out_unlock; | 408 | goto out_unlock; |
407 | } | 409 | } |
408 | rc = 0; | 410 | rc = 0; |
409 | schedule_work(&conn->tx_work); | 411 | schedule_delayed_work(&conn->tx_work, |
412 | SMC_TX_WORK_DELAY); | ||
410 | } | 413 | } |
411 | goto out_unlock; | 414 | goto out_unlock; |
412 | } | 415 | } |
@@ -430,7 +433,7 @@ out_unlock: | |||
430 | */ | 433 | */ |
431 | static void smc_tx_work(struct work_struct *work) | 434 | static void smc_tx_work(struct work_struct *work) |
432 | { | 435 | { |
433 | struct smc_connection *conn = container_of(work, | 436 | struct smc_connection *conn = container_of(to_delayed_work(work), |
434 | struct smc_connection, | 437 | struct smc_connection, |
435 | tx_work); | 438 | tx_work); |
436 | struct smc_sock *smc = container_of(conn, struct smc_sock, conn); | 439 | struct smc_sock *smc = container_of(conn, struct smc_sock, conn); |
@@ -468,7 +471,8 @@ void smc_tx_consumer_update(struct smc_connection *conn) | |||
468 | if (!rc) | 471 | if (!rc) |
469 | rc = smc_cdc_msg_send(conn, wr_buf, pend); | 472 | rc = smc_cdc_msg_send(conn, wr_buf, pend); |
470 | if (rc < 0) { | 473 | if (rc < 0) { |
471 | schedule_work(&conn->tx_work); | 474 | schedule_delayed_work(&conn->tx_work, |
475 | SMC_TX_WORK_DELAY); | ||
472 | return; | 476 | return; |
473 | } | 477 | } |
474 | smc_curs_write(&conn->rx_curs_confirmed, | 478 | smc_curs_write(&conn->rx_curs_confirmed, |
@@ -487,6 +491,6 @@ void smc_tx_consumer_update(struct smc_connection *conn) | |||
487 | void smc_tx_init(struct smc_sock *smc) | 491 | void smc_tx_init(struct smc_sock *smc) |
488 | { | 492 | { |
489 | smc->sk.sk_write_space = smc_tx_write_space; | 493 | smc->sk.sk_write_space = smc_tx_write_space; |
490 | INIT_WORK(&smc->conn.tx_work, smc_tx_work); | 494 | INIT_DELAYED_WORK(&smc->conn.tx_work, smc_tx_work); |
491 | spin_lock_init(&smc->conn.send_lock); | 495 | spin_lock_init(&smc->conn.send_lock); |
492 | } | 496 | } |