Skip to content

Commit 2dd592b

Browse files
blogicdavem330
authored andcommitted
net-next: tag_mtk: add flow_dissect callback to the ops struct
The MT7530 inserts the 4 magic header in between the 802.3 address and protocol field. The patch implements the callback that can be called by the flow dissector to figure out the real protocol and offset of the network header. With this patch applied we can properly parse the packet and thus make hashing function properly. Signed-off-by: Muciri Gatimu <[email protected]> Signed-off-by: Shashidhar Lakkavalli <[email protected]> Signed-off-by: John Crispin <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 598a968 commit 2dd592b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

net/dsa/tag_mtk.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,17 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
8787
return skb;
8888
}
8989

90+
static int mtk_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
91+
int *offset)
92+
{
93+
*offset = 4;
94+
*proto = ((__be16 *)skb->data)[1];
95+
96+
return 0;
97+
}
98+
9099
const struct dsa_device_ops mtk_netdev_ops = {
91-
.xmit = mtk_tag_xmit,
92-
.rcv = mtk_tag_rcv,
100+
.xmit = mtk_tag_xmit,
101+
.rcv = mtk_tag_rcv,
102+
.flow_dissect = mtk_tag_flow_dissect,
93103
};

0 commit comments

Comments
 (0)