From: "Heinz-Jürgen Oertel" <oe@port.de>
To: "Oliver Hartkopp " <socketcan@hartkopp.net>
Cc: linux-can@vger.kernel.org
Subject: Re: What are you doing if the TX buffer overflows?
Date: Mon, 17 Sep 2012 21:40:41 +0200 [thread overview]
Message-ID: <3033577.LU3ttOr8xL@linux-edhj> (raw)
In-Reply-To: <4283CE44E963D741A50240F32D185B9F109AA1@SBSPORT3.portgmbh.local>
Hallo Oliver,
Danke für Deine Antwort.
>
> Hello Heinz,
>
> On 17.09.2012 15:58, Heinz-Jürgen Oertel wrote:
>
> >
> > is there a way to empty the tx buffer ?
>
>
> Usually the buffer does not get empty due to a problem of the CAN controller
> and/or the CAN network.
I know :-)
>
> So even if you could flush the queue the CAN controller is probably still
> stuck with his processed frame.
At least the SJA1000 (I'm using most often)
allows to abort a pending transmission.
>
> Setting the interface to DOWN and UP again re-initializes the CAN controller
> and flushes all the queues.
>
> This would work - but all open sockets would get a notification of the
> interface went down.
May be in my current case this is acceptable.
>
> Btw. IIRC there's a IFLA_CAN_RESTART functionality to kick the CAN controller
> if it got stuck. It can by triggered by a netlink message. This is the same
> configuration interface that's used to set the bittiming:
>
> http://lxr.linux.no/#linux+v3.5.4/include/linux/can/netlink.h#L103
>
> But i have currently no source code example as i always use the 'ip' tool from
> the iproute2 package to configure my CAN interfaces:
>
> http://lxr.linux.no/#linux+v3.5.4/Documentation/networking/can.txt#L646
>
> Following that documentation
>
> ip link set can0 type can restart
>
> should do it for 'can0'.
>
> > Or read out the occupied size of it
> > to get the mumber of CAN frames waiting for transmission?
>
>
> I'll take a look, if there's a programming interface to get this value.
> Or is this request obsolete now after my answer above?
No. This is still of interest.
Knowing if the transmit queue is mostly empty is a good thing.
Otherwise the application is sending to fast,
or a lot of higher priority messages are on the network.
>
> Regards,
> Oliver
>
Thanks for your effort.
Regards
Heinz
next prev parent reply other threads:[~2012-09-17 19:40 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-17 13:58 What are you doing if the TX buffer overflows? Heinz-Jürgen Oertel
2012-09-17 19:19 ` Oliver Hartkopp
2012-09-17 19:26 ` Andrew Bell
2012-09-17 19:33 ` Oliver Hartkopp
2012-09-18 13:36 ` Andrew Bell
2012-09-18 13:46 ` Wolfgang Grandegger
[not found] ` <4283CE44E963D741A50240F32D185B9F109AA1@SBSPORT3.portgmbh.local>
2012-09-17 19:40 ` Heinz-Jürgen Oertel [this message]
2012-09-18 11:44 ` Kurt Van Dijck
2012-09-18 12:14 ` Wolfgang Grandegger
2012-09-18 12:34 ` Marc Kleine-Budde
2012-09-18 12:49 ` Wolfgang Grandegger
2012-09-18 13:00 ` Marc Kleine-Budde
2012-09-18 13:39 ` Wolfgang Grandegger
2012-09-18 13:42 ` Marc Kleine-Budde
2012-09-18 18:50 ` Wolfgang Grandegger
2012-09-18 19:01 ` Marc Kleine-Budde
2012-09-18 19:13 ` Wolfgang Grandegger
2012-09-18 20:20 ` Kurt Van Dijck
2012-09-19 5:42 ` Oliver Hartkopp
2012-09-19 7:47 ` Marc Kleine-Budde
2012-09-19 9:04 ` Kurt Van Dijck
2012-09-19 6:50 ` Wolfgang Grandegger
2012-09-19 7:39 ` Marc Kleine-Budde
2012-09-19 8:10 ` Wolfgang Grandegger
2012-09-19 7:31 ` Marc Kleine-Budde
2012-09-19 10:18 ` Steffen Rose
[not found] ` <34567791.oZ5dyCnTQA@lisa>
2012-09-19 10:26 ` [Socketcan-users] " Kurt Van Dijck
2012-09-19 11:32 ` Steffen Rose
2012-11-14 20:48 ` Jason White
2012-11-15 12:54 ` Marc Kleine-Budde
2012-11-15 17:12 ` Oliver Hartkopp
2012-11-15 19:11 ` Jason White
2012-11-15 21:04 ` Oliver Hartkopp
2012-11-16 15:13 ` Kurt Van Dijck
2012-11-16 17:09 ` Jason White
2012-11-15 19:07 ` Jason White
2012-09-18 12:37 ` Wolfgang Grandegger
2012-09-18 13:22 ` Marc Kleine-Budde
2012-09-18 13:24 ` Marc Kleine-Budde
2012-09-18 13:25 ` Wolfgang Grandegger
-- strict thread matches above, loose matches on Subject: below --
2013-01-08 10:09 Alexander Stein
2014-01-27 20:47 ` Jason White
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=3033577.LU3ttOr8xL@linux-edhj \
--to=oe@port.de \
--cc=linux-can@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/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).