From patchwork Wed Mar 27 01:32:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xiaofeis X-Patchwork-Id: 10872373 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FB7D1390 for ; Wed, 27 Mar 2019 01:32:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F8AF28D56 for ; Wed, 27 Mar 2019 01:32:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E18128D70; Wed, 27 Mar 2019 01:32:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E573B28D56 for ; Wed, 27 Mar 2019 01:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731971AbfC0Bcq (ORCPT ); Tue, 26 Mar 2019 21:32:46 -0400 Received: from alexa-out-tai-01.qualcomm.com ([103.229.16.226]:15924 "EHLO alexa-out-tai-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731963AbfC0Bcq (ORCPT ); Tue, 26 Mar 2019 21:32:46 -0400 X-IronPort-AV: E=Sophos;i="5.60,274,1549900800"; d="scan'208";a="2096652" Received: from ironmsg02-tai.qualcomm.com ([10.249.140.7]) by alexa-out-tai-01.qualcomm.com with ESMTP; 27 Mar 2019 09:32:43 +0800 X-IronPort-AV: E=McAfee;i="5900,7806,9207"; a="25682030" Received: from akronite-sh-dev01.ap.qualcomm.com ([10.231.215.213]) by ironmsg02-tai.qualcomm.com with ESMTP; 27 Mar 2019 09:32:43 +0800 Received: by akronite-sh-dev01.ap.qualcomm.com (Postfix, from userid 206661) id 6D4A8204A5; Wed, 27 Mar 2019 09:32:42 +0800 (CST) From: xiaofeis 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 Subject: [PATCH] net: dsa: Implement flow_dissect callback for tag_qca Date: Wed, 27 Mar 2019 09:32:39 +0800 Message-Id: <1553650359-15959-1-git-send-email-xiaofeis@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add flow_dissect for qca tagged packet to get the right hash. Signed-off-by: xiaofeis --- 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, };