linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Evans <tom_usenet@optusnet.com.au>
To: ajneu <ajneu1@gmail.com>, linux-can@vger.kernel.org
Subject: Re: want blocking writes, but eventually get: errno 105 (No buffer space available)
Date: Mon, 27 Jun 2016 09:24:53 +1000	[thread overview]
Message-ID: <57706445.80506@optusnet.com.au> (raw)
In-Reply-To: <loom.20160622T171459-416@post.gmane.org>

On 23/06/16 01:18, ajneu wrote:
> ajneu <ajneu1 <at> gmail.com> writes:
>
>> My test-program blocks (in write) in the beginning (the 1st few
>> program-runs), but then after a number of program-restarts I eventually get:
>>     errno 105 (No buffer space available)
>> which is not acceptable, since I want to block (in the write), and not get
>> any error!!

Very old news. CAN is implemented "sort of like IP-over-Ethernet, and so has 
inherited the buffering from that system. So there's a NETBUF queue. When that 
one overflows you get ENOBUFS. So you can change it with:

     setsockopt(pSkt->skt, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf));

Other details here:

http://socket-can.996257.n3.nabble.com/Solving-ENOBUFS-returned-by-write-td2886.html

Search for ENOBUFS in this as well:

http://rtime.felk.cvut.cz/can/socketcan-qdisc-final.pdf

 > 1st program run:
 > ~> block on 33'rd write (32 frames queued)

You'll have the Network queue, the "tx_queue_len" in the driver, as well as 
however many physical message buffers there are in your hardware, which looks 
to be "32".

Tom



      reply	other threads:[~2016-06-26 23:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 14:39 want blocking writes, but eventually get: errno 105 (No buffer space available) ajneu
2016-06-22 15:00 ` ajneu
2016-06-22 15:52   ` Oliver Hartkopp
2016-06-22 15:18 ` ajneu
2016-06-26 23:24   ` Tom Evans [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57706445.80506@optusnet.com.au \
    --to=tom_usenet@optusnet.com.au \
    --cc=ajneu1@gmail.com \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).