From patchwork Tue Dec 11 19:33:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 10724579 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 C194713BF for ; Tue, 11 Dec 2018 19:35:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B081A2ADA3 for ; Tue, 11 Dec 2018 19:35:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A49822B454; Tue, 11 Dec 2018 19:35:49 +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 3F1392ADA3 for ; Tue, 11 Dec 2018 19:35:49 +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: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:In-Reply-To: References:List-Owner; bh=og1AlZimzCk/UKh4hFKmRZdUNtL7HsaK/Aoe9HcAXOI=; b=RqH JVJ3hdWURmIyZWCdNVEA5Cja4WT7mISW20L92jiqHQGi/yquO4ckZ8J2CNB1xJ5KcZ0u0EZwYHczt dbP4lam/Il9ESjZpWjFvgizbAz/1Wi9cW2DeARyH/pDPG7P0IngFhWXRfDxVXqtNJF7z2NPFOe4uv YOR1I6lxmPqYF7U3rqd7RnwzW/DwpHMFnnxb1ZtnhEq3fUAvYFKVRxEfCTFyJzPyy+D/QfILdMFZ3 CQWh8DNUFs7EPIvFZUBpyvVW2GEWfmiIvXokr3f4VQ1OLAV4v88cRC7qp2uClcGhvi7VvnPmj+UJh K1WvbHZ+R37XwSIPQBfDDgUTgqzOHGg==; 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 1gWnom-00038c-Uh; Tue, 11 Dec 2018 19:35:44 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWnnG-0000RZ-VC; Tue, 11 Dec 2018 19:34:14 +0000 Received: from localhost.localdomain ([91.14.83.44]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MVui8-1gv5yW0MwK-00X4CI; Tue, 11 Dec 2018 20:33:32 +0100 From: Frank Wunderlich To: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Matthias Brugger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/7] [DSA] adding fields for holding information about upstream-port Date: Tue, 11 Dec 2018 20:33:08 +0100 Message-Id: <20181211193314.10695-1-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 X-Provags-ID: V03:K1:6e4Tt0QPCv1129zyq1CTat5YbKXl3QuCfFVnI8ILsXDi2GCjTem y9EFJSDGzeyReuMagnPqrmKiAoMyiGYotXfr4phS/lZpwyoyIAUyBi4yPn933lGaJHi5f6F Gh/Wq+TeM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auqAWx2PTS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_113411_295406_283C625F X-CRM114-Status: UNSURE ( 9.04 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }