netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: xiaofeis <xiaofeis@codeaurora.org>
To: davem@davemloft.net
Cc: vkoul@kernel.org, netdev@vger.kernel.org, andrew@lunn.ch,
	linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org,
	vivien.didelot@gmail.com, f.fainelli@gmail.com,
	niklas.cassel@linaro.org, xiazha@codeaurora.org,
	xiaofeis <xiaofeis@codeaurora.org>
Subject: [PATCH] net: dsa: Implement flow_dissect callback for tag_qca
Date: Wed, 27 Mar 2019 09:32:39 +0800	[thread overview]
Message-ID: <1553650359-15959-1-git-send-email-xiaofeis@codeaurora.org> (raw)

Add flow_dissect for qca tagged packet to get the right hash.

Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
---
 net/dsa/tag_qca.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
index e886a3c..f4b4de3 100644
--- a/net/dsa/tag_qca.c
+++ b/net/dsa/tag_qca.c
@@ -113,8 +113,18 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
 	return skb;
 }
 
+static int qca_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+                                int *offset)
+{
+	*offset = QCA_HDR_LEN;
+	*proto = ((__be16 *)skb->data)[0];
+
+	return 0;
+}
+
 const struct dsa_device_ops qca_netdev_ops = {
 	.xmit	= qca_tag_xmit,
 	.rcv	= qca_tag_rcv,
+	.flow_dissect = qca_tag_flow_dissect,
 	.overhead = QCA_HDR_LEN,
 };
-- 
1.9.1


             reply	other threads:[~2019-03-27  1:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27  1:32 xiaofeis [this message]
2019-03-27  3:50 ` [PATCH] net: dsa: Implement flow_dissect callback for tag_qca Bjorn Andersson
  -- strict thread matches above, loose matches on Subject: below --
2019-03-27  3:59 xiaofeis
2019-03-27  8:57 ` Andrew Lunn
2019-03-27 10:15 ` Vinod Koul
2019-03-28  4:37   ` xiaofeis
2019-03-27 16:27 ` Florian Fainelli
2019-03-28 23:57 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1553650359-15959-1-git-send-email-xiaofeis@codeaurora.org \
    --to=xiaofeis@codeaurora.org \
    --cc=andrew@lunn.ch \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.cassel@linaro.org \
    --cc=vivien.didelot@gmail.com \
    --cc=vkoul@kernel.org \
    --cc=xiazha@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).