From owner-freebsd-net@FreeBSD.ORG Fri Jul 18 18:28:42 2014 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A17A6944; Fri, 18 Jul 2014 18:28:42 +0000 (UTC) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B4520EC; Fri, 18 Jul 2014 18:28:42 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id l6so3634396qcy.39 for ; Fri, 18 Jul 2014 11:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fTGVmHvqa3TrcVyq4bV8IPKl+EgHkjxKJhyKv8MCULo=; b=Z3EC9Sfr27sahja6EjoZPtTZrVqzgPv4XZ4K5HByGkZmlEVTAqkyEAv/k+nm4nwsHl nvbVEGerjLzCwR4qiV8GroO2aJoOgk+k0M1S9AveZ6b60cIKReiBS2iKgO2nKmGdgDBt 8+F0F42gz+/sVFeHiIoRdEr8CuQ8UXLvWpCnHvoggDUenu7nhhxk9JdtkBeJnxK/NIKN AutFQvjObs7VM4UkP7dQd4eU8P8v6hphAkjgb0RHBRa8pmlH9CWz0NfyD85r3J8LEfVp P1hLeoAQa/qBLM+lvztdAPkYL5GXhWiYLOZYqCh8jAkCa3f8poLCbg20+eiAZLst6eyY TrgA== MIME-Version: 1.0 X-Received: by 10.140.90.7 with SMTP id w7mr10544705qgd.52.1405708121024; Fri, 18 Jul 2014 11:28:41 -0700 (PDT) Received: by 10.96.73.39 with HTTP; Fri, 18 Jul 2014 11:28:40 -0700 (PDT) In-Reply-To: References: Date: Fri, 18 Jul 2014 11:28:40 -0700 Message-ID: Subject: Re: UDP sendto() returning ENOBUFS - "No buffer space available" From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 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, 18 Jul 2014 18:28:42 -0000 On Wed, Jul 16, 2014 at 11:00 AM, Adrian Chadd wrote: > Hi! > > So the UDP transmit path is udp_usrreqs->pru_send() == udp_send() -> > udp_output() -> ip_output() > > udp_output() does do a M_PREPEND() which can return ENOBUFS. ip_output > can also return ENOBUFS. > > it doesn't look like the socket code (eg sosend_dgram()) is doing any > buffering - it's just copying the frame and stuffing it up to the > driver. No queuing involved before the NIC. Right. Thanks for confirming. > > So a _well behaved_ driver will return ENOBUFS _and_ not queue the > frame. However, it's entirely plausible that the driver isn't well > behaved - the intel drivers screwed up here and there with transmit > queue and failure to queue vs failure to transmit. > > So yeah, try tweaking the tx ring descriptor for the driver your'e > using and see how big a bufring it's allocating. Yes, so I am dealing with Broadcom BCM5706/BCM5708 Gigabit Ethernet, i.e. bce(4). I bumped up tx_pages from 2 (default) to 8 where each page is 255 buffer descriptors. I am seeing quite nice improvement on stable/10 where I can send *more* stuff :-) cheers, Hiren