From: Andre Naujoks <nautsch2@gmail.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>, linux-can@vger.kernel.org
Subject: Re: [PATCH] can: add new socket option CAN_RAW_FILTER_UNIQUE to eliminate duplicate matches
Date: Tue, 17 Mar 2015 16:58:42 +0100 [thread overview]
Message-ID: <55084F32.50500@gmail.com> (raw)
In-Reply-To: <55084D1F.3080001@hartkopp.net>
On 17.03.2015 16:49, Oliver Hartkopp wrote:
> On 17.03.2015 16:36, Andre Naujoks wrote:
>> On 17.03.2015 13:58, Oliver Hartkopp wrote:
>>> The CAN_RAW socket can set multiple CAN identifier specific filters
>>> that lead
>>> to multiple filters in the af_can.c filter processing. These filters are
>>> indenpendent from each other which leads to logical OR'ed filters
>>> when applied.
>>>
>>> Especially when the filter is intended to notch single CAN IDs or CAN
>>> ID ranges
>>> a problem emerges when using more than just one filter: The notched
>>> CAN IDs
>>> will be delivered once while the other CAN IDs will be delivered twice.
>>>
>>> This patch implements a new option to make sure that every CAN frame
>>> which is
>>> filtered for a specific socket is only delivered once to the user space.
>>> This is independent from the number of matching CAN filters of this
>>> socket.
>>
>> Hi Oliver.
>>
>> I don't think this should be an option. A CAN-frame should never be
>> delivered more than once even if multiple filters match.
>>
>> In my eyes this is a long standing bug ;-), which would get an
>> off-switch this way.
>
> https://www.youtube.com/watch?v=4JgxDxwf7RU
>
> :-))
>
> So you think the 'unifying option' should be enabled by default!?!
Yes!
> Would you assume this to break any user space apps?
I don't see how. In fact I had to work around the "duplpicate frame
issue" on occasion. If nobody sees a reason against this, I am strongly
in favour of making this the default behaviour.
>
> Btw. what's your opinion about
>
> http://marc.info/?l=linux-can&m=142660595731528&w=2
http://marc.info/?l=linux-can&m=142660682531909&w=2 ;-)
I'd like that as a socket option. Effectively choosing if the set
filters should be OR'd or AND'd.
Regards
Andre
>
> ??
>
> Regards,
> Oliver
prev parent reply other threads:[~2015-03-17 15:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 12:58 [PATCH] can: add new socket option CAN_RAW_FILTER_UNIQUE to eliminate duplicate matches Oliver Hartkopp
2015-03-17 13:23 ` Oliver Hartkopp
2015-03-17 15:25 ` Oliver Hartkopp
2015-03-17 15:40 ` Andre Naujoks
2015-03-17 15:36 ` Andre Naujoks
2015-03-17 15:49 ` Oliver Hartkopp
2015-03-17 15:58 ` Andre Naujoks [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=55084F32.50500@gmail.com \
--to=nautsch2@gmail.com \
--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 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.