From owner-freebsd-net@FreeBSD.ORG Wed Jul 16 08:58:22 2014 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F403598 for ; Wed, 16 Jul 2014 08:58:22 +0000 (UTC) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (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 23A822F64 for ; Wed, 16 Jul 2014 08:58:22 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id c9so490470qcz.29 for ; Wed, 16 Jul 2014 01:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=5Xox9ml0rNziRzR23OLLs6LTWnvR0G2ez05DQ8ZW+Fw=; b=ZnmB6eWZkp+lDCTeysS6jK4VJbyCUYn8VjMOHFlwby+aqbb2/VrwxE3DT5ccFapNmG 1ThDVkmYYwu4A11Sfm/g+M4bkiJsKO4igjenbkeSh+RFwad5CFQaqondclbidyenwKJk yTOIEdNyRTwqLmO3Q1PgNnNdE+UAtn3lrEPGQ06MGTodEaeg/wZTgN+GptmyE2OcdfoS /7gDJuvC6j5LU5BSsrN7gJKpM50l5BqWQEGs1dwP7/F/NG4f3Po+i8VRwa6/Da8IKUPX w46RXMqhQLMyRn7cSzmPpjpE1qR3tgT/JPs3qD9by58jVckM8bRF1fNmy9c7k2Env4xi xVOg== MIME-Version: 1.0 X-Received: by 10.140.95.101 with SMTP id h92mr43120557qge.35.1405501101227; Wed, 16 Jul 2014 01:58:21 -0700 (PDT) Received: by 10.96.73.39 with HTTP; Wed, 16 Jul 2014 01:58:21 -0700 (PDT) Date: Wed, 16 Jul 2014 01:58:21 -0700 Message-ID: Subject: UDP sendto() returning ENOBUFS - "No buffer space available" From: hiren panchasara To: "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 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: Wed, 16 Jul 2014 08:58:22 -0000 Return values in sendto() manpage says: [ENOBUFS] The system was unable to allocate an internal buffer. The operation may succeed when buffers become avail- able. [ENOBUFS] The output queue for a network interface was full. This generally indicates that the interface has stopped sending, but may be caused by transient con- gestion. If I hit the first condition, it should reflect as failures in "netstat -m". Is that a correct assumption? I want to understand what happens when/if we hit the second condition. And how to prevent that from happening. Is it just application's job to rate-limit data it sends to the n/w interface card so that it doesn't saturate? Does kernel do any sort of queuing in the case of ENOBUFS? OR does the message just gets dropped? For an application sending a lot of UDP data and returning ENOBUFS, what all udp and other tunables I should tweak? I can only think of: - number of tx ring descriptors - increasing this will get us more txds. - kern.ipc.maxsockbuf: Increasing this will increase buffer size allocated for sockets. what else? Any comments/suggestions/corrections? cheers, Hiren