lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 15 Feb 2019 08:22:53 +0000 From: Rundong Ge <rdong.ge@...il.com> To: andrew@...n.ch Cc: vivien.didelot@...il.com, f.fainelli@...il.com, davem@...emloft.net, netdev@...r.kernel.org, linux-kernel@...r.kernel.org, rdong.ge@...il.com Subject: [PATCH] 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. And tag_dsa also needs to implement the callback. Signed-off-by: Rundong Ge <rdong.ge@...il.com> --- net/dsa/tag_dsa.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index 8b2f92e..67ff3fa 100644 --- a/net/dsa/tag_dsa.c +++ b/net/dsa/tag_dsa.c @@ -146,8 +146,17 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev, 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 = { .xmit = dsa_xmit, .rcv = dsa_rcv, + .flow_dissect = dsa_tag_flow_dissect, .overhead = DSA_HLEN, }; -- 1.8.3.1
Powered by blists - more mailing lists