Commit 57fd9678 authored by Rundong Ge's avatar Rundong Ge Committed by David S. Miller

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: default avatarRundong Ge <rdong.ge@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6e07902f
...@@ -146,8 +146,17 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -146,8 +146,17 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev,
return skb; return skb;
} }
static int dsa_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 dsa_netdev_ops = { const struct dsa_device_ops dsa_netdev_ops = {
.xmit = dsa_xmit, .xmit = dsa_xmit,
.rcv = dsa_rcv, .rcv = dsa_rcv,
.flow_dissect = dsa_tag_flow_dissect,
.overhead = DSA_HLEN, .overhead = DSA_HLEN,
}; };
...@@ -165,8 +165,17 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -165,8 +165,17 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev,
return skb; 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 = { const struct dsa_device_ops edsa_netdev_ops = {
.xmit = edsa_xmit, .xmit = edsa_xmit,
.rcv = edsa_rcv, .rcv = edsa_rcv,
.flow_dissect = edsa_tag_flow_dissect,
.overhead = EDSA_HLEN, .overhead = EDSA_HLEN,
}; };
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