drbd: trigger tcp_push_pending_frames() for PING and PING_ACK
authorLars Ellenberg <lars.ellenberg@linbit.com>
Wed, 5 Feb 2014 05:13:53 +0000 (06:13 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 10 Jul 2014 16:34:52 +0000 (18:34 +0200)
This should reduce latency for such in-DRBD-protocol "pings",
and may help reduce spurious disconnect/reconnect cycles due to
 "PingAck did not arrive in time."

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_main.c

index 8e0813ddf72aec4278164874074423a5ccf5833c..77d34a61bb58b0c8b8aaaeab90dcb25bde3af1c9 100644 (file)
@@ -662,6 +662,11 @@ static int __send_command(struct drbd_connection *connection, int vnr,
                            msg_flags);
        if (data && !err)
                err = drbd_send_all(connection, sock->socket, data, size, 0);
+       /* DRBD protocol "pings" are latency critical.
+        * This is supposed to trigger tcp_push_pending_frames() */
+       if (!err && (cmd == P_PING || cmd == P_PING_ACK))
+               drbd_tcp_nodelay(sock->socket);
+
        return err;
 }