From owner-freebsd-net@FreeBSD.ORG Thu May 2 04:47:24 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A24B7A5E for ; Thu, 2 May 2013 04:47:24 +0000 (UTC) (envelope-from realrichardsharpe@gmail.com) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) by mx1.freebsd.org (Postfix) with ESMTP id 3D3F313D8 for ; Thu, 2 May 2013 04:47:24 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id ey16so166603wid.8 for ; Wed, 01 May 2013 21:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=BT8YULLk2tqYZbjn+54NdnrZNlsnOqkKs22o1kKfLtU=; b=ghE/RNJbXYyRVW/0ARXSgcqE7EhcSBVQVWLqy7lxE0CM+hKqymrVdmultSr68WgzsU uyenof/240f000sA1Pn5dXYHKSXFSquonNIQvZAzjby98gGEeLbpDkPVRv7rUS0xftKJ GSsTtdisp0473QkfjqGm+zL+f30hTCEbIDbI0LcrQRuyTjGl9oLHyyFppeGqylqaznmO Sm++Pk9s2RR77E5VtFtEUmK5nV2/a6XiB5uH8OlJdOjduFrcmjp+eqxEOyntOVW3QIop 7zPwSzHF762qKviiAWrluWQdAdyZD2LrNeSBtdTBEFBUAl/zF8bVxmDPrkWxo5ioLLvX TSbQ== MIME-Version: 1.0 X-Received: by 10.194.11.70 with SMTP id o6mr5582448wjb.29.1367470043486; Wed, 01 May 2013 21:47:23 -0700 (PDT) Received: by 10.194.179.194 with HTTP; Wed, 1 May 2013 21:47:23 -0700 (PDT) In-Reply-To: <5181ECDF.1040905@mu.org> References: <5181ECDF.1040905@mu.org> Date: Wed, 1 May 2013 21:47:23 -0700 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 From: Richard Sharpe To: Alfred Perlstein Content-Type: text/plain; charset=Big5 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org 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: Thu, 02 May 2013 04:47:24 -0000 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. It usually consists of four elements. All of the elements are accessible because I checked some of the data. Well, actually, I did not check the 65536 bytes of the last element, but they seemed to go out on the wire, although I should check the last offset. The lengths were usually: 4, 64, 8 or 16, 65536. So, I do need to check the last element. I think it all went out on the wire. With 4,64,16 and 65536 byte segments that is 65620 bytes and they were all accounted for and the SMB2 sequence number matched what was in memory. --=20 Regards, Richard Sharpe (=A6=F3=A5H=B8=D1=BC~=A1H=B0=DF=A6=B3=A7=F9=B1d=A1C--=B1=E4=BE=DE)