]> www.infradead.org Git - users/jedix/linux-maple.git/commit
can: replace timestamp as unique skb attribute
authorOliver Hartkopp <socketcan@hartkopp.net>
Fri, 26 Jun 2015 09:58:19 +0000 (11:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Aug 2015 19:21:51 +0000 (12:21 -0700)
commit153fa24b8f6763c51915c59feed10dad045bd880
tree9ac30a7c88ee2022e23060dd90aaae89a41f6677
parentcea0f568222b53b21242c50445776fccd4a1b8b8
can: replace timestamp as unique skb attribute

commit d3b58c47d330de8c29898fe9746f7530408f8a59 upstream.

Commit 514ac99c64b "can: fix multiple delivery of a single CAN frame for
overlapping CAN filters" requires the skb->tstamp to be set to check for
identical CAN skbs.

Without timestamping to be required by user space applications this timestamp
was not generated which lead to commit 36c01245eb8 "can: fix loss of CAN frames
in raw_rcv" - which forces the timestamp to be set in all CAN related skbuffs
by introducing several __net_timestamp() calls.

This forces e.g. out of tree drivers which are not using alloc_can{,fd}_skb()
to add __net_timestamp() after skbuff creation to prevent the frame loss fixed
in mainline Linux.

This patch removes the timestamp dependency and uses an atomic counter to
create an unique identifier together with the skbuff pointer.

Btw: the new skbcnt element introduced in struct can_skb_priv has to be
initialized with zero in out-of-tree drivers which are not using
alloc_can{,fd}_skb() too.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/dev.c
drivers/net/can/slcan.c
drivers/net/can/vcan.c
include/linux/can/skb.h
net/can/af_can.c
net/can/bcm.c
net/can/raw.c