net: dsa: free skb->cb usage in core driver
authorYangbo Lu <yangbo.lu@nxp.com>
Tue, 27 Apr 2021 04:22:00 +0000 (12:22 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Apr 2021 21:10:15 +0000 (14:10 -0700)
commitc4b364ce1270d689ee5010001344b8eae3685f32
tree9067cf9a35e95a99308d823ba9b2db06165fb8ae
parent5c5416f5d4c75fe6aba56f6c2c45a070b5e7cc78
net: dsa: free skb->cb usage in core driver

Free skb->cb usage in core driver and let device drivers decide to
use or not. The reason having a DSA_SKB_CB(skb)->clone was because
dsa_skb_tx_timestamp() which may set the clone pointer was called
before p->xmit() which would use the clone if any, and the device
driver has no way to initialize the clone pointer.

This patch just put memset(skb->cb, 0, sizeof(skb->cb)) at beginning
of dsa_slave_xmit(). Some new features in the future, like one-step
timestamp may need more bytes of skb->cb to use in
dsa_skb_tx_timestamp(), and p->xmit().

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c
drivers/net/dsa/sja1105/sja1105_main.c
drivers/net/dsa/sja1105/sja1105_ptp.c
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/mscc/ocelot_net.c
include/linux/dsa/sja1105.h
include/net/dsa.h
include/soc/mscc/ocelot.h
net/dsa/slave.c
net/dsa/tag_ocelot.c
net/dsa/tag_ocelot_8021q.c