From nobody Tue Feb 10 20:28:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527794871047912.319468725868; Thu, 31 May 2018 12:27:51 -0700 (PDT) Received: from localhost ([::1]:45800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOTEk-0007es-7J for importer@patchew.org; Thu, 31 May 2018 15:27:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOT9v-00044f-4q for qemu-devel@nongnu.org; Thu, 31 May 2018 15:22:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOT9u-0008Tc-4P for qemu-devel@nongnu.org; Thu, 31 May 2018 15:22:51 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:55112) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fOT9t-0008Sg-UT for qemu-devel@nongnu.org; Thu, 31 May 2018 15:22:50 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C1CFD9A3; Thu, 31 May 2018 21:22:48 +0200 (CEST) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wjua3pvgU0fX; Thu, 31 May 2018 21:22:46 +0200 (CEST) Received: from var.youpi.perso.aquilenet.fr (unknown [109.190.253.11]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 2A567944; Thu, 31 May 2018 21:22:39 +0200 (CEST) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.91) (envelope-from ) id 1fOT9i-00013L-BH; Thu, 31 May 2018 21:22:38 +0200 X-Virus-Scanned: Debian amavisd-new at aquilenet.fr From: Samuel Thibault To: qemu-devel@nongnu.org Date: Thu, 31 May 2018 21:22:30 +0200 Message-Id: <20180531192237.3994-3-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180531192237.3994-1-samuel.thibault@ens-lyon.org> References: <20180531192237.3994-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.233.100.1 Subject: [Qemu-devel] [PULL 2/9] slirp: disable Nagle in outgoing connections X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jan.kiszka@siemens.com, Samuel Thibault , stefanha@redhat.com, Andreas Gustafsson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Andreas Gustafsson When setting up an outgoing user mode networking TCP connection, disable the Nagle algorithm in the host-side connection. Either the guest is already doing Nagle, in which case there is no point in doing it twice, or it has chosen to disable it, in which case we should respect that choice. This change speeds up GDB remote debugging over TCP over user mode networking (with GDB runing on the guest) by multiple orders of magnitude, and has been part of the local patches applied by pkgsrc since 2012 with no reported ill effects. Signed-off-by: Andreas Gustafsson Reviewed-by: Kamil Rytarowski Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Samuel Thibault --- slirp/tcp_subr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index da0d53743f..8d0f94b75f 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -416,6 +416,8 @@ int tcp_fconnect(struct socket *so, unsigned short af) socket_set_fast_reuse(s); opt =3D 1; qemu_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt)); + opt =3D 1; + qemu_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)); =20 addr =3D so->fhost.ss; DEBUG_CALL(" connect()ing") --=20 2.17.0