summary refs log tree commit diff
path: root/net/smc/smc_tx.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-09-23 10:16:53 -0700
committerDavid S. Miller <davem@davemloft.net>2017-09-23 10:16:53 -0700
commit1f8d31d189cc6ce1e4b972959fda41e790bb92b8 (patch)
treefd3cca12a29319f073773ac55f7d41cc58e2c73f /net/smc/smc_tx.c
parent3fb5ec06578e4c85d3486b6a73cbeb07960a51ce (diff)
parentcd4175b11685b11c40e31a03e05084cc212b0649 (diff)
downloadlinux-1f8d31d189cc6ce1e4b972959fda41e790bb92b8.tar.gz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/smc/smc_tx.c')
-rw-r--r--net/smc/smc_tx.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c
index e2228f6d1c25..ec49bc3c3283 100644
--- a/net/smc/smc_tx.c
+++ b/net/smc/smc_tx.c
@@ -24,6 +24,8 @@
 #include "smc_cdc.h"
 #include "smc_tx.h"
 
+#define SMC_TX_WORK_DELAY	HZ
+
 /***************************** sndbuf producer *******************************/
 
 /* callback implementation for sk.sk_write_space()
@@ -405,7 +407,8 @@ int smc_tx_sndbuf_nonempty(struct smc_connection *conn)
 				goto out_unlock;
 			}
 			rc = 0;
-			schedule_work(&conn->tx_work);
+			schedule_delayed_work(&conn->tx_work,
+					      SMC_TX_WORK_DELAY);
 		}
 		goto out_unlock;
 	}
@@ -429,7 +432,7 @@ out_unlock:
  */
 static void smc_tx_work(struct work_struct *work)
 {
-	struct smc_connection *conn = container_of(work,
+	struct smc_connection *conn = container_of(to_delayed_work(work),
 						   struct smc_connection,
 						   tx_work);
 	struct smc_sock *smc = container_of(conn, struct smc_sock, conn);
@@ -466,7 +469,8 @@ void smc_tx_consumer_update(struct smc_connection *conn)
 		if (!rc)
 			rc = smc_cdc_msg_send(conn, wr_buf, pend);
 		if (rc < 0) {
-			schedule_work(&conn->tx_work);
+			schedule_delayed_work(&conn->tx_work,
+					      SMC_TX_WORK_DELAY);
 			return;
 		}
 		smc_curs_write(&conn->rx_curs_confirmed,
@@ -485,6 +489,6 @@ void smc_tx_consumer_update(struct smc_connection *conn)
 void smc_tx_init(struct smc_sock *smc)
 {
 	smc->sk.sk_write_space = smc_tx_write_space;
-	INIT_WORK(&smc->conn.tx_work, smc_tx_work);
+	INIT_DELAYED_WORK(&smc->conn.tx_work, smc_tx_work);
 	spin_lock_init(&smc->conn.send_lock);
 }