From patchwork Wed Aug 9 12:41:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 9890609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 90E6460384 for ; Wed, 9 Aug 2017 12:42:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8148928A65 for ; Wed, 9 Aug 2017 12:42:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75F1F28A7E; Wed, 9 Aug 2017 12:42:18 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3981F28A6D for ; Wed, 9 Aug 2017 12:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YiJv/FWrE6Dxw1qqIJVTImlrP3IvtyN+3aT0u2mP8vk=; b=m8a7tYAb/o6BfqFPp12rG1AXQq rdPasmlOShFAAzHd5hG5+c/PTkX/7YvCm1+FvKo41h1KJzrXPVa1FJUldoVsm0kuGiYu+YRiH5MPj /maoQr9IuNYw4icaUcEWmwJ5568bl4zgpx3+z35TARz9PvdfNew12oQNf+BVpDccjPC4yEnaTDhl4 GhhLabBYC81j7X9nvZoN4Qoo+MFD755faPVN8sNZVH4R8nGDeAqaqefQ1gtqeiXxYmciThepE3mEH LRKpE/jG+cjPqwDXN1C8+fdR9V3WS94/Sg6P4Sz4Q9gXquizmyhhWTFtxaRNQ9PrIRByPZvb338Rx WxPEtlvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dfQJV-0006Cd-Fe; Wed, 09 Aug 2017 12:42:17 +0000 Received: from nbd.name ([2a01:4f8:131:30e2::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dfQJO-0005zM-SX for linux-mediatek@lists.infradead.org; Wed, 09 Aug 2017 12:42:13 +0000 From: John Crispin To: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S . Miller" , Sean Wang Subject: [PATCH 2/4] net-next: dsa: add flow_dissect callback to struct dsa_device_ops Date: Wed, 9 Aug 2017 14:41:17 +0200 Message-Id: <20170809124119.24320-3-john@phrozen.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170809124119.24320-1-john@phrozen.org> References: <20170809124119.24320-1-john@phrozen.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170809_054211_214966_374D3891 X-CRM114-Status: UNSURE ( 6.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Muciri Gatimu , netdev@vger.kernel.org, Shashidhar Lakkavalli , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, John Crispin MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When the flow dissector first sees packets coming in on a DSA devices the 802.3 header wont be located where the code expects it to be as the tag is still present. Adding this new callback allows a DSA device to provide a new function that the flow_dissector can use to get the correct protocol and offset of the network header. Signed-off-by: Muciri Gatimu Signed-off-by: Shashidhar Lakkavalli Signed-off-by: John Crispin Reviewed-by: Andrew Lunn --- include/net/dsa.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index 65d7804c6f69..7f46b521313e 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -106,6 +106,8 @@ struct dsa_device_ops { struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev); + int (*flow_dissect)(const struct sk_buff *skb, __be16 *proto, + int *offset); }; struct dsa_switch_tree {