From owner-freebsd-net@FreeBSD.ORG Fri May 3 00:14:43 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A950C5F0 for ; Fri, 3 May 2013 00:14:43 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-x229.google.com (mail-pb0-x229.google.com [IPv6:2607:f8b0:400e:c01::229]) by mx1.freebsd.org (Postfix) with ESMTP id 823231D69 for ; Fri, 3 May 2013 00:14:43 +0000 (UTC) Received: by mail-pb0-f41.google.com with SMTP id mc17so615805pbc.28 for ; Thu, 02 May 2013 17:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=8/AetLsgEILFUCe34wuAZn1qr9Fwm4EBh7BvXKub7+o=; b=bajKZ4rgvWnFjjAgNjkaLN9+oAV/9Tku715hGtmTLNP9C+eRB8J4InosjUvLeUYQq7 3335k0K2BGAYtweDbSfeTwjJtgMCF+8Pz37tVa68rq8X+cM5Eu7gkS9lgXZ9uiNGuBeA cj7fud/9+yN/ce3pdSx92IbnJahO63LesJlWw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:x-gm-message-state; bh=8/AetLsgEILFUCe34wuAZn1qr9Fwm4EBh7BvXKub7+o=; b=dSUiNrck3YCgwDuJOmMpCfyTEAQKF+yMKZdPs5qq8hyXBOeBmQS43Q0F4xPqzspKo1 EVFiXIrZy6kK6sJr4gpMHv+sbr9g5Za0O7i9+N2CtHb1AzfLp9evza4IZSKxX9UbiMt4 m1UCZ/eT9wtwPElGEj3qcT0LIV5jHuhCs7NItLhYkRSSR1BJiXTlr456Q8Hck9/9hcoA 570uqVZXocCBh3XQmE+/A7rMZM6jkfNiZTtRpmcijAoBq6WAUA5CFShFLfslvFsUxufc ezZCAsRD3PR7rR3hdD++pTfMZEG1RCVrCsv/+rhegqLrc2A1Y4AYM2VsNHl5J5ksbHSV zZOA== X-Received: by 10.68.220.106 with SMTP id pv10mr11519204pbc.52.1367540083189; Thu, 02 May 2013 17:14:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.159.97 with HTTP; Thu, 2 May 2013 17:14:12 -0700 (PDT) In-Reply-To: References: <5181ECDF.1040905@mu.org> <51827DAA.2020009@vangyzen.net> From: Eitan Adler Date: Thu, 2 May 2013 20:14:12 -0400 Message-ID: Subject: Re: Seeing EINVAL from writev on 8.0 to a non-blocking socket even though the data seems to hit the wire To: Richard Sharpe Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlSrpahw05K/pq+hzvj9hvpn+GIoDbkC3yB4YlRfuaNRb6NDB6Dk2vcf5QR8s+hzvLKXUhi Cc: freebsd-net@freebsd.org, Eric van Gyzen , Alfred Perlstein X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 00:14:43 -0000 On 2 May 2013 20:00, Richard Sharpe wrote: > On Thu, May 2, 2013 at 7:52 AM, Eric van Gyzen wrote: >> On 05/02/2013 08:48, Richard Sharpe wrote: >>> On Wed, May 1, 2013 at 9:34 PM, Alfred Perlstein wrote: >>>> On 5/1/13 8:03 PM, Richard Sharpe wrote: >>>>> Hi folks, >>>>> >>>>> I am checking to see if there are any known bugs with respect to this >>>>> in FreeBSD 8.0. >>>>> >>>>> Situation is that Samba 3.6.6 uses writev to a non-blocking socket to >>>>> get the SMB2 requests on the wire. >>>>> >>>>> Intermittently, we see the writev return EINVAL even though the data >>>>> has gotten on the wire. This I have verified by grabbing a capture and >>>>> comparing the SMB Sequence number in the last outgoing packet on the >>>>> wire vs the in-memory contents when we get EINVAL. >>>>> >>>>> Sometimes it occurs on a four-element IOVEC, sometimes we get EAGAIN >>>>> on the four-element IOVEC and then we get EINVAL when retrying on a >>>>> smaller IOVEC. >>>>> >>>>> Where should I look to check if there is some path where this might be >>>>> happening? Is this even the correct mailing list? >>>>> >>>> What does the iovec look like when you get EINVAL? Can you sanity check >>>> it? Is there anything special about it? (zero length vecs?) >>>> >>>> I think there are a few "maxvals" that if overrun cause EINVAL to be >>>> returned. example is if your iovec is somehow huge or has many, many >>>> elements. >>> Can anyone tell me the call graph down to the TCP code? >>> >> >> writev kern/sys_generic.c >> kern_writev >> dofilewrite >> fo_write in sys/file.h >> soo_write in kern/sys_socket.c >> sosend in kern/uipc_socket.c >> sosend_generic >> tcp_usr_send in netinet/tcp_usrreq.c > > Is there a tool that generates call graphs? gprof in base valgrind --callgrind doxygen can also do this. there are probably others. -- Eitan Adler