Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752921AbdHIMmQ (ORCPT ); Wed, 9 Aug 2017 08:42:16 -0400 Received: from nbd.name ([46.4.11.11]:37816 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752872AbdHIMmP (ORCPT ); Wed, 9 Aug 2017 08:42:15 -0400 From: John Crispin To: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S . Miller" , Sean Wang Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Muciri Gatimu , Shashidhar Lakkavalli , John Crispin 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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1024 Lines: 28 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 --- 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 { -- 2.11.0