Received: from [140.186.70.92] (port=53261 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pmj8e-0003SM-B2 for qemu-devel@nongnu.org; Tue, 08 Feb 2011 03:41:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pmj8c-0004l6-Or for qemu-devel@nongnu.org; Tue, 08 Feb 2011 03:41:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pmj8c-0004kx-Hv for qemu-devel@nongnu.org; Tue, 08 Feb 2011 03:41:30 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH] tap: minor code cleanup References: <20110203163748.GA10461@redhat.com> Date: Tue, 08 Feb 2011 09:41:15 +0100 In-Reply-To: <20110203163748.GA10461@redhat.com> (Michael S. Tsirkin's message of "Thu, 3 Feb 2011 18:37:48 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org "Michael S. Tsirkin" writes: > remove a confusing comment. > TAP_DEFAULT_SNDBUF 0 is later translated to INT_MAX, so > let's set that value directly. > > Signed-off-by: Michael S. Tsirkin > --- > net/tap-linux.c | 7 +------ > 1 files changed, 1 insertions(+), 6 deletions(-) > > diff --git a/net/tap-linux.c b/net/tap-linux.c > index 00f84d4..b8c0f3b 100644 > --- a/net/tap-linux.c > +++ b/net/tap-linux.c > @@ -84,13 +84,8 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required > * Unfortunately when it's enabled, and packets are sent > * to other guests on the same host, the receiver > * can lock up the transmitter indefinitely. > - * > - * To avoid packet loss, sndbuf should be set to a value lower than the tx > - * queue capacity of any destination network interface. > - * Ethernet NICs generally have txqueuelen=1000, so 1Mb is > - * a good value, given a 1500 byte MTU. > */ > -#define TAP_DEFAULT_SNDBUF 0 > +#define TAP_DEFAULT_SNDBUF INT_MAX > > int tap_set_sndbuf(int fd, QemuOpts *opts) > { Can't comment on whether the comment should stay or go, but what about tap_set_sndbuf()'s if (!sndbuf) { sndbuf = INT_MAX; } Shouldn't that assign TAP_DEFAULT_SNDBUF now?