From owner-freebsd-net@FreeBSD.ORG Sat May 4 13:52:18 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 C23A9BCF for ; Sat, 4 May 2013 13:52:18 +0000 (UTC) (envelope-from realrichardsharpe@gmail.com) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 603511C00 for ; Sat, 4 May 2013 13:52:18 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id z12so2362788wgg.35 for ; Sat, 04 May 2013 06:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=WyaEqzCWwWVuZ9vOJIaA50JPr2M0yLRorkcVKma7jD4=; b=zbi4Zsy4qBQOvvQzHRobpBy4xjSHV+LBNR8fcw1VIPd04JNSaRCCfw7XyL2G+OKt1R eTb96yKwB/W9m8czyqfnIKhuWpvefsCDjG1lHfiuSmOHlfKmBDYyE+ISMjrFKHSKZrKS O5zsHssjk4IfKIqlYN96hz3UaHpXkbO+D3c/fu7WZNkdGmP8/ezZK0LDsNnL4RMneD0K 7uqmgz8Y23oBFn5Wl8ZPSkw8wqfMGIKfdq6AhknOjA9cqXLWDFUrK4p0iZSCsHEQx0y4 VnvBuk7k6uVpUsbiPmCboHktiJNTQ/TPULQ3h4nDbqr67hI48pUGa4G2wo/qtS7gGnng 2kEQ== MIME-Version: 1.0 X-Received: by 10.180.182.110 with SMTP id ed14mr2156240wic.6.1367675537432; Sat, 04 May 2013 06:52:17 -0700 (PDT) Received: by 10.194.179.194 with HTTP; Sat, 4 May 2013 06:52:17 -0700 (PDT) Date: Sat, 4 May 2013 06:52:17 -0700 Message-ID: Subject: Is there any way to limit the amount of data in an mbuf chain submitted to a driver? From: Richard Sharpe To: freebsd-net@freebsd.org Content-Type: text/plain; charset=Big5 Content-Transfer-Encoding: quoted-printable 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: Sat, 04 May 2013 13:52:18 -0000 Hi folks, I understand better why I am seeing EINVAL intermittently when sending data from Samba via SMB2. The ixgbe driver, for TSO reasons, limits the amount of data that can be DMA'd to 65535 bytes. It returns EINVAL for any mbuf chain larger than that. The SO_SNDBUF for that socket is set to 131972. Mostly there is less than 64kiB of space available, so that is all TCP etc can put into the socket in one chain of mbufs. However, every now and then there is more than 65535 bytes available in the socket buffers, and we have an SMB packet that is larger than 65535 bytes, and we get hit. To confirm this I am going to set SO_SNDBUF back to the default of 65536 and test again. My repros are very reliable. However, I wondered if my only way around this if I want to continue to use SO_SNDBUF sizes larger than 65536 is to fragment large mbuf chains in the driver? --=20 Regards, Richard Sharpe (=A6=F3=A5H=B8=D1=BC~=A1H=B0=DF=A6=B3=A7=F9=B1d=A1C--=B1=E4=BE=DE)