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).
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -20,18 +20,6 @@ · 19 unmodified lines | |||
| 20 | #define SJA1105_LINKLOCAL_FILTER_B 0x011B19000000ull | 20 | #define SJA1105_LINKLOCAL_FILTER_B 0x011B19000000ull |
| 21 | #define SJA1105_LINKLOCAL_FILTER_B_MASK 0xFFFFFF000000ull | 21 | #define SJA1105_LINKLOCAL_FILTER_B_MASK 0xFFFFFF000000ull |
| 22 | 22 | ||
| 23 | enum sja1105_frame_type { | ||
| 24 | SJA1105_FRAME_TYPE_NORMAL = 0, | ||
| 25 | SJA1105_FRAME_TYPE_LINK_LOCAL, | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct sja1105_skb_cb { | ||
| 29 | enum sja1105_frame_type type; | ||
| 30 | }; | ||
| 31 | |||
| 32 | #define SJA1105_SKB_CB(skb) \ | ||
| 33 | ((struct sja1105_skb_cb *)DSA_SKB_CB_PRIV(skb)) | ||
| 34 | |||
| 35 | struct sja1105_port { | 23 | struct sja1105_port { |
| 36 | struct dsa_port *dp; | 24 | struct dsa_port *dp; |
| 37 | int mgmt_slot; | 25 | int mgmt_slot; |