Commit 2dd592b2 authored by John Crispin's avatar John Crispin Committed by David S. Miller

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: default avatarMuciri Gatimu <muciri@openmesh.com>
Signed-off-by: default avatarShashidhar Lakkavalli <shashidhar.lakkavalli@openmesh.com>
Signed-off-by: default avatarJohn Crispin <john@phrozen.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 598a9680
......@@ -87,7 +87,17 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
return skb;
}
static int mtk_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
int *offset)
{
*offset = 4;
*proto = ((__be16 *)skb->data)[1];
return 0;
}
const struct dsa_device_ops mtk_netdev_ops = {
.xmit = mtk_tag_xmit,
.rcv = mtk_tag_rcv,
.xmit = mtk_tag_xmit,
.rcv = mtk_tag_rcv,
.flow_dissect = mtk_tag_flow_dissect,
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment