From nobody Thu Nov 6 16:21:10 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542199767761672.0270056709516; Wed, 14 Nov 2018 04:49:27 -0800 (PST) Received: from localhost ([::1]:59852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMubh-0000ZR-Gc for importer@patchew.org; Wed, 14 Nov 2018 07:49:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMuSg-0001cQ-1u for qemu-devel@nongnu.org; Wed, 14 Nov 2018 07:40:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMuSZ-00029O-7l for qemu-devel@nongnu.org; Wed, 14 Nov 2018 07:40:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35056) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gMuSX-0001n8-Ct for qemu-devel@nongnu.org; Wed, 14 Nov 2018 07:39:55 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 64D568E251; Wed, 14 Nov 2018 12:39:10 +0000 (UTC) Received: from localhost (ovpn-112-55.ams2.redhat.com [10.36.112.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 104A316D2C; Wed, 14 Nov 2018 12:38:49 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Wed, 14 Nov 2018 16:36:14 +0400 Message-Id: <20181114123643.24091-13-marcandre.lureau@redhat.com> In-Reply-To: <20181114123643.24091-1-marcandre.lureau@redhat.com> References: <20181114123643.24091-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 14 Nov 2018 12:39:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-3.2 12/41] slirp: remove the disabled readv()/writev() code path 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: samuel.thibault@ens-lyon.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , rjones@redhat.com, stefanha@redhat.com, renzo@cs.unibo.it Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The soread() function may be used on datagram sockets, and would provide different behaviour if HAVE_READV was set, on empty datagrams. This looks like a minor optimization, that never has been a strong goal for slirp. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- slirp/slirp_config.h | 3 --- slirp/socket.c | 15 --------------- 2 files changed, 18 deletions(-) diff --git a/slirp/slirp_config.h b/slirp/slirp_config.h index f0cc1c781b..3ce64e088e 100644 --- a/slirp/slirp_config.h +++ b/slirp/slirp_config.h @@ -29,9 +29,6 @@ /* Define if the machine is big endian */ //#undef HOST_WORDS_BIGENDIAN =20 -/* Define if you have readv */ -#undef HAVE_READV - /* Define if iovec needs to be declared */ #undef DECLARE_IOVEC #ifdef _WIN32 diff --git a/slirp/socket.c b/slirp/socket.c index 041ec5061a..7012c7c07d 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -187,12 +187,7 @@ soread(struct socket *so) */ sopreprbuf(so, iov, &n); =20 -#ifdef HAVE_READV - nn =3D readv(so->s, (struct iovec *)iov, n); - DEBUG_MISC((dfd, " ... read nn =3D %d bytes\n", nn)); -#else nn =3D qemu_recv(so->s, iov[0].iov_base, iov[0].iov_len,0); -#endif if (nn <=3D 0) { if (nn < 0 && (errno =3D=3D EINTR || errno =3D=3D EAGAIN)) return 0; @@ -226,7 +221,6 @@ soread(struct socket *so) } } =20 -#ifndef HAVE_READV /* * If there was no error, try and read the second time round * We read again if n =3D 2 (ie, there's another part of the buffer) @@ -244,7 +238,6 @@ soread(struct socket *so) } =20 DEBUG_MISC((dfd, " ... read nn =3D %d bytes\n", nn)); -#endif =20 /* Update fields */ sb->sb_cc +=3D nn; @@ -452,13 +445,7 @@ sowrite(struct socket *so) } /* Check if there's urgent data to send, and if so, send it */ =20 -#ifdef HAVE_READV - nn =3D writev(so->s, (const struct iovec *)iov, n); - - DEBUG_MISC((dfd, " ... wrote nn =3D %d bytes\n", nn)); -#else nn =3D slirp_send(so, iov[0].iov_base, iov[0].iov_len,0); -#endif /* This should never happen, but people tell me it does *shrug* */ if (nn < 0 && (errno =3D=3D EAGAIN || errno =3D=3D EINTR)) return 0; @@ -467,7 +454,6 @@ sowrite(struct socket *so) goto err_disconnected; } =20 -#ifndef HAVE_READV if (n =3D=3D 2 && nn =3D=3D iov[0].iov_len) { int ret; ret =3D slirp_send(so, iov[1].iov_base, iov[1].iov_len,0); @@ -475,7 +461,6 @@ sowrite(struct socket *so) nn +=3D ret; } DEBUG_MISC((dfd, " ... wrote nn =3D %d bytes\n", nn)); -#endif =20 /* Update sbuf */ sb->sb_cc -=3D nn; --=20 2.19.1.708.g4ede3d42df