aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_edsa.c
diff options
context:
space:
mode:
authorRundong Ge <rdong.ge@gmail.com>2019-02-16 08:35:24 +0000
committerDavid S. Miller <davem@davemloft.net>2019-02-18 16:35:41 -0800
commit57fd967838c665544f425c4a66ead1259a9ad0dc (patch)
treeb5741260664b1bbf5b547bde7cb3d2d65002ce14 /net/dsa/tag_edsa.c
parentnet: sched: using kfree_rcu() to simplify the code (diff)
downloadlinux-dev-57fd967838c665544f425c4a66ead1259a9ad0dc.tar.xz
linux-dev-57fd967838c665544f425c4a66ead1259a9ad0dc.zip
net: dsa: Implement flow_dissect callback for tag_dsa.
RPS not work for DSA devices since the 'skb_get_hash' will always get the invalid hash for dsa tagged packets. "[PATCH] tag_mtk: add flow_dissect callback to the ops struct" introduced the flow_dissect callback to get the right hash for MTK tagged packet. Tag_dsa and tag_edsa also need to implement the callback. Signed-off-by: Rundong Ge <rdong.ge@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_edsa.c')
-rw-r--r--net/dsa/tag_edsa.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
index f5b87ee5c94e..234585ec116e 100644
--- a/net/dsa/tag_edsa.c
+++ b/net/dsa/tag_edsa.c
@@ -165,8 +165,17 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev,
return skb;
}
+static int edsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+ int *offset)
+{
+ *offset = 8;
+ *proto = ((__be16 *)skb->data)[3];
+ return 0;
+}
+
const struct dsa_device_ops edsa_netdev_ops = {
.xmit = edsa_xmit,
.rcv = edsa_rcv,
+ .flow_dissect = edsa_tag_flow_dissect,
.overhead = EDSA_HLEN,
};