linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Join CAN filters with CAN_RAW_JOIN_FILTERS sockopt is ready for testing
@ 2015-03-17 19:42 Oliver Hartkopp
  2015-03-18  7:13 ` Oliver Hartkopp
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Hartkopp @ 2015-03-17 19:42 UTC (permalink / raw)
  To: linux-can@vger.kernel.org

Hi all,

as discussed today I posted the patches to "fix the long standing bug" of 
getting duplicate CAN frames when having overlapping filters.

The second patch (and the candump patch) is to test the functionality to 
implement joined filters which provides a logical AND for the given filters.

Happy testing - feedback is welcome!

Regards,
Oliver

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] Join CAN filters with CAN_RAW_JOIN_FILTERS sockopt is ready for testing
  2015-03-17 19:42 [RFC] Join CAN filters with CAN_RAW_JOIN_FILTERS sockopt is ready for testing Oliver Hartkopp
@ 2015-03-18  7:13 ` Oliver Hartkopp
  2015-03-18  7:48   ` Pankajkumar Misra (RBEI/EEA2)
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Hartkopp @ 2015-03-18  7:13 UTC (permalink / raw)
  To: linux-can@vger.kernel.org

Here some tests with the V2 version:

Current mainline (no modifications)

$ candump vcan0,0:0,0:0
   vcan0  1C8   [8]  5C FE CC 4C E9 4F 4A 21
   vcan0  1C8   [8]  5C FE CC 4C E9 4F 4A 21
   vcan0  60D   [8]  BA 3B 6F 53 05 79 BE 4F
   vcan0  60D   [8]  BA 3B 6F 53 05 79 BE 4F
   vcan0  4BE   [8]  BF AA 6D 72 31 E0 E2 1C
   vcan0  4BE   [8]  BF AA 6D 72 31 E0 E2 1C
   vcan0  7DE   [7]  4A E0 8B 68 AC 6E 0F
   vcan0  7DE   [7]  4A E0 8B 68 AC 6E 0F

two filters for 'all' lead to two frames each.
(cangen vcan0 in separate terminal)

With patch1 (can: fix multiple delivery ...)

$ candump vcan0,0:0,0:0
   vcan0  78D   [8]  C0 71 65 56 23 16 95 6B
   vcan0  70E   [3]  01 D4 CC
   vcan0  749   [7]  A7 8D B3 43 75 C1 22
   vcan0  238   [2]  17 06
   vcan0  108   [4]  8C F7 79 03
   vcan0  190   [0]
   vcan0  25D   [1]  C2
   vcan0  4CE   [4]  6F 1A 50 38

eliminates the double reception.

Now testing patch2 (can: introduce new raw socket option ...)
Using 'cangen vcan0 -I i -n 6 -L 0' in separate terminal.

Current mainline (no modifications)

$ candump vcan0,001~7FF,003~7FF,004~7FF
   vcan0  000   [0]
   vcan0  000   [0]
   vcan0  000   [0]
   vcan0  001   [0]
   vcan0  001   [0]
   vcan0  002   [0]
   vcan0  002   [0]
   vcan0  002   [0]
   vcan0  003   [0]
   vcan0  003   [0]
   vcan0  004   [0]
   vcan0  004   [0]
   vcan0  005   [0]
   vcan0  005   [0]
   vcan0  005   [0]

With patch1 and patch2 but no joined filters:

$ candump vcan0,001~7FF,003~7FF,004~7FF
   vcan0  000   [0]
   vcan0  001   [0]
   vcan0  002   [0]
   vcan0  003   [0]
   vcan0  004   [0]
   vcan0  005   [0]

With patch1 and patch2 with joined filters:

$ candump vcan0,001~7FF,003~7FF,004~7FF,J
   vcan0  000   [0]
   vcan0  002   [0]
   vcan0  005   [0]


Hey - that rocks!


On 17.03.2015 20:42, Oliver Hartkopp wrote:
> Hi all,
>
> as discussed today I posted the patches to "fix the long standing bug" of
> getting duplicate CAN frames when having overlapping filters.
>
> The second patch (and the candump patch) is to test the functionality to
> implement joined filters which provides a logical AND for the given filters.
>
> Happy testing - feedback is welcome!
>
> Regards,
> Oliver
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [RFC] Join CAN filters with CAN_RAW_JOIN_FILTERS sockopt is ready for testing
  2015-03-18  7:13 ` Oliver Hartkopp
@ 2015-03-18  7:48   ` Pankajkumar Misra (RBEI/EEA2)
  2015-03-18  7:52     ` Oliver Hartkopp
  0 siblings, 1 reply; 4+ messages in thread
From: Pankajkumar Misra (RBEI/EEA2) @ 2015-03-18  7:48 UTC (permalink / raw)
  To: Oliver Hartkopp, linux-can@vger.kernel.org

Hello Oliver,

I have a question here.

The filter used with candump are software filters or actual can device filter registers are updated ?

Best Regards,
Pankaj

-----Original Message-----
From: linux-can-owner@vger.kernel.org [mailto:linux-can-owner@vger.kernel.org] On Behalf Of Oliver Hartkopp
Sent: Wednesday, March 18, 2015 12:44 PM
To: linux-can@vger.kernel.org
Subject: Re: [RFC] Join CAN filters with CAN_RAW_JOIN_FILTERS sockopt is ready for testing

Here some tests with the V2 version:

Current mainline (no modifications)

$ candump vcan0,0:0,0:0
   vcan0  1C8   [8]  5C FE CC 4C E9 4F 4A 21
   vcan0  1C8   [8]  5C FE CC 4C E9 4F 4A 21
   vcan0  60D   [8]  BA 3B 6F 53 05 79 BE 4F
   vcan0  60D   [8]  BA 3B 6F 53 05 79 BE 4F
   vcan0  4BE   [8]  BF AA 6D 72 31 E0 E2 1C
   vcan0  4BE   [8]  BF AA 6D 72 31 E0 E2 1C
   vcan0  7DE   [7]  4A E0 8B 68 AC 6E 0F
   vcan0  7DE   [7]  4A E0 8B 68 AC 6E 0F

two filters for 'all' lead to two frames each.
(cangen vcan0 in separate terminal)

With patch1 (can: fix multiple delivery ...)

$ candump vcan0,0:0,0:0
   vcan0  78D   [8]  C0 71 65 56 23 16 95 6B
   vcan0  70E   [3]  01 D4 CC
   vcan0  749   [7]  A7 8D B3 43 75 C1 22
   vcan0  238   [2]  17 06
   vcan0  108   [4]  8C F7 79 03
   vcan0  190   [0]
   vcan0  25D   [1]  C2
   vcan0  4CE   [4]  6F 1A 50 38

eliminates the double reception.

Now testing patch2 (can: introduce new raw socket option ...)
Using 'cangen vcan0 -I i -n 6 -L 0' in separate terminal.

Current mainline (no modifications)

$ candump vcan0,001~7FF,003~7FF,004~7FF
   vcan0  000   [0]
   vcan0  000   [0]
   vcan0  000   [0]
   vcan0  001   [0]
   vcan0  001   [0]
   vcan0  002   [0]
   vcan0  002   [0]
   vcan0  002   [0]
   vcan0  003   [0]
   vcan0  003   [0]
   vcan0  004   [0]
   vcan0  004   [0]
   vcan0  005   [0]
   vcan0  005   [0]
   vcan0  005   [0]

With patch1 and patch2 but no joined filters:

$ candump vcan0,001~7FF,003~7FF,004~7FF
   vcan0  000   [0]
   vcan0  001   [0]
   vcan0  002   [0]
   vcan0  003   [0]
   vcan0  004   [0]
   vcan0  005   [0]

With patch1 and patch2 with joined filters:

$ candump vcan0,001~7FF,003~7FF,004~7FF,J
   vcan0  000   [0]
   vcan0  002   [0]
   vcan0  005   [0]


Hey - that rocks!


On 17.03.2015 20:42, Oliver Hartkopp wrote:
> Hi all,
>
> as discussed today I posted the patches to "fix the long standing bug" of
> getting duplicate CAN frames when having overlapping filters.
>
> The second patch (and the candump patch) is to test the functionality to
> implement joined filters which provides a logical AND for the given filters.
>
> Happy testing - feedback is welcome!
>
> Regards,
> Oliver
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] Join CAN filters with CAN_RAW_JOIN_FILTERS sockopt is ready for testing
  2015-03-18  7:48   ` Pankajkumar Misra (RBEI/EEA2)
@ 2015-03-18  7:52     ` Oliver Hartkopp
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Hartkopp @ 2015-03-18  7:52 UTC (permalink / raw)
  To: Pankajkumar Misra (RBEI/EEA2), linux-can@vger.kernel.org

Hello Pankaj

On 18.03.2015 08:48, Pankajkumar Misra (RBEI/EEA2) wrote:

> I have a question here.
>
> The filter used with candump are software filters or actual can device filter registers are updated ?
>

Yes. The CAN controllers are always operated without filters and all the 
filtering is done in the NET_RX softirq inside the Linux network layer.

See https://www.kernel.org/doc/Documentation/networking/can.txt Chapter 3.1

Regards,
Oliver

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-18  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 19:42 [RFC] Join CAN filters with CAN_RAW_JOIN_FILTERS sockopt is ready for testing Oliver Hartkopp
2015-03-18  7:13 ` Oliver Hartkopp
2015-03-18  7:48   ` Pankajkumar Misra (RBEI/EEA2)
2015-03-18  7:52     ` Oliver Hartkopp

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).