From patchwork Mon Apr 15 14:14:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 236616 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6CB8C2C00CC for ; Tue, 16 Apr 2013 00:15:55 +1000 (EST) Received: from localhost ([::1]:48970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URkCE-0006WJ-9J for incoming@patchwork.ozlabs.org; Mon, 15 Apr 2013 10:15:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URkBb-000688-BY for qemu-devel@nongnu.org; Mon, 15 Apr 2013 10:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URkBY-0008CB-Nn for qemu-devel@nongnu.org; Mon, 15 Apr 2013 10:15:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URkBY-0008C5-Gz for qemu-devel@nongnu.org; Mon, 15 Apr 2013 10:15:08 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3FEF0I1022404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 15 Apr 2013 10:15:00 -0400 Received: from localhost (ovpn-112-34.ams2.redhat.com [10.36.112.34]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3FEEwhk011508; Mon, 15 Apr 2013 10:14:59 -0400 From: Stefan Hajnoczi To: Date: Mon, 15 Apr 2013 16:14:48 +0200 Message-Id: <1366035288-15840-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1366035288-15840-1-git-send-email-stefanha@redhat.com> References: <1366035288-15840-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi , Nick Thomas Subject: [Qemu-devel] [PATCH 3/3] nbd: set TCP_NODELAY X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Disable the Nagle algorithm to reduce latency. Note this means we must also use TCP_CORK when sending header followed by payload to avoid fragmenting lots of little packets. The previous patch took care of that. Suggested-by: Nick Thomas Signed-off-by: Stefan Hajnoczi --- block/nbd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 485bbf0..d9dc454 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -406,6 +406,9 @@ static int nbd_establish_connection(BlockDriverState *bs) sock = unix_socket_outgoing(qemu_opt_get(s->socket_opts, "path")); } else { sock = tcp_socket_outgoing_opts(s->socket_opts); + if (sock >= 0) { + socket_set_nodelay(sock); + } } /* Failed to establish connection */