From patchwork Fri Dec 14 16:48:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 10731457 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 67E67924 for ; Fri, 14 Dec 2018 16:50:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF1772890F for ; Fri, 14 Dec 2018 16:50:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2A922D861; Fri, 14 Dec 2018 16:50:35 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 73B122890F for ; Fri, 14 Dec 2018 16:50:35 +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=eUm1yg7SIHEi+pgivORbwAw1/ye7mm03TOVtbV79T2c=; b=FQiN8eIJ45nwCwrtN8bwNq0l06 ZQskaQx4Y5geUeWLdLog4muhR7ASbgGv9PEeOE7T1AT4Olr5t7XSTMxIGfIoWSm91pGgr2oaMGDrE P9+bty9zhKAvHqHRKXPHp56CWkG9Yoj5dsjZjKp4q4qRz2jSpKzCiD4FgctclRWFCZkActDZ5dub1 8rAEhy50gcaWiJQNJYNTm2bsOTQZQ3YtKduAyVLX0xarS0A7EkMOIskAtY636PZ9eFYCYdodkJqQ0 48fVbkgy9qulPu0MmmP3UKISr19zlQkgvVdrVVG4lp6Ve8ogCMbLGkTEF/K6jy7wfoajTesLYNwL7 ooixvt4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXqfa-0000yD-BQ; Fri, 14 Dec 2018 16:50:34 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXqfN-0008Ak-NT for linux-mediatek@lists.infradead.org; Fri, 14 Dec 2018 16:50:26 +0000 Received: from localhost.localdomain ([91.14.94.237]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LhOSG-1hBKHI10BE-00mXcJ; Fri, 14 Dec 2018 17:49:12 +0100 From: Frank Wunderlich To: Matthias Brugger , netdev@vger.kernel.org, Sean Wang , Andrew Lunn , linux-mediatek@lists.infradead.org Subject: [PATCH 1/8] net: dsa: adding fields for holding information about upstream-port Date: Fri, 14 Dec 2018 17:48:40 +0100 Message-Id: <20181214164847.4851-2-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181214164847.4851-1-frank-w@public-files.de> References: <20181214164847.4851-1-frank-w@public-files.de> X-Provags-ID: V03:K1:ovUUBPJLPAQf2zRMjVDF1oSgXzC70FRGtdEio7Ezn9WL4B1MIlH Z0Eg+hZpJPIUECikF90RaaDoQwEsAin8BBze8SPu17MNCpEJ90FLYmqEo/Bau67RnxafXo3 VJtp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+aZaAbPQiY X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181214_085022_195214_ADBE9FCD X-CRM114-Status: UNSURE ( 9.71 ) 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: Frank Wunderlich 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 for multiple cpu-Ports aech port needs storing the the cpu-port to be used this Patch adds the needed fields for this based on https://github.com/openwrt/openwrt/blob/master/target/linux/mediatek/patches-4.14/0033-dsa-multi-cpu.patch Signed-off-by: Frank Wunderlich --- include/net/dsa.h | 4 ++++ net/dsa/dsa_priv.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index 23690c44e167..3efa81e08993 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -203,6 +203,10 @@ struct dsa_port { struct net_device *bridge_dev; struct devlink_port devlink_port; struct phylink *pl; + + struct net_device *ethernet; + int upstream; + /* * Original copy of the master netdev ethtool_ops */ diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h index 9e4fd04ab53c..cc0cd7675117 100644 --- a/net/dsa/dsa_priv.h +++ b/net/dsa/dsa_priv.h @@ -81,6 +81,8 @@ struct dsa_slave_priv { /* TC context */ struct list_head mall_tc_list; + + struct net_device *master; }; /* dsa.c */ @@ -188,7 +190,10 @@ static inline struct net_device * dsa_slave_to_master(const struct net_device *dev) { struct dsa_port *dp = dsa_slave_to_port(dev); + struct dsa_slave_priv *p = netdev_priv(dev); + if (p->master) + return p->master; return dp->cpu_dp->master; }