]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: Don't store frame type in skb->cb
authorVladimir Oltean <olteanv@gmail.com>
Wed, 29 May 2019 21:51:26 +0000 (00:51 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 May 2019 21:27:27 +0000 (14:27 -0700)
commitb5ea9941e682eb1d26ba8c4954709a60b93ccd32
tree21c9c98a90cfbf1802904cf3ce8755e5b7402e3e
parent521c1e24e755fcd0c98c234cd870853e8c7f1c9b
net: dsa: sja1105: Don't store frame type in skb->cb

Due to a confusion I thought that eth_type_trans() was called by the
network stack whereas it can actually be called by network drivers to
figure out the skb protocol and next packet_type handlers.

In light of the above, it is not safe to store the frame type from the
DSA tagger's .filter callback (first entry point on RX path), since GRO
is yet to be invoked on the received traffic.  Hence it is very likely
that the skb->cb will actually get overwritten between eth_type_trans()
and the actual DSA packet_type handler.

Of course, what this patch fixes is the actual overwriting of the
SJA1105_SKB_CB(skb)->type field from the GRO layer, which made all
frames be seen as SJA1105_FRAME_TYPE_NORMAL (0).

Fixes: 4edf5460df00 ("net: dsa: sja1105: Add support for traffic through standalone ports")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/dsa/sja1105.h
net/dsa/tag_sja1105.c