All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: "Wolfgang Grandegger" <wg@grandegger.com>,
	"Heinz-Jürgen Oertel" <oe@port.de>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	"Kurt Van Dijck" <kurt.van.dijck@eia.be>
Subject: Re: What are you doing if the TX buffer overflows?
Date: Wed, 19 Sep 2012 09:47:46 +0200	[thread overview]
Message-ID: <505978A2.5010609@pengutronix.de> (raw)
In-Reply-To: <50595B4A.10409@hartkopp.net>

[-- Attachment #1: Type: text/plain, Size: 3101 bytes --]

On 09/19/2012 07:42 AM, Oliver Hartkopp wrote:
[...]

>>>>>>> What do people really want/need and why? This is still not clear to me.
>>>>>>> More input would be nice.
>>>>>>
>>>>>> Heinz-Jürgen uses abort current TX Message on SJA1000, can you give us
>>>>>> more insight? I've talked to customers, e.g. they want to abort the
>>>>>> current frame if it takes "too long" to send it, because the frames CAN
>>>>>> id priority is too low.
>>
>> If "too long" is defined as a period of time where it makes sense to
>> take such actions in software (like > 10msec), and your message still
>> did not get out, but you wanted it to be,
>> then IMO the bus load is too high with regard to the expected time restrictions.
>>
>> Or am I missing something?

I was just describing the use case for a "abort-current-tx" command. The
it takes "too long" and then abort will be implemented in the userspace.
But without a "abort-current-tx" command this is not possible. It was
not my intention to propose to implement an automatic abort if message
is too old in the kernel as a framework option.

> The question is, if we should add some time of expiry to the tx-skb?!?

No, see above.

> I have not checked whether the new ematch queuing discipline
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f057bbb6f9ed0fb61ea11105c9ef0ed5ac1a354d
> 
> http://rtime.felk.cvut.cz/can/socketcan-qdisc-final.pdf
> 
> would allow already to sort out expired skbs.
> 
> This is probably the preferred solution instead of checking expired skbs
> inside the driver.

I don't want to check for expired frames in the driver.

>>>>> What we could implement rather easily is a "tx-abort-last" or
>>>>> "tx-abort-all" netlink command. As this command does not make sense when
>>>>> more than one message is pending I'm in favor of "tx-abort-last".
>>>>
>>>> I like to have both commands.
>>>
>>> But then "tx-abort-all" should also clear the tx socket queue. Also be
>>> aware that more than one socket may send messages. Let's wait for more
>>> use-cases.
>>
>> I'm afraid tx-abort-all & tx-abort-last cause more damage than good,
>> especially, but not only, in multi-user environments.
> 
> 
> These netlink commands are/can be restricted to be used by root only.
> Maybe for some special use-cases it makes sense to have them.
> 
> When draining the tx queues from the driver side, all skbs are purged.
> I think this is not bound to a special socket instance then.
> 
> Summarizing i would suggest to check the expiring possibility of skbs (which
> will kill out-dated CAN frames) - and only implement a tx-abort command that
> kills the latest frame only.

You mean a "in-band" skb that kills out-dated CAN frames? No, no inband
magic, please.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2012-09-19  7:47 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
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 [this message]
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=505978A2.5010609@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=kurt.van.dijck@eia.be \
    --cc=linux-can@vger.kernel.org \
    --cc=oe@port.de \
    --cc=socketcan@hartkopp.net \
    --cc=wg@grandegger.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.