[PATCH RFC net-next 11/19] net: dsa: tag_lan9303: add .flow_dissect() callback

From: Alexander Lobakin
Date: Mon Dec 30 2019 - 09:32:18 EST


This fixes Rx packet hashing on RPS-enabled systems.
Misc: fix lan9303_netdev_ops identation.

Signed-off-by: Alexander Lobakin <alobakin@xxxxxxxx>
---
net/dsa/tag_lan9303.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c
index eb0e7a32e53d..d328a44381a9 100644
--- a/net/dsa/tag_lan9303.c
+++ b/net/dsa/tag_lan9303.c
@@ -128,12 +128,20 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
return skb;
}

+static void lan9303_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+ int *offset)
+{
+ *offset = LAN9303_TAG_LEN;
+ *proto = *(__be16 *)(skb->data + 2);
+}
+
static const struct dsa_device_ops lan9303_netdev_ops = {
- .name = "lan9303",
- .proto = DSA_TAG_PROTO_LAN9303,
- .xmit = lan9303_xmit,
- .rcv = lan9303_rcv,
- .overhead = LAN9303_TAG_LEN,
+ .name = "lan9303",
+ .proto = DSA_TAG_PROTO_LAN9303,
+ .xmit = lan9303_xmit,
+ .rcv = lan9303_rcv,
+ .flow_dissect = lan9303_flow_dissect,
+ .overhead = LAN9303_TAG_LEN,
};

MODULE_LICENSE("GPL");
--
2.24.1