[PATCH 0/7] CAN: Add new PF_CAN protocol family, try #10

2007-10-05 Thread Urs Thuermann
Hello Dave, hello Patrick,

this is the tenth post of the patch series that adds the PF_CAN
protocol family for the Controller Area Network.

We've fixed some cosmetic issues as remarked by Arnaldo:

* Rename our static debug variables to {can,raw,bcm,vcan}_debug.
* Use module_param_named() so that the module option names remain.
* Remove raw_poll() and bcm_poll() functions and use datagram_poll instead.
* Cleanup of can_addr union in sockaddr_can.
* Change type of echo module parameter to boolean.

Thanks to all reviewers for the constructive feedback!

Regards,
urs



The changes in try #9 were:

* Changes suggested by Arnaldo Carvalho de Melo:
  - Use gfp_any() instead of checking in_interrupt().
  - Don't kfree() the sk_protinfo field.
* Fixed licence text as pointed out by Yoshifuji Hideaki and Patrick McHardy.
* Added IFF_ECHO to include/linux/if.h and use that instead of IFF_LOOPBACK,
  as suggested by Eric W. Biederman.  IFF_LOOPBACK is only for the normal
  loopback interface.

The changes in try #8 were:

* Some changes in debug code, following suggestions from Joe Perches:
  - Remove dynamically allocated buffer for debug output.
  - Use kernel functions for hexdumps.
  - Don't interpret printf-style %-sequences in can_debug_cframe().
  - Specify the fixed argument fmt to DBG() macro and use
GCC ## mechanism to remove , when args is empty.
* Removed CAN_RAW_USER and CAN_BCM_USER Kconfig options following a
  suggestion from Patrick.
* Prevent overflow in statistics calculation.
* Minor optimization.

The changes in try #7 were:

* Changes suggested by Patrick:
  - protect proto_tab[] by a lock.
  - add _rcu to some hlist traversals.
  - use printk_ratelimit() for module autoload failures.
  - make can_proto_unregister() and can_rx_unregister() return void.
  - use return value of can_proto_register() and can_rx_register()
(this also removed a flaw in behavior of raw_bind() and raw_setsockopt()
 in case of failure to can_rx_register() their filters).
  - call kzalloc() with GFP_KERNEL in case NETDEV_REGISTER.
  - use round_jiffies() to calculate expiration times.
  - make some variables static and/or __read_mostly.
  - in can_create() check for net namespace before auto loading modules.
  - add build time check for struct sizes.
  - use skb_share_chack() in vcan.
  - fixed some comments.
* Typos in documentation as pointed out by Randy Dunlap and Bill Fink.

The changes in try #6 were:

* Update code to work with namespaces in net-2.6.24.
* Remove SET_MODULE_OWNER() from vcan.

The changes in try #5 were:

* Remove slab destructor from calls to kmem_cache_alloc().
* Add comments about types defined in can.h.
* Update comment on vcan loopback module parameter.
* Fix typo in documentation.

The changes in try #4 were:

* Change vcan network driver to use the new RTNL API, as suggested by
  Patrick.
* Revert our change to use skb-iif instead of skb-cb.  After
  discussion with Patrick and Jamal it turned out, our first
  implementation was correct.
* Use skb_tail_pointer() instead of skb-tail directly.
* Coding style changes to satisfy linux/scripts/checkpatch.pl.
* Minor changes for 64-bit-cleanliness.
* Minor cleanup of #include's

The changes in try #3 were:

* Use sbk-sk and skb-pkt_type instead of skb-cb to pass loopback
  flags and originating socket down to the driver and back to the
  receiving socket.  Thanks to Patrick McHardy for pointing out our
  wrong use of sbk-cb.
* Use skb-iif instead of skb-cb to pass receiving interface from
  raw_rcv() and bcm_rcv() up to raw_recvmsg() and bcm_recvmsg().
* Set skb-protocol when sending CAN frames to netdevices.
* Removed struct raw_opt and struct bcm_opt and integrated these
  directly into struct raw_sock and bcm_sock resp., like most other
  proto implementations do.
* We have found and fixed race conditions between raw_bind(),
  raw_{set,get}sockopt() and raw_notifier().  This resulted in
  - complete removal of our own notifier list infrastructure in
af_can.c.  raw.c and bcm.c now use normal netdevice notifiers.
  - removal of ro-lock spinlock.  We use lock_sock(sk) now.
  - changed deletion of dev_rcv_lists, which are now marked for
deletion in the netdevice notifier in af_can.c and are actually
deleted when all entries have been deleted using can_rx_unregister().
* Follow changes in 2.6.22 (e.g. ktime_t timestamps in skb).
* Removed obsolete code from vcan.c, as pointed out by Stephen Hemminger.

The changes in try #2 were:

* reduced RCU callback overhead when deleting receiver lists (thx to
  feedback from Paul E. McKenney).
* eliminated some code duplication in net/can/proc.c.
* renamed slock-29 and sk_lock-29 to slock-AF_CAN and sk_lock-AF_CAN in
  net/core/sock.c
* added entry for can.txt in Documentation/networking/00-INDEX
* added error frame definitions in include/linux/can/error.h, which are to
  be used by CAN network drivers.


This patch series applies against net-2.6.24 and is derived from Subversion

[PATCH 0/7] CAN: Add new PF_CAN protocol family, try #9

2007-10-02 Thread Urs Thuermann
Hello Dave, hello Patrick,

this is the nineth post of the patch series that adds the PF_CAN
protocol family for the Controller Area Network.

Since our last post we have changed the following:

* Changes suggested by Arnaldo Carvalho de Melo:
  - Use gfp_any() instead of checking in_interrupt().
  - Don't kfree() the sk_protinfo field.
* Fixed licence text as pointed out by Yoshifuji Hideaki and Patrick McHardy.
* Added IFF_ECHO to include/linux/if.h and use that instead of IFF_LOOPBACK,
  as suggested by Eric W. Biederman.  IFF_LOOPBACK is only for the normal
  loopback interface.

The changes in try #8 were:

* Some changes in debug code, following suggestions from Joe Perches:
  - Remove dynamically allocated buffer for debug output.
  - Use kernel functions for hexdumps.
  - Don't interpret printf-style %-sequences in can_debug_cframe().
  - Specify the fixed argument fmt to DBG() macro and use
GCC ## mechanism to remove , when args is empty.
* Removed CAN_RAW_USER and CAN_BCM_USER Kconfig options following a
  suggestion from Patrick.
* Prevent overflow in statistics calculation.
* Minor optimization.

The changes in try #7 were:

* Changes suggested by Patrick:
  - protect proto_tab[] by a lock.
  - add _rcu to some hlist traversals.
  - use printk_ratelimit() for module autoload failures.
  - make can_proto_unregister() and can_rx_unregister() return void.
  - use return value of can_proto_register() and can_rx_register()
(this also removed a flaw in behavior of raw_bind() and raw_setsockopt()
 in case of failure to can_rx_register() their filters).
  - call kzalloc() with GFP_KERNEL in case NETDEV_REGISTER.
  - use round_jiffies() to calculate expiration times.
  - make some variables static and/or __read_mostly.
  - in can_create() check for net namespace before auto loading modules.
  - add build time check for struct sizes.
  - use skb_share_chack() in vcan.
  - fixed some comments.
* Typos in documentation as pointed out by Randy Dunlap and Bill Fink.

The changes in try #6 were:

* Update code to work with namespaces in net-2.6.24.
* Remove SET_MODULE_OWNER() from vcan.

The changes in try #5 were:

* Remove slab destructor from calls to kmem_cache_alloc().
* Add comments about types defined in can.h.
* Update comment on vcan loopback module parameter.
* Fix typo in documentation.

The changes in try #4 were:

* Change vcan network driver to use the new RTNL API, as suggested by
  Patrick.
* Revert our change to use skb-iif instead of skb-cb.  After
  discussion with Patrick and Jamal it turned out, our first
  implementation was correct.
* Use skb_tail_pointer() instead of skb-tail directly.
* Coding style changes to satisfy linux/scripts/checkpatch.pl.
* Minor changes for 64-bit-cleanliness.
* Minor cleanup of #include's

The changes in try #3 were:

* Use sbk-sk and skb-pkt_type instead of skb-cb to pass loopback
  flags and originating socket down to the driver and back to the
  receiving socket.  Thanks to Patrick McHardy for pointing out our
  wrong use of sbk-cb.
* Use skb-iif instead of skb-cb to pass receiving interface from
  raw_rcv() and bcm_rcv() up to raw_recvmsg() and bcm_recvmsg().
* Set skb-protocol when sending CAN frames to netdevices.
* Removed struct raw_opt and struct bcm_opt and integrated these
  directly into struct raw_sock and bcm_sock resp., like most other
  proto implementations do.
* We have found and fixed race conditions between raw_bind(),
  raw_{set,get}sockopt() and raw_notifier().  This resulted in
  - complete removal of our own notifier list infrastructure in
af_can.c.  raw.c and bcm.c now use normal netdevice notifiers.
  - removal of ro-lock spinlock.  We use lock_sock(sk) now.
  - changed deletion of dev_rcv_lists, which are now marked for
deletion in the netdevice notifier in af_can.c and are actually
deleted when all entries have been deleted using can_rx_unregister().
* Follow changes in 2.6.22 (e.g. ktime_t timestamps in skb).
* Removed obsolete code from vcan.c, as pointed out by Stephen Hemminger.

The changes in try #2 were:

* reduced RCU callback overhead when deleting receiver lists (thx to
  feedback from Paul E. McKenney).
* eliminated some code duplication in net/can/proc.c.
* renamed slock-29 and sk_lock-29 to slock-AF_CAN and sk_lock-AF_CAN in
  net/core/sock.c
* added entry for can.txt in Documentation/networking/00-INDEX
* added error frame definitions in include/linux/can/error.h, which are to
  be used by CAN network drivers.


This patch series applies against net-2.6.24 and is derived from Subversion
revision r511 of http://svn.berlios.de/svnroot/repos/socketcan.
It can be found in the directory
http://svn.berlios.de/svnroot/repos/socketcan/trunk/patch-series/version.

Thanks very much for your work!

Best regards,

Urs Thuermann
Oliver Hartkopp
--
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  

[PATCH 0/7] CAN: Add new PF_CAN protocol family, try #8

2007-09-25 Thread Urs Thuermann
Hello Dave, hello Patrick,

this is the eigth post of the patch series that adds the PF_CAN
protocol family for the Controller Area Network.

Since our last post we have changed the following:

* Some changes in debug code, following suggestions from Joe Perches:
  - Remove dynamically allocated buffer for debug output.
  - Use kernel functions for hexdumps.
  - Don't interpret printf-style %-sequences in can_debug_cframe().
  - Specify the fixed argument fmt to DBG() macro and use
GCC ## mechanism to remove , when args is empty.
* Removed CAN_RAW_USER and CAN_BCM_USER Kconfig options following a
  suggestion from Patrick.
* Prevent overflow in statistics calculation.
* Minor optimization.

The changes in try #7 were:

* Changes suggested by Patrick:
  - protect proto_tab[] by a lock.
  - add _rcu to some hlist traversals.
  - use printk_ratelimit() for module autoload failures.
  - make can_proto_unregister() and can_rx_unregister() return void.
  - use return value of can_proto_register() and can_rx_register()
(this also removed a flaw in behavior of raw_bind() and raw_setsockopt()
 in case of failure to can_rx_register() their filters).
  - call kzalloc() with GFP_KERNEL in case NETDEV_REGISTER.
  - use round_jiffies() to calculate expiration times.
  - make some variables static and/or __read_mostly.
  - in can_create() check for net namespace before auto loading modules.
  - add build time check for struct sizes.
  - use skb_share_chack() in vcan.
  - fixed some comments.
* Typos in documentation as pointed out by Randy Dunlap and Bill Fink.

The changes in try #6 were:

* Update code to work with namespaces in net-2.6.24.
* Remove SET_MODULE_OWNER() from vcan.

The changes in try #5 were:

* Remove slab destructor from calls to kmem_cache_alloc().
* Add comments about types defined in can.h.
* Update comment on vcan loopback module parameter.
* Fix typo in documentation.

The changes in try #4 were:

* Change vcan network driver to use the new RTNL API, as suggested by
  Patrick.
* Revert our change to use skb-iif instead of skb-cb.  After
  discussion with Patrick and Jamal it turned out, our first
  implementation was correct.
* Use skb_tail_pointer() instead of skb-tail directly.
* Coding style changes to satisfy linux/scripts/checkpatch.pl.
* Minor changes for 64-bit-cleanliness.
* Minor cleanup of #include's

The changes in try #3 were:

* Use sbk-sk and skb-pkt_type instead of skb-cb to pass loopback
  flags and originating socket down to the driver and back to the
  receiving socket.  Thanks to Patrick McHardy for pointing out our
  wrong use of sbk-cb.
* Use skb-iif instead of skb-cb to pass receiving interface from
  raw_rcv() and bcm_rcv() up to raw_recvmsg() and bcm_recvmsg().
* Set skb-protocol when sending CAN frames to netdevices.
* Removed struct raw_opt and struct bcm_opt and integrated these
  directly into struct raw_sock and bcm_sock resp., like most other
  proto implementations do.
* We have found and fixed race conditions between raw_bind(),
  raw_{set,get}sockopt() and raw_notifier().  This resulted in
  - complete removal of our own notifier list infrastructure in
af_can.c.  raw.c and bcm.c now use normal netdevice notifiers.
  - removal of ro-lock spinlock.  We use lock_sock(sk) now.
  - changed deletion of dev_rcv_lists, which are now marked for
deletion in the netdevice notifier in af_can.c and are actually
deleted when all entries have been deleted using can_rx_unregister().
* Follow changes in 2.6.22 (e.g. ktime_t timestamps in skb).
* Removed obsolete code from vcan.c, as pointed out by Stephen Hemminger.

The changes in try #2 were:

* reduced RCU callback overhead when deleting receiver lists (thx to
  feedback from Paul E. McKenney).
* eliminated some code duplication in net/can/proc.c.
* renamed slock-29 and sk_lock-29 to slock-AF_CAN and sk_lock-AF_CAN in
  net/core/sock.c
* added entry for can.txt in Documentation/networking/00-INDEX
* added error frame definitions in include/linux/can/error.h, which are to
  be used by CAN network drivers.


This patch series applies against net-2.6.24 and is derived from Subversion
revision r493 of http://svn.berlios.de/svnroot/repos/socketcan.
It can be found in the directory
http://svn.berlios.de/svnroot/repos/socketcan/trunk/patch-series/version.

Thanks very much for your work!

Best regards,

Urs Thuermann
Oliver Hartkopp
--
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] CAN: Add new PF_CAN protocol family, try #7

2007-09-20 Thread Urs Thuermann
Hello Dave, hello Patrick,

this is the seventh post of the patch series that adds the PF_CAN
protocol family for the Controller Area Network.

Since our last post we have changed the following:

* Changes suggested by Patrick:
  - protect proto_tab[] by a lock.
  - add _rcu to some hlist traversals.
  - use printk_ratelimit() for module autoload failures.
  - make can_proto_unregister() and can_rx_unregister() return void.
  - use return value of can_proto_register() and can_rx_register()
(this also removed a flaw in behavior of raw_bind() and raw_setsockopt()
 in case of failure to can_rx_register() their filters).
  - call kzalloc() with GFP_KERNEL in case NETDEV_REGISTER.
  - use round_jiffies() to calculate expiration times.
  - make some variables static and/or __read_mostly.
  - in can_create() check for net namespace before auto loading modules.
  - add build time check for struct sizes.
  - use skb_share_chack() in vcan.
  - fixed some comments.
* Typos in documentation as pointed out by Randy Dunlap and Bill Fink.

The changes in try #6 were:

* Update code to work with namespaces in net-2.6.24.
* Remove SET_MODULE_OWNER() from vcan.

The changes in try #5 were:

* Remove slab destructor from calls to kmem_cache_alloc().
* Add comments about types defined in can.h.
* Update comment on vcan loopback module parameter.
* Fix typo in documentation.

The changes in try #4 were:

* Change vcan network driver to use the new RTNL API, as suggested by
  Patrick.
* Revert our change to use skb-iif instead of skb-cb.  After
  discussion with Patrick and Jamal it turned out, our first
  implementation was correct.
* Use skb_tail_pointer() instead of skb-tail directly.
* Coding style changes to satisfy linux/scripts/checkpatch.pl.
* Minor changes for 64-bit-cleanliness.
* Minor cleanup of #include's

The changes in try #3 were:

* Use sbk-sk and skb-pkt_type instead of skb-cb to pass loopback
  flags and originating socket down to the driver and back to the
  receiving socket.  Thanks to Patrick McHardy for pointing out our
  wrong use of sbk-cb.
* Use skb-iif instead of skb-cb to pass receiving interface from
  raw_rcv() and bcm_rcv() up to raw_recvmsg() and bcm_recvmsg().
* Set skb-protocol when sending CAN frames to netdevices.
* Removed struct raw_opt and struct bcm_opt and integrated these
  directly into struct raw_sock and bcm_sock resp., like most other
  proto implementations do.
* We have found and fixed race conditions between raw_bind(),
  raw_{set,get}sockopt() and raw_notifier().  This resulted in
  - complete removal of our own notifier list infrastructure in
af_can.c.  raw.c and bcm.c now use normal netdevice notifiers.
  - removal of ro-lock spinlock.  We use lock_sock(sk) now.
  - changed deletion of dev_rcv_lists, which are now marked for
deletion in the netdevice notifier in af_can.c and are actually
deleted when all entries have been deleted using can_rx_unregister().
* Follow changes in 2.6.22 (e.g. ktime_t timestamps in skb).
* Removed obsolete code from vcan.c, as pointed out by Stephen Hemminger.

The changes in try #2 were:

* reduced RCU callback overhead when deleting receiver lists (thx to
  feedback from Paul E. McKenney).
* eliminated some code duplication in net/can/proc.c.
* renamed slock-29 and sk_lock-29 to slock-AF_CAN and sk_lock-AF_CAN in
  net/core/sock.c
* added entry for can.txt in Documentation/networking/00-INDEX
* added error frame definitions in include/linux/can/error.h, which are to
  be used by CAN network drivers.


This patch series applies against net-2.6.24 and is derived from Subversion
revision r484 of http://svn.berlios.de/svnroot/repos/socketcan.
It can be found in the directory
http://svn.berlios.de/svnroot/repos/socketcan/trunk/patch-series/version.

Thanks very much for your work!

Best regards,

Urs Thuermann
Oliver Hartkopp


P.S. Greetings from some BSD and Linux users here at the LUG meeting in
 Braunschweig :-)
--
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] CAN: Add new PF_CAN protocol family, try #6

2007-09-17 Thread Urs Thuermann
Hello Dave,

this is the sixth post of the patch series that adds the PF_CAN
protocol family for the Controller Area Network.

Since our last post we have changed the following:

* Update code to work with namespaces in net-2.6.24.
* Remove SET_MODULE_OWNER() from vcan.

The changes in try #5 were:

* Remove slab destructor from calls to kmem_cache_alloc().
* Add comments about types defined in can.h.
* Update comment on vcan loopback module parameter.
* Fix typo in documentation.

The changes in try #4 were:

* Change vcan network driver to use the new RTNL API, as suggested by
  Patrick.
* Revert our change to use skb-iif instead of skb-cb.  After
  discussion with Patrick and Jamal it turned out, our first
  implementation was correct.
* Use skb_tail_pointer() instead of skb-tail directly.
* Coding style changes to satisfy linux/scripts/checkpatch.pl.
* Minor changes for 64-bit-cleanliness.
* Minor cleanup of #include's

The changes in try #3 were:

* Use sbk-sk and skb-pkt_type instead of skb-cb to pass loopback
  flags and originating socket down to the driver and back to the
  receiving socket.  Thanks to Patrick McHardy for pointing out our
  wrong use of sbk-cb.
* Use skb-iif instead of skb-cb to pass receiving interface from
  raw_rcv() and bcm_rcv() up to raw_recvmsg() and bcm_recvmsg().
* Set skb-protocol when sending CAN frames to netdevices.
* Removed struct raw_opt and struct bcm_opt and integrated these
  directly into struct raw_sock and bcm_sock resp., like most other
  proto implementations do.
* We have found and fixed race conditions between raw_bind(),
  raw_{set,get}sockopt() and raw_notifier().  This resulted in
  - complete removal of our own notifier list infrastructure in
af_can.c.  raw.c and bcm.c now use normal netdevice notifiers.
  - removal of ro-lock spinlock.  We use lock_sock(sk) now.
  - changed deletion of dev_rcv_lists, which are now marked for
deletion in the netdevice notifier in af_can.c and are actually
deleted when all entries have been deleted using can_rx_unregister().
* Follow changes in 2.6.22 (e.g. ktime_t timestamps in skb).
* Removed obsolete code from vcan.c, as pointed out by Stephen Hemminger.

The changes in try #2 were:

* reduced RCU callback overhead when deleting receiver lists (thx to
  feedback from Paul E. McKenney).
* eliminated some code duplication in net/can/proc.c.
* renamed slock-29 and sk_lock-29 to slock-AF_CAN and sk_lock-AF_CAN in
  net/core/sock.c
* added entry for can.txt in Documentation/networking/00-INDEX
* added error frame definitions in include/linux/can/error.h, which are to
  be used by CAN network drivers.


This patch series applies against net-2.6.24 and is derived from Subversion
revision r466 of http://svn.berlios.de/svnroot/repos/socketcan.
It can be found in the directory
http://svn.berlios.de/svnroot/repos/socketcan/trunk/patch-series/version.

This patch doesn't touch anything in the kernel except for the allocation
of a couple of numbers for protocol, arp hw type, and a line discipline.

Please review this patch series for integration into your tree.

Thanks very much for your work!

Best regards,

Urs Thuermann
Oliver Hartkopp
--
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 0/7] CAN: Add new PF_CAN protocol family, try #5

2007-08-03 Thread Urs Thuermann
Hello Dave,

this is the fifth post of the patch series that adds the PF_CAN
protocol family for the Controller Area Network.

Since our last post we have changed the following:

* Remove slab destructor from calls to kmem_cache_alloc().
* Add comments about types defined in can.h.
* Update comment on vcan loopback module parameter.
* Fix typo in documentation.

The changes in try #4 were:

* Change vcan network driver to use the new RTNL API, as suggested by
  Patrick.
* Revert our change to use skb-iif instead of skb-cb.  After
  discussion with Patrick and Jamal it turned out, our first
  implementation was correct.
* Use skb_tail_pointer() instead of skb-tail directly.
* Coding style changes to satisfy linux/scripts/checkpatch.pl.
* Minor changes for 64-bit-cleanliness.
* Minor cleanup of #include's

The changes in try #3 were:

* Use sbk-sk and skb-pkt_type instead of skb-cb to pass loopback
  flags and originating socket down to the driver and back to the
  receiving socket.  Thanks to Patrick McHardy for pointing out our
  wrong use of sbk-cb.
* Use skb-iif instead of skb-cb to pass receiving interface from
  raw_rcv() and bcm_rcv() up to raw_recvmsg() and bcm_recvmsg().
* Set skb-protocol when sending CAN frames to netdevices.
* Removed struct raw_opt and struct bcm_opt and integrated these
  directly into struct raw_sock and bcm_sock resp., like most other
  proto implementations do.
* We have found and fixed race conditions between raw_bind(),
  raw_{set,get}sockopt() and raw_notifier().  This resulted in
  - complete removal of our own notifier list infrastructure in
af_can.c.  raw.c and bcm.c now use normal netdevice notifiers.
  - removal of ro-lock spinlock.  We use lock_sock(sk) now.
  - changed deletion of dev_rcv_lists, which are now marked for
deletion in the netdevice notifier in af_can.c and are actually
deleted when all entries have been deleted using can_rx_unregister().
* Follow changes in 2.6.22 (e.g. ktime_t timestamps in skb).
* Removed obsolete code from vcan.c, as pointed out by Stephen Hemminger.

The changes in try #2 were:

* reduced RCU callback overhead when deleting receiver lists (thx to
  feedback from Paul E. McKenney).
* eliminated some code duplication in net/can/proc.c.
* renamed slock-29 and sk_lock-29 to slock-AF_CAN and sk_lock-AF_CAN in
  net/core/sock.c
* added entry for can.txt in Documentation/networking/00-INDEX
* added error frame definitions in include/linux/can/error.h, which are to
  be used by CAN network drivers.


This patch series applies against net-2.6 and is derived from Subversion
revision r455 of http://svn.berlios.de/svnroot/repos/socketcan.
It can be found in the directory
http://svn.berlios.de/svnroot/repos/socketcan/trunk/patch-series/version.

This patch doesn't touch anything in the kernel except for the allocation
of a couple of numbers for protocol, arp hw type, and a line discipline.

Please review this patch series for integration into your tree.

Thanks very much for your work!

Best regards,

Urs Thuermann
Oliver Hartkopp

--
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 0/7] CAN: Add new PF_CAN protocol family, try #3

2007-06-22 Thread Oliver Hartkopp
Patrick McHardy wrote:
 Urs Thuermann wrote:
   
 * Use skb-iif instead of skb-cb to pass receiving interface from
   raw_rcv() and bcm_rcv() up to raw_recvmsg() and bcm_recvmsg().
 


 skb-iif doesn't necessarily point to the incoming network device
 as seen seen by netif_receive_skb, for layered devices it currently
 always points to the first interface that received a packet.
   

This is exactly the intention.

 Its so far also only used for traffic classification, please explain
 how you're using it and what values it is set to on which paths.
   

As you might have seen in Documentation/networking/can.txt (hint, hint,
hint!) the CAN has no routing, no ARP, no MAC adressing and is a
broadcast only medium. So if there is (at least) any reasonable
addressing on CAN it consists of the CAN-frame's CAN-Identifier and
the CAN-bus this CAN-frame is sent/received on.

For this reason the information about the interface the CAN-frame has
been received on has to be made available to the user-application if it
needs this information. Until your hint about our skb-cb missusage, we
(successfully) transported this information inside skb-cb to
socket-level. But indeed skb-iif is the better (and in our opinion the
right) place to transport this information inside the skb to the
socket-level.

In both cases (receiving real CAN-frames from the CAN-netdev /
performing the loopback of CAN-frames) we set skb-iif to zero to let
netif_receive_skb() set the iif-value to the current skb-dev index. So
skb-iif is set to the first interface the CAN-frame is received on,
which is what we need  intended here.

Is it the right approach to let netif_receive_skb() set the iif-value or
should we better set this value on our own before invoking netif_rx()?

Best regards,
Oliver


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 0/7] CAN: Add new PF_CAN protocol family, try #3

2007-06-22 Thread Patrick McHardy

Oliver Hartkopp wrote:

Patrick McHardy wrote:
  

Urs Thuermann wrote:
  


* Use skb-iif instead of skb-cb to pass receiving interface from
  raw_rcv() and bcm_rcv() up to raw_recvmsg() and bcm_recvmsg().

  

skb-iif doesn't necessarily point to the incoming network device
as seen seen by netif_receive_skb, for layered devices it currently
always points to the first interface that received a packet.
  



This is exactly the intention.

  

Its so far also only used for traffic classification, please explain
how you're using it and what values it is set to on which paths.
  



As you might have seen in Documentation/networking/can.txt (hint, hint,
hint!) the CAN has no routing, no ARP, no MAC adressing and is a
broadcast only medium. So if there is (at least) any reasonable
addressing on CAN it consists of the CAN-frame's CAN-Identifier and
the CAN-bus this CAN-frame is sent/received on.

For this reason the information about the interface the CAN-frame has
been received on has to be made available to the user-application if it
needs this information. Until your hint about our skb-cb missusage, we
(successfully) transported this information inside skb-cb to
socket-level. But indeed skb-iif is the better (and in our opinion the
right) place to transport this information inside the skb to the
socket-level.
  


Lets hear Jamal's opinion on this, to be honest I never understood
how exactly it is supposed to be used.


In both cases (receiving real CAN-frames from the CAN-netdev /
performing the loopback of CAN-frames) we set skb-iif to zero to let
netif_receive_skb() set the iif-value to the current skb-dev index. So
skb-iif is set to the first interface the CAN-frame is received on,
which is what we need  intended here.

Is it the right approach to let netif_receive_skb() set the iif-value or
should we better set this value on our own before invoking netif_rx()?
  


netif_receive_skb is meant to be used as a default, the driver can
override this if it makes sense. If you touch it anyway you might
as well set it to the final value.

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 0/7] CAN: Add new PF_CAN protocol family, try #3

2007-06-22 Thread Oliver Hartkopp
Patrick McHardy wrote:
 Oliver Hartkopp wrote:


 Is it the right approach to let netif_receive_skb() set the iif-value or
 should we better set this value on our own before invoking netif_rx()?
   

 netif_receive_skb is meant to be used as a default, the driver can
 override this if it makes sense. If you touch it anyway you might
 as well set it to the final value.

The CAN bus is really not that high sophisticated network technology, so
it does not need more than the default internal network transport
mechanics the Linux Kernel already provides in an excellent manner.

I also thought about setting skb-iif myself to ensure the correct value
to be set - maybe Jamal has also an opinion on this. The CAN bus only
transports CAN-frames with a 11/29 bit CAN-Identifier (for CSMA/CA
arbitration) with up to 8 Bytes of payload. There is no space for VLANs
and other addressing schemes that are known from Ethernet or other
network media. So in opposite to all the fancy VLANs, routing, filter,
NAT and whatever the CAN is really dumb ;-)

Regards,
Oliver


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 0/7] CAN: Add new PF_CAN protocol family, try #3

2007-06-21 Thread Urs Thuermann
Hello Dave,

this is the third post of the patch series that adds the PF_CAN
protocol family for the Controller Area Network.

Since our last post we have changed the code quite a lot:

* Use sbk-sk and skb-pkt_type instead of skb-cb to pass loopback
  flags and originating socket down to the driver and back to the
  receiving socket.  Thanks to Patrick McHardy for pointing out our
  wrong use of sbk-cb.

* Use skb-iif instead of skb-cb to pass receiving interface from
  raw_rcv() and bcm_rcv() up to raw_recvmsg() and bcm_recvmsg().
  
* Set skb-protocol when sending CAN frames to netdevices.

* Removed struct raw_opt and struct bcm_opt and integrated these
  directly into struct raw_sock and bcm_sock resp., like most other
  proto implementations do.

* We have found and fixed race conditions between raw_bind(),
  raw_{set,get}sockopt() and raw_notifier().  This resulted in
  - complete removal of our own notifier list infrastructure in
af_can.c.  raw.c and bcm.c now use normal netdevice notifiers.
  - removal of ro-lock spinlock.  We use lock_sock(sk) now.
  - changed deletion of dev_rcv_lists, which are now marked for
deletion in the netdevice notifier in af_can.c and are actually
deleted when all entries have been deleted using can_rx_unregister().

* Follow changes in 2.6.22 (e.g. ktime_t timestamps in skb).

* Removed obsolete code from vcan.c, as pointed out by Stephen Hemminger.

This patch series applies against linux-2.6.22-rc5-git5 and is derived from
Subversion revision r390 of http://svn.berlios.de/svnroot/repos/socketcan.
It can be found in the directory
http://svn.berlios.de/svnroot/repos/socketcan/trunk/patch-series/version.

This patch doesn't touch anything in the kernel except for the allocation
of a couple of numbers for protocol, arp hw type, and a line discipline.

Please consider this patch series for integration into your tree.

Thanks very much for your work!

Best regards,

Urs Thuermann
Oliver Hartkopp
--
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 0/7] CAN: Add new PF_CAN protocol family, update

2007-05-30 Thread Urs Thuermann
Hello Dave,

this is the second post of the patch series that adds the PF_CAN
protocol family for the Controller Area Network.

Due to some feedback on the netdev-list and own reviews we have changed
the following:

* reduced RCU callback overhead when deleting receiver lists (thx to
  feedback from Paul E. McKenney).

* eliminated some code duplication in net/can/proc.c.

* renamed slock-29 and sk_lock-29 to slock-AF_CAN and sk_lock-AF_CAN in
  net/core/sock.c

* added entry for can.txt in Documentation/networking/00-INDEX

* added error frame definitions in include/linux/can/error.h, which are to
  be used by CAN network drivers.

This patch series applies against linux-2.6.22-rc3 and is derived from
Subversion revision r322 of http://svn.berlios.de/svnroot/repos/socketcan.
It doesn't touch anything in the kernel except for the allocation of a
couple of numbers for protocol, arp hw type, and a line discipline.

The realization of PF_CAN has been started at the end of 2002 and is
stable since mid-2006.  It's used in automation, naval applications and
several automotive RD environments (e.g. for the Car2Car onboard unit in
http://www.its.dot.gov/vii).

Since, the code has been heavily used and tested and has been reviewed and
discussed intensively on the project mailing lists, we do not expect any
vital problems in this patch series.
Please apply it after a final review.

Thanks very much for your work!

Best regards,

Urs Thuermann
Oliver Hartkopp

--
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 0/7] CAN: Add new PF_CAN protocol family

2007-05-16 Thread Urs Thuermann
This patch series applies against linux-2.6.22-rc1-git4.  It adds a new
protocol family to Linux for communication on the CAN (Controller Area
Network) using the socket API.

The current implementation supports two protocols in the family, a raw
protocol for sending and receiving raw CAN frames, and a broadcast
manager protocol, which effeciently handles periodically sent
broadcast messages, which are typical in CAN environments.

There is also a virtual CAN network driver which only loops back sent
CAN frames.  Drivers for real CAN hardware are also being worked on
and are nearly complete.  These will be released later, or you can find
them in the subversion repository at
http://svn.berlios.de/svnroot/repos/socketcan.

Additional information about the concepts of the CAN protocol family
can be found in the file Documentation/networking/can.txt, added by
patch 7/7.

Userspace tools (can-utils) and test suites for the different CAN
protocols can also be found in the subversion repository.
--
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html