2018.10.08 v2: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> resending this patches as pre requirement for j1939 stack. - added ACKs for already ACKed patches. 2017.08.02 v1: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> Hello, while reviwing and cleaning up the j1939 stack I digged a bit deeper into af_can and raw implementation. The first patch adds a missing error check and will probably go into -stable. Patches 2-8 change some struct and variable names, making the code more readble, IMHO. Patch 9 removed the need for struct raw_sock::ifindex from the raw sock, by using struct sock::sk_bound_dev_if from the generic socket structure. Patch 10: Checks if can_family is AF_CAN in raw's bind function. Patch 11: Cleans up the newly integrated CAN net namespace support. Patches 13-14: Where to put the per device protocol specific memory? af_can allocated it's memory during a netdev_notifier call, life cycle proves to be rather complicated (see remove_on_zero_entries, etc...), adding the j1939 memory makes it even more compilcated. So I decided to allocate the memory during the allocation if net_device. And this seems to work. More details in the individual patches. This series applies to net-next/master, but should work on any recent kernel. Please review, test and comment. regards, Marc Marc Kleine-Budde (15): can: netns: give structs holding the CAN statistics a sensible name can: netns: give members of struct netns_can holding the statistics a sensible name can: af_can: give variables holding CAN statistics a sensible name can: proc: give variables holding CAN statistics a sensible name can: netns: remove "can_" prefix from members struct netns_can can: af_can: give variable holding the CAN per device receive lists a sensible name can: proc: give variable holding the CAN per device receive lists a sensible name can: af_can: rename find_rcv_list() to can_rcv_list_find() can: af_can: rename find_dev_rcv_lists() to can_dev_rcv_lists_find() can: af_can: give variable holding the CAN receiver and the receiver list a sensible name can: af_can: can_rx_register(): use max() instead of open coding it can: af_can: can_pernet_exit(): no need to iterate over and cleanup registered CAN devices can: introduce CAN midlayer private and allocate it automatically can: make use of preallocated can_ml_priv for per device struct can_dev_rcv_lists can: af_can: remove NULL-ptr checks from users of can_dev_rcv_lists_find() drivers/net/can/dev.c | 24 ++- drivers/net/can/slcan.c | 6 +- drivers/net/can/vcan.c | 7 +- drivers/net/can/vxcan.c | 4 +- include/linux/can/can-ml.h | 23 +++ include/net/netns/can.h | 14 +- net/can/af_can.c | 296 +++++++++++++++---------------------- net/can/af_can.h | 5 +- net/can/proc.c | 162 ++++++++++---------- 9 files changed, 265 insertions(+), 276 deletions(-) create mode 100644 include/linux/can/can-ml.h -- 2.19.0