]> 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)
commitdc248b0422d0b5feb9530343408db0bf79a86226
tree7878e10d9185bab8f6b70a64dabd3851f739cecd
parentfd9332452c602418140ee3e1d8fb2cba6c503113
can: replace timestamp as unique skb attribute

Commit 2e6e9125d32 "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 30ab590a8ac "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