]> git.baikalelectronics.ru Git - kernel.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)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 12 Jul 2015 19:13:22 +0000 (21:13 +0200)
commit99112a12bf10299ac0ac428825b701795e025f28
tree7878e10d9185bab8f6b70a64dabd3851f739cecd
parent589284e38ff45552bdbc3fe9ec83f12902a34c24
can: replace timestamp as unique skb attribute

Commit 35b42339e42 "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 149f43bb06d "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>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
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