From nobody Sun Nov 10 11:53:58 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BCECCD98C9 for ; Tue, 10 Oct 2023 21:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344155AbjJJVkE (ORCPT ); Tue, 10 Oct 2023 17:40:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344162AbjJJVkA (ORCPT ); Tue, 10 Oct 2023 17:40:00 -0400 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0157194 for ; Tue, 10 Oct 2023 14:39:52 -0700 (PDT) Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-41b09c75bd5so28795491cf.3 for ; Tue, 10 Oct 2023 14:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1696973992; x=1697578792; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=aBHqhNglBf6JlB5x5DnicJqKVFYU5snsWV3RAp6KqRg=; b=GPE7FM3fjRdcM/UOew34j3Q7dxcDIm1f3RIMfqQxp7TQHsS7OFZXd/mAsm11F1QhAs 7OpXeYESAm6PDd3K/ZnQZenK5lKo48IKfhqPuyJEEGgmfMgjhUfi8nfTz+Z+LNyrd8xJ 36Xh8sV9kvJUIOPMEoXK2KilfUCRc5aqJ1e40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696973992; x=1697578792; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aBHqhNglBf6JlB5x5DnicJqKVFYU5snsWV3RAp6KqRg=; b=ohyIW4e/rsH7plEgViv/ZskCsBa219qrmfJWJ4uhsd4yLk0SI8dKsBD695Fr4NiV6K 8xrkPwLVWva+nNN3r+w5ChtfuZyuL3ExXDn1ZIKvuHDCoE9pozVJfpRbyr9ZwRUU5y9e cIxgGzSws17r2E1WxaDHIBGwO2tqsIiPqbVN52EqID2d2AKfm0yzPeGSoGuCjUwhPazO uotzffo6uEqsdlauJAme3stS33bornLRau9la8NJkUlgEsruTG+v3OJZZICFNsc/o0r5 dHOyU1wNXjxnFBB0HSPSN4Nf1bXPKCIASp3l7/otIPNOOD6VGWgmGb0Oato7GGmV89zQ Q0uA== X-Gm-Message-State: AOJu0YzmHvT/6aOtNWRtDRvxQab7yhcT2VF/smZ0Rr3D4SgwbIPFofCh y4YQHutF9ppPvm79Krs35RIECm78KxRPHasc3s0= X-Google-Smtp-Source: AGHT+IHt6oINDZbyN2RFMOFRqu51Mpb1RUYJ7wuHU5lX+ImSnPe65xhDcmKNybJsu3bJuIhN2NcS8A== X-Received: by 2002:a05:622a:1053:b0:412:132d:3e62 with SMTP id f19-20020a05622a105300b00412132d3e62mr23937910qte.5.1696973990983; Tue, 10 Oct 2023 14:39:50 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bb36-20020a05622a1b2400b00403ad6ec2e8sm4804797qtb.26.2023.10.10.14.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 14:39:50 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list:ARM/Mediatek SoC support), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-renesas-soc@vger.kernel.org (open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER) Subject: [PATCH net-next 1/2] net: dsa: Use conduit and user terms Date: Tue, 10 Oct 2023 14:39:41 -0700 Message-Id: <20231010213942.3633407-2-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010213942.3633407-1-florian.fainelli@broadcom.com> References: <20231010213942.3633407-1-florian.fainelli@broadcom.com> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000001cece0607638cf8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000001cece0607638cf8 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use more inclusive terms throughout the DSA subsystem by moving away from "master" which is replaced by "conduit" and "slave" which is replaced by "user". No functional changes. Signed-off-by: Florian Fainelli Acked-by: Rob Herring --- .../bindings/net/dsa/mediatek,mt7530.yaml | 2 +- Documentation/networking/dsa/b53.rst | 14 +- Documentation/networking/dsa/bcm_sf2.rst | 2 +- .../networking/dsa/configuration.rst | 104 +- Documentation/networking/dsa/dsa.rst | 150 +- Documentation/networking/dsa/lan9303.rst | 2 +- Documentation/networking/dsa/sja1105.rst | 8 +- .../dts/marvell/armada-3720-espressobin.dtsi | 2 +- drivers/net/dsa/b53/b53_common.c | 4 +- drivers/net/dsa/b53/b53_mdio.c | 2 +- drivers/net/dsa/bcm_sf2.c | 36 +- drivers/net/dsa/bcm_sf2.h | 2 +- drivers/net/dsa/bcm_sf2_cfp.c | 4 +- drivers/net/dsa/lan9303-core.c | 4 +- drivers/net/dsa/lantiq_gswip.c | 34 +- drivers/net/dsa/microchip/ksz9477.c | 6 +- drivers/net/dsa/microchip/ksz_common.c | 20 +- drivers/net/dsa/microchip/ksz_ptp.c | 2 +- drivers/net/dsa/mt7530.c | 16 +- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- drivers/net/dsa/ocelot/felix.c | 62 +- drivers/net/dsa/ocelot/felix.h | 4 +- drivers/net/dsa/qca/qca8k-8xxx.c | 48 +- drivers/net/dsa/qca/qca8k-common.c | 2 +- drivers/net/dsa/qca/qca8k-leds.c | 6 +- drivers/net/dsa/qca/qca8k.h | 2 +- drivers/net/dsa/realtek/realtek-smi.c | 28 +- drivers/net/dsa/realtek/realtek.h | 2 +- drivers/net/dsa/sja1105/sja1105_main.c | 4 +- drivers/net/dsa/xrs700x/xrs700x.c | 12 +- drivers/net/ethernet/broadcom/bcmsysport.c | 2 +- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- include/linux/dsa/sja1105.h | 2 +- include/net/dsa.h | 54 +- include/net/dsa_stubs.h | 10 +- net/core/dev_ioctl.c | 2 +- net/dsa/Makefile | 4 +- net/dsa/{master.c =3D> conduit.c} | 96 +- net/dsa/conduit.h | 22 + net/dsa/dsa.c | 218 +-- net/dsa/dsa.h | 10 +- net/dsa/master.h | 22 - net/dsa/netlink.c | 14 +- net/dsa/port.c | 114 +- net/dsa/port.h | 2 +- net/dsa/slave.h | 69 - net/dsa/switch.c | 18 +- net/dsa/switch.h | 4 +- net/dsa/tag.c | 10 +- net/dsa/tag.h | 26 +- net/dsa/tag_8021q.c | 22 +- net/dsa/tag_8021q.h | 2 +- net/dsa/tag_ar9331.c | 4 +- net/dsa/tag_brcm.c | 14 +- net/dsa/tag_dsa.c | 6 +- net/dsa/tag_gswip.c | 4 +- net/dsa/tag_hellcreek.c | 4 +- net/dsa/tag_ksz.c | 12 +- net/dsa/tag_lan9303.c | 4 +- net/dsa/tag_mtk.c | 4 +- net/dsa/tag_none.c | 4 +- net/dsa/tag_ocelot.c | 22 +- net/dsa/tag_ocelot_8021q.c | 12 +- net/dsa/tag_qca.c | 6 +- net/dsa/tag_rtl4_a.c | 6 +- net/dsa/tag_rtl8_4.c | 6 +- net/dsa/tag_rzn1_a5psw.c | 4 +- net/dsa/tag_sja1105.c | 30 +- net/dsa/tag_trailer.c | 4 +- net/dsa/tag_xrs700x.c | 4 +- net/dsa/{slave.c =3D> user.c} | 1240 ++++++++--------- net/dsa/user.h | 69 + 72 files changed, 1385 insertions(+), 1385 deletions(-) rename net/dsa/{master.c =3D> conduit.c} (79%) create mode 100644 net/dsa/conduit.h delete mode 100644 net/dsa/master.h delete mode 100644 net/dsa/slave.h rename net/dsa/{slave.c =3D> user.c} (67%) create mode 100644 net/dsa/user.h diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml= b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index e532c6b795f4..6ff5b944f5a8 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -60,7 +60,7 @@ description: | =20 Check out example 6. =20 - - Port 5 can be wired to an external phy. Port 5 becomes a DSA slave. + - Port 5 can be wired to an external phy. Port 5 becomes a DSA user po= rt. =20 For the multi-chip module MT7530, the external phy must be wired TX = to TX to gmac1 of the SoC for this to work. Ubiquiti EdgeRouter X SFP is w= ired diff --git a/Documentation/networking/dsa/b53.rst b/Documentation/networkin= g/dsa/b53.rst index b41637cdb82b..1cb3ff648f88 100644 --- a/Documentation/networking/dsa/b53.rst +++ b/Documentation/networking/dsa/b53.rst @@ -52,7 +52,7 @@ VLAN programming would basically change the CPU port's de= fault PVID and make it untagged, undesirable. =20 In difference to the configuration described in :ref:`dsa-vlan-configurati= on` -the default VLAN 1 has to be removed from the slave interface configuratio= n in +the default VLAN 1 has to be removed from the user interface configuration= in single port and gateway configuration, while there is no need to add an ex= tra VLAN configuration in the bridge showcase. =20 @@ -68,13 +68,13 @@ By default packages are tagged with vid 1: ip link add link eth0 name eth0.2 type vlan id 2 ip link add link eth0 name eth0.3 type vlan id 3 =20 - # The master interface needs to be brought up before the slave ports. + # The conduit interface needs to be brought up before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up ip link set eth0.3 up =20 - # bring up the slave interfaces + # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up @@ -113,11 +113,11 @@ bridge # tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 =20 - # The master interface needs to be brought up before the slave ports. + # The conduit interface needs to be brought up before the user ports. ip link set eth0 up ip link set eth0.1 up =20 - # bring up the slave interfaces + # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up @@ -149,12 +149,12 @@ gateway ip link add link eth0 name eth0.1 type vlan id 1 ip link add link eth0 name eth0.2 type vlan id 2 =20 - # The master interface needs to be brought up before the slave ports. + # The conduit interface needs to be brought up before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up =20 - # bring up the slave interfaces + # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up diff --git a/Documentation/networking/dsa/bcm_sf2.rst b/Documentation/netwo= rking/dsa/bcm_sf2.rst index dee234039e1e..ed8582841561 100644 --- a/Documentation/networking/dsa/bcm_sf2.rst +++ b/Documentation/networking/dsa/bcm_sf2.rst @@ -67,7 +67,7 @@ MDIO indirect accesses ---------------------- =20 Due to a limitation in how Broadcom switches have been designed, external -Broadcom switches connected to a SF2 require the use of the DSA slave MDIO= bus +Broadcom switches connected to a SF2 require the use of the DSA MDIO bus in order to properly configure them. By default, the SF2 pseudo-PHY addres= s, and an external switch pseudo-PHY address will both be snooping for incoming M= DIO transactions, since they are at the same address (30), resulting in some k= ind of diff --git a/Documentation/networking/dsa/configuration.rst b/Documentation= /networking/dsa/configuration.rst index d2934c40f0f1..a5a38c31736d 100644 --- a/Documentation/networking/dsa/configuration.rst +++ b/Documentation/networking/dsa/configuration.rst @@ -31,38 +31,38 @@ at https://www.kernel.org/pub/linux/utils/net/iproute2/ =20 Through DSA every port of a switch is handled like a normal linux Ethernet interface. The CPU port is the switch port connected to an Ethernet MAC ch= ip. -The corresponding linux Ethernet interface is called the master interface. -All other corresponding linux interfaces are called slave interfaces. +The corresponding linux Ethernet interface is called the conduit interface. +All other corresponding linux interfaces are called user interfaces. =20 -The slave interfaces depend on the master interface being up in order for = them -to send or receive traffic. Prior to kernel v5.12, the state of the master +The user interfaces depend on the conduit interface being up in order for = them +to send or receive traffic. Prior to kernel v5.12, the state of the conduit interface had to be managed explicitly by the user. Starting with kernel v= 5.12, the behavior is as follows: =20 -- when a DSA slave interface is brought up, the master interface is +- when a DSA user interface is brought up, the conduit interface is automatically brought up. -- when the master interface is brought down, all DSA slave interfaces are +- when the conduit interface is brought down, all DSA user interfaces are automatically brought down. =20 In this documentation the following Ethernet interfaces are used: =20 *eth0* - the master interface + the conduit interface =20 *eth1* - another master interface + another conduit interface =20 *lan1* - a slave interface + a user interface =20 *lan2* - another slave interface + another user interface =20 *lan3* - a third slave interface + a third user interface =20 *wan* - A slave interface dedicated for upstream traffic + A user interface dedicated for upstream traffic =20 Further Ethernet interfaces can be configured similar. The configured IPs and networks are: @@ -96,11 +96,11 @@ without using a VLAN based configuration. ip addr add 192.0.2.5/30 dev lan2 ip addr add 192.0.2.9/30 dev lan3 =20 - # For kernels earlier than v5.12, the master interface needs to be - # brought up manually before the slave ports. + # For kernels earlier than v5.12, the conduit interface needs to be + # brought up manually before the user ports. ip link set eth0 up =20 - # bring up the slave interfaces + # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up @@ -108,11 +108,11 @@ without using a VLAN based configuration. *bridge* .. code-block:: sh =20 - # For kernels earlier than v5.12, the master interface needs to be - # brought up manually before the slave ports. + # For kernels earlier than v5.12, the conduit interface needs to be + # brought up manually before the user ports. ip link set eth0 up =20 - # bring up the slave interfaces + # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up @@ -134,11 +134,11 @@ without using a VLAN based configuration. *gateway* .. code-block:: sh =20 - # For kernels earlier than v5.12, the master interface needs to be - # brought up manually before the slave ports. + # For kernels earlier than v5.12, the conduit interface needs to be + # brought up manually before the user ports. ip link set eth0 up =20 - # bring up the slave interfaces + # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up @@ -178,14 +178,14 @@ configuration. ip link add link eth0 name eth0.2 type vlan id 2 ip link add link eth0 name eth0.3 type vlan id 3 =20 - # For kernels earlier than v5.12, the master interface needs to be - # brought up manually before the slave ports. + # For kernels earlier than v5.12, the conduit interface needs to be + # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up ip link set eth0.3 up =20 - # bring up the slave interfaces + # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up @@ -221,12 +221,12 @@ configuration. # tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 =20 - # For kernels earlier than v5.12, the master interface needs to be - # brought up manually before the slave ports. + # For kernels earlier than v5.12, the conduit interface needs to be + # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up =20 - # bring up the slave interfaces + # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up @@ -261,13 +261,13 @@ configuration. ip link add link eth0 name eth0.1 type vlan id 1 ip link add link eth0 name eth0.2 type vlan id 2 =20 - # For kernels earlier than v5.12, the master interface needs to be - # brought up manually before the slave ports. + # For kernels earlier than v5.12, the conduit interface needs to be + # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up =20 - # bring up the slave interfaces + # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up @@ -380,30 +380,30 @@ affinities according to the available CPU ports. =20 Secondly, it is possible to perform load balancing between CPU ports on a = per packet basis, rather than statically assigning user ports to CPU ports. -This can be achieved by placing the DSA masters under a LAG interface (bon= ding +This can be achieved by placing the DSA conduits under a LAG interface (bo= nding or team). DSA monitors this operation and creates a mirror of this softwar= e LAG -on the CPU ports facing the physical DSA masters that constitute the LAG s= lave +on the CPU ports facing the physical DSA conduits that constitute the LAG = user devices. =20 To make use of multiple CPU ports, the firmware (device tree) description = of -the switch must mark all the links between CPU ports and their DSA masters +the switch must mark all the links between CPU ports and their DSA conduits using the ``ethernet`` reference/phandle. At startup, only a single CPU po= rt -and DSA master will be used - the numerically first port from the firmware +and DSA conduit will be used - the numerically first port from the firmware description which has an ``ethernet`` property. It is up to the user to -configure the system for the switch to use other masters. +configure the system for the switch to use other conduits. =20 DSA uses the ``rtnl_link_ops`` mechanism (with a "dsa" ``kind``) to allow -changing the DSA master of a user port. The ``IFLA_DSA_MASTER`` u32 netlink -attribute contains the ifindex of the master device that handles each slave -device. The DSA master must be a valid candidate based on firmware node -information, or a LAG interface which contains only slaves which are valid +changing the DSA conduit of a user port. The ``IFLA_DSA_MASTER`` u32 netli= nk +attribute contains the ifindex of the conduit device that handles each user +device. The DSA conduit must be a valid candidate based on firmware node +information, or a LAG interface which contains only users which are valid candidates. =20 Using iproute2, the following manipulations are possible: =20 .. code-block:: sh =20 - # See the DSA master in current use + # See the DSA conduit in current use ip -d link show dev swp0 (...) dsa master eth0 @@ -414,7 +414,7 @@ Using iproute2, the following manipulations are possibl= e: ip link set swp2 type dsa master eth1 ip link set swp3 type dsa master eth0 =20 - # CPU ports in LAG, using explicit assignment of the DSA master + # CPU ports in LAG, using explicit assignment of the DSA conduit ip link add bond0 type bond mode balance-xor && ip link set bond0 up ip link set eth1 down && ip link set eth1 master bond0 ip link set swp0 type dsa master bond0 @@ -426,7 +426,7 @@ Using iproute2, the following manipulations are possibl= e: (...) dsa master bond0 =20 - # CPU ports in LAG, relying on implicit migration of the DSA master + # CPU ports in LAG, relying on implicit migration of the DSA conduit ip link add bond0 type bond mode balance-xor && ip link set bond0 up ip link set eth0 down && ip link set eth0 master bond0 ip link set eth1 down && ip link set eth1 master bond0 @@ -436,23 +436,23 @@ Using iproute2, the following manipulations are possi= ble: =20 Notice that in the case of CPU ports under a LAG, the use of the ``IFLA_DSA_MASTER`` netlink attribute is not strictly needed, but rather, = DSA -reacts to the ``IFLA_MASTER`` attribute change of its present master (``et= h0``) +reacts to the ``IFLA_MASTER`` attribute change of its present conduit (``e= th0``) and migrates all user ports to the new upper of ``eth0``, ``bond0``. Simil= arly, when ``bond0`` is destroyed using ``RTM_DELLINK``, DSA migrates the user p= orts -that were assigned to this interface to the first physical DSA master whic= h is +that were assigned to this interface to the first physical DSA conduit whi= ch is eligible, based on the firmware description (it effectively reverts to the startup configuration). =20 In a setup with more than 2 physical CPU ports, it is therefore possible t= o mix -static user to CPU port assignment with LAG between DSA masters. It is not -possible to statically assign a user port towards a DSA master that has any -upper interfaces (this includes LAG devices - the master must always be th= e LAG +static user to CPU port assignment with LAG between DSA conduits. It is not +possible to statically assign a user port towards a DSA conduit that has a= ny +upper interfaces (this includes LAG devices - the conduit must always be t= he LAG in this case). =20 -Live changing of the DSA master (and thus CPU port) affinity of a user por= t is +Live changing of the DSA conduit (and thus CPU port) affinity of a user po= rt is permitted, in order to allow dynamic redistribution in response to traffic. =20 -Physical DSA masters are allowed to join and leave at any time a LAG inter= face -used as a DSA master; however, DSA will reject a LAG interface as a valid -candidate for being a DSA master unless it has at least one physical DSA m= aster -as a slave device. +Physical DSA conduits are allowed to join and leave at any time a LAG inte= rface +used as a DSA conduit; however, DSA will reject a LAG interface as a valid +candidate for being a DSA conduit unless it has at least one physical DSA = conduit +as a user device. diff --git a/Documentation/networking/dsa/dsa.rst b/Documentation/networkin= g/dsa/dsa.rst index a94ddf83348a..fb90d14cf400 100644 --- a/Documentation/networking/dsa/dsa.rst +++ b/Documentation/networking/dsa/dsa.rst @@ -25,7 +25,7 @@ presence of a management port connected to an Ethernet co= ntroller capable of receiving Ethernet frames from the switch. This is a very common setup for= all kinds of Ethernet switches found in Small Home and Office products: router= s, gateways, or even top-of-rack switches. This host Ethernet controller will -be later referred to as "master" and "cpu" in DSA terminology and code. +be later referred to as "conduit" and "cpu" in DSA terminology and code. =20 The D in DSA stands for Distributed, because the subsystem has been design= ed with the ability to configure and manage cascaded switches on top of each = other @@ -35,7 +35,7 @@ of multiple switches connected to each other is called a = "switch tree". =20 For each front-panel port, DSA creates specialized network devices which a= re used as controlling and data-flowing endpoints for use by the Linux networ= king -stack. These specialized network interfaces are referred to as "slave" net= work +stack. These specialized network interfaces are referred to as "user" netw= ork interfaces in DSA terminology and code. =20 The ideal case for using DSA is when an Ethernet switch supports a "switch= tag" @@ -56,7 +56,7 @@ Note that DSA does not currently create network interface= s for the "cpu" and =20 - the "cpu" port is the Ethernet switch facing side of the management controller, and as such, would create a duplication of feature, since you - would get two interfaces for the same conduit: master netdev, and "cpu" = netdev + would get two interfaces for the same conduit: conduit netdev, and "cpu"= netdev =20 - the "dsa" port(s) are just conduits between two or more switches, and as= such cannot really be used as proper network interfaces either, only the @@ -80,14 +80,14 @@ methods of the ``struct dsa_device_ops`` structure, whi= ch are detailed below. Tagging protocols generally fall in one of three categories: =20 1. The switch-specific frame header is located before the Ethernet header, - shifting to the right (from the perspective of the DSA master's frame + shifting to the right (from the perspective of the DSA conduit's frame parser) the MAC DA, MAC SA, EtherType and the entire L2 payload. 2. The switch-specific frame header is located before the EtherType, keepi= ng - the MAC DA and MAC SA in place from the DSA master's perspective, but + the MAC DA and MAC SA in place from the DSA conduit's perspective, but shifting the 'real' EtherType and L2 payload to the right. 3. The switch-specific frame header is located at the tail of the packet, keeping all frame headers in place and not altering the view of the pac= ket - that the DSA master's frame parser has. + that the DSA conduit's frame parser has. =20 A tagging protocol may tag all packets with switch tags of the same length= , or the tag length might vary (for example packets with PTP timestamps might @@ -95,7 +95,7 @@ require an extended switch tag, or there might be one tag= length on TX and a different one on RX). Either way, the tagging protocol driver must populat= e the ``struct dsa_device_ops::needed_headroom`` and/or ``struct dsa_device_ops:= :needed_tailroom`` with the length in octets of the longest switch frame header/trailer. The = DSA -framework will automatically adjust the MTU of the master interface to +framework will automatically adjust the MTU of the conduit interface to accommodate for this extra size in order for DSA user ports to support the standard MTU (L2 payload length) of 1500 octets. The ``needed_headroom`` a= nd ``needed_tailroom`` properties are also used to request from the network s= tack, @@ -140,18 +140,18 @@ adding or removing the ``ETH_P_EDSA`` EtherType and s= ome padding octets). It is possible to construct cascaded setups of DSA switches even if their tagging protocols are not compatible with one another. In this case, there= are no DSA links in this fabric, and each switch constitutes a disjoint DSA sw= itch -tree. The DSA links are viewed as simply a pair of a DSA master (the out-f= acing +tree. The DSA links are viewed as simply a pair of a DSA conduit (the out-= facing port of the upstream DSA switch) and a CPU port (the in-facing port of the downstream DSA switch). =20 The tagging protocol of the attached DSA switch tree can be viewed through= the -``dsa/tagging`` sysfs attribute of the DSA master:: +``dsa/tagging`` sysfs attribute of the DSA conduit:: =20 cat /sys/class/net/eth0/dsa/tagging =20 If the hardware and driver are capable, the tagging protocol of the DSA sw= itch tree can be changed at runtime. This is done by writing the new tagging -protocol name to the same sysfs device attribute as above (the DSA master = and +protocol name to the same sysfs device attribute as above (the DSA conduit= and all attached switch ports must be down while doing this). =20 It is desirable that all tagging protocols are testable with the ``dsa_loo= p`` @@ -159,7 +159,7 @@ mockup driver, which can be attached to any network int= erface. The goal is that any network interface should be capable of transmitting the same packet in= the same way, and the tagger should decode the same received packet in the sam= e way regardless of the driver used for the switch control path, and the driver = used -for the DSA master. +for the DSA conduit. =20 The transmission of a packet goes through the tagger's ``xmit`` function. The passed ``struct sk_buff *skb`` has ``skb->data`` pointing at @@ -183,44 +183,44 @@ virtual DSA user network interface corresponding to t= he physical front-facing switch port that the packet was received on. =20 Since tagging protocols in category 1 and 2 break software (and most often= also -hardware) packet dissection on the DSA master, features such as RPS (Recei= ve -Packet Steering) on the DSA master would be broken. The DSA framework deals +hardware) packet dissection on the DSA conduit, features such as RPS (Rece= ive +Packet Steering) on the DSA conduit would be broken. The DSA framework dea= ls with this by hooking into the flow dissector and shifting the offset at wh= ich -the IP header is to be found in the tagged frame as seen by the DSA master. +the IP header is to be found in the tagged frame as seen by the DSA condui= t. This behavior is automatic based on the ``overhead`` value of the tagging protocol. If not all packets are of equal size, the tagger can implement t= he ``flow_dissect`` method of the ``struct dsa_device_ops`` and override this default behavior by specifying the correct offset incurred by each individ= ual RX packet. Tail taggers do not cause issues to the flow dissector. =20 -Checksum offload should work with category 1 and 2 taggers when the DSA ma= ster +Checksum offload should work with category 1 and 2 taggers when the DSA co= nduit driver declares NETIF_F_HW_CSUM in vlan_features and looks at csum_start a= nd csum_offset. For those cases, DSA will shift the checksum start and offset= by -the tag size. If the DSA master driver still uses the legacy NETIF_F_IP_CS= UM +the tag size. If the DSA conduit driver still uses the legacy NETIF_F_IP_C= SUM or NETIF_F_IPV6_CSUM in vlan_features, the offload might only work if the offload hardware already expects that specific tag (perhaps due to matching -vendors). DSA slaves inherit those flags from the master port, and it is u= p to +vendors). DSA users inherit those flags from the conduit port, and it is u= p to the driver to correctly fall back to software checksum when the IP header = is not where the hardware expects. If that check is ineffective, the packets migh= t go to the network without a proper checksum (the checksum field will have the pseudo IP header sum). For category 3, when the offload hardware does not already expect the switch tag in use, the checksum must be calculated befo= re any -tag is inserted (i.e. inside the tagger). Otherwise, the DSA master would +tag is inserted (i.e. inside the tagger). Otherwise, the DSA conduit would include the tail tag in the (software or hardware) checksum calculation. T= hen, when the tag gets stripped by the switch during transmission, it will leav= e an incorrect IP checksum in place. =20 Due to various reasons (most common being category 1 taggers being associa= ted -with DSA-unaware masters, mangling what the master perceives as MAC DA), t= he -tagging protocol may require the DSA master to operate in promiscuous mode= , to +with DSA-unaware conduits, mangling what the conduit perceives as MAC DA),= the +tagging protocol may require the DSA conduit to operate in promiscuous mod= e, to receive all frames regardless of the value of the MAC DA. This can be done= by -setting the ``promisc_on_master`` property of the ``struct dsa_device_ops`= `. -Note that this assumes a DSA-unaware master driver, which is the norm. +setting the ``promisc_on_conduit`` property of the ``struct dsa_device_ops= ``. +Note that this assumes a DSA-unaware conduit driver, which is the norm. =20 -Master network devices +conduit network devices ---------------------- =20 -Master network devices are regular, unmodified Linux network device driver= s for +conduit network devices are regular, unmodified Linux network device drive= rs for the CPU/management Ethernet interface. Such a driver might occasionally ne= ed to know whether DSA is enabled (e.g.: to enable/disable specific offload feat= ures), but the DSA subsystem has been proven to work with industry standard drive= rs: @@ -232,14 +232,14 @@ Ethernet switch. Networking stack hooks ---------------------- =20 -When a master netdev is used with DSA, a small hook is placed in the +When a conduit netdev is used with DSA, a small hook is placed in the networking stack is in order to have the DSA subsystem process the Ethernet switch specific tagging protocol. DSA accomplishes this by registering a specific (and fake) Ethernet type (later becoming ``skb->protocol``) with = the networking stack, this is also known as a ``ptype`` or ``packet_type``. A = typical Ethernet Frame receive sequence looks like this: =20 -Master network device (e.g.: e1000e): +conduit network device (e.g.: e1000e): =20 1. Receive interrupt fires: =20 @@ -269,16 +269,16 @@ Master network device (e.g.: e1000e): =20 - inspect and strip switch tag protocol to determine originating p= ort - locate per-port network device - - invoke ``eth_type_trans()`` with the DSA slave network device + - invoke ``eth_type_trans()`` with the DSA user network device - invoked ``netif_receive_skb()`` =20 -Past this point, the DSA slave network devices get delivered regular Ether= net +Past this point, the DSA user network devices get delivered regular Ethern= et frames that can be processed by the networking stack. =20 -Slave network devices +user network devices --------------------- =20 -Slave network devices created by DSA are stacked on top of their master ne= twork +user network devices created by DSA are stacked on top of their conduit ne= twork device, each of these network interfaces will be responsible for being a controlling and data-flowing end-point for each front-panel port of the sw= itch. These interfaces are specialized in order to: @@ -289,31 +289,31 @@ These interfaces are specialized in order to: Wake-on-LAN, register dumps... - manage external/internal PHY: link, auto-negotiation, etc. =20 -These slave network devices have custom net_device_ops and ethtool_ops fun= ction +These user network devices have custom net_device_ops and ethtool_ops func= tion pointers which allow DSA to introduce a level of layering between the netw= orking stack/ethtool and the switch driver implementation. =20 -Upon frame transmission from these slave network devices, DSA will look up= which +Upon frame transmission from these user network devices, DSA will look up = which switch tagging protocol is currently registered with these network devices= and invoke a specific transmit routine which takes care of adding the relevant switch tag in the Ethernet frames. =20 -These frames are then queued for transmission using the master network dev= ice +These frames are then queued for transmission using the conduit network de= vice ``ndo_start_xmit()`` function. Since they contain the appropriate switch t= ag, the Ethernet switch will be able to process these incoming frames from the management interface and deliver them to the physical switch port. =20 When using multiple CPU ports, it is possible to stack a LAG (bonding/team) -device between the DSA slave devices and the physical DSA masters. The LAG -device is thus also a DSA master, but the LAG slave devices continue to be= DSA -masters as well (just with no user port assigned to them; this is needed f= or -recovery in case the LAG DSA master disappears). Thus, the data path of th= e LAG -DSA master is used asymmetrically. On RX, the ``ETH_P_XDSA`` handler, which -calls ``dsa_switch_rcv()``, is invoked early (on the physical DSA master; -LAG slave). Therefore, the RX data path of the LAG DSA master is not used. -On the other hand, TX takes place linearly: ``dsa_slave_xmit`` calls -``dsa_enqueue_skb``, which calls ``dev_queue_xmit`` towards the LAG DSA ma= ster. -The latter calls ``dev_queue_xmit`` towards one physical DSA master or the +device between the DSA user devices and the physical DSA conduits. The LAG +device is thus also a DSA conduit, but the LAG user devices continue to be= DSA +conduits as well (just with no user port assigned to them; this is needed = for +recovery in case the LAG DSA conduit disappears). Thus, the data path of t= he LAG +DSA conduit is used asymmetrically. On RX, the ``ETH_P_XDSA`` handler, whi= ch +calls ``dsa_switch_rcv()``, is invoked early (on the physical DSA conduit; +LAG user). Therefore, the RX data path of the LAG DSA conduit is not used. +On the other hand, TX takes place linearly: ``dsa_user_xmit`` calls +``dsa_enqueue_skb``, which calls ``dev_queue_xmit`` towards the LAG DSA co= nduit. +The latter calls ``dev_queue_xmit`` towards one physical DSA conduit or the other, and in both cases, the packet exits the system through a hardware p= ath towards the switch. =20 @@ -352,11 +352,11 @@ perspective:: || swp0 | | swp1 | | swp2 | | swp3 || ++------+-+------+-+------+-+------++ =20 -Slave MDIO bus +user MDIO bus -------------- =20 In order to be able to read to/from a switch PHY built into it, DSA create= s a -slave MDIO bus which allows a specific switch driver to divert and interce= pt +user MDIO bus which allows a specific switch driver to divert and intercept MDIO reads/writes towards specific PHY addresses. In most MDIO-connected switches, these functions would utilize direct or indirect PHY addressing = mode to return standard MII registers from the switch builtin PHYs, allowing th= e PHY @@ -364,7 +364,7 @@ library and/or to return link status, link partner page= s, auto-negotiation results, etc. =20 For Ethernet switches which have both external and internal MDIO buses, the -slave MII bus can be utilized to mux/demux MDIO reads and writes towards e= ither +user MII bus can be utilized to mux/demux MDIO reads and writes towards ei= ther internal or external MDIO devices this switch might be connected to: inter= nal PHYs, external PHYs, or even external switches. =20 @@ -381,10 +381,10 @@ DSA data structures are defined in ``include/net/dsa.= h`` as well as =20 - ``dsa_platform_data``: platform device configuration data which can refe= rence a collection of dsa_chip_data structures if multiple switches are cascad= ed, - the master network device this switch tree is attached to needs to be + the conduit network device this switch tree is attached to needs to be referenced =20 -- ``dsa_switch_tree``: structure assigned to the master network device und= er +- ``dsa_switch_tree``: structure assigned to the conduit network device un= der ``dsa_ptr``, this structure references a dsa_platform_data structure as = well as the tagging protocol supported by the switch tree, and which receive/tra= nsmit function hooks should be invoked, information about the directly attached @@ -392,7 +392,7 @@ DSA data structures are defined in ``include/net/dsa.h`= ` as well as referenced to address individual switches in the tree. =20 - ``dsa_switch``: structure describing a switch device in the tree, refere= ncing - a ``dsa_switch_tree`` as a backpointer, slave network devices, master ne= twork + a ``dsa_switch_tree`` as a backpointer, user network devices, conduit ne= twork device, and a reference to the backing``dsa_switch_ops`` =20 - ``dsa_switch_ops``: structure referencing function pointers, see below f= or a @@ -404,7 +404,7 @@ Design limitations Lack of CPU/DSA network devices ------------------------------- =20 -DSA does not currently create slave network devices for the CPU or DSA por= ts, as +DSA does not currently create user network devices for the CPU or DSA port= s, as described before. This might be an issue in the following cases: =20 - inability to fetch switch CPU port statistics counters using ethtool, wh= ich @@ -419,7 +419,7 @@ described before. This might be an issue in the followi= ng cases: Common pitfalls using DSA setups -------------------------------- =20 -Once a master network device is configured to use DSA (dev->dsa_ptr becomes +Once a conduit network device is configured to use DSA (dev->dsa_ptr becom= es non-NULL), and the switch behind it expects a tagging protocol, this netwo= rk interface can only exclusively be used as a conduit interface. Sending pac= kets directly through this interface (e.g.: opening a socket using this interfa= ce) @@ -440,7 +440,7 @@ DSA currently leverages the following subsystems: MDIO/PHY library ---------------- =20 -Slave network devices exposed by DSA may or may not be interfacing with PHY +user network devices exposed by DSA may or may not be interfacing with PHY devices (``struct phy_device`` as defined in ``include/linux/phy.h)``, but= the DSA subsystem deals with all possible combinations: =20 @@ -450,7 +450,7 @@ subsystem deals with all possible combinations: - special, non-autonegotiated or non MDIO-managed PHY devices: SFPs, MoCA;= a.k.a fixed PHYs =20 -The PHY configuration is done by the ``dsa_slave_phy_setup()`` function an= d the +The PHY configuration is done by the ``dsa_user_phy_setup()`` function and= the logic basically looks like this: =20 - if Device Tree is used, the PHY device is looked up using the standard @@ -463,7 +463,7 @@ logic basically looks like this: and connected transparently using the special fixed MDIO bus driver =20 - finally, if the PHY is built into the switch, as is very common with - standalone switch packages, the PHY is probed using the slave MII bus cr= eated + standalone switch packages, the PHY is probed using the user MII bus cre= ated by DSA =20 =20 @@ -472,7 +472,7 @@ SWITCHDEV =20 DSA directly utilizes SWITCHDEV when interfacing with the bridge layer, and more specifically with its VLAN filtering portion when configuring VLANs o= n top -of per-port slave network devices. As of today, the only SWITCHDEV objects +of per-port user network devices. As of today, the only SWITCHDEV objects supported by DSA are the FDB and VLAN objects. =20 Devlink @@ -589,8 +589,8 @@ is torn down when the first switch unregisters. It is mandatory for DSA switch drivers to implement the ``shutdown()`` cal= lback of their respective bus, and call ``dsa_switch_shutdown()`` from it (a min= imal version of the full teardown performed by ``dsa_unregister_switch()``). -The reason is that DSA keeps a reference on the master net device, and if = the -driver for the master device decides to unbind on shutdown, DSA's reference +The reason is that DSA keeps a reference on the conduit net device, and if= the +driver for the conduit device decides to unbind on shutdown, DSA's referen= ce will block that operation from finalizing. =20 Either ``dsa_switch_shutdown()`` or ``dsa_unregister_switch()`` must be ca= lled, @@ -615,7 +615,7 @@ Switch configuration tag formats. =20 - ``change_tag_protocol``: when the default tagging protocol has compatibi= lity - problems with the master or other issues, the driver may support changin= g it + problems with the conduit or other issues, the driver may support changi= ng it at runtime, either through a device tree property or through sysfs. In t= hat case, further calls to ``get_tag_protocol`` should report the protocol in current use. @@ -643,22 +643,22 @@ Switch configuration PHY cannot be found. In this case, probing of the DSA switch continues without that particular port. =20 -- ``port_change_master``: method through which the affinity (association u= sed +- ``port_change_conduit``: method through which the affinity (association = used for traffic termination purposes) between a user port and a CPU port can= be changed. By default all user ports from a tree are assigned to the first available CPU port that makes sense for them (most of the times this mea= ns the user ports of a tree are all assigned to the same CPU port, except f= or H topologies as described in commit 2c0b03258b8b). The ``port`` argument - represents the index of the user port, and the ``master`` argument repre= sents - the new DSA master ``net_device``. The CPU port associated with the new - master can be retrieved by looking at ``struct dsa_port *cpu_dp =3D - master->dsa_ptr``. Additionally, the master can also be a LAG device whe= re - all the slave devices are physical DSA masters. LAG DSA masters also hav= e a - valid ``master->dsa_ptr`` pointer, however this is not unique, but rathe= r a - duplicate of the first physical DSA master's (LAG slave) ``dsa_ptr``. In= case - of a LAG DSA master, a further call to ``port_lag_join`` will be emitted + represents the index of the user port, and the ``conduit`` argument repr= esents + the new DSA conduit ``net_device``. The CPU port associated with the new + conduit can be retrieved by looking at ``struct dsa_port *cpu_dp =3D + conduit->dsa_ptr``. Additionally, the conduit can also be a LAG device w= here + all the user devices are physical DSA conduits. LAG DSA conduits also ha= ve a + valid ``conduit->dsa_ptr`` pointer, however this is not unique, but rath= er a + duplicate of the first physical DSA conduit's (LAG user) ``dsa_ptr``. In= case + of a LAG DSA conduit, a further call to ``port_lag_join`` will be emitted separately for the physical CPU ports associated with the physical DSA - masters, requesting them to create a hardware LAG associated with the LAG + conduits, requesting them to create a hardware LAG associated with the L= AG interface. =20 PHY devices and link management @@ -670,16 +670,16 @@ PHY devices and link management should return a 32-bit bitmask of "flags" that is private between the sw= itch driver and the Ethernet PHY driver in ``drivers/net/phy/\*``. =20 -- ``phy_read``: Function invoked by the DSA slave MDIO bus when attempting= to read +- ``phy_read``: Function invoked by the DSA user MDIO bus when attempting = to read the switch port MDIO registers. If unavailable, return 0xffff for each r= ead. For builtin switch Ethernet PHYs, this function should allow reading the= link status, auto-negotiation results, link partner pages, etc. =20 -- ``phy_write``: Function invoked by the DSA slave MDIO bus when attemptin= g to write +- ``phy_write``: Function invoked by the DSA user MDIO bus when attempting= to write to the switch port MDIO registers. If unavailable return a negative error code. =20 -- ``adjust_link``: Function invoked by the PHY library when a slave networ= k device +- ``adjust_link``: Function invoked by the PHY library when a user network= device is attached to a PHY device. This function is responsible for appropriat= ely configuring the switch port link parameters: speed, duplex, pause based = on what the ``phy_device`` is providing. @@ -698,14 +698,14 @@ Ethtool operations typically return statistics strings, private flags strings, etc. =20 - ``get_ethtool_stats``: ethtool function used to query per-port statistic= s and - return their values. DSA overlays slave network devices general statisti= cs: + return their values. DSA overlays user network devices general statistic= s: RX/TX counters from the network device, with switch driver specific stat= istics per port =20 - ``get_sset_count``: ethtool function used to query the number of statist= ics items =20 - ``get_wol``: ethtool function used to obtain Wake-on-LAN settings per-po= rt, this - function may for certain implementations also query the master network d= evice + function may for certain implementations also query the conduit network = device Wake-on-LAN settings if this interface needs to participate in Wake-on-L= AN =20 - ``set_wol``: ethtool function used to configure Wake-on-LAN settings per= -port, @@ -747,13 +747,13 @@ Power management should resume all Ethernet switch activities and re-configure the switch= to be in a fully active state =20 -- ``port_enable``: function invoked by the DSA slave network device ndo_op= en +- ``port_enable``: function invoked by the DSA user network device ndo_open function when a port is administratively brought up, this function should fully enable a given switch port. DSA takes care of marking the port with ``BR_STATE_BLOCKING`` if the port is a bridge member, or ``BR_STATE_FORW= ARDING`` if it was not, and propagating these changes down to the hardware =20 -- ``port_disable``: function invoked by the DSA slave network device ndo_c= lose +- ``port_disable``: function invoked by the DSA user network device ndo_cl= ose function when a port is administratively brought down, this function sho= uld fully disable a given switch port. DSA takes care of marking the port wi= th ``BR_STATE_DISABLED`` and propagating changes to the hardware if this po= rt is diff --git a/Documentation/networking/dsa/lan9303.rst b/Documentation/netwo= rking/dsa/lan9303.rst index e3c820db28ad..ab81b4e0139e 100644 --- a/Documentation/networking/dsa/lan9303.rst +++ b/Documentation/networking/dsa/lan9303.rst @@ -4,7 +4,7 @@ LAN9303 Ethernet switch driver =20 The LAN9303 is a three port 10/100 Mbps ethernet switch with integrated ph= ys for the two external ethernet ports. The third port is an RMII/MII interface t= o a -host master network interface (e.g. fixed link). +host conduit network interface (e.g. fixed link). =20 =20 Driver details diff --git a/Documentation/networking/dsa/sja1105.rst b/Documentation/netwo= rking/dsa/sja1105.rst index e0219c1452ab..aeebfff595f7 100644 --- a/Documentation/networking/dsa/sja1105.rst +++ b/Documentation/networking/dsa/sja1105.rst @@ -79,7 +79,7 @@ The hardware tags all traffic internally with a port-base= d VLAN (pvid), or it decodes the VLAN information from the 802.1Q tag. Advanced VLAN classifica= tion is not possible. Once attributed a VLAN tag, frames are checked against the port's membership rules and dropped at ingress if they don't match any VLA= N. -This behavior is available when switch ports are enslaved to a bridge with +This behavior is available when switch ports are enuserd to a bridge with ``vlan_filtering 1``. =20 Normally the hardware is not configurable with respect to VLAN awareness, = but @@ -122,7 +122,7 @@ on egress. Using ``vlan_filtering=3D1``, the behavior i= s the other way around: offloaded flows can be steered to TX queues based on the VLAN PCP, but the= DSA net devices are no longer able to do that. To inject frames into a hardwar= e TX queue with VLAN awareness active, it is necessary to create a VLAN -sub-interface on the DSA master port, and send normal (0x8100) VLAN-tagged +sub-interface on the DSA conduit port, and send normal (0x8100) VLAN-tagged towards the switch, with the VLAN PCP bits set appropriately. =20 Management traffic (having DMAC 01-80-C2-xx-xx-xx or 01-19-1B-xx-xx-xx) is= the @@ -389,11 +389,11 @@ MDIO bus and PHY management The SJA1105 does not have an MDIO bus and does not perform in-band AN eith= er. Therefore there is no link state notification coming from the switch devic= e. A board would need to hook up the PHYs connected to the switch to any other -MDIO bus available to Linux within the system (e.g. to the DSA master's MD= IO +MDIO bus available to Linux within the system (e.g. to the DSA conduit's M= DIO bus). Link state management then works by the driver manually keeping in s= ync (over SPI commands) the MAC link speed with the settings negotiated by the= PHY. =20 -By comparison, the SJA1110 supports an MDIO slave access point over which = its +By comparison, the SJA1110 supports an MDIO user access point over which i= ts internal 100base-T1 PHYs can be accessed from the host. This is, however, = not used by the driver, instead the internal 100base-T1 and 100base-TX PHYs are accessed through SPI commands, modeled in Linux as virtual MDIO buses. diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi b/arc= h/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi index 5fc613d24151..49cbdb55b4b3 100644 --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi @@ -13,7 +13,7 @@ / { aliases { ethernet0 =3D ð0; - /* for dsa slave device */ + /* for DSA user port device */ ethernet1 =3D &switch0port1; ethernet2 =3D &switch0port2; ethernet3 =3D &switch0port3; diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_com= mon.c index 4e27dc913cf7..0d628b35fd5c 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -757,7 +757,7 @@ int b53_configure_vlan(struct dsa_switch *ds) =20 /* Create an untagged VLAN entry for the default PVID in case * CONFIG_VLAN_8021Q is disabled and there are no calls to - * dsa_slave_vlan_rx_add_vid() to create the default VLAN + * dsa_user_vlan_rx_add_vid() to create the default VLAN * entry. Do this only when the tagging protocol is not * DSA_TAG_PROTO_NONE */ @@ -958,7 +958,7 @@ static struct phy_device *b53_get_phy_device(struct dsa= _switch *ds, int port) return NULL; } =20 - return mdiobus_get_phy(ds->slave_mii_bus, port); + return mdiobus_get_phy(ds->user_mii_bus, port); } =20 void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset, diff --git a/drivers/net/dsa/b53/b53_mdio.c b/drivers/net/dsa/b53/b53_mdio.c index 4d55d8d18376..897e5e8b3d69 100644 --- a/drivers/net/dsa/b53/b53_mdio.c +++ b/drivers/net/dsa/b53/b53_mdio.c @@ -329,7 +329,7 @@ static int b53_mdio_probe(struct mdio_device *mdiodev) * layer setup */ if (of_machine_is_compatible("brcm,bcm7445d0") && - strcmp(mdiodev->bus->name, "sf2 slave mii")) + strcmp(mdiodev->bus->name, "sf2 user mii")) return -EPROBE_DEFER; =20 dev =3D b53_switch_alloc(&mdiodev->dev, &b53_mdio_ops, mdiodev->bus); diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 0b62bd78ac50..f2ece68bdd67 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -624,19 +624,19 @@ static int bcm_sf2_mdio_register(struct dsa_switch *d= s) get_device(&priv->master_mii_bus->dev); priv->master_mii_dn =3D dn; =20 - priv->slave_mii_bus =3D mdiobus_alloc(); - if (!priv->slave_mii_bus) { + priv->user_mii_bus =3D mdiobus_alloc(); + if (!priv->user_mii_bus) { of_node_put(dn); return -ENOMEM; } =20 - priv->slave_mii_bus->priv =3D priv; - priv->slave_mii_bus->name =3D "sf2 slave mii"; - priv->slave_mii_bus->read =3D bcm_sf2_sw_mdio_read; - priv->slave_mii_bus->write =3D bcm_sf2_sw_mdio_write; - snprintf(priv->slave_mii_bus->id, MII_BUS_ID_SIZE, "sf2-%d", + priv->user_mii_bus->priv =3D priv; + priv->user_mii_bus->name =3D "sf2 user mii"; + priv->user_mii_bus->read =3D bcm_sf2_sw_mdio_read; + priv->user_mii_bus->write =3D bcm_sf2_sw_mdio_write; + snprintf(priv->user_mii_bus->id, MII_BUS_ID_SIZE, "sf2-%d", index++); - priv->slave_mii_bus->dev.of_node =3D dn; + priv->user_mii_bus->dev.of_node =3D dn; =20 /* Include the pseudo-PHY address to divert reads towards our * workaround. This is only required for 7445D0, since 7445E0 @@ -654,9 +654,9 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds) priv->indir_phy_mask =3D 0; =20 ds->phys_mii_mask =3D priv->indir_phy_mask; - ds->slave_mii_bus =3D priv->slave_mii_bus; - priv->slave_mii_bus->parent =3D ds->dev->parent; - priv->slave_mii_bus->phy_mask =3D ~priv->indir_phy_mask; + ds->user_mii_bus =3D priv->user_mii_bus; + priv->user_mii_bus->parent =3D ds->dev->parent; + priv->user_mii_bus->phy_mask =3D ~priv->indir_phy_mask; =20 /* We need to make sure that of_phy_connect() will not work by * removing the 'phandle' and 'linux,phandle' properties and @@ -683,9 +683,9 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds) phy_device_remove(phydev); } =20 - err =3D mdiobus_register(priv->slave_mii_bus); + err =3D mdiobus_register(priv->user_mii_bus); if (err && dn) { - mdiobus_free(priv->slave_mii_bus); + mdiobus_free(priv->user_mii_bus); of_node_put(dn); } =20 @@ -694,8 +694,8 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds) =20 static void bcm_sf2_mdio_unregister(struct bcm_sf2_priv *priv) { - mdiobus_unregister(priv->slave_mii_bus); - mdiobus_free(priv->slave_mii_bus); + mdiobus_unregister(priv->user_mii_bus); + mdiobus_free(priv->user_mii_bus); of_node_put(priv->master_mii_dn); } =20 @@ -909,7 +909,7 @@ static void bcm_sf2_sw_fixed_state(struct dsa_switch *d= s, int port, * state machine and make it go in PHY_FORCING state instead. */ if (!status->link) - netif_carrier_off(dsa_to_port(ds, port)->slave); + netif_carrier_off(dsa_to_port(ds, port)->user); status->duplex =3D DUPLEX_FULL; } else { status->link =3D true; @@ -983,7 +983,7 @@ static int bcm_sf2_sw_resume(struct dsa_switch *ds) static void bcm_sf2_sw_get_wol(struct dsa_switch *ds, int port, struct ethtool_wolinfo *wol) { - struct net_device *p =3D dsa_port_to_master(dsa_to_port(ds, port)); + struct net_device *p =3D dsa_port_to_conduit(dsa_to_port(ds, port)); struct bcm_sf2_priv *priv =3D bcm_sf2_to_priv(ds); struct ethtool_wolinfo pwol =3D { }; =20 @@ -1007,7 +1007,7 @@ static void bcm_sf2_sw_get_wol(struct dsa_switch *ds,= int port, static int bcm_sf2_sw_set_wol(struct dsa_switch *ds, int port, struct ethtool_wolinfo *wol) { - struct net_device *p =3D dsa_port_to_master(dsa_to_port(ds, port)); + struct net_device *p =3D dsa_port_to_conduit(dsa_to_port(ds, port)); struct bcm_sf2_priv *priv =3D bcm_sf2_to_priv(ds); s8 cpu_port =3D dsa_to_port(ds, port)->cpu_dp->index; struct ethtool_wolinfo pwol =3D { }; diff --git a/drivers/net/dsa/bcm_sf2.h b/drivers/net/dsa/bcm_sf2.h index 00afc94ce522..424f896b5a6f 100644 --- a/drivers/net/dsa/bcm_sf2.h +++ b/drivers/net/dsa/bcm_sf2.h @@ -108,7 +108,7 @@ struct bcm_sf2_priv { /* Master and slave MDIO bus controller */ unsigned int indir_phy_mask; struct device_node *master_mii_dn; - struct mii_bus *slave_mii_bus; + struct mii_bus *user_mii_bus; struct mii_bus *master_mii_bus; =20 /* Bitmask of ports needing BRCM tags */ diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c index c4010b7bf089..c88ee3dd4299 100644 --- a/drivers/net/dsa/bcm_sf2_cfp.c +++ b/drivers/net/dsa/bcm_sf2_cfp.c @@ -1102,7 +1102,7 @@ static int bcm_sf2_cfp_rule_get_all(struct bcm_sf2_pr= iv *priv, int bcm_sf2_get_rxnfc(struct dsa_switch *ds, int port, struct ethtool_rxnfc *nfc, u32 *rule_locs) { - struct net_device *p =3D dsa_port_to_master(dsa_to_port(ds, port)); + struct net_device *p =3D dsa_port_to_conduit(dsa_to_port(ds, port)); struct bcm_sf2_priv *priv =3D bcm_sf2_to_priv(ds); int ret =3D 0; =20 @@ -1145,7 +1145,7 @@ int bcm_sf2_get_rxnfc(struct dsa_switch *ds, int port, int bcm_sf2_set_rxnfc(struct dsa_switch *ds, int port, struct ethtool_rxnfc *nfc) { - struct net_device *p =3D dsa_port_to_master(dsa_to_port(ds, port)); + struct net_device *p =3D dsa_port_to_conduit(dsa_to_port(ds, port)); struct bcm_sf2_priv *priv =3D bcm_sf2_to_priv(ds); int ret =3D 0; =20 diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index ee67adeb2cdb..fcb20eac332a 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -1084,7 +1084,7 @@ static int lan9303_port_enable(struct dsa_switch *ds,= int port, if (!dsa_port_is_user(dp)) return 0; =20 - vlan_vid_add(dsa_port_to_master(dp), htons(ETH_P_8021Q), port); + vlan_vid_add(dsa_port_to_conduit(dp), htons(ETH_P_8021Q), port); =20 return lan9303_enable_processing_port(chip, port); } @@ -1097,7 +1097,7 @@ static void lan9303_port_disable(struct dsa_switch *d= s, int port) if (!dsa_port_is_user(dp)) return; =20 - vlan_vid_del(dsa_port_to_master(dp), htons(ETH_P_8021Q), port); + vlan_vid_del(dsa_port_to_conduit(dp), htons(ETH_P_8021Q), port); =20 lan9303_disable_processing_port(chip, port); lan9303_phy_write(ds, chip->phy_addr_base + port, MII_BMCR, BMCR_PDOWN); diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index 25abf2caf5fb..95fc42ba2d74 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -510,22 +510,22 @@ static int gswip_mdio(struct gswip_priv *priv, struct= device_node *mdio_np) struct dsa_switch *ds =3D priv->ds; int err; =20 - ds->slave_mii_bus =3D mdiobus_alloc(); - if (!ds->slave_mii_bus) + ds->user_mii_bus =3D mdiobus_alloc(); + if (!ds->user_mii_bus) return -ENOMEM; =20 - ds->slave_mii_bus->priv =3D priv; - ds->slave_mii_bus->read =3D gswip_mdio_rd; - ds->slave_mii_bus->write =3D gswip_mdio_wr; - ds->slave_mii_bus->name =3D "lantiq,xrx200-mdio"; - snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "%s-mii", + ds->user_mii_bus->priv =3D priv; + ds->user_mii_bus->read =3D gswip_mdio_rd; + ds->user_mii_bus->write =3D gswip_mdio_wr; + ds->user_mii_bus->name =3D "lantiq,xrx200-mdio"; + snprintf(ds->user_mii_bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(priv->dev)); - ds->slave_mii_bus->parent =3D priv->dev; - ds->slave_mii_bus->phy_mask =3D ~ds->phys_mii_mask; + ds->user_mii_bus->parent =3D priv->dev; + ds->user_mii_bus->phy_mask =3D ~ds->phys_mii_mask; =20 - err =3D of_mdiobus_register(ds->slave_mii_bus, mdio_np); + err =3D of_mdiobus_register(ds->user_mii_bus, mdio_np); if (err) - mdiobus_free(ds->slave_mii_bus); + mdiobus_free(ds->user_mii_bus); =20 return err; } @@ -2197,8 +2197,8 @@ static int gswip_probe(struct platform_device *pdev) dsa_unregister_switch(priv->ds); mdio_bus: if (mdio_np) { - mdiobus_unregister(priv->ds->slave_mii_bus); - mdiobus_free(priv->ds->slave_mii_bus); + mdiobus_unregister(priv->ds->user_mii_bus); + mdiobus_free(priv->ds->user_mii_bus); } put_mdio_node: of_node_put(mdio_np); @@ -2220,10 +2220,10 @@ static void gswip_remove(struct platform_device *pd= ev) =20 dsa_unregister_switch(priv->ds); =20 - if (priv->ds->slave_mii_bus) { - mdiobus_unregister(priv->ds->slave_mii_bus); - of_node_put(priv->ds->slave_mii_bus->dev.of_node); - mdiobus_free(priv->ds->slave_mii_bus); + if (priv->ds->user_mii_bus) { + mdiobus_unregister(priv->ds->user_mii_bus); + of_node_put(priv->ds->user_mii_bus->dev.of_node); + mdiobus_free(priv->ds->user_mii_bus); } =20 for (i =3D 0; i < priv->num_gphy_fw; i++) diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchi= p/ksz9477.c index cde8ef33d029..a8b0e528b804 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -1170,7 +1170,7 @@ int ksz9477_tc_cbs_set_cinc(struct ksz_device *dev, i= nt port, u32 val) void ksz9477_hsr_join(struct dsa_switch *ds, int port, struct net_device *= hsr) { struct ksz_device *dev =3D ds->priv; - struct net_device *slave; + struct net_device *user; struct dsa_port *hsr_dp; u8 data, hsr_ports =3D 0; =20 @@ -1202,8 +1202,8 @@ void ksz9477_hsr_join(struct dsa_switch *ds, int port= , struct net_device *hsr) ksz_port_cfg(dev, port, REG_PORT_LUE_CTRL, PORT_SRC_ADDR_FILTER, true); =20 /* Setup HW supported features for lan HSR ports */ - slave =3D dsa_to_port(ds, port)->slave; - slave->features |=3D KSZ9477_SUPPORTED_HSR_FEATURES; + user =3D dsa_to_port(ds, port)->user; + user->features |=3D KSZ9477_SUPPORTED_HSR_FEATURES; } =20 void ksz9477_hsr_leave(struct dsa_switch *ds, int port, struct net_device = *hsr) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/micro= chip/ksz_common.c index b800ace40ce1..a8025ff988ec 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -1945,14 +1945,14 @@ static int ksz_irq_phy_setup(struct ksz_device *dev) ret =3D irq; goto out; } - ds->slave_mii_bus->irq[phy] =3D irq; + ds->user_mii_bus->irq[phy] =3D irq; } } return 0; out: while (phy--) if (BIT(phy) & ds->phys_mii_mask) - irq_dispose_mapping(ds->slave_mii_bus->irq[phy]); + irq_dispose_mapping(ds->user_mii_bus->irq[phy]); =20 return ret; } @@ -1964,7 +1964,7 @@ static void ksz_irq_phy_free(struct ksz_device *dev) =20 for (phy =3D 0; phy < KSZ_MAX_NUM_PORTS; phy++) if (BIT(phy) & ds->phys_mii_mask) - irq_dispose_mapping(ds->slave_mii_bus->irq[phy]); + irq_dispose_mapping(ds->user_mii_bus->irq[phy]); } =20 static int ksz_mdio_register(struct ksz_device *dev) @@ -1987,12 +1987,12 @@ static int ksz_mdio_register(struct ksz_device *dev) bus->priv =3D dev; bus->read =3D ksz_sw_mdio_read; bus->write =3D ksz_sw_mdio_write; - bus->name =3D "ksz slave smi"; + bus->name =3D "ksz user smi"; snprintf(bus->id, MII_BUS_ID_SIZE, "SMI-%d", ds->index); bus->parent =3D ds->dev; bus->phy_mask =3D ~ds->phys_mii_mask; =20 - ds->slave_mii_bus =3D bus; + ds->user_mii_bus =3D bus; =20 if (dev->irq > 0) { ret =3D ksz_irq_phy_setup(dev); @@ -2344,7 +2344,7 @@ static void ksz_mib_read_work(struct work_struct *wor= k) if (!p->read) { const struct dsa_port *dp =3D dsa_to_port(dev->ds, i); =20 - if (!netif_carrier_ok(dp->slave)) + if (!netif_carrier_ok(dp->user)) mib->cnt_ptr =3D dev->info->reg_mib_cnt; } port_r_cnt(dev, i); @@ -2464,7 +2464,7 @@ static void ksz_get_ethtool_stats(struct dsa_switch *= ds, int port, mutex_lock(&mib->cnt_mutex); =20 /* Only read dropped counters if no link. */ - if (!netif_carrier_ok(dp->slave)) + if (!netif_carrier_ok(dp->user)) mib->cnt_ptr =3D dev->info->reg_mib_cnt; port_r_cnt(dev, port); memcpy(buf, mib->counters, dev->info->mib_cnt * sizeof(u64)); @@ -2574,7 +2574,7 @@ static int ksz_port_setup(struct dsa_switch *ds, int = port) if (!dsa_is_user_port(ds, port)) return 0; =20 - /* setup slave port */ + /* setup user port */ dev->dev_ops->port_setup(dev, port, false); =20 /* port_stp_state_set() will be called after to enable the port so @@ -3567,8 +3567,8 @@ static int ksz_port_set_mac_address(struct dsa_switch= *ds, int port, static int ksz_switch_macaddr_get(struct dsa_switch *ds, int port, struct netlink_ext_ack *extack) { - struct net_device *slave =3D dsa_to_port(ds, port)->slave; - const unsigned char *addr =3D slave->dev_addr; + struct net_device *user =3D dsa_to_port(ds, port)->user; + const unsigned char *addr =3D user->dev_addr; struct ksz_switch_macaddr *switch_macaddr; struct ksz_device *dev =3D ds->priv; const u16 *regs =3D dev->info->regs; diff --git a/drivers/net/dsa/microchip/ksz_ptp.c b/drivers/net/dsa/microchi= p/ksz_ptp.c index 4e22a695a64c..1fe105913c75 100644 --- a/drivers/net/dsa/microchip/ksz_ptp.c +++ b/drivers/net/dsa/microchip/ksz_ptp.c @@ -557,7 +557,7 @@ static void ksz_ptp_txtstamp_skb(struct ksz_device *dev, struct skb_shared_hwtstamps hwtstamps =3D {}; int ret; =20 - /* timeout must include DSA master to transmit data, tstamp latency, + /* timeout must include DSA conduit to transmit data, tstamp latency, * IRQ latency and time for reading the time stamp. */ ret =3D wait_for_completion_timeout(&prt->tstamp_msg_comp, diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 0d62c69dfbb6..d2a92ee64f8e 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2070,7 +2070,7 @@ mt7530_setup_mdio_irq(struct mt7530_priv *priv) unsigned int irq; =20 irq =3D irq_create_mapping(priv->irq_domain, p); - ds->slave_mii_bus->irq[p] =3D irq; + ds->user_mii_bus->irq[p] =3D irq; } } } @@ -2164,7 +2164,7 @@ mt7530_setup_mdio(struct mt7530_priv *priv) if (!bus) return -ENOMEM; =20 - ds->slave_mii_bus =3D bus; + ds->user_mii_bus =3D bus; bus->priv =3D priv; bus->name =3D KBUILD_MODNAME "-mii"; snprintf(bus->id, MII_BUS_ID_SIZE, KBUILD_MODNAME "-%d", idx++); @@ -2201,20 +2201,20 @@ mt7530_setup(struct dsa_switch *ds) u32 id, val; int ret, i; =20 - /* The parent node of master netdev which holds the common system + /* The parent node of conduit netdev which holds the common system * controller also is the container for two GMACs nodes representing * as two netdev instances. */ dsa_switch_for_each_cpu_port(cpu_dp, ds) { - dn =3D cpu_dp->master->dev.of_node->parent; + dn =3D cpu_dp->conduit->dev.of_node->parent; /* It doesn't matter which CPU port is found first, - * their masters should share the same parent OF node + * their conduits should share the same parent OF node */ break; } =20 if (!dn) { - dev_err(ds->dev, "parent OF node of DSA master not found"); + dev_err(ds->dev, "parent OF node of DSA conduit not found"); return -EINVAL; } =20 @@ -2489,7 +2489,7 @@ mt7531_setup(struct dsa_switch *ds) if (mt7531_dual_sgmii_supported(priv)) { priv->p5_intf_sel =3D P5_INTF_SEL_GMAC5_SGMII; =20 - /* Let ds->slave_mii_bus be able to access external phy. */ + /* Let ds->user_mii_bus be able to access external phy. */ mt7530_rmw(priv, MT7531_GPIO_MODE1, MT7531_GPIO11_RG_RXD2_MASK, MT7531_EXT_P_MDC_11); mt7530_rmw(priv, MT7531_GPIO_MODE1, MT7531_GPIO12_RG_RXD3_MASK, @@ -2718,7 +2718,7 @@ mt7531_mac_config(struct dsa_switch *ds, int port, un= signed int mode, case PHY_INTERFACE_MODE_RGMII_RXID: case PHY_INTERFACE_MODE_RGMII_TXID: dp =3D dsa_to_port(ds, port); - phydev =3D dp->slave->phydev; + phydev =3D dp->user->phydev; return mt7531_rgmii_setup(priv, port, interface, phydev); case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_NA: diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/c= hip.c index ab434a77b059..be2491de173d 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -3719,7 +3719,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) return err; =20 chip->ds =3D ds; - ds->slave_mii_bus =3D mv88e6xxx_default_mdio_bus(chip); + ds->user_mii_bus =3D mv88e6xxx_default_mdio_bus(chip); =20 /* Since virtual bridges are mapped in the PVT, the number we support * depends on the physical switch topology. We need to let DSA figure diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 9a3e5ec16972..7a8a3e249454 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -42,22 +42,22 @@ static struct net_device *felix_classify_db(struct dsa_= db db) } } =20 -static int felix_cpu_port_for_master(struct dsa_switch *ds, - struct net_device *master) +static int felix_cpu_port_for_conduit(struct dsa_switch *ds, + struct net_device *conduit) { struct ocelot *ocelot =3D ds->priv; struct dsa_port *cpu_dp; int lag; =20 - if (netif_is_lag_master(master)) { + if (netif_is_lag_master(conduit)) { mutex_lock(&ocelot->fwd_domain_lock); - lag =3D ocelot_bond_get_id(ocelot, master); + lag =3D ocelot_bond_get_id(ocelot, conduit); mutex_unlock(&ocelot->fwd_domain_lock); =20 return lag; } =20 - cpu_dp =3D master->dsa_ptr; + cpu_dp =3D conduit->dsa_ptr; return cpu_dp->index; } =20 @@ -366,7 +366,7 @@ static int felix_update_trapping_destinations(struct ds= a_switch *ds, * is the mode through which frames can be injected from and extracted to = an * external CPU, over Ethernet. In NXP SoCs, the "external CPU" is the ARM= CPU * running Linux, and this forms a DSA setup together with the enetc or fm= an - * DSA master. + * DSA conduit. */ static void felix_npi_port_init(struct ocelot *ocelot, int port) { @@ -441,16 +441,16 @@ static unsigned long felix_tag_npi_get_host_fwd_mask(= struct dsa_switch *ds) return BIT(ocelot->num_phys_ports); } =20 -static int felix_tag_npi_change_master(struct dsa_switch *ds, int port, - struct net_device *master, +static int felix_tag_npi_change_conduit(struct dsa_switch *ds, int port, + struct net_device *conduit, struct netlink_ext_ack *extack) { struct dsa_port *dp =3D dsa_to_port(ds, port), *other_dp; struct ocelot *ocelot =3D ds->priv; =20 - if (netif_is_lag_master(master)) { + if (netif_is_lag_master(conduit)) { NL_SET_ERR_MSG_MOD(extack, - "LAG DSA master only supported using ocelot-8021q"); + "LAG DSA conduit only supported using ocelot-8021q"); return -EOPNOTSUPP; } =20 @@ -459,24 +459,24 @@ static int felix_tag_npi_change_master(struct dsa_swi= tch *ds, int port, * come back up until they're all changed to the new one. */ dsa_switch_for_each_user_port(other_dp, ds) { - struct net_device *slave =3D other_dp->slave; + struct net_device *user =3D other_dp->user; =20 - if (other_dp !=3D dp && (slave->flags & IFF_UP) && - dsa_port_to_master(other_dp) !=3D master) { + if (other_dp !=3D dp && (user->flags & IFF_UP) && + dsa_port_to_conduit(other_dp) !=3D conduit) { NL_SET_ERR_MSG_MOD(extack, - "Cannot change while old master still has users"); + "Cannot change while old conduit still has users"); return -EOPNOTSUPP; } } =20 felix_npi_port_deinit(ocelot, ocelot->npi); - felix_npi_port_init(ocelot, felix_cpu_port_for_master(ds, master)); + felix_npi_port_init(ocelot, felix_cpu_port_for_conduit(ds, conduit)); =20 return 0; } =20 /* Alternatively to using the NPI functionality, that same hardware MAC - * connected internally to the enetc or fman DSA master can be configured = to + * connected internally to the enetc or fman DSA conduit can be configured= to * use the software-defined tag_8021q frame format. As far as the hardware= is * concerned, it thinks it is a "dumb switch" - the queues of the CPU port * module are now disconnected from it, but can still be accessed through @@ -486,7 +486,7 @@ static const struct felix_tag_proto_ops felix_tag_npi_p= roto_ops =3D { .setup =3D felix_tag_npi_setup, .teardown =3D felix_tag_npi_teardown, .get_host_fwd_mask =3D felix_tag_npi_get_host_fwd_mask, - .change_master =3D felix_tag_npi_change_master, + .change_conduit =3D felix_tag_npi_change_conduit, }; =20 static int felix_tag_8021q_setup(struct dsa_switch *ds) @@ -561,11 +561,11 @@ static unsigned long felix_tag_8021q_get_host_fwd_mas= k(struct dsa_switch *ds) return dsa_cpu_ports(ds); } =20 -static int felix_tag_8021q_change_master(struct dsa_switch *ds, int port, - struct net_device *master, +static int felix_tag_8021q_change_conduit(struct dsa_switch *ds, int port, + struct net_device *conduit, struct netlink_ext_ack *extack) { - int cpu =3D felix_cpu_port_for_master(ds, master); + int cpu =3D felix_cpu_port_for_conduit(ds, conduit); struct ocelot *ocelot =3D ds->priv; =20 ocelot_port_unassign_dsa_8021q_cpu(ocelot, port); @@ -578,7 +578,7 @@ static const struct felix_tag_proto_ops felix_tag_8021q= _proto_ops =3D { .setup =3D felix_tag_8021q_setup, .teardown =3D felix_tag_8021q_teardown, .get_host_fwd_mask =3D felix_tag_8021q_get_host_fwd_mask, - .change_master =3D felix_tag_8021q_change_master, + .change_conduit =3D felix_tag_8021q_change_conduit, }; =20 static void felix_set_host_flood(struct dsa_switch *ds, unsigned long mask, @@ -741,14 +741,14 @@ static void felix_port_set_host_flood(struct dsa_swit= ch *ds, int port, !!felix->host_flood_mc_mask, true); } =20 -static int felix_port_change_master(struct dsa_switch *ds, int port, - struct net_device *master, +static int felix_port_change_conduit(struct dsa_switch *ds, int port, + struct net_device *conduit, struct netlink_ext_ack *extack) { struct ocelot *ocelot =3D ds->priv; struct felix *felix =3D ocelot_to_felix(ocelot); =20 - return felix->tag_proto_ops->change_master(ds, port, master, extack); + return felix->tag_proto_ops->change_conduit(ds, port, conduit, extack); } =20 static int felix_set_ageing_time(struct dsa_switch *ds, @@ -953,7 +953,7 @@ static int felix_lag_join(struct dsa_switch *ds, int po= rt, if (!dsa_is_cpu_port(ds, port)) return 0; =20 - return felix_port_change_master(ds, port, lag.dev, extack); + return felix_port_change_conduit(ds, port, lag.dev, extack); } =20 static int felix_lag_leave(struct dsa_switch *ds, int port, @@ -967,7 +967,7 @@ static int felix_lag_leave(struct dsa_switch *ds, int p= ort, if (!dsa_is_cpu_port(ds, port)) return 0; =20 - return felix_port_change_master(ds, port, lag.dev, NULL); + return felix_port_change_conduit(ds, port, lag.dev, NULL); } =20 static int felix_lag_change(struct dsa_switch *ds, int port) @@ -1116,10 +1116,10 @@ static int felix_port_enable(struct dsa_switch *ds,= int port, return 0; =20 if (ocelot->npi >=3D 0) { - struct net_device *master =3D dsa_port_to_master(dp); + struct net_device *conduit =3D dsa_port_to_conduit(dp); =20 - if (felix_cpu_port_for_master(ds, master) !=3D ocelot->npi) { - dev_err(ds->dev, "Multiple masters are not allowed\n"); + if (felix_cpu_port_for_conduit(ds, conduit) !=3D ocelot->npi) { + dev_err(ds->dev, "Multiple conduits are not allowed\n"); return -EINVAL; } } @@ -2164,7 +2164,7 @@ const struct dsa_switch_ops felix_switch_ops =3D { .port_add_dscp_prio =3D felix_port_add_dscp_prio, .port_del_dscp_prio =3D felix_port_del_dscp_prio, .port_set_host_flood =3D felix_port_set_host_flood, - .port_change_master =3D felix_port_change_master, + .port_change_conduit =3D felix_port_change_conduit, }; EXPORT_SYMBOL_GPL(felix_switch_ops); =20 @@ -2176,7 +2176,7 @@ struct net_device *felix_port_to_netdev(struct ocelot= *ocelot, int port) if (!dsa_is_user_port(ds, port)) return NULL; =20 - return dsa_to_port(ds, port)->slave; + return dsa_to_port(ds, port)->user; } EXPORT_SYMBOL_GPL(felix_port_to_netdev); =20 diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h index 1d4befe7cfe8..288d37aaf4bd 100644 --- a/drivers/net/dsa/ocelot/felix.h +++ b/drivers/net/dsa/ocelot/felix.h @@ -77,8 +77,8 @@ struct felix_tag_proto_ops { int (*setup)(struct dsa_switch *ds); void (*teardown)(struct dsa_switch *ds); unsigned long (*get_host_fwd_mask)(struct dsa_switch *ds); - int (*change_master)(struct dsa_switch *ds, int port, - struct net_device *master, + int (*change_conduit)(struct dsa_switch *ds, int port, + struct net_device *conduit, struct netlink_ext_ack *extack); }; =20 diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8= xxx.c index de1dc22cf683..765df4640782 100644 --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c @@ -323,14 +323,14 @@ static int qca8k_read_eth(struct qca8k_priv *priv, u3= 2 reg, u32 *val, int len) =20 mutex_lock(&mgmt_eth_data->mutex); =20 - /* Check mgmt_master if is operational */ - if (!priv->mgmt_master) { + /* Check mgmt_conduit if is operational */ + if (!priv->mgmt_conduit) { kfree_skb(skb); mutex_unlock(&mgmt_eth_data->mutex); return -EINVAL; } =20 - skb->dev =3D priv->mgmt_master; + skb->dev =3D priv->mgmt_conduit; =20 reinit_completion(&mgmt_eth_data->rw_done); =20 @@ -375,14 +375,14 @@ static int qca8k_write_eth(struct qca8k_priv *priv, u= 32 reg, u32 *val, int len) =20 mutex_lock(&mgmt_eth_data->mutex); =20 - /* Check mgmt_master if is operational */ - if (!priv->mgmt_master) { + /* Check mgmt_conduit if is operational */ + if (!priv->mgmt_conduit) { kfree_skb(skb); mutex_unlock(&mgmt_eth_data->mutex); return -EINVAL; } =20 - skb->dev =3D priv->mgmt_master; + skb->dev =3D priv->mgmt_conduit; =20 reinit_completion(&mgmt_eth_data->rw_done); =20 @@ -508,7 +508,7 @@ qca8k_bulk_read(void *ctx, const void *reg_buf, size_t = reg_len, u32 reg =3D *(u32 *)reg_buf & U16_MAX; struct qca8k_priv *priv =3D ctx; =20 - if (priv->mgmt_master && + if (priv->mgmt_conduit && !qca8k_read_eth(priv, reg, val_buf, val_len)) return 0; =20 @@ -531,7 +531,7 @@ qca8k_bulk_gather_write(void *ctx, const void *reg_buf,= size_t reg_len, struct qca8k_priv *priv =3D ctx; u32 *val =3D (u32 *)val_buf; =20 - if (priv->mgmt_master && + if (priv->mgmt_conduit && !qca8k_write_eth(priv, reg, val, val_len)) return 0; =20 @@ -626,7 +626,7 @@ qca8k_phy_eth_command(struct qca8k_priv *priv, bool rea= d, int phy, struct sk_buff *write_skb, *clear_skb, *read_skb; struct qca8k_mgmt_eth_data *mgmt_eth_data; u32 write_val, clear_val =3D 0, val; - struct net_device *mgmt_master; + struct net_device *mgmt_conduit; int ret, ret1; bool ack; =20 @@ -674,17 +674,17 @@ qca8k_phy_eth_command(struct qca8k_priv *priv, bool r= ead, int phy, */ mutex_lock(&mgmt_eth_data->mutex); =20 - /* Check if mgmt_master is operational */ - mgmt_master =3D priv->mgmt_master; - if (!mgmt_master) { + /* Check if mgmt_conduit is operational */ + mgmt_conduit =3D priv->mgmt_conduit; + if (!mgmt_conduit) { mutex_unlock(&mgmt_eth_data->mutex); ret =3D -EINVAL; - goto err_mgmt_master; + goto err_mgmt_conduit; } =20 - read_skb->dev =3D mgmt_master; - clear_skb->dev =3D mgmt_master; - write_skb->dev =3D mgmt_master; + read_skb->dev =3D mgmt_conduit; + clear_skb->dev =3D mgmt_conduit; + write_skb->dev =3D mgmt_conduit; =20 reinit_completion(&mgmt_eth_data->rw_done); =20 @@ -769,7 +769,7 @@ qca8k_phy_eth_command(struct qca8k_priv *priv, bool rea= d, int phy, return ret; =20 /* Error handling before lock */ -err_mgmt_master: +err_mgmt_conduit: kfree_skb(read_skb); err_read_skb: kfree_skb(clear_skb); @@ -948,12 +948,12 @@ qca8k_mdio_register(struct qca8k_priv *priv) ds->dst->index, ds->index); bus->parent =3D ds->dev; bus->phy_mask =3D ~ds->phys_mii_mask; - ds->slave_mii_bus =3D bus; + ds->user_mii_bus =3D bus; =20 /* Check if the devicetree declare the port:phy mapping */ mdio =3D of_get_child_by_name(priv->dev->of_node, "mdio"); if (of_device_is_available(mdio)) { - bus->name =3D "qca8k slave mii"; + bus->name =3D "qca8k user mii"; bus->read =3D qca8k_internal_mdio_read; bus->write =3D qca8k_internal_mdio_write; return devm_of_mdiobus_register(priv->dev, bus, mdio); @@ -962,7 +962,7 @@ qca8k_mdio_register(struct qca8k_priv *priv) /* If a mapping can't be found the legacy mapping is used, * using the qca8k_port_to_phy function */ - bus->name =3D "qca8k-legacy slave mii"; + bus->name =3D "qca8k-legacy user mii"; bus->read =3D qca8k_legacy_mdio_read; bus->write =3D qca8k_legacy_mdio_write; return devm_mdiobus_register(priv->dev, bus); @@ -1717,10 +1717,10 @@ qca8k_get_tag_protocol(struct dsa_switch *ds, int p= ort, } =20 static void -qca8k_master_change(struct dsa_switch *ds, const struct net_device *master, +qca8k_conduit_change(struct dsa_switch *ds, const struct net_device *condu= it, bool operational) { - struct dsa_port *dp =3D master->dsa_ptr; + struct dsa_port *dp =3D conduit->dsa_ptr; struct qca8k_priv *priv =3D ds->priv; =20 /* Ethernet MIB/MDIO is only supported for CPU port 0 */ @@ -1730,7 +1730,7 @@ qca8k_master_change(struct dsa_switch *ds, const stru= ct net_device *master, mutex_lock(&priv->mgmt_eth_data.mutex); mutex_lock(&priv->mib_eth_data.mutex); =20 - priv->mgmt_master =3D operational ? (struct net_device *)master : NULL; + priv->mgmt_conduit =3D operational ? (struct net_device *)conduit : NULL; =20 mutex_unlock(&priv->mib_eth_data.mutex); mutex_unlock(&priv->mgmt_eth_data.mutex); @@ -2005,7 +2005,7 @@ static const struct dsa_switch_ops qca8k_switch_ops = =3D { .get_phy_flags =3D qca8k_get_phy_flags, .port_lag_join =3D qca8k_port_lag_join, .port_lag_leave =3D qca8k_port_lag_leave, - .master_state_change =3D qca8k_master_change, + .conduit_state_change =3D qca8k_conduit_change, .connect_tag_protocol =3D qca8k_connect_tag_protocol, }; =20 diff --git a/drivers/net/dsa/qca/qca8k-common.c b/drivers/net/dsa/qca/qca8k= -common.c index fce04ce12cf9..0230efa3725e 100644 --- a/drivers/net/dsa/qca/qca8k-common.c +++ b/drivers/net/dsa/qca/qca8k-common.c @@ -500,7 +500,7 @@ void qca8k_get_ethtool_stats(struct dsa_switch *ds, int= port, u32 hi =3D 0; int ret; =20 - if (priv->mgmt_master && priv->info->ops->autocast_mib && + if (priv->mgmt_conduit && priv->info->ops->autocast_mib && priv->info->ops->autocast_mib(ds, port, data) > 0) return; =20 diff --git a/drivers/net/dsa/qca/qca8k-leds.c b/drivers/net/dsa/qca/qca8k-l= eds.c index e8c16e76e34b..90e30c2909e4 100644 --- a/drivers/net/dsa/qca/qca8k-leds.c +++ b/drivers/net/dsa/qca/qca8k-leds.c @@ -356,8 +356,8 @@ static struct device *qca8k_cled_hw_control_get_device(= struct led_classdev *ldev dp =3D dsa_to_port(priv->ds, qca8k_phy_to_port(led->port_num)); if (!dp) return NULL; - if (dp->slave) - return &dp->slave->dev; + if (dp->user) + return &dp->user->dev; return NULL; } =20 @@ -429,7 +429,7 @@ qca8k_parse_port_leds(struct qca8k_priv *priv, struct f= wnode_handle *port, int p init_data.default_label =3D ":port"; init_data.fwnode =3D led; init_data.devname_mandatory =3D true; - init_data.devicename =3D kasprintf(GFP_KERNEL, "%s:0%d", ds->slave_mii_b= us->id, + init_data.devicename =3D kasprintf(GFP_KERNEL, "%s:0%d", ds->user_mii_bu= s->id, port_num); if (!init_data.devicename) return -ENOMEM; diff --git a/drivers/net/dsa/qca/qca8k.h b/drivers/net/dsa/qca/qca8k.h index 8f88b7db384d..2ac7e88f8da5 100644 --- a/drivers/net/dsa/qca/qca8k.h +++ b/drivers/net/dsa/qca/qca8k.h @@ -458,7 +458,7 @@ struct qca8k_priv { struct mutex reg_mutex; struct device *dev; struct gpio_desc *reset_gpio; - struct net_device *mgmt_master; /* Track if mdio/mib Ethernet is availabl= e */ + struct net_device *mgmt_conduit; /* Track if mdio/mib Ethernet is availab= le */ struct qca8k_mgmt_eth_data mgmt_eth_data; struct qca8k_mib_eth_data mib_eth_data; struct qca8k_mdio_cache mdio_cache; diff --git a/drivers/net/dsa/realtek/realtek-smi.c b/drivers/net/dsa/realte= k/realtek-smi.c index bfd11591faf4..755546ed8db6 100644 --- a/drivers/net/dsa/realtek/realtek-smi.c +++ b/drivers/net/dsa/realtek/realtek-smi.c @@ -378,25 +378,25 @@ static int realtek_smi_setup_mdio(struct dsa_switch *= ds) return -ENODEV; } =20 - priv->slave_mii_bus =3D devm_mdiobus_alloc(priv->dev); - if (!priv->slave_mii_bus) { + priv->user_mii_bus =3D devm_mdiobus_alloc(priv->dev); + if (!priv->user_mii_bus) { ret =3D -ENOMEM; goto err_put_node; } - priv->slave_mii_bus->priv =3D priv; - priv->slave_mii_bus->name =3D "SMI slave MII"; - priv->slave_mii_bus->read =3D realtek_smi_mdio_read; - priv->slave_mii_bus->write =3D realtek_smi_mdio_write; - snprintf(priv->slave_mii_bus->id, MII_BUS_ID_SIZE, "SMI-%d", + priv->user_mii_bus->priv =3D priv; + priv->user_mii_bus->name =3D "SMI user MII"; + priv->user_mii_bus->read =3D realtek_smi_mdio_read; + priv->user_mii_bus->write =3D realtek_smi_mdio_write; + snprintf(priv->user_mii_bus->id, MII_BUS_ID_SIZE, "SMI-%d", ds->index); - priv->slave_mii_bus->dev.of_node =3D mdio_np; - priv->slave_mii_bus->parent =3D priv->dev; - ds->slave_mii_bus =3D priv->slave_mii_bus; + priv->user_mii_bus->dev.of_node =3D mdio_np; + priv->user_mii_bus->parent =3D priv->dev; + ds->user_mii_bus =3D priv->user_mii_bus; =20 - ret =3D devm_of_mdiobus_register(priv->dev, priv->slave_mii_bus, mdio_np); + ret =3D devm_of_mdiobus_register(priv->dev, priv->user_mii_bus, mdio_np); if (ret) { dev_err(priv->dev, "unable to register MDIO bus %s\n", - priv->slave_mii_bus->id); + priv->user_mii_bus->id); goto err_put_node; } =20 @@ -514,8 +514,8 @@ static void realtek_smi_remove(struct platform_device *= pdev) return; =20 dsa_unregister_switch(priv->ds); - if (priv->slave_mii_bus) - of_node_put(priv->slave_mii_bus->dev.of_node); + if (priv->user_mii_bus) + of_node_put(priv->user_mii_bus->dev.of_node); =20 /* leave the device reset asserted */ if (priv->reset) diff --git a/drivers/net/dsa/realtek/realtek.h b/drivers/net/dsa/realtek/re= altek.h index 4fa7c6ba874a..790488e9c667 100644 --- a/drivers/net/dsa/realtek/realtek.h +++ b/drivers/net/dsa/realtek/realtek.h @@ -54,7 +54,7 @@ struct realtek_priv { struct regmap *map; struct regmap *map_nolock; struct mutex map_lock; - struct mii_bus *slave_mii_bus; + struct mii_bus *user_mii_bus; struct mii_bus *bus; int mdio_addr; =20 diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja11= 05/sja1105_main.c index 1a367e64bc3b..74cee39d73df 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -2688,7 +2688,7 @@ static int sja1105_mgmt_xmit(struct dsa_switch *ds, i= nt port, int slot, } =20 /* Transfer skb to the host port. */ - dsa_enqueue_skb(skb, dsa_to_port(ds, port)->slave); + dsa_enqueue_skb(skb, dsa_to_port(ds, port)->user); =20 /* Wait until the switch has processed the frame */ do { @@ -3081,7 +3081,7 @@ static int sja1105_port_bridge_flags(struct dsa_switc= h *ds, int port, * ref_clk pin. So port clocking needs to be initialized early, before * connecting to PHYs is attempted, otherwise they won't respond through M= DIO. * Setting correct PHY link speed does not matter now. - * But dsa_slave_phy_setup is called later than sja1105_setup, so the PHY + * But dsa_user_phy_setup is called later than sja1105_setup, so the PHY * bindings are not yet parsed by DSA core. We need to parse early so that= we * can populate the xMII mode parameters table. */ diff --git a/drivers/net/dsa/xrs700x/xrs700x.c b/drivers/net/dsa/xrs700x/xr= s700x.c index 5b02e9e426fd..96db032b478f 100644 --- a/drivers/net/dsa/xrs700x/xrs700x.c +++ b/drivers/net/dsa/xrs700x/xrs700x.c @@ -554,7 +554,7 @@ static int xrs700x_hsr_join(struct dsa_switch *ds, int = port, unsigned int val =3D XRS_HSR_CFG_HSR_PRP; struct dsa_port *partner =3D NULL, *dp; struct xrs700x *priv =3D ds->priv; - struct net_device *slave; + struct net_device *user; int ret, i, hsr_pair[2]; enum hsr_version ver; bool fwd =3D false; @@ -638,8 +638,8 @@ static int xrs700x_hsr_join(struct dsa_switch *ds, int = port, hsr_pair[0] =3D port; hsr_pair[1] =3D partner->index; for (i =3D 0; i < ARRAY_SIZE(hsr_pair); i++) { - slave =3D dsa_to_port(ds, hsr_pair[i])->slave; - slave->features |=3D XRS7000X_SUPPORTED_HSR_FEATURES; + user =3D dsa_to_port(ds, hsr_pair[i])->user; + user->features |=3D XRS7000X_SUPPORTED_HSR_FEATURES; } =20 return 0; @@ -650,7 +650,7 @@ static int xrs700x_hsr_leave(struct dsa_switch *ds, int= port, { struct dsa_port *partner =3D NULL, *dp; struct xrs700x *priv =3D ds->priv; - struct net_device *slave; + struct net_device *user; int i, hsr_pair[2]; unsigned int val; =20 @@ -692,8 +692,8 @@ static int xrs700x_hsr_leave(struct dsa_switch *ds, int= port, hsr_pair[0] =3D port; hsr_pair[1] =3D partner->index; for (i =3D 0; i < ARRAY_SIZE(hsr_pair); i++) { - slave =3D dsa_to_port(ds, hsr_pair[i])->slave; - slave->features &=3D ~XRS7000X_SUPPORTED_HSR_FEATURES; + user =3D dsa_to_port(ds, hsr_pair[i])->user; + user->features &=3D ~XRS7000X_SUPPORTED_HSR_FEATURES; } =20 return 0; diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ether= net/broadcom/bcmsysport.c index ab096795e805..c9faa8540859 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -2430,7 +2430,7 @@ static int bcm_sysport_netdevice_event(struct notifie= r_block *nb, if (dev->netdev_ops !=3D &bcm_sysport_netdev_ops) return NOTIFY_DONE; =20 - if (!dsa_slave_dev_check(info->upper_dev)) + if (!dsa_user_dev_check(info->upper_dev)) return NOTIFY_DONE; =20 if (info->linking) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethe= rnet/mediatek/mtk_eth_soc.c index 60d49b0f595f..3cf6589cfdac 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -3329,7 +3329,7 @@ static int mtk_device_event(struct notifier_block *n,= unsigned long event, void return NOTIFY_DONE; =20 found: - if (!dsa_slave_dev_check(dev)) + if (!dsa_user_dev_check(dev)) return NOTIFY_DONE; =20 if (__ethtool_get_link_ksettings(dev, &s)) diff --git a/include/linux/dsa/sja1105.h b/include/linux/dsa/sja1105.h index c177322f793d..b9dd35d4b8f5 100644 --- a/include/linux/dsa/sja1105.h +++ b/include/linux/dsa/sja1105.h @@ -28,7 +28,7 @@ /* Source and Destination MAC of follow-up meta frames. * Whereas the choice of SMAC only affects the unique identification of the * switch as sender of meta frames, the DMAC must be an address that is pr= esent - * in the DSA master port's multicast MAC filter. + * in the DSA conduit port's multicast MAC filter. * 01-80-C2-00-00-0E is a good choice for this, as all profiles of IEEE 15= 88 * over L2 use this address for some purpose already. */ diff --git a/include/net/dsa.h b/include/net/dsa.h index d98439ea6146..6616079ca78e 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -102,11 +102,11 @@ struct dsa_device_ops { const char *name; enum dsa_tag_protocol proto; /* Some tagging protocols either mangle or shift the destination MAC - * address, in which case the DSA master would drop packets on ingress + * address, in which case the DSA conduit would drop packets on ingress * if what it understands out of the destination MAC address is not in * its RX filter. */ - bool promisc_on_master; + bool promisc_on_conduit; }; =20 struct dsa_lag { @@ -236,12 +236,12 @@ struct dsa_bridge { }; =20 struct dsa_port { - /* A CPU port is physically connected to a master device. - * A user port exposed to userspace has a slave device. + /* A CPU port is physically connected to a conduit device. + * A user port exposed to userspace has a user device. */ union { - struct net_device *master; - struct net_device *slave; + struct net_device *conduit; + struct net_device *user; }; =20 /* Copy of the tagging protocol operations, for quicker access @@ -249,7 +249,7 @@ struct dsa_port { */ const struct dsa_device_ops *tag_ops; =20 - /* Copies for faster access in master receive hot path */ + /* Copies for faster access in conduit receive hot path */ struct dsa_switch_tree *dst; struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev); =20 @@ -281,9 +281,9 @@ struct dsa_port { =20 u8 lag_tx_enabled:1; =20 - /* Master state bits, valid only on CPU ports */ - u8 master_admin_up:1; - u8 master_oper_up:1; + /* conduit state bits, valid only on CPU ports */ + u8 conduit_admin_up:1; + u8 conduit_oper_up:1; =20 /* Valid only on user ports */ u8 cpu_port_in_lag:1; @@ -303,7 +303,7 @@ struct dsa_port { struct list_head list; =20 /* - * Original copy of the master netdev ethtool_ops + * Original copy of the conduit netdev ethtool_ops */ const struct ethtool_ops *orig_ethtool_ops; =20 @@ -452,10 +452,10 @@ struct dsa_switch { const struct dsa_switch_ops *ops; =20 /* - * Slave mii_bus and devices for the individual ports. + * user mii_bus and devices for the individual ports. */ u32 phys_mii_mask; - struct mii_bus *slave_mii_bus; + struct mii_bus *user_mii_bus; =20 /* Ageing Time limits in msecs */ unsigned int ageing_time_min; @@ -520,10 +520,10 @@ static inline bool dsa_port_is_unused(struct dsa_port= *dp) return dp->type =3D=3D DSA_PORT_TYPE_UNUSED; } =20 -static inline bool dsa_port_master_is_operational(struct dsa_port *dp) +static inline bool dsa_port_conduit_is_operational(struct dsa_port *dp) { - return dsa_port_is_cpu(dp) && dp->master_admin_up && - dp->master_oper_up; + return dsa_port_is_cpu(dp) && dp->conduit_admin_up && + dp->conduit_oper_up; } =20 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) @@ -713,12 +713,12 @@ static inline bool dsa_port_offloads_lag(struct dsa_p= ort *dp, return dsa_port_lag_dev_get(dp) =3D=3D lag->dev; } =20 -static inline struct net_device *dsa_port_to_master(const struct dsa_port = *dp) +static inline struct net_device *dsa_port_to_conduit(const struct dsa_port= *dp) { if (dp->cpu_port_in_lag) return dsa_port_lag_dev_get(dp->cpu_dp); =20 - return dp->cpu_dp->master; + return dp->cpu_dp->conduit; } =20 static inline @@ -732,7 +732,7 @@ struct net_device *dsa_port_to_bridge_port(const struct= dsa_port *dp) else if (dp->hsr_dev) return dp->hsr_dev; =20 - return dp->slave; + return dp->user; } =20 static inline struct net_device * @@ -834,8 +834,8 @@ struct dsa_switch_ops { int (*connect_tag_protocol)(struct dsa_switch *ds, enum dsa_tag_protocol proto); =20 - int (*port_change_master)(struct dsa_switch *ds, int port, - struct net_device *master, + int (*port_change_conduit)(struct dsa_switch *ds, int port, + struct net_device *conduit, struct netlink_ext_ack *extack); =20 /* Optional switch-wide initialization and destruction methods */ @@ -1233,11 +1233,11 @@ struct dsa_switch_ops { int (*tag_8021q_vlan_del)(struct dsa_switch *ds, int port, u16 vid); =20 /* - * DSA master tracking operations + * DSA conduit tracking operations */ - void (*master_state_change)(struct dsa_switch *ds, - const struct net_device *master, - bool operational); + void (*conduit_state_change)(struct dsa_switch *ds, + const struct net_device *conduit, + bool operational); }; =20 #define DSA_DEVLINK_PARAM_DRIVER(_id, _name, _type, _cmodes) \ @@ -1374,9 +1374,9 @@ static inline int dsa_switch_resume(struct dsa_switch= *ds) #endif /* CONFIG_PM_SLEEP */ =20 #if IS_ENABLED(CONFIG_NET_DSA) -bool dsa_slave_dev_check(const struct net_device *dev); +bool dsa_user_dev_check(const struct net_device *dev); #else -static inline bool dsa_slave_dev_check(const struct net_device *dev) +static inline bool dsa_user_dev_check(const struct net_device *dev) { return false; } diff --git a/include/net/dsa_stubs.h b/include/net/dsa_stubs.h index 361811750a54..45f80661bbe1 100644 --- a/include/net/dsa_stubs.h +++ b/include/net/dsa_stubs.h @@ -13,12 +13,12 @@ extern const struct dsa_stubs *dsa_stubs; =20 struct dsa_stubs { - int (*master_hwtstamp_validate)(struct net_device *dev, + int (*conduit_hwtstamp_validate)(struct net_device *dev, const struct kernel_hwtstamp_config *config, struct netlink_ext_ack *extack); }; =20 -static inline int dsa_master_hwtstamp_validate(struct net_device *dev, +static inline int dsa_conduit_hwtstamp_validate(struct net_device *dev, const struct kernel_hwtstamp_config *config, struct netlink_ext_ack *extack) { @@ -29,16 +29,16 @@ static inline int dsa_master_hwtstamp_validate(struct n= et_device *dev, * netdev_uses_dsa() returns true, the dsa_core module is still * registered, and so, dsa_unregister_stubs() couldn't have run. * For netdev_uses_dsa() to start returning false, it would imply that - * dsa_master_teardown() has executed, which requires rtnl_lock(). + * dsa_conduit_teardown() has executed, which requires rtnl_lock(). */ ASSERT_RTNL(); =20 - return dsa_stubs->master_hwtstamp_validate(dev, config, extack); + return dsa_stubs->conduit_hwtstamp_validate(dev, config, extack); } =20 #else =20 -static inline int dsa_master_hwtstamp_validate(struct net_device *dev, +static inline int dsa_conduit_hwtstamp_validate(struct net_device *dev, const struct kernel_hwtstamp_config *config, struct netlink_ext_ack *extack) { diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index b46aedc36939..feeddf95f450 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -382,7 +382,7 @@ static int dev_set_hwtstamp(struct net_device *dev, str= uct ifreq *ifr) if (err) return err; =20 - err =3D dsa_master_hwtstamp_validate(dev, &kernel_cfg, &extack); + err =3D dsa_conduit_hwtstamp_validate(dev, &kernel_cfg, &extack); if (err) { if (extack._msg) netdev_err(dev, "%s\n", extack._msg); diff --git a/net/dsa/Makefile b/net/dsa/Makefile index 12e305824a96..009053962c63 100644 --- a/net/dsa/Makefile +++ b/net/dsa/Makefile @@ -10,10 +10,10 @@ obj-$(CONFIG_NET_DSA) +=3D dsa_core.o dsa_core-y +=3D \ devlink.o \ dsa.o \ - master.o \ + conduit.o \ netlink.o \ port.o \ - slave.o \ + user.o \ switch.o \ tag.o \ tag_8021q.o \ diff --git a/net/dsa/master.c b/net/dsa/conduit.c similarity index 79% rename from net/dsa/master.c rename to net/dsa/conduit.c index 6be89ab0cc01..4963debd2bb9 100644 --- a/net/dsa/master.c +++ b/net/dsa/conduit.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Handling of a master device, switching frames via its switch fabric CPU= port + * Handling of a conduit device, switching frames via its switch fabric CP= U port * * Copyright (c) 2017 Savoir-faire Linux Inc. * Vivien Didelot @@ -12,11 +12,11 @@ #include =20 #include "dsa.h" -#include "master.h" +#include "conduit.h" #include "port.h" #include "tag.h" =20 -static int dsa_master_get_regs_len(struct net_device *dev) +static int dsa_conduit_get_regs_len(struct net_device *dev) { struct dsa_port *cpu_dp =3D dev->dsa_ptr; const struct ethtool_ops *ops =3D cpu_dp->orig_ethtool_ops; @@ -45,7 +45,7 @@ static int dsa_master_get_regs_len(struct net_device *dev) return ret; } =20 -static void dsa_master_get_regs(struct net_device *dev, +static void dsa_conduit_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *data) { struct dsa_port *cpu_dp =3D dev->dsa_ptr; @@ -80,7 +80,7 @@ static void dsa_master_get_regs(struct net_device *dev, } } =20 -static void dsa_master_get_ethtool_stats(struct net_device *dev, +static void dsa_conduit_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, uint64_t *data) { @@ -99,7 +99,7 @@ static void dsa_master_get_ethtool_stats(struct net_devic= e *dev, ds->ops->get_ethtool_stats(ds, port, data + count); } =20 -static void dsa_master_get_ethtool_phy_stats(struct net_device *dev, +static void dsa_conduit_get_ethtool_phy_stats(struct net_device *dev, struct ethtool_stats *stats, uint64_t *data) { @@ -125,7 +125,7 @@ static void dsa_master_get_ethtool_phy_stats(struct net= _device *dev, ds->ops->get_ethtool_phy_stats(ds, port, data + count); } =20 -static int dsa_master_get_sset_count(struct net_device *dev, int sset) +static int dsa_conduit_get_sset_count(struct net_device *dev, int sset) { struct dsa_port *cpu_dp =3D dev->dsa_ptr; const struct ethtool_ops *ops =3D cpu_dp->orig_ethtool_ops; @@ -147,7 +147,7 @@ static int dsa_master_get_sset_count(struct net_device = *dev, int sset) return count; } =20 -static void dsa_master_get_strings(struct net_device *dev, uint32_t string= set, +static void dsa_conduit_get_strings(struct net_device *dev, uint32_t strin= gset, uint8_t *data) { struct dsa_port *cpu_dp =3D dev->dsa_ptr; @@ -195,10 +195,10 @@ static void dsa_master_get_strings(struct net_device = *dev, uint32_t stringset, } } =20 -/* Deny PTP operations on master if there is at least one switch in the tr= ee +/* Deny PTP operations on conduit if there is at least one switch in the t= ree * that is PTP capable. */ -int __dsa_master_hwtstamp_validate(struct net_device *dev, +int __dsa_conduit_hwtstamp_validate(struct net_device *dev, const struct kernel_hwtstamp_config *config, struct netlink_ext_ack *extack) { @@ -212,7 +212,7 @@ int __dsa_master_hwtstamp_validate(struct net_device *d= ev, list_for_each_entry(dp, &dst->ports, list) { if (dsa_port_supports_hwtstamp(dp)) { NL_SET_ERR_MSG(extack, - "HW timestamping not allowed on DSA master when switch supports= the operation"); + "HW timestamping not allowed on DSA conduit when switch support= s the operation"); return -EBUSY; } } @@ -220,7 +220,7 @@ int __dsa_master_hwtstamp_validate(struct net_device *d= ev, return 0; } =20 -static int dsa_master_ethtool_setup(struct net_device *dev) +static int dsa_conduit_ethtool_setup(struct net_device *dev) { struct dsa_port *cpu_dp =3D dev->dsa_ptr; struct dsa_switch *ds =3D cpu_dp->ds; @@ -237,19 +237,19 @@ static int dsa_master_ethtool_setup(struct net_device= *dev) if (cpu_dp->orig_ethtool_ops) memcpy(ops, cpu_dp->orig_ethtool_ops, sizeof(*ops)); =20 - ops->get_regs_len =3D dsa_master_get_regs_len; - ops->get_regs =3D dsa_master_get_regs; - ops->get_sset_count =3D dsa_master_get_sset_count; - ops->get_ethtool_stats =3D dsa_master_get_ethtool_stats; - ops->get_strings =3D dsa_master_get_strings; - ops->get_ethtool_phy_stats =3D dsa_master_get_ethtool_phy_stats; + ops->get_regs_len =3D dsa_conduit_get_regs_len; + ops->get_regs =3D dsa_conduit_get_regs; + ops->get_sset_count =3D dsa_conduit_get_sset_count; + ops->get_ethtool_stats =3D dsa_conduit_get_ethtool_stats; + ops->get_strings =3D dsa_conduit_get_strings; + ops->get_ethtool_phy_stats =3D dsa_conduit_get_ethtool_phy_stats; =20 dev->ethtool_ops =3D ops; =20 return 0; } =20 -static void dsa_master_ethtool_teardown(struct net_device *dev) +static void dsa_conduit_ethtool_teardown(struct net_device *dev) { struct dsa_port *cpu_dp =3D dev->dsa_ptr; =20 @@ -260,16 +260,16 @@ static void dsa_master_ethtool_teardown(struct net_de= vice *dev) cpu_dp->orig_ethtool_ops =3D NULL; } =20 -/* Keep the master always promiscuous if the tagging protocol requires that +/* Keep the conduit always promiscuous if the tagging protocol requires th= at * (garbles MAC DA) or if it doesn't support unicast filtering, case in wh= ich * it would revert to promiscuous mode as soon as we call dev_uc_add() on = it * anyway. */ -static void dsa_master_set_promiscuity(struct net_device *dev, int inc) +static void dsa_conduit_set_promiscuity(struct net_device *dev, int inc) { const struct dsa_device_ops *ops =3D dev->dsa_ptr->tag_ops; =20 - if ((dev->priv_flags & IFF_UNICAST_FLT) && !ops->promisc_on_master) + if ((dev->priv_flags & IFF_UNICAST_FLT) && !ops->promisc_on_conduit) return; =20 ASSERT_RTNL(); @@ -336,17 +336,17 @@ static ssize_t tagging_store(struct device *d, struct= device_attribute *attr, } static DEVICE_ATTR_RW(tagging); =20 -static struct attribute *dsa_slave_attrs[] =3D { +static struct attribute *dsa_user_attrs[] =3D { &dev_attr_tagging.attr, NULL }; =20 static const struct attribute_group dsa_group =3D { .name =3D "dsa", - .attrs =3D dsa_slave_attrs, + .attrs =3D dsa_user_attrs, }; =20 -static void dsa_master_reset_mtu(struct net_device *dev) +static void dsa_conduit_reset_mtu(struct net_device *dev) { int err; =20 @@ -356,7 +356,7 @@ static void dsa_master_reset_mtu(struct net_device *dev) "Unable to reset MTU to exclude DSA overheads\n"); } =20 -int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp) +int dsa_conduit_setup(struct net_device *dev, struct dsa_port *cpu_dp) { const struct dsa_device_ops *tag_ops =3D cpu_dp->tag_ops; struct dsa_switch *ds =3D cpu_dp->ds; @@ -365,7 +365,7 @@ int dsa_master_setup(struct net_device *dev, struct dsa= _port *cpu_dp) =20 mtu =3D ETH_DATA_LEN + dsa_tag_protocol_overhead(tag_ops); =20 - /* The DSA master must use SET_NETDEV_DEV for this to work. */ + /* The DSA conduit must use SET_NETDEV_DEV for this to work. */ if (!netif_is_lag_master(dev)) { consumer_link =3D device_link_add(ds->dev, dev->dev.parent, DL_FLAG_AUTOREMOVE_CONSUMER); @@ -376,7 +376,7 @@ int dsa_master_setup(struct net_device *dev, struct dsa= _port *cpu_dp) } =20 /* The switch driver may not implement ->port_change_mtu(), case in - * which dsa_slave_change_mtu() will not update the master MTU either, + * which dsa_user_change_mtu() will not update the conduit MTU either, * so we need to do that here. */ ret =3D dev_set_mtu(dev, mtu); @@ -392,9 +392,9 @@ int dsa_master_setup(struct net_device *dev, struct dsa= _port *cpu_dp) =20 dev->dsa_ptr =3D cpu_dp; =20 - dsa_master_set_promiscuity(dev, 1); + dsa_conduit_set_promiscuity(dev, 1); =20 - ret =3D dsa_master_ethtool_setup(dev); + ret =3D dsa_conduit_ethtool_setup(dev); if (ret) goto out_err_reset_promisc; =20 @@ -405,18 +405,18 @@ int dsa_master_setup(struct net_device *dev, struct d= sa_port *cpu_dp) return ret; =20 out_err_ethtool_teardown: - dsa_master_ethtool_teardown(dev); + dsa_conduit_ethtool_teardown(dev); out_err_reset_promisc: - dsa_master_set_promiscuity(dev, -1); + dsa_conduit_set_promiscuity(dev, -1); return ret; } =20 -void dsa_master_teardown(struct net_device *dev) +void dsa_conduit_teardown(struct net_device *dev) { sysfs_remove_group(&dev->dev.kobj, &dsa_group); - dsa_master_ethtool_teardown(dev); - dsa_master_reset_mtu(dev); - dsa_master_set_promiscuity(dev, -1); + dsa_conduit_ethtool_teardown(dev); + dsa_conduit_reset_mtu(dev); + dsa_conduit_set_promiscuity(dev, -1); =20 dev->dsa_ptr =3D NULL; =20 @@ -427,39 +427,39 @@ void dsa_master_teardown(struct net_device *dev) wmb(); } =20 -int dsa_master_lag_setup(struct net_device *lag_dev, struct dsa_port *cpu_= dp, +int dsa_conduit_lag_setup(struct net_device *lag_dev, struct dsa_port *cpu= _dp, struct netdev_lag_upper_info *uinfo, struct netlink_ext_ack *extack) { - bool master_setup =3D false; + bool conduit_setup =3D false; int err; =20 if (!netdev_uses_dsa(lag_dev)) { - err =3D dsa_master_setup(lag_dev, cpu_dp); + err =3D dsa_conduit_setup(lag_dev, cpu_dp); if (err) return err; =20 - master_setup =3D true; + conduit_setup =3D true; } =20 err =3D dsa_port_lag_join(cpu_dp, lag_dev, uinfo, extack); if (err) { NL_SET_ERR_MSG_WEAK_MOD(extack, "CPU port failed to join LAG"); - goto out_master_teardown; + goto out_conduit_teardown; } =20 return 0; =20 -out_master_teardown: - if (master_setup) - dsa_master_teardown(lag_dev); +out_conduit_teardown: + if (conduit_setup) + dsa_conduit_teardown(lag_dev); return err; } =20 -/* Tear down a master if there isn't any other user port on it, +/* Tear down a conduit if there isn't any other user port on it, * optionally also destroying LAG information. */ -void dsa_master_lag_teardown(struct net_device *lag_dev, +void dsa_conduit_lag_teardown(struct net_device *lag_dev, struct dsa_port *cpu_dp) { struct net_device *upper; @@ -468,8 +468,8 @@ void dsa_master_lag_teardown(struct net_device *lag_dev, dsa_port_lag_leave(cpu_dp, lag_dev); =20 netdev_for_each_upper_dev_rcu(lag_dev, upper, iter) - if (dsa_slave_dev_check(upper)) + if (dsa_user_dev_check(upper)) return; =20 - dsa_master_teardown(lag_dev); + dsa_conduit_teardown(lag_dev); } diff --git a/net/dsa/conduit.h b/net/dsa/conduit.h new file mode 100644 index 000000000000..1f4d12596dd2 --- /dev/null +++ b/net/dsa/conduit.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef __DSA_CONDUIT_H +#define __DSA_CONDUIT_H + +struct dsa_port; +struct net_device; +struct netdev_lag_upper_info; +struct netlink_ext_ack; + +int dsa_conduit_setup(struct net_device *dev, struct dsa_port *cpu_dp); +void dsa_conduit_teardown(struct net_device *dev); +int dsa_conduit_lag_setup(struct net_device *lag_dev, struct dsa_port *cpu= _dp, + struct netdev_lag_upper_info *uinfo, + struct netlink_ext_ack *extack); +void dsa_conduit_lag_teardown(struct net_device *lag_dev, + struct dsa_port *cpu_dp); +int __dsa_conduit_hwtstamp_validate(struct net_device *dev, + const struct kernel_hwtstamp_config *config, + struct netlink_ext_ack *extack); + +#endif diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index ccbdb98109f8..3ecad0ffa192 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -22,10 +22,10 @@ =20 #include "devlink.h" #include "dsa.h" -#include "master.h" +#include "conduit.h" #include "netlink.h" #include "port.h" -#include "slave.h" +#include "user.h" #include "switch.h" #include "tag.h" =20 @@ -365,18 +365,18 @@ static struct dsa_port *dsa_tree_find_first_cpu(struc= t dsa_switch_tree *dst) return NULL; } =20 -struct net_device *dsa_tree_find_first_master(struct dsa_switch_tree *dst) +struct net_device *dsa_tree_find_first_conduit(struct dsa_switch_tree *dst) { struct device_node *ethernet; - struct net_device *master; + struct net_device *conduit; struct dsa_port *cpu_dp; =20 cpu_dp =3D dsa_tree_find_first_cpu(dst); ethernet =3D of_parse_phandle(cpu_dp->dn, "ethernet", 0); - master =3D of_find_net_device_by_node(ethernet); + conduit =3D of_find_net_device_by_node(ethernet); of_node_put(ethernet); =20 - return master; + return conduit; } =20 /* Assign the default CPU port (the first one in the tree) to all ports of= the @@ -517,7 +517,7 @@ static int dsa_port_setup(struct dsa_port *dp) break; case DSA_PORT_TYPE_USER: of_get_mac_address(dp->dn, dp->mac); - err =3D dsa_slave_create(dp); + err =3D dsa_user_create(dp); break; } =20 @@ -554,9 +554,9 @@ static void dsa_port_teardown(struct dsa_port *dp) dsa_shared_port_link_unregister_of(dp); break; case DSA_PORT_TYPE_USER: - if (dp->slave) { - dsa_slave_destroy(dp->slave); - dp->slave =3D NULL; + if (dp->user) { + dsa_user_destroy(dp->user); + dp->user =3D NULL; } break; } @@ -632,9 +632,9 @@ static int dsa_switch_setup(struct dsa_switch *ds) if (ds->setup) return 0; =20 - /* Initialize ds->phys_mii_mask before registering the slave MDIO bus + /* Initialize ds->phys_mii_mask before registering the user MDIO bus * driver and before ops->setup() has run, since the switch drivers and - * the slave MDIO bus driver rely on these values for probing PHY + * the user MDIO bus driver rely on these values for probing PHY * devices or not */ ds->phys_mii_mask |=3D dsa_user_ports(ds); @@ -657,21 +657,21 @@ static int dsa_switch_setup(struct dsa_switch *ds) if (err) goto teardown; =20 - if (!ds->slave_mii_bus && ds->ops->phy_read) { - ds->slave_mii_bus =3D mdiobus_alloc(); - if (!ds->slave_mii_bus) { + if (!ds->user_mii_bus && ds->ops->phy_read) { + ds->user_mii_bus =3D mdiobus_alloc(); + if (!ds->user_mii_bus) { err =3D -ENOMEM; goto teardown; } =20 - dsa_slave_mii_bus_init(ds); + dsa_user_mii_bus_init(ds); =20 dn =3D of_get_child_by_name(ds->dev->of_node, "mdio"); =20 - err =3D of_mdiobus_register(ds->slave_mii_bus, dn); + err =3D of_mdiobus_register(ds->user_mii_bus, dn); of_node_put(dn); if (err < 0) - goto free_slave_mii_bus; + goto free_user_mii_bus; } =20 dsa_switch_devlink_register(ds); @@ -679,9 +679,9 @@ static int dsa_switch_setup(struct dsa_switch *ds) ds->setup =3D true; return 0; =20 -free_slave_mii_bus: - if (ds->slave_mii_bus && ds->ops->phy_read) - mdiobus_free(ds->slave_mii_bus); +free_user_mii_bus: + if (ds->user_mii_bus && ds->ops->phy_read) + mdiobus_free(ds->user_mii_bus); teardown: if (ds->ops->teardown) ds->ops->teardown(ds); @@ -699,10 +699,10 @@ static void dsa_switch_teardown(struct dsa_switch *ds) =20 dsa_switch_devlink_unregister(ds); =20 - if (ds->slave_mii_bus && ds->ops->phy_read) { - mdiobus_unregister(ds->slave_mii_bus); - mdiobus_free(ds->slave_mii_bus); - ds->slave_mii_bus =3D NULL; + if (ds->user_mii_bus && ds->ops->phy_read) { + mdiobus_unregister(ds->user_mii_bus); + mdiobus_free(ds->user_mii_bus); + ds->user_mii_bus =3D NULL; } =20 dsa_switch_teardown_tag_protocol(ds); @@ -793,7 +793,7 @@ static int dsa_tree_setup_switches(struct dsa_switch_tr= ee *dst) return err; } =20 -static int dsa_tree_setup_master(struct dsa_switch_tree *dst) +static int dsa_tree_setup_conduit(struct dsa_switch_tree *dst) { struct dsa_port *cpu_dp; int err =3D 0; @@ -801,18 +801,18 @@ static int dsa_tree_setup_master(struct dsa_switch_tr= ee *dst) rtnl_lock(); =20 dsa_tree_for_each_cpu_port(cpu_dp, dst) { - struct net_device *master =3D cpu_dp->master; - bool admin_up =3D (master->flags & IFF_UP) && - !qdisc_tx_is_noop(master); + struct net_device *conduit =3D cpu_dp->conduit; + bool admin_up =3D (conduit->flags & IFF_UP) && + !qdisc_tx_is_noop(conduit); =20 - err =3D dsa_master_setup(master, cpu_dp); + err =3D dsa_conduit_setup(conduit, cpu_dp); if (err) break; =20 - /* Replay master state event */ - dsa_tree_master_admin_state_change(dst, master, admin_up); - dsa_tree_master_oper_state_change(dst, master, - netif_oper_up(master)); + /* Replay conduit state event */ + dsa_tree_conduit_admin_state_change(dst, conduit, admin_up); + dsa_tree_conduit_oper_state_change(dst, conduit, + netif_oper_up(conduit)); } =20 rtnl_unlock(); @@ -820,22 +820,22 @@ static int dsa_tree_setup_master(struct dsa_switch_tr= ee *dst) return err; } =20 -static void dsa_tree_teardown_master(struct dsa_switch_tree *dst) +static void dsa_tree_teardown_conduit(struct dsa_switch_tree *dst) { struct dsa_port *cpu_dp; =20 rtnl_lock(); =20 dsa_tree_for_each_cpu_port(cpu_dp, dst) { - struct net_device *master =3D cpu_dp->master; + struct net_device *conduit =3D cpu_dp->conduit; =20 /* Synthesizing an "admin down" state is sufficient for - * the switches to get a notification if the master is + * the switches to get a notification if the conduit is * currently up and running. */ - dsa_tree_master_admin_state_change(dst, master, false); + dsa_tree_conduit_admin_state_change(dst, conduit, false); =20 - dsa_master_teardown(master); + dsa_conduit_teardown(conduit); } =20 rtnl_unlock(); @@ -894,13 +894,13 @@ static int dsa_tree_setup(struct dsa_switch_tree *dst) if (err) goto teardown_switches; =20 - err =3D dsa_tree_setup_master(dst); + err =3D dsa_tree_setup_conduit(dst); if (err) goto teardown_ports; =20 err =3D dsa_tree_setup_lags(dst); if (err) - goto teardown_master; + goto teardown_conduit; =20 dst->setup =3D true; =20 @@ -908,8 +908,8 @@ static int dsa_tree_setup(struct dsa_switch_tree *dst) =20 return 0; =20 -teardown_master: - dsa_tree_teardown_master(dst); +teardown_conduit: + dsa_tree_teardown_conduit(dst); teardown_ports: dsa_tree_teardown_ports(dst); teardown_switches: @@ -929,7 +929,7 @@ static void dsa_tree_teardown(struct dsa_switch_tree *d= st) =20 dsa_tree_teardown_lags(dst); =20 - dsa_tree_teardown_master(dst); + dsa_tree_teardown_conduit(dst); =20 dsa_tree_teardown_ports(dst); =20 @@ -978,7 +978,7 @@ static int dsa_tree_bind_tag_proto(struct dsa_switch_tr= ee *dst, return err; } =20 -/* Since the dsa/tagging sysfs device attribute is per master, the assumpt= ion +/* Since the dsa/tagging sysfs device attribute is per conduit, the assump= tion * is that all DSA switches within a tree share the same tagger, otherwise * they would have formed disjoint trees (different "dsa,member" values). */ @@ -999,10 +999,10 @@ int dsa_tree_change_tag_proto(struct dsa_switch_tree = *dst, * restriction, there needs to be another mutex which serializes this. */ dsa_tree_for_each_user_port(dp, dst) { - if (dsa_port_to_master(dp)->flags & IFF_UP) + if (dsa_port_to_conduit(dp)->flags & IFF_UP) goto out_unlock; =20 - if (dp->slave->flags & IFF_UP) + if (dp->user->flags & IFF_UP) goto out_unlock; } =20 @@ -1028,62 +1028,62 @@ int dsa_tree_change_tag_proto(struct dsa_switch_tre= e *dst, return err; } =20 -static void dsa_tree_master_state_change(struct dsa_switch_tree *dst, - struct net_device *master) +static void dsa_tree_conduit_state_change(struct dsa_switch_tree *dst, + struct net_device *conduit) { - struct dsa_notifier_master_state_info info; - struct dsa_port *cpu_dp =3D master->dsa_ptr; + struct dsa_notifier_conduit_state_info info; + struct dsa_port *cpu_dp =3D conduit->dsa_ptr; =20 - info.master =3D master; - info.operational =3D dsa_port_master_is_operational(cpu_dp); + info.conduit =3D conduit; + info.operational =3D dsa_port_conduit_is_operational(cpu_dp); =20 dsa_tree_notify(dst, DSA_NOTIFIER_MASTER_STATE_CHANGE, &info); } =20 -void dsa_tree_master_admin_state_change(struct dsa_switch_tree *dst, - struct net_device *master, +void dsa_tree_conduit_admin_state_change(struct dsa_switch_tree *dst, + struct net_device *conduit, bool up) { - struct dsa_port *cpu_dp =3D master->dsa_ptr; + struct dsa_port *cpu_dp =3D conduit->dsa_ptr; bool notify =3D false; =20 - /* Don't keep track of admin state on LAG DSA masters, - * but rather just of physical DSA masters + /* Don't keep track of admin state on LAG DSA conduits, + * but rather just of physical DSA conduits */ - if (netif_is_lag_master(master)) + if (netif_is_lag_master(conduit)) return; =20 - if ((dsa_port_master_is_operational(cpu_dp)) !=3D - (up && cpu_dp->master_oper_up)) + if ((dsa_port_conduit_is_operational(cpu_dp)) !=3D + (up && cpu_dp->conduit_oper_up)) notify =3D true; =20 - cpu_dp->master_admin_up =3D up; + cpu_dp->conduit_admin_up =3D up; =20 if (notify) - dsa_tree_master_state_change(dst, master); + dsa_tree_conduit_state_change(dst, conduit); } =20 -void dsa_tree_master_oper_state_change(struct dsa_switch_tree *dst, - struct net_device *master, +void dsa_tree_conduit_oper_state_change(struct dsa_switch_tree *dst, + struct net_device *conduit, bool up) { - struct dsa_port *cpu_dp =3D master->dsa_ptr; + struct dsa_port *cpu_dp =3D conduit->dsa_ptr; bool notify =3D false; =20 - /* Don't keep track of oper state on LAG DSA masters, - * but rather just of physical DSA masters + /* Don't keep track of oper state on LAG DSA conduits, + * but rather just of physical DSA conduits */ - if (netif_is_lag_master(master)) + if (netif_is_lag_master(conduit)) return; =20 - if ((dsa_port_master_is_operational(cpu_dp)) !=3D - (cpu_dp->master_admin_up && up)) + if ((dsa_port_conduit_is_operational(cpu_dp)) !=3D + (cpu_dp->conduit_admin_up && up)) notify =3D true; =20 - cpu_dp->master_oper_up =3D up; + cpu_dp->conduit_oper_up =3D up; =20 if (notify) - dsa_tree_master_state_change(dst, master); + dsa_tree_conduit_state_change(dst, conduit); } =20 static struct dsa_port *dsa_port_touch(struct dsa_switch *ds, int index) @@ -1129,7 +1129,7 @@ static int dsa_port_parse_dsa(struct dsa_port *dp) } =20 static enum dsa_tag_protocol dsa_get_tag_protocol(struct dsa_port *dp, - struct net_device *master) + struct net_device *conduit) { enum dsa_tag_protocol tag_protocol =3D DSA_TAG_PROTO_NONE; struct dsa_switch *mds, *ds =3D dp->ds; @@ -1140,21 +1140,21 @@ static enum dsa_tag_protocol dsa_get_tag_protocol(s= truct dsa_port *dp, * happens the switch driver may want to know if its tagging protocol * is going to work in such a configuration. */ - if (dsa_slave_dev_check(master)) { - mdp =3D dsa_slave_to_port(master); + if (dsa_user_dev_check(conduit)) { + mdp =3D dsa_user_to_port(conduit); mds =3D mdp->ds; mdp_upstream =3D dsa_upstream_port(mds, mdp->index); tag_protocol =3D mds->ops->get_tag_protocol(mds, mdp_upstream, DSA_TAG_PROTO_NONE); } =20 - /* If the master device is not itself a DSA slave in a disjoint DSA + /* If the conduit device is not itself a DSA user in a disjoint DSA * tree, then return immediately. */ return ds->ops->get_tag_protocol(ds, dp->index, tag_protocol); } =20 -static int dsa_port_parse_cpu(struct dsa_port *dp, struct net_device *mast= er, +static int dsa_port_parse_cpu(struct dsa_port *dp, struct net_device *cond= uit, const char *user_protocol) { const struct dsa_device_ops *tag_ops =3D NULL; @@ -1163,7 +1163,7 @@ static int dsa_port_parse_cpu(struct dsa_port *dp, st= ruct net_device *master, enum dsa_tag_protocol default_proto; =20 /* Find out which protocol the switch would prefer. */ - default_proto =3D dsa_get_tag_protocol(dp, master); + default_proto =3D dsa_get_tag_protocol(dp, conduit); if (dst->default_proto) { if (dst->default_proto !=3D default_proto) { dev_err(ds->dev, @@ -1218,7 +1218,7 @@ static int dsa_port_parse_cpu(struct dsa_port *dp, st= ruct net_device *master, dst->tag_ops =3D tag_ops; } =20 - dp->master =3D master; + dp->conduit =3D conduit; dp->type =3D DSA_PORT_TYPE_CPU; dsa_port_set_tag_protocol(dp, dst->tag_ops); dp->dst =3D dst; @@ -1248,16 +1248,16 @@ static int dsa_port_parse_of(struct dsa_port *dp, s= truct device_node *dn) dp->dn =3D dn; =20 if (ethernet) { - struct net_device *master; + struct net_device *conduit; const char *user_protocol; =20 - master =3D of_find_net_device_by_node(ethernet); + conduit =3D of_find_net_device_by_node(ethernet); of_node_put(ethernet); - if (!master) + if (!conduit) return -EPROBE_DEFER; =20 user_protocol =3D of_get_property(dn, "dsa-tag-protocol", NULL); - return dsa_port_parse_cpu(dp, master, user_protocol); + return dsa_port_parse_cpu(dp, conduit, user_protocol); } =20 if (link) @@ -1412,15 +1412,15 @@ static int dsa_port_parse(struct dsa_port *dp, cons= t char *name, struct device *dev) { if (!strcmp(name, "cpu")) { - struct net_device *master; + struct net_device *conduit; =20 - master =3D dsa_dev_to_net_device(dev); - if (!master) + conduit =3D dsa_dev_to_net_device(dev); + if (!conduit) return -EPROBE_DEFER; =20 - dev_put(master); + dev_put(conduit); =20 - return dsa_port_parse_cpu(dp, master, NULL); + return dsa_port_parse_cpu(dp, conduit, NULL); } =20 if (!strcmp(name, "dsa")) @@ -1566,14 +1566,14 @@ void dsa_unregister_switch(struct dsa_switch *ds) } EXPORT_SYMBOL_GPL(dsa_unregister_switch); =20 -/* If the DSA master chooses to unregister its net_device on .shutdown, DS= A is +/* If the DSA conduit chooses to unregister its net_device on .shutdown, D= SA is * blocking that operation from completion, due to the dev_hold taken insi= de - * netdev_upper_dev_link. Unlink the DSA slave interfaces from being upper= s of - * the DSA master, so that the system can reboot successfully. + * netdev_upper_dev_link. Unlink the DSA user interfaces from being uppers= of + * the DSA conduit, so that the system can reboot successfully. */ void dsa_switch_shutdown(struct dsa_switch *ds) { - struct net_device *master, *slave_dev; + struct net_device *conduit, *user_dev; struct dsa_port *dp; =20 mutex_lock(&dsa2_mutex); @@ -1584,17 +1584,17 @@ void dsa_switch_shutdown(struct dsa_switch *ds) rtnl_lock(); =20 dsa_switch_for_each_user_port(dp, ds) { - master =3D dsa_port_to_master(dp); - slave_dev =3D dp->slave; + conduit =3D dsa_port_to_conduit(dp); + user_dev =3D dp->user; =20 - netdev_upper_dev_unlink(master, slave_dev); + netdev_upper_dev_unlink(conduit, user_dev); } =20 - /* Disconnect from further netdevice notifiers on the master, + /* Disconnect from further netdevice notifiers on the conduit, * since netdev_uses_dsa() will now return false. */ dsa_switch_for_each_cpu_port(dp, ds) - dp->master->dsa_ptr =3D NULL; + dp->conduit->dsa_ptr =3D NULL; =20 rtnl_unlock(); out: @@ -1605,7 +1605,7 @@ EXPORT_SYMBOL_GPL(dsa_switch_shutdown); #ifdef CONFIG_PM_SLEEP static bool dsa_port_is_initialized(const struct dsa_port *dp) { - return dp->type =3D=3D DSA_PORT_TYPE_USER && dp->slave; + return dp->type =3D=3D DSA_PORT_TYPE_USER && dp->user; } =20 int dsa_switch_suspend(struct dsa_switch *ds) @@ -1613,12 +1613,12 @@ int dsa_switch_suspend(struct dsa_switch *ds) struct dsa_port *dp; int ret =3D 0; =20 - /* Suspend slave network devices */ + /* Suspend user network devices */ dsa_switch_for_each_port(dp, ds) { if (!dsa_port_is_initialized(dp)) continue; =20 - ret =3D dsa_slave_suspend(dp->slave); + ret =3D dsa_user_suspend(dp->user); if (ret) return ret; } @@ -1641,12 +1641,12 @@ int dsa_switch_resume(struct dsa_switch *ds) if (ret) return ret; =20 - /* Resume slave network devices */ + /* Resume user network devices */ dsa_switch_for_each_port(dp, ds) { if (!dsa_port_is_initialized(dp)) continue; =20 - ret =3D dsa_slave_resume(dp->slave); + ret =3D dsa_user_resume(dp->user); if (ret) return ret; } @@ -1658,10 +1658,10 @@ EXPORT_SYMBOL_GPL(dsa_switch_resume); =20 struct dsa_port *dsa_port_from_netdev(struct net_device *netdev) { - if (!netdev || !dsa_slave_dev_check(netdev)) + if (!netdev || !dsa_user_dev_check(netdev)) return ERR_PTR(-ENODEV); =20 - return dsa_slave_to_port(netdev); + return dsa_user_to_port(netdev); } EXPORT_SYMBOL_GPL(dsa_port_from_netdev); =20 @@ -1726,7 +1726,7 @@ bool dsa_mdb_present_in_other_db(struct dsa_switch *d= s, int port, EXPORT_SYMBOL_GPL(dsa_mdb_present_in_other_db); =20 static const struct dsa_stubs __dsa_stubs =3D { - .master_hwtstamp_validate =3D __dsa_master_hwtstamp_validate, + .conduit_hwtstamp_validate =3D __dsa_conduit_hwtstamp_validate, }; =20 static void dsa_register_stubs(void) @@ -1748,7 +1748,7 @@ static int __init dsa_init_module(void) if (!dsa_owq) return -ENOMEM; =20 - rc =3D dsa_slave_register_notifier(); + rc =3D dsa_user_register_notifier(); if (rc) goto register_notifier_fail; =20 @@ -1763,7 +1763,7 @@ static int __init dsa_init_module(void) return 0; =20 netlink_register_fail: - dsa_slave_unregister_notifier(); + dsa_user_unregister_notifier(); dev_remove_pack(&dsa_pack_type); register_notifier_fail: destroy_workqueue(dsa_owq); @@ -1778,7 +1778,7 @@ static void __exit dsa_cleanup_module(void) =20 rtnl_link_unregister(&dsa_link_ops); =20 - dsa_slave_unregister_notifier(); + dsa_user_unregister_notifier(); dev_remove_pack(&dsa_pack_type); destroy_workqueue(dsa_owq); } diff --git a/net/dsa/dsa.h b/net/dsa/dsa.h index b7e17ae1094d..07b1b7f0d470 100644 --- a/net/dsa/dsa.h +++ b/net/dsa/dsa.h @@ -21,15 +21,15 @@ void dsa_lag_map(struct dsa_switch_tree *dst, struct ds= a_lag *lag); void dsa_lag_unmap(struct dsa_switch_tree *dst, struct dsa_lag *lag); struct dsa_lag *dsa_tree_lag_find(struct dsa_switch_tree *dst, const struct net_device *lag_dev); -struct net_device *dsa_tree_find_first_master(struct dsa_switch_tree *dst); +struct net_device *dsa_tree_find_first_conduit(struct dsa_switch_tree *dst= ); int dsa_tree_change_tag_proto(struct dsa_switch_tree *dst, const struct dsa_device_ops *tag_ops, const struct dsa_device_ops *old_tag_ops); -void dsa_tree_master_admin_state_change(struct dsa_switch_tree *dst, - struct net_device *master, +void dsa_tree_conduit_admin_state_change(struct dsa_switch_tree *dst, + struct net_device *conduit, bool up); -void dsa_tree_master_oper_state_change(struct dsa_switch_tree *dst, - struct net_device *master, +void dsa_tree_conduit_oper_state_change(struct dsa_switch_tree *dst, + struct net_device *conduit, bool up); unsigned int dsa_bridge_num_get(const struct net_device *bridge_dev, int m= ax); void dsa_bridge_num_put(const struct net_device *bridge_dev, diff --git a/net/dsa/master.h b/net/dsa/master.h deleted file mode 100644 index 76e39d3ec909..000000000000 --- a/net/dsa/master.h +++ /dev/null @@ -1,22 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#ifndef __DSA_MASTER_H -#define __DSA_MASTER_H - -struct dsa_port; -struct net_device; -struct netdev_lag_upper_info; -struct netlink_ext_ack; - -int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp); -void dsa_master_teardown(struct net_device *dev); -int dsa_master_lag_setup(struct net_device *lag_dev, struct dsa_port *cpu_= dp, - struct netdev_lag_upper_info *uinfo, - struct netlink_ext_ack *extack); -void dsa_master_lag_teardown(struct net_device *lag_dev, - struct dsa_port *cpu_dp); -int __dsa_master_hwtstamp_validate(struct net_device *dev, - const struct kernel_hwtstamp_config *config, - struct netlink_ext_ack *extack); - -#endif diff --git a/net/dsa/netlink.c b/net/dsa/netlink.c index bd4bbaf851de..f56f90a25b99 100644 --- a/net/dsa/netlink.c +++ b/net/dsa/netlink.c @@ -5,7 +5,7 @@ #include =20 #include "netlink.h" -#include "slave.h" +#include "user.h" =20 static const struct nla_policy dsa_policy[IFLA_DSA_MAX + 1] =3D { [IFLA_DSA_MASTER] =3D { .type =3D NLA_U32 }, @@ -22,13 +22,13 @@ static int dsa_changelink(struct net_device *dev, struc= t nlattr *tb[], =20 if (data[IFLA_DSA_MASTER]) { u32 ifindex =3D nla_get_u32(data[IFLA_DSA_MASTER]); - struct net_device *master; + struct net_device *conduit; =20 - master =3D __dev_get_by_index(dev_net(dev), ifindex); - if (!master) + conduit =3D __dev_get_by_index(dev_net(dev), ifindex); + if (!conduit) return -EINVAL; =20 - err =3D dsa_slave_change_master(dev, master, extack); + err =3D dsa_user_change_conduit(dev, conduit, extack); if (err) return err; } @@ -44,9 +44,9 @@ static size_t dsa_get_size(const struct net_device *dev) =20 static int dsa_fill_info(struct sk_buff *skb, const struct net_device *dev) { - struct net_device *master =3D dsa_slave_to_master(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); =20 - if (nla_put_u32(skb, IFLA_DSA_MASTER, master->ifindex)) + if (nla_put_u32(skb, IFLA_DSA_MASTER, conduit->ifindex)) return -EMSGSIZE; =20 return 0; diff --git a/net/dsa/port.c b/net/dsa/port.c index 5f01bd4f9dec..de71f4d1f3e7 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -14,7 +14,7 @@ =20 #include "dsa.h" #include "port.h" -#include "slave.h" +#include "user.h" #include "switch.h" #include "tag_8021q.h" =20 @@ -289,7 +289,7 @@ static void dsa_port_reset_vlan_filtering(struct dsa_po= rt *dp, } =20 /* If the bridge was vlan_filtering, the bridge core doesn't trigger an - * event for changing vlan_filtering setting upon slave ports leaving + * event for changing vlan_filtering setting upon user ports leaving * it. That is a good thing, because that lets us handle it and also * handle the case where the switch's vlan_filtering setting is global * (not per port). When that happens, the correct moment to trigger the @@ -489,7 +489,7 @@ int dsa_port_bridge_join(struct dsa_port *dp, struct ne= t_device *br, .dp =3D dp, .extack =3D extack, }; - struct net_device *dev =3D dp->slave; + struct net_device *dev =3D dp->user; struct net_device *brport_dev; int err; =20 @@ -514,8 +514,8 @@ int dsa_port_bridge_join(struct dsa_port *dp, struct ne= t_device *br, dp->bridge->tx_fwd_offload =3D info.tx_fwd_offload; =20 err =3D switchdev_bridge_port_offload(brport_dev, dev, dp, - &dsa_slave_switchdev_notifier, - &dsa_slave_switchdev_blocking_notifier, + &dsa_user_switchdev_notifier, + &dsa_user_switchdev_blocking_notifier, dp->bridge->tx_fwd_offload, extack); if (err) goto out_rollback_unbridge; @@ -528,8 +528,8 @@ int dsa_port_bridge_join(struct dsa_port *dp, struct ne= t_device *br, =20 out_rollback_unoffload: switchdev_bridge_port_unoffload(brport_dev, dp, - &dsa_slave_switchdev_notifier, - &dsa_slave_switchdev_blocking_notifier); + &dsa_user_switchdev_notifier, + &dsa_user_switchdev_blocking_notifier); dsa_flush_workqueue(); out_rollback_unbridge: dsa_broadcast(DSA_NOTIFIER_BRIDGE_LEAVE, &info); @@ -547,8 +547,8 @@ void dsa_port_pre_bridge_leave(struct dsa_port *dp, str= uct net_device *br) return; =20 switchdev_bridge_port_unoffload(brport_dev, dp, - &dsa_slave_switchdev_notifier, - &dsa_slave_switchdev_blocking_notifier); + &dsa_user_switchdev_notifier, + &dsa_user_switchdev_blocking_notifier); =20 dsa_flush_workqueue(); } @@ -741,10 +741,10 @@ static bool dsa_port_can_apply_vlan_filtering(struct = dsa_port *dp, */ if (vlan_filtering && dsa_port_is_user(dp)) { struct net_device *br =3D dsa_port_bridge_dev_get(dp); - struct net_device *upper_dev, *slave =3D dp->slave; + struct net_device *upper_dev, *user =3D dp->user; struct list_head *iter; =20 - netdev_for_each_upper_dev_rcu(slave, upper_dev, iter) { + netdev_for_each_upper_dev_rcu(user, upper_dev, iter) { struct bridge_vlan_info br_info; u16 vid; =20 @@ -803,9 +803,9 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool v= lan_filtering, if (!ds->ops->port_vlan_filtering) return -EOPNOTSUPP; =20 - /* We are called from dsa_slave_switchdev_blocking_event(), + /* We are called from dsa_user_switchdev_blocking_event(), * which is not under rcu_read_lock(), unlike - * dsa_slave_switchdev_event(). + * dsa_user_switchdev_event(). */ rcu_read_lock(); apply =3D dsa_port_can_apply_vlan_filtering(dp, vlan_filtering, extack); @@ -827,15 +827,15 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool= vlan_filtering, ds->vlan_filtering =3D vlan_filtering; =20 dsa_switch_for_each_user_port(other_dp, ds) { - struct net_device *slave =3D other_dp->slave; + struct net_device *user =3D other_dp->user; =20 /* We might be called in the unbind path, so not - * all slave devices might still be registered. + * all user devices might still be registered. */ - if (!slave) + if (!user) continue; =20 - err =3D dsa_slave_manage_vlan_filtering(slave, + err =3D dsa_user_manage_vlan_filtering(user, vlan_filtering); if (err) goto restore; @@ -843,7 +843,7 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool v= lan_filtering, } else { dp->vlan_filtering =3D vlan_filtering; =20 - err =3D dsa_slave_manage_vlan_filtering(dp->slave, + err =3D dsa_user_manage_vlan_filtering(dp->user, vlan_filtering); if (err) goto restore; @@ -863,7 +863,7 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool v= lan_filtering, } =20 /* This enforces legacy behavior for switch drivers which assume they can't - * receive VLAN configuration when enslaved to a bridge with vlan_filterin= g=3D0 + * receive VLAN configuration when enuserd to a bridge with vlan_filtering= =3D0 */ bool dsa_port_skip_vlan_configuration(struct dsa_port *dp) { @@ -1047,7 +1047,7 @@ int dsa_port_standalone_host_fdb_add(struct dsa_port = *dp, int dsa_port_bridge_host_fdb_add(struct dsa_port *dp, const unsigned char *addr, u16 vid) { - struct net_device *master =3D dsa_port_to_master(dp); + struct net_device *conduit =3D dsa_port_to_conduit(dp); struct dsa_db db =3D { .type =3D DSA_DB_BRIDGE, .bridge =3D *dp->bridge, @@ -1057,12 +1057,12 @@ int dsa_port_bridge_host_fdb_add(struct dsa_port *d= p, if (!dp->ds->fdb_isolation) db.bridge.num =3D 0; =20 - /* Avoid a call to __dev_set_promiscuity() on the master, which + /* Avoid a call to __dev_set_promiscuity() on the conduit, which * requires rtnl_lock(), since we can't guarantee that is held here, * and we can't take it either. */ - if (master->priv_flags & IFF_UNICAST_FLT) { - err =3D dev_uc_add(master, addr); + if (conduit->priv_flags & IFF_UNICAST_FLT) { + err =3D dev_uc_add(conduit, addr); if (err) return err; } @@ -1098,7 +1098,7 @@ int dsa_port_standalone_host_fdb_del(struct dsa_port = *dp, int dsa_port_bridge_host_fdb_del(struct dsa_port *dp, const unsigned char *addr, u16 vid) { - struct net_device *master =3D dsa_port_to_master(dp); + struct net_device *conduit =3D dsa_port_to_conduit(dp); struct dsa_db db =3D { .type =3D DSA_DB_BRIDGE, .bridge =3D *dp->bridge, @@ -1108,8 +1108,8 @@ int dsa_port_bridge_host_fdb_del(struct dsa_port *dp, if (!dp->ds->fdb_isolation) db.bridge.num =3D 0; =20 - if (master->priv_flags & IFF_UNICAST_FLT) { - err =3D dev_uc_del(master, addr); + if (conduit->priv_flags & IFF_UNICAST_FLT) { + err =3D dev_uc_del(conduit, addr); if (err) return err; } @@ -1229,7 +1229,7 @@ int dsa_port_standalone_host_mdb_add(const struct dsa= _port *dp, int dsa_port_bridge_host_mdb_add(const struct dsa_port *dp, const struct switchdev_obj_port_mdb *mdb) { - struct net_device *master =3D dsa_port_to_master(dp); + struct net_device *conduit =3D dsa_port_to_conduit(dp); struct dsa_db db =3D { .type =3D DSA_DB_BRIDGE, .bridge =3D *dp->bridge, @@ -1239,7 +1239,7 @@ int dsa_port_bridge_host_mdb_add(const struct dsa_por= t *dp, if (!dp->ds->fdb_isolation) db.bridge.num =3D 0; =20 - err =3D dev_mc_add(master, mdb->addr); + err =3D dev_mc_add(conduit, mdb->addr); if (err) return err; =20 @@ -1273,7 +1273,7 @@ int dsa_port_standalone_host_mdb_del(const struct dsa= _port *dp, int dsa_port_bridge_host_mdb_del(const struct dsa_port *dp, const struct switchdev_obj_port_mdb *mdb) { - struct net_device *master =3D dsa_port_to_master(dp); + struct net_device *conduit =3D dsa_port_to_conduit(dp); struct dsa_db db =3D { .type =3D DSA_DB_BRIDGE, .bridge =3D *dp->bridge, @@ -1283,7 +1283,7 @@ int dsa_port_bridge_host_mdb_del(const struct dsa_por= t *dp, if (!dp->ds->fdb_isolation) db.bridge.num =3D 0; =20 - err =3D dev_mc_del(master, mdb->addr); + err =3D dev_mc_del(conduit, mdb->addr); if (err) return err; =20 @@ -1318,7 +1318,7 @@ int dsa_port_host_vlan_add(struct dsa_port *dp, const struct switchdev_obj_port_vlan *vlan, struct netlink_ext_ack *extack) { - struct net_device *master =3D dsa_port_to_master(dp); + struct net_device *conduit =3D dsa_port_to_conduit(dp); struct dsa_notifier_vlan_info info =3D { .dp =3D dp, .vlan =3D vlan, @@ -1330,7 +1330,7 @@ int dsa_port_host_vlan_add(struct dsa_port *dp, if (err && err !=3D -EOPNOTSUPP) return err; =20 - vlan_vid_add(master, htons(ETH_P_8021Q), vlan->vid); + vlan_vid_add(conduit, htons(ETH_P_8021Q), vlan->vid); =20 return err; } @@ -1338,7 +1338,7 @@ int dsa_port_host_vlan_add(struct dsa_port *dp, int dsa_port_host_vlan_del(struct dsa_port *dp, const struct switchdev_obj_port_vlan *vlan) { - struct net_device *master =3D dsa_port_to_master(dp); + struct net_device *conduit =3D dsa_port_to_conduit(dp); struct dsa_notifier_vlan_info info =3D { .dp =3D dp, .vlan =3D vlan, @@ -1349,7 +1349,7 @@ int dsa_port_host_vlan_del(struct dsa_port *dp, if (err && err !=3D -EOPNOTSUPP) return err; =20 - vlan_vid_del(master, htons(ETH_P_8021Q), vlan->vid); + vlan_vid_del(conduit, htons(ETH_P_8021Q), vlan->vid); =20 return err; } @@ -1398,24 +1398,24 @@ int dsa_port_mrp_del_ring_role(const struct dsa_por= t *dp, return ds->ops->port_mrp_del_ring_role(ds, dp->index, mrp); } =20 -static int dsa_port_assign_master(struct dsa_port *dp, - struct net_device *master, +static int dsa_port_assign_conduit(struct dsa_port *dp, + struct net_device *conduit, struct netlink_ext_ack *extack, bool fail_on_err) { struct dsa_switch *ds =3D dp->ds; int port =3D dp->index, err; =20 - err =3D ds->ops->port_change_master(ds, port, master, extack); + err =3D ds->ops->port_change_conduit(ds, port, conduit, extack); if (err && !fail_on_err) - dev_err(ds->dev, "port %d failed to assign master %s: %pe\n", - port, master->name, ERR_PTR(err)); + dev_err(ds->dev, "port %d failed to assign conduit %s: %pe\n", + port, conduit->name, ERR_PTR(err)); =20 if (err && fail_on_err) return err; =20 - dp->cpu_dp =3D master->dsa_ptr; - dp->cpu_port_in_lag =3D netif_is_lag_master(master); + dp->cpu_dp =3D conduit->dsa_ptr; + dp->cpu_port_in_lag =3D netif_is_lag_master(conduit); =20 return 0; } @@ -1428,12 +1428,12 @@ static int dsa_port_assign_master(struct dsa_port *= dp, * the old CPU port before changing it, and restore it on errors during the * bringup of the new one. */ -int dsa_port_change_master(struct dsa_port *dp, struct net_device *master, +int dsa_port_change_conduit(struct dsa_port *dp, struct net_device *condui= t, struct netlink_ext_ack *extack) { struct net_device *bridge_dev =3D dsa_port_bridge_dev_get(dp); - struct net_device *old_master =3D dsa_port_to_master(dp); - struct net_device *dev =3D dp->slave; + struct net_device *old_conduit =3D dsa_port_to_conduit(dp); + struct net_device *dev =3D dp->user; struct dsa_switch *ds =3D dp->ds; bool vlan_filtering; int err, tmp; @@ -1454,7 +1454,7 @@ int dsa_port_change_master(struct dsa_port *dp, struc= t net_device *master, */ vlan_filtering =3D dsa_port_is_vlan_filtering(dp); if (vlan_filtering) { - err =3D dsa_slave_manage_vlan_filtering(dev, false); + err =3D dsa_user_manage_vlan_filtering(dev, false); if (err) { NL_SET_ERR_MSG_MOD(extack, "Failed to remove standalone VLANs"); @@ -1465,16 +1465,16 @@ int dsa_port_change_master(struct dsa_port *dp, str= uct net_device *master, /* Standalone addresses, and addresses of upper interfaces like * VLAN, LAG, HSR need to be migrated. */ - dsa_slave_unsync_ha(dev); + dsa_user_unsync_ha(dev); =20 - err =3D dsa_port_assign_master(dp, master, extack, true); + err =3D dsa_port_assign_conduit(dp, conduit, extack, true); if (err) goto rewind_old_addrs; =20 - dsa_slave_sync_ha(dev); + dsa_user_sync_ha(dev); =20 if (vlan_filtering) { - err =3D dsa_slave_manage_vlan_filtering(dev, true); + err =3D dsa_user_manage_vlan_filtering(dev, true); if (err) { NL_SET_ERR_MSG_MOD(extack, "Failed to restore standalone VLANs"); @@ -1495,19 +1495,19 @@ int dsa_port_change_master(struct dsa_port *dp, str= uct net_device *master, =20 rewind_new_vlan: if (vlan_filtering) - dsa_slave_manage_vlan_filtering(dev, false); + dsa_user_manage_vlan_filtering(dev, false); =20 rewind_new_addrs: - dsa_slave_unsync_ha(dev); + dsa_user_unsync_ha(dev); =20 - dsa_port_assign_master(dp, old_master, NULL, false); + dsa_port_assign_conduit(dp, old_conduit, NULL, false); =20 /* Restore the objects on the old CPU port */ rewind_old_addrs: - dsa_slave_sync_ha(dev); + dsa_user_sync_ha(dev); =20 if (vlan_filtering) { - tmp =3D dsa_slave_manage_vlan_filtering(dev, true); + tmp =3D dsa_user_manage_vlan_filtering(dev, true); if (tmp) { dev_err(ds->dev, "port %d failed to restore standalone VLANs: %pe\n", @@ -1634,7 +1634,7 @@ static void dsa_port_phylink_mac_link_down(struct phy= link_config *config, struct dsa_switch *ds =3D dp->ds; =20 if (dsa_port_is_user(dp)) - phydev =3D dp->slave->phydev; + phydev =3D dp->user->phydev; =20 if (!ds->ops->phylink_mac_link_down) { if (ds->ops->adjust_link && phydev) @@ -1823,7 +1823,7 @@ static int dsa_shared_port_phylink_register(struct ds= a_port *dp) * their type. * * User ports with no phy-handle or fixed-link are expected to connect to = an - * internal PHY located on the ds->slave_mii_bus at an MDIO address equal = to + * internal PHY located on the ds->user_mii_bus at an MDIO address equal to * the port number. This description is still actively supported. * * Shared (CPU and DSA) ports with no phy-handle or fixed-link are expecte= d to @@ -1844,7 +1844,7 @@ static int dsa_shared_port_phylink_register(struct ds= a_port *dp) * a fixed-link, a phy-handle, or a managed =3D "in-band-status" property. * It becomes the responsibility of the driver to ensure that these ports * operate at the maximum speed (whatever this means) and will interoperate - * with the DSA master or other cascade port, since phylink methods will n= ot be + * with the DSA conduit or other cascade port, since phylink methods will = not be * invoked for them. * * If you are considering expanding this table for newly introduced switch= es, diff --git a/net/dsa/port.h b/net/dsa/port.h index 334879964e2c..88d5a79d409e 100644 --- a/net/dsa/port.h +++ b/net/dsa/port.h @@ -109,7 +109,7 @@ void dsa_port_hsr_leave(struct dsa_port *dp, struct net= _device *hsr); int dsa_port_tag_8021q_vlan_add(struct dsa_port *dp, u16 vid, bool broadca= st); void dsa_port_tag_8021q_vlan_del(struct dsa_port *dp, u16 vid, bool broadc= ast); void dsa_port_set_host_flood(struct dsa_port *dp, bool uc, bool mc); -int dsa_port_change_master(struct dsa_port *dp, struct net_device *master, +int dsa_port_change_conduit(struct dsa_port *dp, struct net_device *condui= t, struct netlink_ext_ack *extack); =20 #endif diff --git a/net/dsa/slave.h b/net/dsa/slave.h deleted file mode 100644 index d0abe609e00d..000000000000 --- a/net/dsa/slave.h +++ /dev/null @@ -1,69 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#ifndef __DSA_SLAVE_H -#define __DSA_SLAVE_H - -#include -#include -#include -#include -#include -#include -#include - -struct net_device; -struct netlink_ext_ack; - -extern struct notifier_block dsa_slave_switchdev_notifier; -extern struct notifier_block dsa_slave_switchdev_blocking_notifier; - -struct dsa_slave_priv { - /* Copy of CPU port xmit for faster access in slave transmit hot path */ - struct sk_buff * (*xmit)(struct sk_buff *skb, - struct net_device *dev); - - struct gro_cells gcells; - - /* DSA port data, such as switch, port index, etc. */ - struct dsa_port *dp; - -#ifdef CONFIG_NET_POLL_CONTROLLER - struct netpoll *netpoll; -#endif - - /* TC context */ - struct list_head mall_tc_list; -}; - -void dsa_slave_mii_bus_init(struct dsa_switch *ds); -int dsa_slave_create(struct dsa_port *dp); -void dsa_slave_destroy(struct net_device *slave_dev); -int dsa_slave_suspend(struct net_device *slave_dev); -int dsa_slave_resume(struct net_device *slave_dev); -int dsa_slave_register_notifier(void); -void dsa_slave_unregister_notifier(void); -void dsa_slave_sync_ha(struct net_device *dev); -void dsa_slave_unsync_ha(struct net_device *dev); -void dsa_slave_setup_tagger(struct net_device *slave); -int dsa_slave_change_mtu(struct net_device *dev, int new_mtu); -int dsa_slave_change_master(struct net_device *dev, struct net_device *mas= ter, - struct netlink_ext_ack *extack); -int dsa_slave_manage_vlan_filtering(struct net_device *dev, - bool vlan_filtering); - -static inline struct dsa_port *dsa_slave_to_port(const struct net_device *= dev) -{ - struct dsa_slave_priv *p =3D netdev_priv(dev); - - return p->dp; -} - -static inline struct net_device * -dsa_slave_to_master(const struct net_device *dev) -{ - struct dsa_port *dp =3D dsa_slave_to_port(dev); - - return dsa_port_to_master(dp); -} - -#endif diff --git a/net/dsa/switch.c b/net/dsa/switch.c index 1a42f9317334..e05c6cc7c973 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -15,7 +15,7 @@ #include "dsa.h" #include "netlink.h" #include "port.h" -#include "slave.h" +#include "user.h" #include "switch.h" #include "tag_8021q.h" #include "trace.h" @@ -894,12 +894,12 @@ static int dsa_switch_change_tag_proto(struct dsa_swi= tch *ds, * bits that depend on the tagger, such as the MTU. */ dsa_switch_for_each_user_port(dp, ds) { - struct net_device *slave =3D dp->slave; + struct net_device *user =3D dp->user; =20 - dsa_slave_setup_tagger(slave); + dsa_user_setup_tagger(user); =20 /* rtnl_mutex is held in dsa_tree_change_tag_proto */ - dsa_slave_change_mtu(slave, slave->mtu); + dsa_user_change_mtu(user, user->mtu); } =20 return 0; @@ -960,13 +960,13 @@ dsa_switch_disconnect_tag_proto(struct dsa_switch *ds, } =20 static int -dsa_switch_master_state_change(struct dsa_switch *ds, - struct dsa_notifier_master_state_info *info) +dsa_switch_conduit_state_change(struct dsa_switch *ds, + struct dsa_notifier_conduit_state_info *info) { - if (!ds->ops->master_state_change) + if (!ds->ops->conduit_state_change) return 0; =20 - ds->ops->master_state_change(ds, info->master, info->operational); + ds->ops->conduit_state_change(ds, info->conduit, info->operational); =20 return 0; } @@ -1057,7 +1057,7 @@ static int dsa_switch_event(struct notifier_block *nb, err =3D dsa_switch_tag_8021q_vlan_del(ds, info); break; case DSA_NOTIFIER_MASTER_STATE_CHANGE: - err =3D dsa_switch_master_state_change(ds, info); + err =3D dsa_switch_conduit_state_change(ds, info); break; default: err =3D -EOPNOTSUPP; diff --git a/net/dsa/switch.h b/net/dsa/switch.h index ea034677da15..4a9cc941b340 100644 --- a/net/dsa/switch.h +++ b/net/dsa/switch.h @@ -106,8 +106,8 @@ struct dsa_notifier_tag_8021q_vlan_info { }; =20 /* DSA_NOTIFIER_MASTER_STATE_CHANGE */ -struct dsa_notifier_master_state_info { - const struct net_device *master; +struct dsa_notifier_conduit_state_info { + const struct net_device *conduit; bool operational; }; =20 diff --git a/net/dsa/tag.c b/net/dsa/tag.c index 5105a5ff58fa..b7613341431e 100644 --- a/net/dsa/tag.c +++ b/net/dsa/tag.c @@ -13,7 +13,7 @@ #include #include =20 -#include "slave.h" +#include "user.h" #include "tag.h" =20 static LIST_HEAD(dsa_tag_drivers_list); @@ -27,7 +27,7 @@ static DEFINE_MUTEX(dsa_tag_drivers_lock); * switch, the DSA driver owning the interface to which the packet is * delivered is never notified unless we do so here. */ -static bool dsa_skb_defer_rx_timestamp(struct dsa_slave_priv *p, +static bool dsa_skb_defer_rx_timestamp(struct dsa_user_priv *p, struct sk_buff *skb) { struct dsa_switch *ds =3D p->dp->ds; @@ -57,7 +57,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net= _device *dev, struct metadata_dst *md_dst =3D skb_metadata_dst(skb); struct dsa_port *cpu_dp =3D dev->dsa_ptr; struct sk_buff *nskb =3D NULL; - struct dsa_slave_priv *p; + struct dsa_user_priv *p; =20 if (unlikely(!cpu_dp)) { kfree_skb(skb); @@ -75,7 +75,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net= _device *dev, if (!skb_has_extensions(skb)) skb->slow_gro =3D 0; =20 - skb->dev =3D dsa_master_find_slave(dev, 0, port); + skb->dev =3D dsa_conduit_find_user(dev, 0, port); if (likely(skb->dev)) { dsa_default_offload_fwd_mark(skb); nskb =3D skb; @@ -94,7 +94,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net= _device *dev, skb->pkt_type =3D PACKET_HOST; skb->protocol =3D eth_type_trans(skb, skb->dev); =20 - if (unlikely(!dsa_slave_dev_check(skb->dev))) { + if (unlikely(!dsa_user_dev_check(skb->dev))) { /* Packet is to be injected directly on an upper * device, e.g. a team/bond, so skip all DSA-port * specific actions. diff --git a/net/dsa/tag.h b/net/dsa/tag.h index 32d12f4a9d73..f6b9c73718df 100644 --- a/net/dsa/tag.h +++ b/net/dsa/tag.h @@ -9,7 +9,7 @@ #include =20 #include "port.h" -#include "slave.h" +#include "user.h" =20 struct dsa_tag_driver { const struct dsa_device_ops *ops; @@ -29,7 +29,7 @@ static inline int dsa_tag_protocol_overhead(const struct = dsa_device_ops *ops) return ops->needed_headroom + ops->needed_tailroom; } =20 -static inline struct net_device *dsa_master_find_slave(struct net_device *= dev, +static inline struct net_device *dsa_conduit_find_user(struct net_device *= dev, int device, int port) { struct dsa_port *cpu_dp =3D dev->dsa_ptr; @@ -39,7 +39,7 @@ static inline struct net_device *dsa_master_find_slave(st= ruct net_device *dev, list_for_each_entry(dp, &dst->ports, list) if (dp->ds->index =3D=3D device && dp->index =3D=3D port && dp->type =3D=3D DSA_PORT_TYPE_USER) - return dp->slave; + return dp->user; =20 return NULL; } @@ -49,7 +49,7 @@ static inline struct net_device *dsa_master_find_slave(st= ruct net_device *dev, */ static inline struct sk_buff *dsa_untag_bridge_pvid(struct sk_buff *skb) { - struct dsa_port *dp =3D dsa_slave_to_port(skb->dev); + struct dsa_port *dp =3D dsa_user_to_port(skb->dev); struct net_device *br =3D dsa_port_bridge_dev_get(dp); struct net_device *dev =3D skb->dev; struct net_device *upper_dev; @@ -107,12 +107,12 @@ static inline struct sk_buff *dsa_untag_bridge_pvid(s= truct sk_buff *skb) * to support termination through the bridge. */ static inline struct net_device * -dsa_find_designated_bridge_port_by_vid(struct net_device *master, u16 vid) +dsa_find_designated_bridge_port_by_vid(struct net_device *conduit, u16 vid) { - struct dsa_port *cpu_dp =3D master->dsa_ptr; + struct dsa_port *cpu_dp =3D conduit->dsa_ptr; struct dsa_switch_tree *dst =3D cpu_dp->dst; struct bridge_vlan_info vinfo; - struct net_device *slave; + struct net_device *user; struct dsa_port *dp; int err; =20 @@ -134,13 +134,13 @@ dsa_find_designated_bridge_port_by_vid(struct net_dev= ice *master, u16 vid) if (dp->cpu_dp !=3D cpu_dp) continue; =20 - slave =3D dp->slave; + user =3D dp->user; =20 - err =3D br_vlan_get_info_rcu(slave, vid, &vinfo); + err =3D br_vlan_get_info_rcu(user, vid, &vinfo); if (err) continue; =20 - return slave; + return user; } =20 return NULL; @@ -155,7 +155,7 @@ dsa_find_designated_bridge_port_by_vid(struct net_devic= e *master, u16 vid) */ static inline void dsa_default_offload_fwd_mark(struct sk_buff *skb) { - struct dsa_port *dp =3D dsa_slave_to_port(skb->dev); + struct dsa_port *dp =3D dsa_user_to_port(skb->dev); =20 skb->offload_fwd_mark =3D !!(dp->bridge); } @@ -215,9 +215,9 @@ static inline void dsa_alloc_etype_header(struct sk_buf= f *skb, int len) memmove(skb->data, skb->data + len, 2 * ETH_ALEN); } =20 -/* On RX, eth_type_trans() on the DSA master pulls ETH_HLEN bytes starting= from +/* On RX, eth_type_trans() on the DSA conduit pulls ETH_HLEN bytes startin= g from * skb_mac_header(skb), which leaves skb->data pointing at the first byte = after - * what the DSA master perceives as the EtherType (the beginning of the L3 + * what the DSA conduit perceives as the EtherType (the beginning of the L3 * protocol). Since DSA EtherType header taggers treat the EtherType as pa= rt of * the DSA tag itself, and the EtherType is 2 bytes in length, the DSA hea= der * is located 2 bytes behind skb->data. Note that EtherType in this context diff --git a/net/dsa/tag_8021q.c b/net/dsa/tag_8021q.c index cbdfc392f7e0..71b26ae6db39 100644 --- a/net/dsa/tag_8021q.c +++ b/net/dsa/tag_8021q.c @@ -73,7 +73,7 @@ struct dsa_tag_8021q_vlan { struct dsa_8021q_context { struct dsa_switch *ds; struct list_head vlans; - /* EtherType of RX VID, used for filtering on master interface */ + /* EtherType of RX VID, used for filtering on conduit interface */ __be16 proto; }; =20 @@ -338,7 +338,7 @@ static int dsa_tag_8021q_port_setup(struct dsa_switch *= ds, int port) struct dsa_8021q_context *ctx =3D ds->tag_8021q_ctx; struct dsa_port *dp =3D dsa_to_port(ds, port); u16 vid =3D dsa_tag_8021q_standalone_vid(dp); - struct net_device *master; + struct net_device *conduit; int err; =20 /* The CPU port is implicitly configured by @@ -347,7 +347,7 @@ static int dsa_tag_8021q_port_setup(struct dsa_switch *= ds, int port) if (!dsa_port_is_user(dp)) return 0; =20 - master =3D dsa_port_to_master(dp); + conduit =3D dsa_port_to_conduit(dp); =20 err =3D dsa_port_tag_8021q_vlan_add(dp, vid, false); if (err) { @@ -357,8 +357,8 @@ static int dsa_tag_8021q_port_setup(struct dsa_switch *= ds, int port) return err; } =20 - /* Add the VLAN to the master's RX filter. */ - vlan_vid_add(master, ctx->proto, vid); + /* Add the VLAN to the conduit's RX filter. */ + vlan_vid_add(conduit, ctx->proto, vid); =20 return err; } @@ -368,7 +368,7 @@ static void dsa_tag_8021q_port_teardown(struct dsa_swit= ch *ds, int port) struct dsa_8021q_context *ctx =3D ds->tag_8021q_ctx; struct dsa_port *dp =3D dsa_to_port(ds, port); u16 vid =3D dsa_tag_8021q_standalone_vid(dp); - struct net_device *master; + struct net_device *conduit; =20 /* The CPU port is implicitly configured by * configuring the front-panel ports @@ -376,11 +376,11 @@ static void dsa_tag_8021q_port_teardown(struct dsa_sw= itch *ds, int port) if (!dsa_port_is_user(dp)) return; =20 - master =3D dsa_port_to_master(dp); + conduit =3D dsa_port_to_conduit(dp); =20 dsa_port_tag_8021q_vlan_del(dp, vid, false); =20 - vlan_vid_del(master, ctx->proto, vid); + vlan_vid_del(conduit, ctx->proto, vid); } =20 static int dsa_tag_8021q_setup(struct dsa_switch *ds) @@ -468,10 +468,10 @@ struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, s= truct net_device *netdev, } EXPORT_SYMBOL_GPL(dsa_8021q_xmit); =20 -struct net_device *dsa_tag_8021q_find_port_by_vbid(struct net_device *mast= er, +struct net_device *dsa_tag_8021q_find_port_by_vbid(struct net_device *cond= uit, int vbid) { - struct dsa_port *cpu_dp =3D master->dsa_ptr; + struct dsa_port *cpu_dp =3D conduit->dsa_ptr; struct dsa_switch_tree *dst =3D cpu_dp->dst; struct dsa_port *dp; =20 @@ -490,7 +490,7 @@ struct net_device *dsa_tag_8021q_find_port_by_vbid(stru= ct net_device *master, continue; =20 if (dsa_port_bridge_num_get(dp) =3D=3D vbid) - return dp->slave; + return dp->user; } =20 return NULL; diff --git a/net/dsa/tag_8021q.h b/net/dsa/tag_8021q.h index b75cbaa028ef..41f7167ac520 100644 --- a/net/dsa/tag_8021q.h +++ b/net/dsa/tag_8021q.h @@ -16,7 +16,7 @@ struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struc= t net_device *netdev, void dsa_8021q_rcv(struct sk_buff *skb, int *source_port, int *switch_id, int *vbid); =20 -struct net_device *dsa_tag_8021q_find_port_by_vbid(struct net_device *mast= er, +struct net_device *dsa_tag_8021q_find_port_by_vbid(struct net_device *cond= uit, int vbid); =20 int dsa_switch_tag_8021q_vlan_add(struct dsa_switch *ds, diff --git a/net/dsa/tag_ar9331.c b/net/dsa/tag_ar9331.c index 7f3b7d730b85..92ce67b93a58 100644 --- a/net/dsa/tag_ar9331.c +++ b/net/dsa/tag_ar9331.c @@ -29,7 +29,7 @@ static struct sk_buff *ar9331_tag_xmit(struct sk_buff *skb, struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); __le16 *phdr; u16 hdr; =20 @@ -74,7 +74,7 @@ static struct sk_buff *ar9331_tag_rcv(struct sk_buff *skb, /* Get source port information */ port =3D FIELD_GET(AR9331_HDR_PORT_NUM_MASK, hdr); =20 - skb->dev =3D dsa_master_find_slave(ndev, 0, port); + skb->dev =3D dsa_conduit_find_user(ndev, 0, port); if (!skb->dev) return NULL; =20 diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c index cacdafb41200..83d283a5d27e 100644 --- a/net/dsa/tag_brcm.c +++ b/net/dsa/tag_brcm.c @@ -85,7 +85,7 @@ static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff *s= kb, struct net_device *dev, unsigned int offset) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); u16 queue =3D skb_get_queue_mapping(skb); u8 *brcm_tag; =20 @@ -96,7 +96,7 @@ static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff *s= kb, * (including FCS and tag) because the length verification is done after * the Broadcom tag is stripped off the ingress packet. * - * Let dsa_slave_xmit() free the SKB + * Let dsa_user_xmit() free the SKB */ if (__skb_put_padto(skb, ETH_ZLEN + BRCM_TAG_LEN, false)) return NULL; @@ -119,7 +119,7 @@ static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff = *skb, brcm_tag[2] =3D BRCM_IG_DSTMAP2_MASK; brcm_tag[3] =3D (1 << dp->index) & BRCM_IG_DSTMAP1_MASK; =20 - /* Now tell the master network device about the desired output queue + /* Now tell the conduit network device about the desired output queue * as well */ skb_set_queue_mapping(skb, BRCM_TAG_SET_PORT_QUEUE(dp->index, queue)); @@ -164,7 +164,7 @@ static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *= skb, /* Locate which port this is coming from */ source_port =3D brcm_tag[3] & BRCM_EG_PID_MASK; =20 - skb->dev =3D dsa_master_find_slave(dev, 0, source_port); + skb->dev =3D dsa_conduit_find_user(dev, 0, source_port); if (!skb->dev) return NULL; =20 @@ -216,7 +216,7 @@ MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_BRCM, BRCM_NA= ME); static struct sk_buff *brcm_leg_tag_xmit(struct sk_buff *skb, struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); u8 *brcm_tag; =20 /* The Ethernet switch we are interfaced with needs packets to be at @@ -226,7 +226,7 @@ static struct sk_buff *brcm_leg_tag_xmit(struct sk_buff= *skb, * (including FCS and tag) because the length verification is done after * the Broadcom tag is stripped off the ingress packet. * - * Let dsa_slave_xmit() free the SKB + * Let dsa_user_xmit() free the SKB */ if (__skb_put_padto(skb, ETH_ZLEN + BRCM_LEG_TAG_LEN, false)) return NULL; @@ -264,7 +264,7 @@ static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff = *skb, =20 source_port =3D brcm_tag[5] & BRCM_LEG_PORT_ID; =20 - skb->dev =3D dsa_master_find_slave(dev, 0, source_port); + skb->dev =3D dsa_conduit_find_user(dev, 0, source_port); if (!skb->dev) return NULL; =20 diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index 1fd7fa26db64..8ed52dd663ab 100644 --- a/net/dsa/tag_dsa.c +++ b/net/dsa/tag_dsa.c @@ -129,7 +129,7 @@ enum dsa_code { static struct sk_buff *dsa_xmit_ll(struct sk_buff *skb, struct net_device = *dev, u8 extra) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct net_device *br_dev; u8 tag_dev, tag_port; enum dsa_cmd cmd; @@ -267,14 +267,14 @@ static struct sk_buff *dsa_rcv_ll(struct sk_buff *skb= , struct net_device *dev, lag =3D dsa_lag_by_id(cpu_dp->dst, source_port + 1); skb->dev =3D lag ? lag->dev : NULL; } else { - skb->dev =3D dsa_master_find_slave(dev, source_device, + skb->dev =3D dsa_conduit_find_user(dev, source_device, source_port); } =20 if (!skb->dev) return NULL; =20 - /* When using LAG offload, skb->dev is not a DSA slave interface, + /* When using LAG offload, skb->dev is not a DSA user interface, * so we cannot call dsa_default_offload_fwd_mark and we need to * special-case it. */ diff --git a/net/dsa/tag_gswip.c b/net/dsa/tag_gswip.c index e279cd9057b0..3539141b5350 100644 --- a/net/dsa/tag_gswip.c +++ b/net/dsa/tag_gswip.c @@ -61,7 +61,7 @@ static struct sk_buff *gswip_tag_xmit(struct sk_buff *skb, struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); u8 *gswip_tag; =20 skb_push(skb, GSWIP_TX_HEADER_LEN); @@ -89,7 +89,7 @@ static struct sk_buff *gswip_tag_rcv(struct sk_buff *skb, =20 /* Get source port information */ port =3D (gswip_tag[7] & GSWIP_RX_SPPID_MASK) >> GSWIP_RX_SPPID_SHIFT; - skb->dev =3D dsa_master_find_slave(dev, 0, port); + skb->dev =3D dsa_conduit_find_user(dev, 0, port); if (!skb->dev) return NULL; =20 diff --git a/net/dsa/tag_hellcreek.c b/net/dsa/tag_hellcreek.c index 03a1fb9c87a9..6e233cd0aa38 100644 --- a/net/dsa/tag_hellcreek.c +++ b/net/dsa/tag_hellcreek.c @@ -20,7 +20,7 @@ static struct sk_buff *hellcreek_xmit(struct sk_buff *skb, struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); u8 *tag; =20 /* Calculate checksums (if required) before adding the trailer tag to @@ -45,7 +45,7 @@ static struct sk_buff *hellcreek_rcv(struct sk_buff *skb, u8 *tag =3D skb_tail_pointer(skb) - HELLCREEK_TAG_LEN; unsigned int port =3D tag[0] & 0x03; =20 - skb->dev =3D dsa_master_find_slave(dev, 0, port); + skb->dev =3D dsa_conduit_find_user(dev, 0, port); if (!skb->dev) { netdev_warn_once(dev, "Failed to get source port: %d\n", port); return NULL; diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index 3632e47dea9e..9be341fa88f0 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -87,7 +87,7 @@ static struct sk_buff *ksz_common_rcv(struct sk_buff *skb, struct net_device *dev, unsigned int port, unsigned int len) { - skb->dev =3D dsa_master_find_slave(dev, 0, port); + skb->dev =3D dsa_conduit_find_user(dev, 0, port); if (!skb->dev) return NULL; =20 @@ -119,7 +119,7 @@ static struct sk_buff *ksz_common_rcv(struct sk_buff *s= kb, =20 static struct sk_buff *ksz8795_xmit(struct sk_buff *skb, struct net_device= *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct ethhdr *hdr; u8 *tag; =20 @@ -256,7 +256,7 @@ static struct sk_buff *ksz_defer_xmit(struct dsa_port *= dp, struct sk_buff *skb) return NULL; =20 kthread_init_work(&xmit_work->work, xmit_work_fn); - /* Increase refcount so the kfree_skb in dsa_slave_xmit + /* Increase refcount so the kfree_skb in dsa_user_xmit * won't really free the packet. */ xmit_work->dp =3D dp; @@ -272,7 +272,7 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb, { u16 queue_mapping =3D skb_get_queue_mapping(skb); u8 prio =3D netdev_txq_to_tc(dev, queue_mapping); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct ethhdr *hdr; __be16 *tag; u16 val; @@ -344,7 +344,7 @@ static struct sk_buff *ksz9893_xmit(struct sk_buff *skb, { u16 queue_mapping =3D skb_get_queue_mapping(skb); u8 prio =3D netdev_txq_to_tc(dev, queue_mapping); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct ethhdr *hdr; u8 *tag; =20 @@ -410,7 +410,7 @@ static struct sk_buff *lan937x_xmit(struct sk_buff *skb, { u16 queue_mapping =3D skb_get_queue_mapping(skb); u8 prio =3D netdev_txq_to_tc(dev, queue_mapping); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); const struct ethhdr *hdr =3D eth_hdr(skb); __be16 *tag; u16 val; diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c index c25f5536706b..1ed8ee24855d 100644 --- a/net/dsa/tag_lan9303.c +++ b/net/dsa/tag_lan9303.c @@ -56,7 +56,7 @@ static int lan9303_xmit_use_arl(struct dsa_port *dp, u8 *= dest_addr) =20 static struct sk_buff *lan9303_xmit(struct sk_buff *skb, struct net_device= *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); __be16 *lan9303_tag; u16 tag; =20 @@ -99,7 +99,7 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, s= truct net_device *dev) =20 source_port =3D lan9303_tag1 & 0x3; =20 - skb->dev =3D dsa_master_find_slave(dev, 0, source_port); + skb->dev =3D dsa_conduit_find_user(dev, 0, source_port); if (!skb->dev) { dev_warn_ratelimited(&dev->dev, "Dropping packet due to invalid source p= ort\n"); return NULL; diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c index 40af80452747..2483785f6ab1 100644 --- a/net/dsa/tag_mtk.c +++ b/net/dsa/tag_mtk.c @@ -23,7 +23,7 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb, struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); u8 xmit_tpid; u8 *mtk_tag; =20 @@ -85,7 +85,7 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, s= truct net_device *dev) /* Get source port information */ port =3D (hdr & MTK_HDR_RECV_SOURCE_PORT_MASK); =20 - skb->dev =3D dsa_master_find_slave(dev, 0, port); + skb->dev =3D dsa_conduit_find_user(dev, 0, port); if (!skb->dev) return NULL; =20 diff --git a/net/dsa/tag_none.c b/net/dsa/tag_none.c index d2fd179c4227..d40184871b71 100644 --- a/net/dsa/tag_none.c +++ b/net/dsa/tag_none.c @@ -12,7 +12,7 @@ =20 #define NONE_NAME "none" =20 -static struct sk_buff *dsa_slave_notag_xmit(struct sk_buff *skb, +static struct sk_buff *dsa_user_notag_xmit(struct sk_buff *skb, struct net_device *dev) { /* Just return the original SKB */ @@ -22,7 +22,7 @@ static struct sk_buff *dsa_slave_notag_xmit(struct sk_buf= f *skb, static const struct dsa_device_ops none_ops =3D { .name =3D NONE_NAME, .proto =3D DSA_TAG_PROTO_NONE, - .xmit =3D dsa_slave_notag_xmit, + .xmit =3D dsa_user_notag_xmit, }; =20 module_dsa_tag_driver(none_ops); diff --git a/net/dsa/tag_ocelot.c b/net/dsa/tag_ocelot.c index 20bf7074d5a6..ef2f8fffb2c7 100644 --- a/net/dsa/tag_ocelot.c +++ b/net/dsa/tag_ocelot.c @@ -45,7 +45,7 @@ static void ocelot_xmit_get_vlan_info(struct sk_buff *skb= , struct dsa_port *dp, static void ocelot_xmit_common(struct sk_buff *skb, struct net_device *net= dev, __be32 ifh_prefix, void **ifh) { - struct dsa_port *dp =3D dsa_slave_to_port(netdev); + struct dsa_port *dp =3D dsa_user_to_port(netdev); struct dsa_switch *ds =3D dp->ds; u64 vlan_tci, tag_type; void *injection; @@ -79,7 +79,7 @@ static void ocelot_xmit_common(struct sk_buff *skb, struc= t net_device *netdev, static struct sk_buff *ocelot_xmit(struct sk_buff *skb, struct net_device *netdev) { - struct dsa_port *dp =3D dsa_slave_to_port(netdev); + struct dsa_port *dp =3D dsa_user_to_port(netdev); void *injection; =20 ocelot_xmit_common(skb, netdev, cpu_to_be32(0x8880000a), &injection); @@ -91,7 +91,7 @@ static struct sk_buff *ocelot_xmit(struct sk_buff *skb, static struct sk_buff *seville_xmit(struct sk_buff *skb, struct net_device *netdev) { - struct dsa_port *dp =3D dsa_slave_to_port(netdev); + struct dsa_port *dp =3D dsa_user_to_port(netdev); void *injection; =20 ocelot_xmit_common(skb, netdev, cpu_to_be32(0x88800005), &injection); @@ -111,12 +111,12 @@ static struct sk_buff *ocelot_rcv(struct sk_buff *skb, u16 vlan_tpid; u64 rew_val; =20 - /* Revert skb->data by the amount consumed by the DSA master, + /* Revert skb->data by the amount consumed by the DSA conduit, * so it points to the beginning of the frame. */ skb_push(skb, ETH_HLEN); /* We don't care about the short prefix, it is just for easy entrance - * into the DSA master's RX filter. Discard it now by moving it into + * into the DSA conduit's RX filter. Discard it now by moving it into * the headroom. */ skb_pull(skb, OCELOT_SHORT_PREFIX_LEN); @@ -141,12 +141,12 @@ static struct sk_buff *ocelot_rcv(struct sk_buff *skb, ocelot_xfh_get_vlan_tci(extraction, &vlan_tci); ocelot_xfh_get_rew_val(extraction, &rew_val); =20 - skb->dev =3D dsa_master_find_slave(netdev, 0, src_port); + skb->dev =3D dsa_conduit_find_user(netdev, 0, src_port); if (!skb->dev) /* The switch will reflect back some frames sent through - * sockets opened on the bare DSA master. These will come back + * sockets opened on the bare DSA conduit. These will come back * with src_port equal to the index of the CPU port, for which - * there is no slave registered. So don't print any error + * there is no user registered. So don't print any error * message here (ignore and drop those frames). */ return NULL; @@ -170,7 +170,7 @@ static struct sk_buff *ocelot_rcv(struct sk_buff *skb, * equal to the pvid of the ingress port and should not be used for * processing. */ - dp =3D dsa_slave_to_port(skb->dev); + dp =3D dsa_user_to_port(skb->dev); vlan_tpid =3D tag_type ? ETH_P_8021AD : ETH_P_8021Q; =20 if (dsa_port_is_vlan_filtering(dp) && @@ -192,7 +192,7 @@ static const struct dsa_device_ops ocelot_netdev_ops = =3D { .xmit =3D ocelot_xmit, .rcv =3D ocelot_rcv, .needed_headroom =3D OCELOT_TOTAL_TAG_LEN, - .promisc_on_master =3D true, + .promisc_on_conduit =3D true, }; =20 DSA_TAG_DRIVER(ocelot_netdev_ops); @@ -204,7 +204,7 @@ static const struct dsa_device_ops seville_netdev_ops = =3D { .xmit =3D seville_xmit, .rcv =3D ocelot_rcv, .needed_headroom =3D OCELOT_TOTAL_TAG_LEN, - .promisc_on_master =3D true, + .promisc_on_conduit =3D true, }; =20 DSA_TAG_DRIVER(seville_netdev_ops); diff --git a/net/dsa/tag_ocelot_8021q.c b/net/dsa/tag_ocelot_8021q.c index 1f0b8c20eba5..210039320888 100644 --- a/net/dsa/tag_ocelot_8021q.c +++ b/net/dsa/tag_ocelot_8021q.c @@ -37,8 +37,8 @@ static struct sk_buff *ocelot_defer_xmit(struct dsa_port = *dp, return NULL; =20 /* PTP over IP packets need UDP checksumming. We may have inherited - * NETIF_F_HW_CSUM from the DSA master, but these packets are not sent - * through the DSA master, so calculate the checksum here. + * NETIF_F_HW_CSUM from the DSA conduit, but these packets are not sent + * through the DSA conduit, so calculate the checksum here. */ if (skb->ip_summed =3D=3D CHECKSUM_PARTIAL && skb_checksum_help(skb)) return NULL; @@ -49,7 +49,7 @@ static struct sk_buff *ocelot_defer_xmit(struct dsa_port = *dp, =20 /* Calls felix_port_deferred_xmit in felix.c */ kthread_init_work(&xmit_work->work, xmit_work_fn); - /* Increase refcount so the kfree_skb in dsa_slave_xmit + /* Increase refcount so the kfree_skb in dsa_user_xmit * won't really free the packet. */ xmit_work->dp =3D dp; @@ -63,7 +63,7 @@ static struct sk_buff *ocelot_defer_xmit(struct dsa_port = *dp, static struct sk_buff *ocelot_xmit(struct sk_buff *skb, struct net_device *netdev) { - struct dsa_port *dp =3D dsa_slave_to_port(netdev); + struct dsa_port *dp =3D dsa_user_to_port(netdev); u16 queue_mapping =3D skb_get_queue_mapping(skb); u8 pcp =3D netdev_txq_to_tc(netdev, queue_mapping); u16 tx_vid =3D dsa_tag_8021q_standalone_vid(dp); @@ -83,7 +83,7 @@ static struct sk_buff *ocelot_rcv(struct sk_buff *skb, =20 dsa_8021q_rcv(skb, &src_port, &switch_id, NULL); =20 - skb->dev =3D dsa_master_find_slave(netdev, switch_id, src_port); + skb->dev =3D dsa_conduit_find_user(netdev, switch_id, src_port); if (!skb->dev) return NULL; =20 @@ -130,7 +130,7 @@ static const struct dsa_device_ops ocelot_8021q_netdev_= ops =3D { .connect =3D ocelot_connect, .disconnect =3D ocelot_disconnect, .needed_headroom =3D VLAN_HLEN, - .promisc_on_master =3D true, + .promisc_on_conduit =3D true, }; =20 MODULE_LICENSE("GPL v2"); diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c index e5ff7c34e577..6514aa7993ce 100644 --- a/net/dsa/tag_qca.c +++ b/net/dsa/tag_qca.c @@ -14,7 +14,7 @@ =20 static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device= *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); __be16 *phdr; u16 hdr; =20 @@ -78,7 +78,7 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, s= truct net_device *dev) /* Get source port information */ port =3D FIELD_GET(QCA_HDR_RECV_SOURCE_PORT, hdr); =20 - skb->dev =3D dsa_master_find_slave(dev, 0, port); + skb->dev =3D dsa_conduit_find_user(dev, 0, port); if (!skb->dev) return NULL; =20 @@ -116,7 +116,7 @@ static const struct dsa_device_ops qca_netdev_ops =3D { .xmit =3D qca_tag_xmit, .rcv =3D qca_tag_rcv, .needed_headroom =3D QCA_HDR_LEN, - .promisc_on_master =3D true, + .promisc_on_conduit =3D true, }; =20 MODULE_LICENSE("GPL"); diff --git a/net/dsa/tag_rtl4_a.c b/net/dsa/tag_rtl4_a.c index c327314b95e3..4da5bad1a7aa 100644 --- a/net/dsa/tag_rtl4_a.c +++ b/net/dsa/tag_rtl4_a.c @@ -36,7 +36,7 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb, struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); __be16 *p; u8 *tag; u16 out; @@ -97,9 +97,9 @@ static struct sk_buff *rtl4a_tag_rcv(struct sk_buff *skb, } port =3D protport & 0xff; =20 - skb->dev =3D dsa_master_find_slave(dev, 0, port); + skb->dev =3D dsa_conduit_find_user(dev, 0, port); if (!skb->dev) { - netdev_dbg(dev, "could not find slave for port %d\n", port); + netdev_dbg(dev, "could not find user for port %d\n", port); return NULL; } =20 diff --git a/net/dsa/tag_rtl8_4.c b/net/dsa/tag_rtl8_4.c index 4f67834fd121..07e857debabf 100644 --- a/net/dsa/tag_rtl8_4.c +++ b/net/dsa/tag_rtl8_4.c @@ -103,7 +103,7 @@ static void rtl8_4_write_tag(struct sk_buff *skb, struct net_device *dev, void *tag) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); __be16 tag16[RTL8_4_TAG_LEN / 2]; =20 /* Set Realtek EtherType */ @@ -180,10 +180,10 @@ static int rtl8_4_read_tag(struct sk_buff *skb, struc= t net_device *dev, =20 /* Parse TX (switch->CPU) */ port =3D FIELD_GET(RTL8_4_TX, ntohs(tag16[3])); - skb->dev =3D dsa_master_find_slave(dev, 0, port); + skb->dev =3D dsa_conduit_find_user(dev, 0, port); if (!skb->dev) { dev_warn_ratelimited(&dev->dev, - "could not find slave for port %d\n", + "could not find user for port %d\n", port); return -ENOENT; } diff --git a/net/dsa/tag_rzn1_a5psw.c b/net/dsa/tag_rzn1_a5psw.c index 437a6820ac42..2ce866b45615 100644 --- a/net/dsa/tag_rzn1_a5psw.c +++ b/net/dsa/tag_rzn1_a5psw.c @@ -39,7 +39,7 @@ struct a5psw_tag { =20 static struct sk_buff *a5psw_tag_xmit(struct sk_buff *skb, struct net_devi= ce *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct a5psw_tag *ptag; u32 data2_val; =20 @@ -90,7 +90,7 @@ static struct sk_buff *a5psw_tag_rcv(struct sk_buff *skb, =20 port =3D FIELD_GET(A5PSW_CTRL_DATA_PORT, ntohs(tag->ctrl_data)); =20 - skb->dev =3D dsa_master_find_slave(dev, 0, port); + skb->dev =3D dsa_conduit_find_user(dev, 0, port); if (!skb->dev) return NULL; =20 diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c index ade3eeb2f3e6..1fffe8c2b589 100644 --- a/net/dsa/tag_sja1105.c +++ b/net/dsa/tag_sja1105.c @@ -157,7 +157,7 @@ static struct sk_buff *sja1105_defer_xmit(struct dsa_po= rt *dp, return NULL; =20 kthread_init_work(&xmit_work->work, xmit_work_fn); - /* Increase refcount so the kfree_skb in dsa_slave_xmit + /* Increase refcount so the kfree_skb in dsa_user_xmit * won't really free the packet. */ xmit_work->dp =3D dp; @@ -210,7 +210,7 @@ static u16 sja1105_xmit_tpid(struct dsa_port *dp) static struct sk_buff *sja1105_imprecise_xmit(struct sk_buff *skb, struct net_device *netdev) { - struct dsa_port *dp =3D dsa_slave_to_port(netdev); + struct dsa_port *dp =3D dsa_user_to_port(netdev); unsigned int bridge_num =3D dsa_port_bridge_num_get(dp); struct net_device *br =3D dsa_port_bridge_dev_get(dp); u16 tx_vid; @@ -235,7 +235,7 @@ static struct sk_buff *sja1105_imprecise_xmit(struct sk= _buff *skb, =20 /* Transform untagged control packets into pvid-tagged control packets so = that * all packets sent by this tagger are VLAN-tagged and we can configure the - * switch to drop untagged packets coming from the DSA master. + * switch to drop untagged packets coming from the DSA conduit. */ static struct sk_buff *sja1105_pvid_tag_control_pkt(struct dsa_port *dp, struct sk_buff *skb, u8 pcp) @@ -266,7 +266,7 @@ static struct sk_buff *sja1105_pvid_tag_control_pkt(str= uct dsa_port *dp, static struct sk_buff *sja1105_xmit(struct sk_buff *skb, struct net_device *netdev) { - struct dsa_port *dp =3D dsa_slave_to_port(netdev); + struct dsa_port *dp =3D dsa_user_to_port(netdev); u16 queue_mapping =3D skb_get_queue_mapping(skb); u8 pcp =3D netdev_txq_to_tc(netdev, queue_mapping); u16 tx_vid =3D dsa_tag_8021q_standalone_vid(dp); @@ -294,7 +294,7 @@ static struct sk_buff *sja1110_xmit(struct sk_buff *skb, struct net_device *netdev) { struct sk_buff *clone =3D SJA1105_SKB_CB(skb)->clone; - struct dsa_port *dp =3D dsa_slave_to_port(netdev); + struct dsa_port *dp =3D dsa_user_to_port(netdev); u16 queue_mapping =3D skb_get_queue_mapping(skb); u8 pcp =3D netdev_txq_to_tc(netdev, queue_mapping); u16 tx_vid =3D dsa_tag_8021q_standalone_vid(dp); @@ -383,7 +383,7 @@ static struct sk_buff * Buffer it until we get its meta frame. */ if (is_link_local) { - struct dsa_port *dp =3D dsa_slave_to_port(skb->dev); + struct dsa_port *dp =3D dsa_user_to_port(skb->dev); struct sja1105_tagger_private *priv; struct dsa_switch *ds =3D dp->ds; =20 @@ -396,7 +396,7 @@ static struct sk_buff if (priv->stampable_skb) { dev_err_ratelimited(ds->dev, "Expected meta frame, is %12llx " - "in the DSA master multicast filter?\n", + "in the DSA conduit multicast filter?\n", SJA1105_META_DMAC); kfree_skb(priv->stampable_skb); } @@ -417,7 +417,7 @@ static struct sk_buff * frame, which serves no further purpose). */ } else if (is_meta) { - struct dsa_port *dp =3D dsa_slave_to_port(skb->dev); + struct dsa_port *dp =3D dsa_user_to_port(skb->dev); struct sja1105_tagger_private *priv; struct dsa_switch *ds =3D dp->ds; struct sk_buff *stampable_skb; @@ -550,7 +550,7 @@ static struct sk_buff *sja1105_rcv(struct sk_buff *skb, } =20 if (source_port !=3D -1 && switch_id !=3D -1) - skb->dev =3D dsa_master_find_slave(netdev, switch_id, source_port); + skb->dev =3D dsa_conduit_find_user(netdev, switch_id, source_port); else if (vbid >=3D 1) skb->dev =3D dsa_tag_8021q_find_port_by_vbid(netdev, vbid); else @@ -573,16 +573,16 @@ static struct sk_buff *sja1110_rcv_meta(struct sk_buf= f *skb, u16 rx_header) int switch_id =3D SJA1110_RX_HEADER_SWITCH_ID(rx_header); int n_ts =3D SJA1110_RX_HEADER_N_TS(rx_header); struct sja1105_tagger_data *tagger_data; - struct net_device *master =3D skb->dev; + struct net_device *conduit =3D skb->dev; struct dsa_port *cpu_dp; struct dsa_switch *ds; int i; =20 - cpu_dp =3D master->dsa_ptr; + cpu_dp =3D conduit->dsa_ptr; ds =3D dsa_switch_find(cpu_dp->dst->index, switch_id); if (!ds) { net_err_ratelimited("%s: cannot find switch id %d\n", - master->name, switch_id); + conduit->name, switch_id); return NULL; } =20 @@ -649,7 +649,7 @@ static struct sk_buff *sja1110_rcv_inband_control_exten= sion(struct sk_buff *skb, =20 /* skb->len counts from skb->data, while start_of_padding * counts from the destination MAC address. Right now skb->data - * is still as set by the DSA master, so to trim away the + * is still as set by the DSA conduit, so to trim away the * padding and trailer we need to account for the fact that * skb->data points to skb_mac_header(skb) + ETH_HLEN. */ @@ -698,7 +698,7 @@ static struct sk_buff *sja1110_rcv(struct sk_buff *skb, else if (source_port =3D=3D -1 || switch_id =3D=3D -1) skb->dev =3D dsa_find_designated_bridge_port_by_vid(netdev, vid); else - skb->dev =3D dsa_master_find_slave(netdev, switch_id, source_port); + skb->dev =3D dsa_conduit_find_user(netdev, switch_id, source_port); if (!skb->dev) { netdev_warn(netdev, "Couldn't decode source port\n"); return NULL; @@ -778,7 +778,7 @@ static const struct dsa_device_ops sja1105_netdev_ops = =3D { .disconnect =3D sja1105_disconnect, .needed_headroom =3D VLAN_HLEN, .flow_dissect =3D sja1105_flow_dissect, - .promisc_on_master =3D true, + .promisc_on_conduit =3D true, }; =20 DSA_TAG_DRIVER(sja1105_netdev_ops); diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c index 7361b9106382..1ebb25a8b140 100644 --- a/net/dsa/tag_trailer.c +++ b/net/dsa/tag_trailer.c @@ -14,7 +14,7 @@ =20 static struct sk_buff *trailer_xmit(struct sk_buff *skb, struct net_device= *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); u8 *trailer; =20 trailer =3D skb_put(skb, 4); @@ -41,7 +41,7 @@ static struct sk_buff *trailer_rcv(struct sk_buff *skb, s= truct net_device *dev) =20 source_port =3D trailer[1] & 7; =20 - skb->dev =3D dsa_master_find_slave(dev, 0, source_port); + skb->dev =3D dsa_conduit_find_user(dev, 0, source_port); if (!skb->dev) return NULL; =20 diff --git a/net/dsa/tag_xrs700x.c b/net/dsa/tag_xrs700x.c index af19969f9bc4..c9c163598ef2 100644 --- a/net/dsa/tag_xrs700x.c +++ b/net/dsa/tag_xrs700x.c @@ -13,7 +13,7 @@ =20 static struct sk_buff *xrs700x_xmit(struct sk_buff *skb, struct net_device= *dev) { - struct dsa_port *partner, *dp =3D dsa_slave_to_port(dev); + struct dsa_port *partner, *dp =3D dsa_user_to_port(dev); u8 *trailer; =20 trailer =3D skb_put(skb, 1); @@ -39,7 +39,7 @@ static struct sk_buff *xrs700x_rcv(struct sk_buff *skb, s= truct net_device *dev) if (source_port < 0) return NULL; =20 - skb->dev =3D dsa_master_find_slave(dev, 0, source_port); + skb->dev =3D dsa_conduit_find_user(dev, 0, source_port); if (!skb->dev) return NULL; =20 diff --git a/net/dsa/slave.c b/net/dsa/user.c similarity index 67% rename from net/dsa/slave.c rename to net/dsa/user.c index 4c3e502d7e16..b34037989983 100644 --- a/net/dsa/slave.c +++ b/net/dsa/user.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * net/dsa/slave.c - Slave device handling + * net/dsa/user.c - user device handling * Copyright (c) 2008-2009 Marvell Semiconductor */ =20 @@ -25,9 +25,9 @@ =20 #include "dsa.h" #include "port.h" -#include "master.h" +#include "conduit.h" #include "netlink.h" -#include "slave.h" +#include "user.h" #include "switch.h" #include "tag.h" =20 @@ -79,13 +79,13 @@ static bool dsa_switch_supports_mc_filtering(struct dsa= _switch *ds) !ds->needs_standalone_vlan_filtering; } =20 -static void dsa_slave_standalone_event_work(struct work_struct *work) +static void dsa_user_standalone_event_work(struct work_struct *work) { struct dsa_standalone_event_work *standalone_work =3D container_of(work, struct dsa_standalone_event_work, work); const unsigned char *addr =3D standalone_work->addr; struct net_device *dev =3D standalone_work->dev; - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct switchdev_obj_port_mdb mdb; struct dsa_switch *ds =3D dp->ds; u16 vid =3D standalone_work->vid; @@ -140,7 +140,7 @@ static void dsa_slave_standalone_event_work(struct work= _struct *work) kfree(standalone_work); } =20 -static int dsa_slave_schedule_standalone_work(struct net_device *dev, +static int dsa_user_schedule_standalone_work(struct net_device *dev, enum dsa_standalone_event event, const unsigned char *addr, u16 vid) @@ -151,7 +151,7 @@ static int dsa_slave_schedule_standalone_work(struct ne= t_device *dev, if (!standalone_work) return -ENOMEM; =20 - INIT_WORK(&standalone_work->work, dsa_slave_standalone_event_work); + INIT_WORK(&standalone_work->work, dsa_user_standalone_event_work); standalone_work->event =3D event; standalone_work->dev =3D dev; =20 @@ -163,18 +163,18 @@ static int dsa_slave_schedule_standalone_work(struct = net_device *dev, return 0; } =20 -static int dsa_slave_host_vlan_rx_filtering(void *arg, int vid) +static int dsa_user_host_vlan_rx_filtering(void *arg, int vid) { struct dsa_host_vlan_rx_filtering_ctx *ctx =3D arg; =20 - return dsa_slave_schedule_standalone_work(ctx->dev, ctx->event, + return dsa_user_schedule_standalone_work(ctx->dev, ctx->event, ctx->addr, vid); } =20 -static int dsa_slave_vlan_for_each(struct net_device *dev, +static int dsa_user_vlan_for_each(struct net_device *dev, int (*cb)(void *arg, int vid), void *arg) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_vlan *v; int err; =20 @@ -193,99 +193,99 @@ static int dsa_slave_vlan_for_each(struct net_device = *dev, return 0; } =20 -static int dsa_slave_sync_uc(struct net_device *dev, +static int dsa_user_sync_uc(struct net_device *dev, const unsigned char *addr) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_host_vlan_rx_filtering_ctx ctx =3D { .dev =3D dev, .addr =3D addr, .event =3D DSA_UC_ADD, }; =20 - dev_uc_add(master, addr); + dev_uc_add(conduit, addr); =20 if (!dsa_switch_supports_uc_filtering(dp->ds)) return 0; =20 - return dsa_slave_vlan_for_each(dev, dsa_slave_host_vlan_rx_filtering, + return dsa_user_vlan_for_each(dev, dsa_user_host_vlan_rx_filtering, &ctx); } =20 -static int dsa_slave_unsync_uc(struct net_device *dev, +static int dsa_user_unsync_uc(struct net_device *dev, const unsigned char *addr) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_host_vlan_rx_filtering_ctx ctx =3D { .dev =3D dev, .addr =3D addr, .event =3D DSA_UC_DEL, }; =20 - dev_uc_del(master, addr); + dev_uc_del(conduit, addr); =20 if (!dsa_switch_supports_uc_filtering(dp->ds)) return 0; =20 - return dsa_slave_vlan_for_each(dev, dsa_slave_host_vlan_rx_filtering, + return dsa_user_vlan_for_each(dev, dsa_user_host_vlan_rx_filtering, &ctx); } =20 -static int dsa_slave_sync_mc(struct net_device *dev, +static int dsa_user_sync_mc(struct net_device *dev, const unsigned char *addr) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_host_vlan_rx_filtering_ctx ctx =3D { .dev =3D dev, .addr =3D addr, .event =3D DSA_MC_ADD, }; =20 - dev_mc_add(master, addr); + dev_mc_add(conduit, addr); =20 if (!dsa_switch_supports_mc_filtering(dp->ds)) return 0; =20 - return dsa_slave_vlan_for_each(dev, dsa_slave_host_vlan_rx_filtering, + return dsa_user_vlan_for_each(dev, dsa_user_host_vlan_rx_filtering, &ctx); } =20 -static int dsa_slave_unsync_mc(struct net_device *dev, +static int dsa_user_unsync_mc(struct net_device *dev, const unsigned char *addr) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_host_vlan_rx_filtering_ctx ctx =3D { .dev =3D dev, .addr =3D addr, .event =3D DSA_MC_DEL, }; =20 - dev_mc_del(master, addr); + dev_mc_del(conduit, addr); =20 if (!dsa_switch_supports_mc_filtering(dp->ds)) return 0; =20 - return dsa_slave_vlan_for_each(dev, dsa_slave_host_vlan_rx_filtering, + return dsa_user_vlan_for_each(dev, dsa_user_host_vlan_rx_filtering, &ctx); } =20 -void dsa_slave_sync_ha(struct net_device *dev) +void dsa_user_sync_ha(struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; struct netdev_hw_addr *ha; =20 netif_addr_lock_bh(dev); =20 netdev_for_each_synced_mc_addr(ha, dev) - dsa_slave_sync_mc(dev, ha->addr); + dsa_user_sync_mc(dev, ha->addr); =20 netdev_for_each_synced_uc_addr(ha, dev) - dsa_slave_sync_uc(dev, ha->addr); + dsa_user_sync_uc(dev, ha->addr); =20 netif_addr_unlock_bh(dev); =20 @@ -294,19 +294,19 @@ void dsa_slave_sync_ha(struct net_device *dev) dsa_flush_workqueue(); } =20 -void dsa_slave_unsync_ha(struct net_device *dev) +void dsa_user_unsync_ha(struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; struct netdev_hw_addr *ha; =20 netif_addr_lock_bh(dev); =20 netdev_for_each_synced_uc_addr(ha, dev) - dsa_slave_unsync_uc(dev, ha->addr); + dsa_user_unsync_uc(dev, ha->addr); =20 netdev_for_each_synced_mc_addr(ha, dev) - dsa_slave_unsync_mc(dev, ha->addr); + dsa_user_unsync_mc(dev, ha->addr); =20 netif_addr_unlock_bh(dev); =20 @@ -315,8 +315,8 @@ void dsa_slave_unsync_ha(struct net_device *dev) dsa_flush_workqueue(); } =20 -/* slave mii_bus handling ************************************************= ***/ -static int dsa_slave_phy_read(struct mii_bus *bus, int addr, int reg) +/* user mii_bus handling *************************************************= **/ +static int dsa_user_phy_read(struct mii_bus *bus, int addr, int reg) { struct dsa_switch *ds =3D bus->priv; =20 @@ -326,7 +326,7 @@ static int dsa_slave_phy_read(struct mii_bus *bus, int = addr, int reg) return 0xffff; } =20 -static int dsa_slave_phy_write(struct mii_bus *bus, int addr, int reg, u16= val) +static int dsa_user_phy_write(struct mii_bus *bus, int addr, int reg, u16 = val) { struct dsa_switch *ds =3D bus->priv; =20 @@ -336,35 +336,35 @@ static int dsa_slave_phy_write(struct mii_bus *bus, i= nt addr, int reg, u16 val) return 0; } =20 -void dsa_slave_mii_bus_init(struct dsa_switch *ds) +void dsa_user_mii_bus_init(struct dsa_switch *ds) { - ds->slave_mii_bus->priv =3D (void *)ds; - ds->slave_mii_bus->name =3D "dsa slave smi"; - ds->slave_mii_bus->read =3D dsa_slave_phy_read; - ds->slave_mii_bus->write =3D dsa_slave_phy_write; - snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d", + ds->user_mii_bus->priv =3D (void *)ds; + ds->user_mii_bus->name =3D "dsa user smi"; + ds->user_mii_bus->read =3D dsa_user_phy_read; + ds->user_mii_bus->write =3D dsa_user_phy_write; + snprintf(ds->user_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d", ds->dst->index, ds->index); - ds->slave_mii_bus->parent =3D ds->dev; - ds->slave_mii_bus->phy_mask =3D ~ds->phys_mii_mask; + ds->user_mii_bus->parent =3D ds->dev; + ds->user_mii_bus->phy_mask =3D ~ds->phys_mii_mask; } =20 =20 -/* slave device handling *************************************************= ***/ -static int dsa_slave_get_iflink(const struct net_device *dev) +/* user device handling **************************************************= **/ +static int dsa_user_get_iflink(const struct net_device *dev) { - return dsa_slave_to_master(dev)->ifindex; + return dsa_user_to_conduit(dev)->ifindex; } =20 -static int dsa_slave_open(struct net_device *dev) +static int dsa_user_open(struct net_device *dev) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; int err; =20 - err =3D dev_open(master, NULL); + err =3D dev_open(conduit, NULL); if (err < 0) { - netdev_err(dev, "failed to open master %s\n", master->name); + netdev_err(dev, "failed to open conduit %s\n", conduit->name); goto out; } =20 @@ -374,8 +374,8 @@ static int dsa_slave_open(struct net_device *dev) goto out; } =20 - if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) { - err =3D dev_uc_add(master, dev->dev_addr); + if (!ether_addr_equal(dev->dev_addr, conduit->dev_addr)) { + err =3D dev_uc_add(conduit, dev->dev_addr); if (err < 0) goto del_host_addr; } @@ -387,8 +387,8 @@ static int dsa_slave_open(struct net_device *dev) return 0; =20 del_unicast: - if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) - dev_uc_del(master, dev->dev_addr); + if (!ether_addr_equal(dev->dev_addr, conduit->dev_addr)) + dev_uc_del(conduit, dev->dev_addr); del_host_addr: if (dsa_switch_supports_uc_filtering(ds)) dsa_port_standalone_host_fdb_del(dp, dev->dev_addr, 0); @@ -396,16 +396,16 @@ static int dsa_slave_open(struct net_device *dev) return err; } =20 -static int dsa_slave_close(struct net_device *dev) +static int dsa_user_close(struct net_device *dev) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 dsa_port_disable_rt(dp); =20 - if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) - dev_uc_del(master, dev->dev_addr); + if (!ether_addr_equal(dev->dev_addr, conduit->dev_addr)) + dev_uc_del(conduit, dev->dev_addr); =20 if (dsa_switch_supports_uc_filtering(ds)) dsa_port_standalone_host_fdb_del(dp, dev->dev_addr, 0); @@ -413,43 +413,43 @@ static int dsa_slave_close(struct net_device *dev) return 0; } =20 -static void dsa_slave_manage_host_flood(struct net_device *dev) +static void dsa_user_manage_host_flood(struct net_device *dev) { bool mc =3D dev->flags & (IFF_PROMISC | IFF_ALLMULTI); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); bool uc =3D dev->flags & IFF_PROMISC; =20 dsa_port_set_host_flood(dp, uc, mc); } =20 -static void dsa_slave_change_rx_flags(struct net_device *dev, int change) +static void dsa_user_change_rx_flags(struct net_device *dev, int change) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (change & IFF_ALLMULTI) - dev_set_allmulti(master, + dev_set_allmulti(conduit, dev->flags & IFF_ALLMULTI ? 1 : -1); if (change & IFF_PROMISC) - dev_set_promiscuity(master, + dev_set_promiscuity(conduit, dev->flags & IFF_PROMISC ? 1 : -1); =20 if (dsa_switch_supports_uc_filtering(ds) && dsa_switch_supports_mc_filtering(ds)) - dsa_slave_manage_host_flood(dev); + dsa_user_manage_host_flood(dev); } =20 -static void dsa_slave_set_rx_mode(struct net_device *dev) +static void dsa_user_set_rx_mode(struct net_device *dev) { - __dev_mc_sync(dev, dsa_slave_sync_mc, dsa_slave_unsync_mc); - __dev_uc_sync(dev, dsa_slave_sync_uc, dsa_slave_unsync_uc); + __dev_mc_sync(dev, dsa_user_sync_mc, dsa_user_unsync_mc); + __dev_uc_sync(dev, dsa_user_sync_uc, dsa_user_unsync_uc); } =20 -static int dsa_slave_set_mac_address(struct net_device *dev, void *a) +static int dsa_user_set_mac_address(struct net_device *dev, void *a) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; struct sockaddr *addr =3D a; int err; @@ -465,7 +465,7 @@ static int dsa_slave_set_mac_address(struct net_device = *dev, void *a) } =20 /* If the port is down, the address isn't synced yet to hardware or - * to the DSA master, so there is nothing to change. + * to the DSA conduit, so there is nothing to change. */ if (!(dev->flags & IFF_UP)) goto out_change_dev_addr; @@ -476,14 +476,14 @@ static int dsa_slave_set_mac_address(struct net_devic= e *dev, void *a) return err; } =20 - if (!ether_addr_equal(addr->sa_data, master->dev_addr)) { - err =3D dev_uc_add(master, addr->sa_data); + if (!ether_addr_equal(addr->sa_data, conduit->dev_addr)) { + err =3D dev_uc_add(conduit, addr->sa_data); if (err < 0) goto del_unicast; } =20 - if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) - dev_uc_del(master, dev->dev_addr); + if (!ether_addr_equal(dev->dev_addr, conduit->dev_addr)) + dev_uc_del(conduit, dev->dev_addr); =20 if (dsa_switch_supports_uc_filtering(ds)) dsa_port_standalone_host_fdb_del(dp, dev->dev_addr, 0); @@ -500,7 +500,7 @@ static int dsa_slave_set_mac_address(struct net_device = *dev, void *a) return err; } =20 -struct dsa_slave_dump_ctx { +struct dsa_user_dump_ctx { struct net_device *dev; struct sk_buff *skb; struct netlink_callback *cb; @@ -508,10 +508,10 @@ struct dsa_slave_dump_ctx { }; =20 static int -dsa_slave_port_fdb_do_dump(const unsigned char *addr, u16 vid, +dsa_user_port_fdb_do_dump(const unsigned char *addr, u16 vid, bool is_static, void *data) { - struct dsa_slave_dump_ctx *dump =3D data; + struct dsa_user_dump_ctx *dump =3D data; u32 portid =3D NETLINK_CB(dump->cb->skb).portid; u32 seq =3D dump->cb->nlh->nlmsg_seq; struct nlmsghdr *nlh; @@ -552,12 +552,12 @@ dsa_slave_port_fdb_do_dump(const unsigned char *addr,= u16 vid, } =20 static int -dsa_slave_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, +dsa_user_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, struct net_device *dev, struct net_device *filter_dev, int *idx) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); - struct dsa_slave_dump_ctx dump =3D { + struct dsa_port *dp =3D dsa_user_to_port(dev); + struct dsa_user_dump_ctx dump =3D { .dev =3D dev, .skb =3D skb, .cb =3D cb, @@ -565,15 +565,15 @@ dsa_slave_fdb_dump(struct sk_buff *skb, struct netlin= k_callback *cb, }; int err; =20 - err =3D dsa_port_fdb_dump(dp, dsa_slave_port_fdb_do_dump, &dump); + err =3D dsa_port_fdb_dump(dp, dsa_user_port_fdb_do_dump, &dump); *idx =3D dump.idx; =20 return err; } =20 -static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int = cmd) +static int dsa_user_ioctl(struct net_device *dev, struct ifreq *ifr, int c= md) { - struct dsa_slave_priv *p =3D netdev_priv(dev); + struct dsa_user_priv *p =3D netdev_priv(dev); struct dsa_switch *ds =3D p->dp->ds; int port =3D p->dp->index; =20 @@ -592,11 +592,11 @@ static int dsa_slave_ioctl(struct net_device *dev, st= ruct ifreq *ifr, int cmd) return phylink_mii_ioctl(p->dp->pl, ifr, cmd); } =20 -static int dsa_slave_port_attr_set(struct net_device *dev, const void *ctx, +static int dsa_user_port_attr_set(struct net_device *dev, const void *ctx, const struct switchdev_attr *attr, struct netlink_ext_ack *extack) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); int ret; =20 if (ctx && ctx !=3D dp) @@ -663,13 +663,13 @@ static int dsa_slave_port_attr_set(struct net_device = *dev, const void *ctx, =20 /* Must be called under rcu_read_lock() */ static int -dsa_slave_vlan_check_for_8021q_uppers(struct net_device *slave, +dsa_user_vlan_check_for_8021q_uppers(struct net_device *user, const struct switchdev_obj_port_vlan *vlan) { struct net_device *upper_dev; struct list_head *iter; =20 - netdev_for_each_upper_dev_rcu(slave, upper_dev, iter) { + netdev_for_each_upper_dev_rcu(user, upper_dev, iter) { u16 vid; =20 if (!is_vlan_dev(upper_dev)) @@ -683,11 +683,11 @@ dsa_slave_vlan_check_for_8021q_uppers(struct net_devi= ce *slave, return 0; } =20 -static int dsa_slave_vlan_add(struct net_device *dev, +static int dsa_user_vlan_add(struct net_device *dev, const struct switchdev_obj *obj, struct netlink_ext_ack *extack) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct switchdev_obj_port_vlan *vlan; int err; =20 @@ -703,7 +703,7 @@ static int dsa_slave_vlan_add(struct net_device *dev, */ if (br_vlan_enabled(dsa_port_bridge_dev_get(dp))) { rcu_read_lock(); - err =3D dsa_slave_vlan_check_for_8021q_uppers(dev, vlan); + err =3D dsa_user_vlan_check_for_8021q_uppers(dev, vlan); rcu_read_unlock(); if (err) { NL_SET_ERR_MSG_MOD(extack, @@ -718,11 +718,11 @@ static int dsa_slave_vlan_add(struct net_device *dev, /* Offload a VLAN installed on the bridge or on a foreign interface by * installing it as a VLAN towards the CPU port. */ -static int dsa_slave_host_vlan_add(struct net_device *dev, +static int dsa_user_host_vlan_add(struct net_device *dev, const struct switchdev_obj *obj, struct netlink_ext_ack *extack) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct switchdev_obj_port_vlan vlan; =20 /* Do nothing if this is a software bridge */ @@ -744,11 +744,11 @@ static int dsa_slave_host_vlan_add(struct net_device = *dev, return dsa_port_host_vlan_add(dp, &vlan, extack); } =20 -static int dsa_slave_port_obj_add(struct net_device *dev, const void *ctx, +static int dsa_user_port_obj_add(struct net_device *dev, const void *ctx, const struct switchdev_obj *obj, struct netlink_ext_ack *extack) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); int err; =20 if (ctx && ctx !=3D dp) @@ -769,9 +769,9 @@ static int dsa_slave_port_obj_add(struct net_device *de= v, const void *ctx, break; case SWITCHDEV_OBJ_ID_PORT_VLAN: if (dsa_port_offloads_bridge_port(dp, obj->orig_dev)) - err =3D dsa_slave_vlan_add(dev, obj, extack); + err =3D dsa_user_vlan_add(dev, obj, extack); else - err =3D dsa_slave_host_vlan_add(dev, obj, extack); + err =3D dsa_user_host_vlan_add(dev, obj, extack); break; case SWITCHDEV_OBJ_ID_MRP: if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) @@ -794,10 +794,10 @@ static int dsa_slave_port_obj_add(struct net_device *= dev, const void *ctx, return err; } =20 -static int dsa_slave_vlan_del(struct net_device *dev, +static int dsa_user_vlan_del(struct net_device *dev, const struct switchdev_obj *obj) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct switchdev_obj_port_vlan *vlan; =20 if (dsa_port_skip_vlan_configuration(dp)) @@ -808,10 +808,10 @@ static int dsa_slave_vlan_del(struct net_device *dev, return dsa_port_vlan_del(dp, vlan); } =20 -static int dsa_slave_host_vlan_del(struct net_device *dev, +static int dsa_user_host_vlan_del(struct net_device *dev, const struct switchdev_obj *obj) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct switchdev_obj_port_vlan *vlan; =20 /* Do nothing if this is a software bridge */ @@ -826,10 +826,10 @@ static int dsa_slave_host_vlan_del(struct net_device = *dev, return dsa_port_host_vlan_del(dp, vlan); } =20 -static int dsa_slave_port_obj_del(struct net_device *dev, const void *ctx, +static int dsa_user_port_obj_del(struct net_device *dev, const void *ctx, const struct switchdev_obj *obj) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); int err; =20 if (ctx && ctx !=3D dp) @@ -850,9 +850,9 @@ static int dsa_slave_port_obj_del(struct net_device *de= v, const void *ctx, break; case SWITCHDEV_OBJ_ID_PORT_VLAN: if (dsa_port_offloads_bridge_port(dp, obj->orig_dev)) - err =3D dsa_slave_vlan_del(dev, obj); + err =3D dsa_user_vlan_del(dev, obj); else - err =3D dsa_slave_host_vlan_del(dev, obj); + err =3D dsa_user_host_vlan_del(dev, obj); break; case SWITCHDEV_OBJ_ID_MRP: if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) @@ -875,11 +875,11 @@ static int dsa_slave_port_obj_del(struct net_device *= dev, const void *ctx, return err; } =20 -static inline netdev_tx_t dsa_slave_netpoll_send_skb(struct net_device *de= v, +static inline netdev_tx_t dsa_user_netpoll_send_skb(struct net_device *dev, struct sk_buff *skb) { #ifdef CONFIG_NET_POLL_CONTROLLER - struct dsa_slave_priv *p =3D netdev_priv(dev); + struct dsa_user_priv *p =3D netdev_priv(dev); =20 return netpoll_send_skb(p->netpoll, skb); #else @@ -888,7 +888,7 @@ static inline netdev_tx_t dsa_slave_netpoll_send_skb(st= ruct net_device *dev, #endif } =20 -static void dsa_skb_tx_timestamp(struct dsa_slave_priv *p, +static void dsa_skb_tx_timestamp(struct dsa_user_priv *p, struct sk_buff *skb) { struct dsa_switch *ds =3D p->dp->ds; @@ -908,12 +908,12 @@ netdev_tx_t dsa_enqueue_skb(struct sk_buff *skb, stru= ct net_device *dev) * tag to be successfully transmitted */ if (unlikely(netpoll_tx_running(dev))) - return dsa_slave_netpoll_send_skb(dev, skb); + return dsa_user_netpoll_send_skb(dev, skb); =20 /* Queue the SKB for transmission on the parent interface, but * do not modify its EtherType */ - skb->dev =3D dsa_slave_to_master(dev); + skb->dev =3D dsa_user_to_conduit(dev); dev_queue_xmit(skb); =20 return NETDEV_TX_OK; @@ -927,7 +927,7 @@ static int dsa_realloc_skb(struct sk_buff *skb, struct = net_device *dev) =20 /* For tail taggers, we need to pad short frames ourselves, to ensure * that the tail tag does not fail at its role of being at the end of - * the packet, once the master interface pads the frame. Account for + * the packet, once the conduit interface pads the frame. Account for * that pad length here, and pad later. */ if (unlikely(needed_tailroom && skb->len < ETH_ZLEN)) @@ -944,9 +944,9 @@ static int dsa_realloc_skb(struct sk_buff *skb, struct = net_device *dev) GFP_ATOMIC); } =20 -static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, struct net_device *= dev) +static netdev_tx_t dsa_user_xmit(struct sk_buff *skb, struct net_device *d= ev) { - struct dsa_slave_priv *p =3D netdev_priv(dev); + struct dsa_user_priv *p =3D netdev_priv(dev); struct sk_buff *nskb; =20 dev_sw_netstats_tx_add(dev, 1, skb->len); @@ -981,7 +981,7 @@ static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, = struct net_device *dev) =20 /* ethtool operations ****************************************************= ***/ =20 -static void dsa_slave_get_drvinfo(struct net_device *dev, +static void dsa_user_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo) { strscpy(drvinfo->driver, "dsa", sizeof(drvinfo->driver)); @@ -989,9 +989,9 @@ static void dsa_slave_get_drvinfo(struct net_device *de= v, strscpy(drvinfo->bus_info, "platform", sizeof(drvinfo->bus_info)); } =20 -static int dsa_slave_get_regs_len(struct net_device *dev) +static int dsa_user_get_regs_len(struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_regs_len) @@ -1001,25 +1001,25 @@ static int dsa_slave_get_regs_len(struct net_device= *dev) } =20 static void -dsa_slave_get_regs(struct net_device *dev, struct ethtool_regs *regs, void= *_p) +dsa_user_get_regs(struct net_device *dev, struct ethtool_regs *regs, void = *_p) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_regs) ds->ops->get_regs(ds, dp->index, regs, _p); } =20 -static int dsa_slave_nway_reset(struct net_device *dev) +static int dsa_user_nway_reset(struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); =20 return phylink_ethtool_nway_reset(dp->pl); } =20 -static int dsa_slave_get_eeprom_len(struct net_device *dev) +static int dsa_user_get_eeprom_len(struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->cd && ds->cd->eeprom_len) @@ -1031,10 +1031,10 @@ static int dsa_slave_get_eeprom_len(struct net_devi= ce *dev) return 0; } =20 -static int dsa_slave_get_eeprom(struct net_device *dev, +static int dsa_user_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_eeprom) @@ -1043,10 +1043,10 @@ static int dsa_slave_get_eeprom(struct net_device *= dev, return -EOPNOTSUPP; } =20 -static int dsa_slave_set_eeprom(struct net_device *dev, +static int dsa_user_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->set_eeprom) @@ -1055,10 +1055,10 @@ static int dsa_slave_set_eeprom(struct net_device *= dev, return -EOPNOTSUPP; } =20 -static void dsa_slave_get_strings(struct net_device *dev, +static void dsa_user_get_strings(struct net_device *dev, uint32_t stringset, uint8_t *data) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (stringset =3D=3D ETH_SS_STATS) { @@ -1077,11 +1077,11 @@ static void dsa_slave_get_strings(struct net_device= *dev, =20 } =20 -static void dsa_slave_get_ethtool_stats(struct net_device *dev, +static void dsa_user_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, uint64_t *data) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; struct pcpu_sw_netstats *s; unsigned int start; @@ -1107,9 +1107,9 @@ static void dsa_slave_get_ethtool_stats(struct net_de= vice *dev, ds->ops->get_ethtool_stats(ds, dp->index, data + 4); } =20 -static int dsa_slave_get_sset_count(struct net_device *dev, int sset) +static int dsa_user_get_sset_count(struct net_device *dev, int sset) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (sset =3D=3D ETH_SS_STATS) { @@ -1129,20 +1129,20 @@ static int dsa_slave_get_sset_count(struct net_devi= ce *dev, int sset) return -EOPNOTSUPP; } =20 -static void dsa_slave_get_eth_phy_stats(struct net_device *dev, +static void dsa_user_get_eth_phy_stats(struct net_device *dev, struct ethtool_eth_phy_stats *phy_stats) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_eth_phy_stats) ds->ops->get_eth_phy_stats(ds, dp->index, phy_stats); } =20 -static void dsa_slave_get_eth_mac_stats(struct net_device *dev, +static void dsa_user_get_eth_mac_stats(struct net_device *dev, struct ethtool_eth_mac_stats *mac_stats) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_eth_mac_stats) @@ -1150,10 +1150,10 @@ static void dsa_slave_get_eth_mac_stats(struct net_= device *dev, } =20 static void -dsa_slave_get_eth_ctrl_stats(struct net_device *dev, +dsa_user_get_eth_ctrl_stats(struct net_device *dev, struct ethtool_eth_ctrl_stats *ctrl_stats) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_eth_ctrl_stats) @@ -1161,21 +1161,21 @@ dsa_slave_get_eth_ctrl_stats(struct net_device *dev, } =20 static void -dsa_slave_get_rmon_stats(struct net_device *dev, +dsa_user_get_rmon_stats(struct net_device *dev, struct ethtool_rmon_stats *rmon_stats, const struct ethtool_rmon_hist_range **ranges) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_rmon_stats) ds->ops->get_rmon_stats(ds, dp->index, rmon_stats, ranges); } =20 -static void dsa_slave_net_selftest(struct net_device *ndev, +static void dsa_user_net_selftest(struct net_device *ndev, struct ethtool_test *etest, u64 *buf) { - struct dsa_port *dp =3D dsa_slave_to_port(ndev); + struct dsa_port *dp =3D dsa_user_to_port(ndev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->self_test) { @@ -1186,10 +1186,10 @@ static void dsa_slave_net_selftest(struct net_devic= e *ndev, net_selftest(ndev, etest, buf); } =20 -static int dsa_slave_get_mm(struct net_device *dev, +static int dsa_user_get_mm(struct net_device *dev, struct ethtool_mm_state *state) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (!ds->ops->get_mm) @@ -1198,10 +1198,10 @@ static int dsa_slave_get_mm(struct net_device *dev, return ds->ops->get_mm(ds, dp->index, state); } =20 -static int dsa_slave_set_mm(struct net_device *dev, struct ethtool_mm_cfg = *cfg, +static int dsa_user_set_mm(struct net_device *dev, struct ethtool_mm_cfg *= cfg, struct netlink_ext_ack *extack) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (!ds->ops->set_mm) @@ -1210,19 +1210,19 @@ static int dsa_slave_set_mm(struct net_device *dev,= struct ethtool_mm_cfg *cfg, return ds->ops->set_mm(ds, dp->index, cfg, extack); } =20 -static void dsa_slave_get_mm_stats(struct net_device *dev, +static void dsa_user_get_mm_stats(struct net_device *dev, struct ethtool_mm_stats *stats) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_mm_stats) ds->ops->get_mm_stats(ds, dp->index, stats); } =20 -static void dsa_slave_get_wol(struct net_device *dev, struct ethtool_wolin= fo *w) +static void dsa_user_get_wol(struct net_device *dev, struct ethtool_wolinf= o *w) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 phylink_ethtool_get_wol(dp->pl, w); @@ -1231,9 +1231,9 @@ static void dsa_slave_get_wol(struct net_device *dev,= struct ethtool_wolinfo *w) ds->ops->get_wol(ds, dp->index, w); } =20 -static int dsa_slave_set_wol(struct net_device *dev, struct ethtool_wolinf= o *w) +static int dsa_user_set_wol(struct net_device *dev, struct ethtool_wolinfo= *w) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; int ret =3D -EOPNOTSUPP; =20 @@ -1245,9 +1245,9 @@ static int dsa_slave_set_wol(struct net_device *dev, = struct ethtool_wolinfo *w) return ret; } =20 -static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e) +static int dsa_user_set_eee(struct net_device *dev, struct ethtool_eee *e) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; int ret; =20 @@ -1265,9 +1265,9 @@ static int dsa_slave_set_eee(struct net_device *dev, = struct ethtool_eee *e) return phylink_ethtool_set_eee(dp->pl, e); } =20 -static int dsa_slave_get_eee(struct net_device *dev, struct ethtool_eee *e) +static int dsa_user_get_eee(struct net_device *dev, struct ethtool_eee *e) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; int ret; =20 @@ -1285,54 +1285,54 @@ static int dsa_slave_get_eee(struct net_device *dev= , struct ethtool_eee *e) return phylink_ethtool_get_eee(dp->pl, e); } =20 -static int dsa_slave_get_link_ksettings(struct net_device *dev, +static int dsa_user_get_link_ksettings(struct net_device *dev, struct ethtool_link_ksettings *cmd) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); =20 return phylink_ethtool_ksettings_get(dp->pl, cmd); } =20 -static int dsa_slave_set_link_ksettings(struct net_device *dev, +static int dsa_user_set_link_ksettings(struct net_device *dev, const struct ethtool_link_ksettings *cmd) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); =20 return phylink_ethtool_ksettings_set(dp->pl, cmd); } =20 -static void dsa_slave_get_pause_stats(struct net_device *dev, +static void dsa_user_get_pause_stats(struct net_device *dev, struct ethtool_pause_stats *pause_stats) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_pause_stats) ds->ops->get_pause_stats(ds, dp->index, pause_stats); } =20 -static void dsa_slave_get_pauseparam(struct net_device *dev, +static void dsa_user_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); =20 phylink_ethtool_get_pauseparam(dp->pl, pause); } =20 -static int dsa_slave_set_pauseparam(struct net_device *dev, +static int dsa_user_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); =20 return phylink_ethtool_set_pauseparam(dp->pl, pause); } =20 #ifdef CONFIG_NET_POLL_CONTROLLER -static int dsa_slave_netpoll_setup(struct net_device *dev, +static int dsa_user_netpoll_setup(struct net_device *dev, struct netpoll_info *ni) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_slave_priv *p =3D netdev_priv(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_user_priv *p =3D netdev_priv(dev); struct netpoll *netpoll; int err =3D 0; =20 @@ -1340,7 +1340,7 @@ static int dsa_slave_netpoll_setup(struct net_device = *dev, if (!netpoll) return -ENOMEM; =20 - err =3D __netpoll_setup(netpoll, master); + err =3D __netpoll_setup(netpoll, conduit); if (err) { kfree(netpoll); goto out; @@ -1351,9 +1351,9 @@ static int dsa_slave_netpoll_setup(struct net_device = *dev, return err; } =20 -static void dsa_slave_netpoll_cleanup(struct net_device *dev) +static void dsa_user_netpoll_cleanup(struct net_device *dev) { - struct dsa_slave_priv *p =3D netdev_priv(dev); + struct dsa_user_priv *p =3D netdev_priv(dev); struct netpoll *netpoll =3D p->netpoll; =20 if (!netpoll) @@ -1364,15 +1364,15 @@ static void dsa_slave_netpoll_cleanup(struct net_de= vice *dev) __netpoll_free(netpoll); } =20 -static void dsa_slave_poll_controller(struct net_device *dev) +static void dsa_user_poll_controller(struct net_device *dev) { } #endif =20 static struct dsa_mall_tc_entry * -dsa_slave_mall_tc_entry_find(struct net_device *dev, unsigned long cookie) +dsa_user_mall_tc_entry_find(struct net_device *dev, unsigned long cookie) { - struct dsa_slave_priv *p =3D netdev_priv(dev); + struct dsa_user_priv *p =3D netdev_priv(dev); struct dsa_mall_tc_entry *mall_tc_entry; =20 list_for_each_entry(mall_tc_entry, &p->mall_tc_list, list) @@ -1383,13 +1383,13 @@ dsa_slave_mall_tc_entry_find(struct net_device *dev= , unsigned long cookie) } =20 static int -dsa_slave_add_cls_matchall_mirred(struct net_device *dev, +dsa_user_add_cls_matchall_mirred(struct net_device *dev, struct tc_cls_matchall_offload *cls, bool ingress) { struct netlink_ext_ack *extack =3D cls->common.extack; - struct dsa_port *dp =3D dsa_slave_to_port(dev); - struct dsa_slave_priv *p =3D netdev_priv(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); + struct dsa_user_priv *p =3D netdev_priv(dev); struct dsa_mall_mirror_tc_entry *mirror; struct dsa_mall_tc_entry *mall_tc_entry; struct dsa_switch *ds =3D dp->ds; @@ -1409,7 +1409,7 @@ dsa_slave_add_cls_matchall_mirred(struct net_device *= dev, if (!act->dev) return -EINVAL; =20 - if (!dsa_slave_dev_check(act->dev)) + if (!dsa_user_dev_check(act->dev)) return -EOPNOTSUPP; =20 mall_tc_entry =3D kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL); @@ -1420,7 +1420,7 @@ dsa_slave_add_cls_matchall_mirred(struct net_device *= dev, mall_tc_entry->type =3D DSA_PORT_MALL_MIRROR; mirror =3D &mall_tc_entry->mirror; =20 - to_dp =3D dsa_slave_to_port(act->dev); + to_dp =3D dsa_user_to_port(act->dev); =20 mirror->to_local_port =3D to_dp->index; mirror->ingress =3D ingress; @@ -1437,13 +1437,13 @@ dsa_slave_add_cls_matchall_mirred(struct net_device= *dev, } =20 static int -dsa_slave_add_cls_matchall_police(struct net_device *dev, +dsa_user_add_cls_matchall_police(struct net_device *dev, struct tc_cls_matchall_offload *cls, bool ingress) { struct netlink_ext_ack *extack =3D cls->common.extack; - struct dsa_port *dp =3D dsa_slave_to_port(dev); - struct dsa_slave_priv *p =3D netdev_priv(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); + struct dsa_user_priv *p =3D netdev_priv(dev); struct dsa_mall_policer_tc_entry *policer; struct dsa_mall_tc_entry *mall_tc_entry; struct dsa_switch *ds =3D dp->ds; @@ -1497,7 +1497,7 @@ dsa_slave_add_cls_matchall_police(struct net_device *= dev, return err; } =20 -static int dsa_slave_add_cls_matchall(struct net_device *dev, +static int dsa_user_add_cls_matchall(struct net_device *dev, struct tc_cls_matchall_offload *cls, bool ingress) { @@ -1506,22 +1506,22 @@ static int dsa_slave_add_cls_matchall(struct net_de= vice *dev, if (cls->common.protocol =3D=3D htons(ETH_P_ALL) && flow_offload_has_one_action(&cls->rule->action) && cls->rule->action.entries[0].id =3D=3D FLOW_ACTION_MIRRED) - err =3D dsa_slave_add_cls_matchall_mirred(dev, cls, ingress); + err =3D dsa_user_add_cls_matchall_mirred(dev, cls, ingress); else if (flow_offload_has_one_action(&cls->rule->action) && cls->rule->action.entries[0].id =3D=3D FLOW_ACTION_POLICE) - err =3D dsa_slave_add_cls_matchall_police(dev, cls, ingress); + err =3D dsa_user_add_cls_matchall_police(dev, cls, ingress); =20 return err; } =20 -static void dsa_slave_del_cls_matchall(struct net_device *dev, +static void dsa_user_del_cls_matchall(struct net_device *dev, struct tc_cls_matchall_offload *cls) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_mall_tc_entry *mall_tc_entry; struct dsa_switch *ds =3D dp->ds; =20 - mall_tc_entry =3D dsa_slave_mall_tc_entry_find(dev, cls->cookie); + mall_tc_entry =3D dsa_user_mall_tc_entry_find(dev, cls->cookie); if (!mall_tc_entry) return; =20 @@ -1544,7 +1544,7 @@ static void dsa_slave_del_cls_matchall(struct net_dev= ice *dev, kfree(mall_tc_entry); } =20 -static int dsa_slave_setup_tc_cls_matchall(struct net_device *dev, +static int dsa_user_setup_tc_cls_matchall(struct net_device *dev, struct tc_cls_matchall_offload *cls, bool ingress) { @@ -1553,20 +1553,20 @@ static int dsa_slave_setup_tc_cls_matchall(struct n= et_device *dev, =20 switch (cls->command) { case TC_CLSMATCHALL_REPLACE: - return dsa_slave_add_cls_matchall(dev, cls, ingress); + return dsa_user_add_cls_matchall(dev, cls, ingress); case TC_CLSMATCHALL_DESTROY: - dsa_slave_del_cls_matchall(dev, cls); + dsa_user_del_cls_matchall(dev, cls); return 0; default: return -EOPNOTSUPP; } } =20 -static int dsa_slave_add_cls_flower(struct net_device *dev, +static int dsa_user_add_cls_flower(struct net_device *dev, struct flow_cls_offload *cls, bool ingress) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; int port =3D dp->index; =20 @@ -1576,11 +1576,11 @@ static int dsa_slave_add_cls_flower(struct net_devi= ce *dev, return ds->ops->cls_flower_add(ds, port, cls, ingress); } =20 -static int dsa_slave_del_cls_flower(struct net_device *dev, +static int dsa_user_del_cls_flower(struct net_device *dev, struct flow_cls_offload *cls, bool ingress) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; int port =3D dp->index; =20 @@ -1590,11 +1590,11 @@ static int dsa_slave_del_cls_flower(struct net_devi= ce *dev, return ds->ops->cls_flower_del(ds, port, cls, ingress); } =20 -static int dsa_slave_stats_cls_flower(struct net_device *dev, +static int dsa_user_stats_cls_flower(struct net_device *dev, struct flow_cls_offload *cls, bool ingress) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; int port =3D dp->index; =20 @@ -1604,23 +1604,23 @@ static int dsa_slave_stats_cls_flower(struct net_de= vice *dev, return ds->ops->cls_flower_stats(ds, port, cls, ingress); } =20 -static int dsa_slave_setup_tc_cls_flower(struct net_device *dev, +static int dsa_user_setup_tc_cls_flower(struct net_device *dev, struct flow_cls_offload *cls, bool ingress) { switch (cls->command) { case FLOW_CLS_REPLACE: - return dsa_slave_add_cls_flower(dev, cls, ingress); + return dsa_user_add_cls_flower(dev, cls, ingress); case FLOW_CLS_DESTROY: - return dsa_slave_del_cls_flower(dev, cls, ingress); + return dsa_user_del_cls_flower(dev, cls, ingress); case FLOW_CLS_STATS: - return dsa_slave_stats_cls_flower(dev, cls, ingress); + return dsa_user_stats_cls_flower(dev, cls, ingress); default: return -EOPNOTSUPP; } } =20 -static int dsa_slave_setup_tc_block_cb(enum tc_setup_type type, void *type= _data, +static int dsa_user_setup_tc_block_cb(enum tc_setup_type type, void *type_= data, void *cb_priv, bool ingress) { struct net_device *dev =3D cb_priv; @@ -1630,46 +1630,46 @@ static int dsa_slave_setup_tc_block_cb(enum tc_setu= p_type type, void *type_data, =20 switch (type) { case TC_SETUP_CLSMATCHALL: - return dsa_slave_setup_tc_cls_matchall(dev, type_data, ingress); + return dsa_user_setup_tc_cls_matchall(dev, type_data, ingress); case TC_SETUP_CLSFLOWER: - return dsa_slave_setup_tc_cls_flower(dev, type_data, ingress); + return dsa_user_setup_tc_cls_flower(dev, type_data, ingress); default: return -EOPNOTSUPP; } } =20 -static int dsa_slave_setup_tc_block_cb_ig(enum tc_setup_type type, +static int dsa_user_setup_tc_block_cb_ig(enum tc_setup_type type, void *type_data, void *cb_priv) { - return dsa_slave_setup_tc_block_cb(type, type_data, cb_priv, true); + return dsa_user_setup_tc_block_cb(type, type_data, cb_priv, true); } =20 -static int dsa_slave_setup_tc_block_cb_eg(enum tc_setup_type type, +static int dsa_user_setup_tc_block_cb_eg(enum tc_setup_type type, void *type_data, void *cb_priv) { - return dsa_slave_setup_tc_block_cb(type, type_data, cb_priv, false); + return dsa_user_setup_tc_block_cb(type, type_data, cb_priv, false); } =20 -static LIST_HEAD(dsa_slave_block_cb_list); +static LIST_HEAD(dsa_user_block_cb_list); =20 -static int dsa_slave_setup_tc_block(struct net_device *dev, +static int dsa_user_setup_tc_block(struct net_device *dev, struct flow_block_offload *f) { struct flow_block_cb *block_cb; flow_setup_cb_t *cb; =20 if (f->binder_type =3D=3D FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS) - cb =3D dsa_slave_setup_tc_block_cb_ig; + cb =3D dsa_user_setup_tc_block_cb_ig; else if (f->binder_type =3D=3D FLOW_BLOCK_BINDER_TYPE_CLSACT_EGRESS) - cb =3D dsa_slave_setup_tc_block_cb_eg; + cb =3D dsa_user_setup_tc_block_cb_eg; else return -EOPNOTSUPP; =20 - f->driver_block_list =3D &dsa_slave_block_cb_list; + f->driver_block_list =3D &dsa_user_block_cb_list; =20 switch (f->command) { case FLOW_BLOCK_BIND: - if (flow_block_cb_is_busy(cb, dev, &dsa_slave_block_cb_list)) + if (flow_block_cb_is_busy(cb, dev, &dsa_user_block_cb_list)) return -EBUSY; =20 block_cb =3D flow_block_cb_alloc(cb, dev, dev, NULL); @@ -1677,7 +1677,7 @@ static int dsa_slave_setup_tc_block(struct net_device= *dev, return PTR_ERR(block_cb); =20 flow_block_cb_add(block_cb, f); - list_add_tail(&block_cb->driver_list, &dsa_slave_block_cb_list); + list_add_tail(&block_cb->driver_list, &dsa_user_block_cb_list); return 0; case FLOW_BLOCK_UNBIND: block_cb =3D flow_block_cb_lookup(f->block, cb, dev); @@ -1692,28 +1692,28 @@ static int dsa_slave_setup_tc_block(struct net_devi= ce *dev, } } =20 -static int dsa_slave_setup_ft_block(struct dsa_switch *ds, int port, +static int dsa_user_setup_ft_block(struct dsa_switch *ds, int port, void *type_data) { - struct net_device *master =3D dsa_port_to_master(dsa_to_port(ds, port)); + struct net_device *conduit =3D dsa_port_to_conduit(dsa_to_port(ds, port)); =20 - if (!master->netdev_ops->ndo_setup_tc) + if (!conduit->netdev_ops->ndo_setup_tc) return -EOPNOTSUPP; =20 - return master->netdev_ops->ndo_setup_tc(master, TC_SETUP_FT, type_data); + return conduit->netdev_ops->ndo_setup_tc(conduit, TC_SETUP_FT, type_data); } =20 -static int dsa_slave_setup_tc(struct net_device *dev, enum tc_setup_type t= ype, +static int dsa_user_setup_tc(struct net_device *dev, enum tc_setup_type ty= pe, void *type_data) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 switch (type) { case TC_SETUP_BLOCK: - return dsa_slave_setup_tc_block(dev, type_data); + return dsa_user_setup_tc_block(dev, type_data); case TC_SETUP_FT: - return dsa_slave_setup_ft_block(ds, dp->index, type_data); + return dsa_user_setup_ft_block(ds, dp->index, type_data); default: break; } @@ -1724,10 +1724,10 @@ static int dsa_slave_setup_tc(struct net_device *de= v, enum tc_setup_type type, return ds->ops->port_setup_tc(ds, dp->index, type, type_data); } =20 -static int dsa_slave_get_rxnfc(struct net_device *dev, +static int dsa_user_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *nfc, u32 *rule_locs) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (!ds->ops->get_rxnfc) @@ -1736,10 +1736,10 @@ static int dsa_slave_get_rxnfc(struct net_device *d= ev, return ds->ops->get_rxnfc(ds, dp->index, nfc, rule_locs); } =20 -static int dsa_slave_set_rxnfc(struct net_device *dev, +static int dsa_user_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *nfc) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (!ds->ops->set_rxnfc) @@ -1748,10 +1748,10 @@ static int dsa_slave_set_rxnfc(struct net_device *d= ev, return ds->ops->set_rxnfc(ds, dp->index, nfc); } =20 -static int dsa_slave_get_ts_info(struct net_device *dev, +static int dsa_user_get_ts_info(struct net_device *dev, struct ethtool_ts_info *ts) { - struct dsa_slave_priv *p =3D netdev_priv(dev); + struct dsa_user_priv *p =3D netdev_priv(dev); struct dsa_switch *ds =3D p->dp->ds; =20 if (!ds->ops->get_ts_info) @@ -1760,10 +1760,10 @@ static int dsa_slave_get_ts_info(struct net_device = *dev, return ds->ops->get_ts_info(ds, p->dp->index, ts); } =20 -static int dsa_slave_vlan_rx_add_vid(struct net_device *dev, __be16 proto, +static int dsa_user_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct switchdev_obj_port_vlan vlan =3D { .obj.id =3D SWITCHDEV_OBJ_ID_PORT_VLAN, .vid =3D vid, @@ -1810,14 +1810,14 @@ static int dsa_slave_vlan_rx_add_vid(struct net_dev= ice *dev, __be16 proto, =20 if (dsa_switch_supports_mc_filtering(ds)) { netdev_for_each_synced_mc_addr(ha, dev) { - dsa_slave_schedule_standalone_work(dev, DSA_MC_ADD, + dsa_user_schedule_standalone_work(dev, DSA_MC_ADD, ha->addr, vid); } } =20 if (dsa_switch_supports_uc_filtering(ds)) { netdev_for_each_synced_uc_addr(ha, dev) { - dsa_slave_schedule_standalone_work(dev, DSA_UC_ADD, + dsa_user_schedule_standalone_work(dev, DSA_UC_ADD, ha->addr, vid); } } @@ -1835,10 +1835,10 @@ static int dsa_slave_vlan_rx_add_vid(struct net_dev= ice *dev, __be16 proto, return ret; } =20 -static int dsa_slave_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, +static int dsa_user_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct switchdev_obj_port_vlan vlan =3D { .vid =3D vid, /* This API only allows programming tagged, non-PVID VIDs */ @@ -1874,14 +1874,14 @@ static int dsa_slave_vlan_rx_kill_vid(struct net_de= vice *dev, __be16 proto, =20 if (dsa_switch_supports_mc_filtering(ds)) { netdev_for_each_synced_mc_addr(ha, dev) { - dsa_slave_schedule_standalone_work(dev, DSA_MC_DEL, + dsa_user_schedule_standalone_work(dev, DSA_MC_DEL, ha->addr, vid); } } =20 if (dsa_switch_supports_uc_filtering(ds)) { netdev_for_each_synced_uc_addr(ha, dev) { - dsa_slave_schedule_standalone_work(dev, DSA_UC_DEL, + dsa_user_schedule_standalone_work(dev, DSA_UC_DEL, ha->addr, vid); } } @@ -1893,18 +1893,18 @@ static int dsa_slave_vlan_rx_kill_vid(struct net_de= vice *dev, __be16 proto, return 0; } =20 -static int dsa_slave_restore_vlan(struct net_device *vdev, int vid, void *= arg) +static int dsa_user_restore_vlan(struct net_device *vdev, int vid, void *a= rg) { __be16 proto =3D vdev ? vlan_dev_vlan_proto(vdev) : htons(ETH_P_8021Q); =20 - return dsa_slave_vlan_rx_add_vid(arg, proto, vid); + return dsa_user_vlan_rx_add_vid(arg, proto, vid); } =20 -static int dsa_slave_clear_vlan(struct net_device *vdev, int vid, void *ar= g) +static int dsa_user_clear_vlan(struct net_device *vdev, int vid, void *arg) { __be16 proto =3D vdev ? vlan_dev_vlan_proto(vdev) : htons(ETH_P_8021Q); =20 - return dsa_slave_vlan_rx_kill_vid(arg, proto, vid); + return dsa_user_vlan_rx_kill_vid(arg, proto, vid); } =20 /* Keep the VLAN RX filtering list in sync with the hardware only if VLAN @@ -1938,26 +1938,26 @@ static int dsa_slave_clear_vlan(struct net_device *= vdev, int vid, void *arg) * - the bridge VLANs * - the 8021q upper VLANs */ -int dsa_slave_manage_vlan_filtering(struct net_device *slave, +int dsa_user_manage_vlan_filtering(struct net_device *user, bool vlan_filtering) { int err; =20 if (vlan_filtering) { - slave->features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; + user->features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; =20 - err =3D vlan_for_each(slave, dsa_slave_restore_vlan, slave); + err =3D vlan_for_each(user, dsa_user_restore_vlan, user); if (err) { - vlan_for_each(slave, dsa_slave_clear_vlan, slave); - slave->features &=3D ~NETIF_F_HW_VLAN_CTAG_FILTER; + vlan_for_each(user, dsa_user_clear_vlan, user); + user->features &=3D ~NETIF_F_HW_VLAN_CTAG_FILTER; return err; } } else { - err =3D vlan_for_each(slave, dsa_slave_clear_vlan, slave); + err =3D vlan_for_each(user, dsa_user_clear_vlan, user); if (err) return err; =20 - slave->features &=3D ~NETIF_F_HW_VLAN_CTAG_FILTER; + user->features &=3D ~NETIF_F_HW_VLAN_CTAG_FILTER; } =20 return 0; @@ -2028,7 +2028,7 @@ static void dsa_bridge_mtu_normalization(struct dsa_p= ort *dp) list_for_each_entry(dst, &dsa_tree_list, list) { list_for_each_entry(other_dp, &dst->ports, list) { struct dsa_hw_port *hw_port; - struct net_device *slave; + struct net_device *user; =20 if (other_dp->type !=3D DSA_PORT_TYPE_USER) continue; @@ -2039,17 +2039,17 @@ static void dsa_bridge_mtu_normalization(struct dsa= _port *dp) if (!other_dp->ds->mtu_enforcement_ingress) continue; =20 - slave =3D other_dp->slave; + user =3D other_dp->user; =20 - if (min_mtu > slave->mtu) - min_mtu =3D slave->mtu; + if (min_mtu > user->mtu) + min_mtu =3D user->mtu; =20 hw_port =3D kzalloc(sizeof(*hw_port), GFP_KERNEL); if (!hw_port) goto out; =20 - hw_port->dev =3D slave; - hw_port->old_mtu =3D slave->mtu; + hw_port->dev =3D user; + hw_port->old_mtu =3D user->mtu; =20 list_add(&hw_port->list, &hw_port_list); } @@ -2059,7 +2059,7 @@ static void dsa_bridge_mtu_normalization(struct dsa_p= ort *dp) * interface's MTU first, regardless of whether the intention of the * user was to raise or lower it. */ - err =3D dsa_hw_port_list_set_mtu(&hw_port_list, dp->slave->mtu); + err =3D dsa_hw_port_list_set_mtu(&hw_port_list, dp->user->mtu); if (!err) goto out; =20 @@ -2073,16 +2073,16 @@ static void dsa_bridge_mtu_normalization(struct dsa= _port *dp) dsa_hw_port_list_free(&hw_port_list); } =20 -int dsa_slave_change_mtu(struct net_device *dev, int new_mtu) +int dsa_user_change_mtu(struct net_device *dev, int new_mtu) { - struct net_device *master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_port *cpu_dp =3D dp->cpu_dp; struct dsa_switch *ds =3D dp->ds; struct dsa_port *other_dp; int largest_mtu =3D 0; - int new_master_mtu; - int old_master_mtu; + int new_conduit_mtu; + int old_conduit_mtu; int mtu_limit; int overhead; int cpu_mtu; @@ -2092,44 +2092,44 @@ int dsa_slave_change_mtu(struct net_device *dev, in= t new_mtu) return -EOPNOTSUPP; =20 dsa_tree_for_each_user_port(other_dp, ds->dst) { - int slave_mtu; + int user_mtu; =20 - /* During probe, this function will be called for each slave + /* During probe, this function will be called for each user * device, while not all of them have been allocated. That's * ok, it doesn't change what the maximum is, so ignore it. */ - if (!other_dp->slave) + if (!other_dp->user) continue; =20 /* Pretend that we already applied the setting, which we * actually haven't (still haven't done all integrity checks) */ if (dp =3D=3D other_dp) - slave_mtu =3D new_mtu; + user_mtu =3D new_mtu; else - slave_mtu =3D other_dp->slave->mtu; + user_mtu =3D other_dp->user->mtu; =20 - if (largest_mtu < slave_mtu) - largest_mtu =3D slave_mtu; + if (largest_mtu < user_mtu) + largest_mtu =3D user_mtu; } =20 overhead =3D dsa_tag_protocol_overhead(cpu_dp->tag_ops); - mtu_limit =3D min_t(int, master->max_mtu, dev->max_mtu + overhead); - old_master_mtu =3D master->mtu; - new_master_mtu =3D largest_mtu + overhead; - if (new_master_mtu > mtu_limit) + mtu_limit =3D min_t(int, conduit->max_mtu, dev->max_mtu + overhead); + old_conduit_mtu =3D conduit->mtu; + new_conduit_mtu =3D largest_mtu + overhead; + if (new_conduit_mtu > mtu_limit) return -ERANGE; =20 - /* If the master MTU isn't over limit, there's no need to check the CPU + /* If the conduit MTU isn't over limit, there's no need to check the CPU * MTU, since that surely isn't either. */ cpu_mtu =3D largest_mtu; =20 /* Start applying stuff */ - if (new_master_mtu !=3D old_master_mtu) { - err =3D dev_set_mtu(master, new_master_mtu); + if (new_conduit_mtu !=3D old_conduit_mtu) { + err =3D dev_set_mtu(conduit, new_conduit_mtu); if (err < 0) - goto out_master_failed; + goto out_conduit_failed; =20 /* We only need to propagate the MTU of the CPU port to * upstream switches, so emit a notifier which updates them. @@ -2150,19 +2150,19 @@ int dsa_slave_change_mtu(struct net_device *dev, in= t new_mtu) return 0; =20 out_port_failed: - if (new_master_mtu !=3D old_master_mtu) - dsa_port_mtu_change(cpu_dp, old_master_mtu - overhead); + if (new_conduit_mtu !=3D old_conduit_mtu) + dsa_port_mtu_change(cpu_dp, old_conduit_mtu - overhead); out_cpu_failed: - if (new_master_mtu !=3D old_master_mtu) - dev_set_mtu(master, old_master_mtu); -out_master_failed: + if (new_conduit_mtu !=3D old_conduit_mtu) + dev_set_mtu(conduit, old_conduit_mtu); +out_conduit_failed: return err; } =20 static int __maybe_unused -dsa_slave_dcbnl_set_default_prio(struct net_device *dev, struct dcb_app *a= pp) +dsa_user_dcbnl_set_default_prio(struct net_device *dev, struct dcb_app *ap= p) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; unsigned long mask, new_prio; int err, port =3D dp->index; @@ -2187,9 +2187,9 @@ dsa_slave_dcbnl_set_default_prio(struct net_device *d= ev, struct dcb_app *app) } =20 static int __maybe_unused -dsa_slave_dcbnl_add_dscp_prio(struct net_device *dev, struct dcb_app *app) +dsa_user_dcbnl_add_dscp_prio(struct net_device *dev, struct dcb_app *app) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; unsigned long mask, new_prio; int err, port =3D dp->index; @@ -2220,29 +2220,29 @@ dsa_slave_dcbnl_add_dscp_prio(struct net_device *de= v, struct dcb_app *app) return 0; } =20 -static int __maybe_unused dsa_slave_dcbnl_ieee_setapp(struct net_device *d= ev, +static int __maybe_unused dsa_user_dcbnl_ieee_setapp(struct net_device *de= v, struct dcb_app *app) { switch (app->selector) { case IEEE_8021QAZ_APP_SEL_ETHERTYPE: switch (app->protocol) { case 0: - return dsa_slave_dcbnl_set_default_prio(dev, app); + return dsa_user_dcbnl_set_default_prio(dev, app); default: return -EOPNOTSUPP; } break; case IEEE_8021QAZ_APP_SEL_DSCP: - return dsa_slave_dcbnl_add_dscp_prio(dev, app); + return dsa_user_dcbnl_add_dscp_prio(dev, app); default: return -EOPNOTSUPP; } } =20 static int __maybe_unused -dsa_slave_dcbnl_del_default_prio(struct net_device *dev, struct dcb_app *a= pp) +dsa_user_dcbnl_del_default_prio(struct net_device *dev, struct dcb_app *ap= p) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; unsigned long mask, new_prio; int err, port =3D dp->index; @@ -2267,9 +2267,9 @@ dsa_slave_dcbnl_del_default_prio(struct net_device *d= ev, struct dcb_app *app) } =20 static int __maybe_unused -dsa_slave_dcbnl_del_dscp_prio(struct net_device *dev, struct dcb_app *app) +dsa_user_dcbnl_del_dscp_prio(struct net_device *dev, struct dcb_app *app) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; int err, port =3D dp->index; u8 dscp =3D app->protocol; @@ -2290,20 +2290,20 @@ dsa_slave_dcbnl_del_dscp_prio(struct net_device *de= v, struct dcb_app *app) return 0; } =20 -static int __maybe_unused dsa_slave_dcbnl_ieee_delapp(struct net_device *d= ev, +static int __maybe_unused dsa_user_dcbnl_ieee_delapp(struct net_device *de= v, struct dcb_app *app) { switch (app->selector) { case IEEE_8021QAZ_APP_SEL_ETHERTYPE: switch (app->protocol) { case 0: - return dsa_slave_dcbnl_del_default_prio(dev, app); + return dsa_user_dcbnl_del_default_prio(dev, app); default: return -EOPNOTSUPP; } break; case IEEE_8021QAZ_APP_SEL_DSCP: - return dsa_slave_dcbnl_del_dscp_prio(dev, app); + return dsa_user_dcbnl_del_dscp_prio(dev, app); default: return -EOPNOTSUPP; } @@ -2312,9 +2312,9 @@ static int __maybe_unused dsa_slave_dcbnl_ieee_delapp= (struct net_device *dev, /* Pre-populate the DCB application priority table with the priorities * configured during switch setup, which we read from hardware here. */ -static int dsa_slave_dcbnl_init(struct net_device *dev) +static int dsa_user_dcbnl_init(struct net_device *dev) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; int port =3D dp->index; int err; @@ -2362,49 +2362,49 @@ static int dsa_slave_dcbnl_init(struct net_device *= dev) return 0; } =20 -static const struct ethtool_ops dsa_slave_ethtool_ops =3D { - .get_drvinfo =3D dsa_slave_get_drvinfo, - .get_regs_len =3D dsa_slave_get_regs_len, - .get_regs =3D dsa_slave_get_regs, - .nway_reset =3D dsa_slave_nway_reset, +static const struct ethtool_ops dsa_user_ethtool_ops =3D { + .get_drvinfo =3D dsa_user_get_drvinfo, + .get_regs_len =3D dsa_user_get_regs_len, + .get_regs =3D dsa_user_get_regs, + .nway_reset =3D dsa_user_nway_reset, .get_link =3D ethtool_op_get_link, - .get_eeprom_len =3D dsa_slave_get_eeprom_len, - .get_eeprom =3D dsa_slave_get_eeprom, - .set_eeprom =3D dsa_slave_set_eeprom, - .get_strings =3D dsa_slave_get_strings, - .get_ethtool_stats =3D dsa_slave_get_ethtool_stats, - .get_sset_count =3D dsa_slave_get_sset_count, - .get_eth_phy_stats =3D dsa_slave_get_eth_phy_stats, - .get_eth_mac_stats =3D dsa_slave_get_eth_mac_stats, - .get_eth_ctrl_stats =3D dsa_slave_get_eth_ctrl_stats, - .get_rmon_stats =3D dsa_slave_get_rmon_stats, - .set_wol =3D dsa_slave_set_wol, - .get_wol =3D dsa_slave_get_wol, - .set_eee =3D dsa_slave_set_eee, - .get_eee =3D dsa_slave_get_eee, - .get_link_ksettings =3D dsa_slave_get_link_ksettings, - .set_link_ksettings =3D dsa_slave_set_link_ksettings, - .get_pause_stats =3D dsa_slave_get_pause_stats, - .get_pauseparam =3D dsa_slave_get_pauseparam, - .set_pauseparam =3D dsa_slave_set_pauseparam, - .get_rxnfc =3D dsa_slave_get_rxnfc, - .set_rxnfc =3D dsa_slave_set_rxnfc, - .get_ts_info =3D dsa_slave_get_ts_info, - .self_test =3D dsa_slave_net_selftest, - .get_mm =3D dsa_slave_get_mm, - .set_mm =3D dsa_slave_set_mm, - .get_mm_stats =3D dsa_slave_get_mm_stats, + .get_eeprom_len =3D dsa_user_get_eeprom_len, + .get_eeprom =3D dsa_user_get_eeprom, + .set_eeprom =3D dsa_user_set_eeprom, + .get_strings =3D dsa_user_get_strings, + .get_ethtool_stats =3D dsa_user_get_ethtool_stats, + .get_sset_count =3D dsa_user_get_sset_count, + .get_eth_phy_stats =3D dsa_user_get_eth_phy_stats, + .get_eth_mac_stats =3D dsa_user_get_eth_mac_stats, + .get_eth_ctrl_stats =3D dsa_user_get_eth_ctrl_stats, + .get_rmon_stats =3D dsa_user_get_rmon_stats, + .set_wol =3D dsa_user_set_wol, + .get_wol =3D dsa_user_get_wol, + .set_eee =3D dsa_user_set_eee, + .get_eee =3D dsa_user_get_eee, + .get_link_ksettings =3D dsa_user_get_link_ksettings, + .set_link_ksettings =3D dsa_user_set_link_ksettings, + .get_pause_stats =3D dsa_user_get_pause_stats, + .get_pauseparam =3D dsa_user_get_pauseparam, + .set_pauseparam =3D dsa_user_set_pauseparam, + .get_rxnfc =3D dsa_user_get_rxnfc, + .set_rxnfc =3D dsa_user_set_rxnfc, + .get_ts_info =3D dsa_user_get_ts_info, + .self_test =3D dsa_user_net_selftest, + .get_mm =3D dsa_user_get_mm, + .set_mm =3D dsa_user_set_mm, + .get_mm_stats =3D dsa_user_get_mm_stats, }; =20 -static const struct dcbnl_rtnl_ops __maybe_unused dsa_slave_dcbnl_ops =3D { - .ieee_setapp =3D dsa_slave_dcbnl_ieee_setapp, - .ieee_delapp =3D dsa_slave_dcbnl_ieee_delapp, +static const struct dcbnl_rtnl_ops __maybe_unused dsa_user_dcbnl_ops =3D { + .ieee_setapp =3D dsa_user_dcbnl_ieee_setapp, + .ieee_delapp =3D dsa_user_dcbnl_ieee_delapp, }; =20 -static void dsa_slave_get_stats64(struct net_device *dev, +static void dsa_user_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *s) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; =20 if (ds->ops->get_stats64) @@ -2413,43 +2413,43 @@ static void dsa_slave_get_stats64(struct net_device= *dev, dev_get_tstats64(dev, s); } =20 -static int dsa_slave_fill_forward_path(struct net_device_path_ctx *ctx, +static int dsa_user_fill_forward_path(struct net_device_path_ctx *ctx, struct net_device_path *path) { - struct dsa_port *dp =3D dsa_slave_to_port(ctx->dev); - struct net_device *master =3D dsa_port_to_master(dp); + struct dsa_port *dp =3D dsa_user_to_port(ctx->dev); + struct net_device *conduit =3D dsa_port_to_conduit(dp); struct dsa_port *cpu_dp =3D dp->cpu_dp; =20 path->dev =3D ctx->dev; path->type =3D DEV_PATH_DSA; path->dsa.proto =3D cpu_dp->tag_ops->proto; path->dsa.port =3D dp->index; - ctx->dev =3D master; + ctx->dev =3D conduit; =20 return 0; } =20 -static const struct net_device_ops dsa_slave_netdev_ops =3D { - .ndo_open =3D dsa_slave_open, - .ndo_stop =3D dsa_slave_close, - .ndo_start_xmit =3D dsa_slave_xmit, - .ndo_change_rx_flags =3D dsa_slave_change_rx_flags, - .ndo_set_rx_mode =3D dsa_slave_set_rx_mode, - .ndo_set_mac_address =3D dsa_slave_set_mac_address, - .ndo_fdb_dump =3D dsa_slave_fdb_dump, - .ndo_eth_ioctl =3D dsa_slave_ioctl, - .ndo_get_iflink =3D dsa_slave_get_iflink, +static const struct net_device_ops dsa_user_netdev_ops =3D { + .ndo_open =3D dsa_user_open, + .ndo_stop =3D dsa_user_close, + .ndo_start_xmit =3D dsa_user_xmit, + .ndo_change_rx_flags =3D dsa_user_change_rx_flags, + .ndo_set_rx_mode =3D dsa_user_set_rx_mode, + .ndo_set_mac_address =3D dsa_user_set_mac_address, + .ndo_fdb_dump =3D dsa_user_fdb_dump, + .ndo_eth_ioctl =3D dsa_user_ioctl, + .ndo_get_iflink =3D dsa_user_get_iflink, #ifdef CONFIG_NET_POLL_CONTROLLER - .ndo_netpoll_setup =3D dsa_slave_netpoll_setup, - .ndo_netpoll_cleanup =3D dsa_slave_netpoll_cleanup, - .ndo_poll_controller =3D dsa_slave_poll_controller, + .ndo_netpoll_setup =3D dsa_user_netpoll_setup, + .ndo_netpoll_cleanup =3D dsa_user_netpoll_cleanup, + .ndo_poll_controller =3D dsa_user_poll_controller, #endif - .ndo_setup_tc =3D dsa_slave_setup_tc, - .ndo_get_stats64 =3D dsa_slave_get_stats64, - .ndo_vlan_rx_add_vid =3D dsa_slave_vlan_rx_add_vid, - .ndo_vlan_rx_kill_vid =3D dsa_slave_vlan_rx_kill_vid, - .ndo_change_mtu =3D dsa_slave_change_mtu, - .ndo_fill_forward_path =3D dsa_slave_fill_forward_path, + .ndo_setup_tc =3D dsa_user_setup_tc, + .ndo_get_stats64 =3D dsa_user_get_stats64, + .ndo_vlan_rx_add_vid =3D dsa_user_vlan_rx_add_vid, + .ndo_vlan_rx_kill_vid =3D dsa_user_vlan_rx_kill_vid, + .ndo_change_mtu =3D dsa_user_change_mtu, + .ndo_fill_forward_path =3D dsa_user_fill_forward_path, }; =20 static struct device_type dsa_type =3D { @@ -2465,7 +2465,7 @@ void dsa_port_phylink_mac_change(struct dsa_switch *d= s, int port, bool up) } EXPORT_SYMBOL_GPL(dsa_port_phylink_mac_change); =20 -static void dsa_slave_phylink_fixed_state(struct phylink_config *config, +static void dsa_user_phylink_fixed_state(struct phylink_config *config, struct phylink_link_state *state) { struct dsa_port *dp =3D container_of(config, struct dsa_port, pl_config); @@ -2477,33 +2477,33 @@ static void dsa_slave_phylink_fixed_state(struct ph= ylink_config *config, ds->ops->phylink_fixed_state(ds, dp->index, state); } =20 -/* slave device setup ****************************************************= ***/ -static int dsa_slave_phy_connect(struct net_device *slave_dev, int addr, +/* user device setup *****************************************************= **/ +static int dsa_user_phy_connect(struct net_device *user_dev, int addr, u32 flags) { - struct dsa_port *dp =3D dsa_slave_to_port(slave_dev); + struct dsa_port *dp =3D dsa_user_to_port(user_dev); struct dsa_switch *ds =3D dp->ds; =20 - slave_dev->phydev =3D mdiobus_get_phy(ds->slave_mii_bus, addr); - if (!slave_dev->phydev) { - netdev_err(slave_dev, "no phy at %d\n", addr); + user_dev->phydev =3D mdiobus_get_phy(ds->user_mii_bus, addr); + if (!user_dev->phydev) { + netdev_err(user_dev, "no phy at %d\n", addr); return -ENODEV; } =20 - slave_dev->phydev->dev_flags |=3D flags; + user_dev->phydev->dev_flags |=3D flags; =20 - return phylink_connect_phy(dp->pl, slave_dev->phydev); + return phylink_connect_phy(dp->pl, user_dev->phydev); } =20 -static int dsa_slave_phy_setup(struct net_device *slave_dev) +static int dsa_user_phy_setup(struct net_device *user_dev) { - struct dsa_port *dp =3D dsa_slave_to_port(slave_dev); + struct dsa_port *dp =3D dsa_user_to_port(user_dev); struct device_node *port_dn =3D dp->dn; struct dsa_switch *ds =3D dp->ds; u32 phy_flags =3D 0; int ret; =20 - dp->pl_config.dev =3D &slave_dev->dev; + dp->pl_config.dev =3D &user_dev->dev; dp->pl_config.type =3D PHYLINK_NETDEV; =20 /* The get_fixed_state callback takes precedence over polling the @@ -2511,7 +2511,7 @@ static int dsa_slave_phy_setup(struct net_device *sla= ve_dev) * this if the switch provides such a callback. */ if (ds->ops->phylink_fixed_state) { - dp->pl_config.get_fixed_state =3D dsa_slave_phylink_fixed_state; + dp->pl_config.get_fixed_state =3D dsa_user_phylink_fixed_state; dp->pl_config.poll_fixed_state =3D true; } =20 @@ -2523,14 +2523,14 @@ static int dsa_slave_phy_setup(struct net_device *s= lave_dev) phy_flags =3D ds->ops->get_phy_flags(ds, dp->index); =20 ret =3D phylink_of_phy_connect(dp->pl, port_dn, phy_flags); - if (ret =3D=3D -ENODEV && ds->slave_mii_bus) { + if (ret =3D=3D -ENODEV && ds->user_mii_bus) { /* We could not connect to a designated PHY or SFP, so try to * use the switch internal MDIO bus instead */ - ret =3D dsa_slave_phy_connect(slave_dev, dp->index, phy_flags); + ret =3D dsa_user_phy_connect(user_dev, dp->index, phy_flags); } if (ret) { - netdev_err(slave_dev, "failed to connect to PHY: %pe\n", + netdev_err(user_dev, "failed to connect to PHY: %pe\n", ERR_PTR(ret)); dsa_port_phylink_destroy(dp); } @@ -2538,42 +2538,42 @@ static int dsa_slave_phy_setup(struct net_device *s= lave_dev) return ret; } =20 -void dsa_slave_setup_tagger(struct net_device *slave) +void dsa_user_setup_tagger(struct net_device *user) { - struct dsa_port *dp =3D dsa_slave_to_port(slave); - struct net_device *master =3D dsa_port_to_master(dp); - struct dsa_slave_priv *p =3D netdev_priv(slave); + struct dsa_port *dp =3D dsa_user_to_port(user); + struct net_device *conduit =3D dsa_port_to_conduit(dp); + struct dsa_user_priv *p =3D netdev_priv(user); const struct dsa_port *cpu_dp =3D dp->cpu_dp; const struct dsa_switch *ds =3D dp->ds; =20 - slave->needed_headroom =3D cpu_dp->tag_ops->needed_headroom; - slave->needed_tailroom =3D cpu_dp->tag_ops->needed_tailroom; - /* Try to save one extra realloc later in the TX path (in the master) - * by also inheriting the master's needed headroom and tailroom. + user->needed_headroom =3D cpu_dp->tag_ops->needed_headroom; + user->needed_tailroom =3D cpu_dp->tag_ops->needed_tailroom; + /* Try to save one extra realloc later in the TX path (in the conduit) + * by also inheriting the conduit's needed headroom and tailroom. * The 8021q driver also does this. */ - slave->needed_headroom +=3D master->needed_headroom; - slave->needed_tailroom +=3D master->needed_tailroom; + user->needed_headroom +=3D conduit->needed_headroom; + user->needed_tailroom +=3D conduit->needed_tailroom; =20 p->xmit =3D cpu_dp->tag_ops->xmit; =20 - slave->features =3D master->vlan_features | NETIF_F_HW_TC; - slave->hw_features |=3D NETIF_F_HW_TC; - slave->features |=3D NETIF_F_LLTX; - if (slave->needed_tailroom) - slave->features &=3D ~(NETIF_F_SG | NETIF_F_FRAGLIST); + user->features =3D conduit->vlan_features | NETIF_F_HW_TC; + user->hw_features |=3D NETIF_F_HW_TC; + user->features |=3D NETIF_F_LLTX; + if (user->needed_tailroom) + user->features &=3D ~(NETIF_F_SG | NETIF_F_FRAGLIST); if (ds->needs_standalone_vlan_filtering) - slave->features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; + user->features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; } =20 -int dsa_slave_suspend(struct net_device *slave_dev) +int dsa_user_suspend(struct net_device *user_dev) { - struct dsa_port *dp =3D dsa_slave_to_port(slave_dev); + struct dsa_port *dp =3D dsa_user_to_port(user_dev); =20 - if (!netif_running(slave_dev)) + if (!netif_running(user_dev)) return 0; =20 - netif_device_detach(slave_dev); + netif_device_detach(user_dev); =20 rtnl_lock(); phylink_stop(dp->pl); @@ -2582,14 +2582,14 @@ int dsa_slave_suspend(struct net_device *slave_dev) return 0; } =20 -int dsa_slave_resume(struct net_device *slave_dev) +int dsa_user_resume(struct net_device *user_dev) { - struct dsa_port *dp =3D dsa_slave_to_port(slave_dev); + struct dsa_port *dp =3D dsa_user_to_port(user_dev); =20 - if (!netif_running(slave_dev)) + if (!netif_running(user_dev)) return 0; =20 - netif_device_attach(slave_dev); + netif_device_attach(user_dev); =20 rtnl_lock(); phylink_start(dp->pl); @@ -2598,12 +2598,12 @@ int dsa_slave_resume(struct net_device *slave_dev) return 0; } =20 -int dsa_slave_create(struct dsa_port *port) +int dsa_user_create(struct dsa_port *port) { - struct net_device *master =3D dsa_port_to_master(port); + struct net_device *conduit =3D dsa_port_to_conduit(port); struct dsa_switch *ds =3D port->ds; - struct net_device *slave_dev; - struct dsa_slave_priv *p; + struct net_device *user_dev; + struct dsa_user_priv *p; const char *name; int assign_type; int ret; @@ -2619,55 +2619,55 @@ int dsa_slave_create(struct dsa_port *port) assign_type =3D NET_NAME_ENUM; } =20 - slave_dev =3D alloc_netdev_mqs(sizeof(struct dsa_slave_priv), name, + user_dev =3D alloc_netdev_mqs(sizeof(struct dsa_user_priv), name, assign_type, ether_setup, ds->num_tx_queues, 1); - if (slave_dev =3D=3D NULL) + if (user_dev =3D=3D NULL) return -ENOMEM; =20 - slave_dev->rtnl_link_ops =3D &dsa_link_ops; - slave_dev->ethtool_ops =3D &dsa_slave_ethtool_ops; + user_dev->rtnl_link_ops =3D &dsa_link_ops; + user_dev->ethtool_ops =3D &dsa_user_ethtool_ops; #if IS_ENABLED(CONFIG_DCB) - slave_dev->dcbnl_ops =3D &dsa_slave_dcbnl_ops; + user_dev->dcbnl_ops =3D &dsa_user_dcbnl_ops; #endif if (!is_zero_ether_addr(port->mac)) - eth_hw_addr_set(slave_dev, port->mac); + eth_hw_addr_set(user_dev, port->mac); else - eth_hw_addr_inherit(slave_dev, master); - slave_dev->priv_flags |=3D IFF_NO_QUEUE; + eth_hw_addr_inherit(user_dev, conduit); + user_dev->priv_flags |=3D IFF_NO_QUEUE; if (dsa_switch_supports_uc_filtering(ds)) - slave_dev->priv_flags |=3D IFF_UNICAST_FLT; - slave_dev->netdev_ops =3D &dsa_slave_netdev_ops; + user_dev->priv_flags |=3D IFF_UNICAST_FLT; + user_dev->netdev_ops =3D &dsa_user_netdev_ops; if (ds->ops->port_max_mtu) - slave_dev->max_mtu =3D ds->ops->port_max_mtu(ds, port->index); - SET_NETDEV_DEVTYPE(slave_dev, &dsa_type); - - SET_NETDEV_DEV(slave_dev, port->ds->dev); - SET_NETDEV_DEVLINK_PORT(slave_dev, &port->devlink_port); - slave_dev->dev.of_node =3D port->dn; - slave_dev->vlan_features =3D master->vlan_features; - - p =3D netdev_priv(slave_dev); - slave_dev->tstats =3D netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); - if (!slave_dev->tstats) { - free_netdev(slave_dev); + user_dev->max_mtu =3D ds->ops->port_max_mtu(ds, port->index); + SET_NETDEV_DEVTYPE(user_dev, &dsa_type); + + SET_NETDEV_DEV(user_dev, port->ds->dev); + SET_NETDEV_DEVLINK_PORT(user_dev, &port->devlink_port); + user_dev->dev.of_node =3D port->dn; + user_dev->vlan_features =3D conduit->vlan_features; + + p =3D netdev_priv(user_dev); + user_dev->tstats =3D netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); + if (!user_dev->tstats) { + free_netdev(user_dev); return -ENOMEM; } =20 - ret =3D gro_cells_init(&p->gcells, slave_dev); + ret =3D gro_cells_init(&p->gcells, user_dev); if (ret) goto out_free; =20 p->dp =3D port; INIT_LIST_HEAD(&p->mall_tc_list); - port->slave =3D slave_dev; - dsa_slave_setup_tagger(slave_dev); + port->user =3D user_dev; + dsa_user_setup_tagger(user_dev); =20 - netif_carrier_off(slave_dev); + netif_carrier_off(user_dev); =20 - ret =3D dsa_slave_phy_setup(slave_dev); + ret =3D dsa_user_phy_setup(user_dev); if (ret) { - netdev_err(slave_dev, + netdev_err(user_dev, "error %d setting up PHY for tree %d, switch %d, port %d\n", ret, ds->dst->index, ds->index, port->index); goto out_gcells; @@ -2675,23 +2675,23 @@ int dsa_slave_create(struct dsa_port *port) =20 rtnl_lock(); =20 - ret =3D dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN); + ret =3D dsa_user_change_mtu(user_dev, ETH_DATA_LEN); if (ret && ret !=3D -EOPNOTSUPP) dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n", ret, ETH_DATA_LEN, port->index); =20 - ret =3D register_netdevice(slave_dev); + ret =3D register_netdevice(user_dev); if (ret) { - netdev_err(master, "error %d registering interface %s\n", - ret, slave_dev->name); + netdev_err(conduit, "error %d registering interface %s\n", + ret, user_dev->name); rtnl_unlock(); goto out_phy; } =20 if (IS_ENABLED(CONFIG_DCB)) { - ret =3D dsa_slave_dcbnl_init(slave_dev); + ret =3D dsa_user_dcbnl_init(user_dev); if (ret) { - netdev_err(slave_dev, + netdev_err(user_dev, "failed to initialize DCB: %pe\n", ERR_PTR(ret)); rtnl_unlock(); @@ -2699,7 +2699,7 @@ int dsa_slave_create(struct dsa_port *port) } } =20 - ret =3D netdev_upper_dev_link(master, slave_dev, NULL); + ret =3D netdev_upper_dev_link(conduit, user_dev, NULL); =20 rtnl_unlock(); =20 @@ -2709,7 +2709,7 @@ int dsa_slave_create(struct dsa_port *port) return 0; =20 out_unregister: - unregister_netdev(slave_dev); + unregister_netdev(user_dev); out_phy: rtnl_lock(); phylink_disconnect_phy(p->dp->pl); @@ -2718,122 +2718,122 @@ int dsa_slave_create(struct dsa_port *port) out_gcells: gro_cells_destroy(&p->gcells); out_free: - free_percpu(slave_dev->tstats); - free_netdev(slave_dev); - port->slave =3D NULL; + free_percpu(user_dev->tstats); + free_netdev(user_dev); + port->user =3D NULL; return ret; } =20 -void dsa_slave_destroy(struct net_device *slave_dev) +void dsa_user_destroy(struct net_device *user_dev) { - struct net_device *master =3D dsa_slave_to_master(slave_dev); - struct dsa_port *dp =3D dsa_slave_to_port(slave_dev); - struct dsa_slave_priv *p =3D netdev_priv(slave_dev); + struct net_device *conduit =3D dsa_user_to_conduit(user_dev); + struct dsa_port *dp =3D dsa_user_to_port(user_dev); + struct dsa_user_priv *p =3D netdev_priv(user_dev); =20 - netif_carrier_off(slave_dev); + netif_carrier_off(user_dev); rtnl_lock(); - netdev_upper_dev_unlink(master, slave_dev); - unregister_netdevice(slave_dev); + netdev_upper_dev_unlink(conduit, user_dev); + unregister_netdevice(user_dev); phylink_disconnect_phy(dp->pl); rtnl_unlock(); =20 dsa_port_phylink_destroy(dp); gro_cells_destroy(&p->gcells); - free_percpu(slave_dev->tstats); - free_netdev(slave_dev); + free_percpu(user_dev->tstats); + free_netdev(user_dev); } =20 -int dsa_slave_change_master(struct net_device *dev, struct net_device *mas= ter, +int dsa_user_change_conduit(struct net_device *dev, struct net_device *con= duit, struct netlink_ext_ack *extack) { - struct net_device *old_master =3D dsa_slave_to_master(dev); - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct net_device *old_conduit =3D dsa_user_to_conduit(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch *ds =3D dp->ds; struct net_device *upper; struct list_head *iter; int err; =20 - if (master =3D=3D old_master) + if (conduit =3D=3D old_conduit) return 0; =20 - if (!ds->ops->port_change_master) { + if (!ds->ops->port_change_conduit) { NL_SET_ERR_MSG_MOD(extack, - "Driver does not support changing DSA master"); + "Driver does not support changing DSA conduit"); return -EOPNOTSUPP; } =20 - if (!netdev_uses_dsa(master)) { + if (!netdev_uses_dsa(conduit)) { NL_SET_ERR_MSG_MOD(extack, - "Interface not eligible as DSA master"); + "Interface not eligible as DSA conduit"); return -EOPNOTSUPP; } =20 - netdev_for_each_upper_dev_rcu(master, upper, iter) { - if (dsa_slave_dev_check(upper)) + netdev_for_each_upper_dev_rcu(conduit, upper, iter) { + if (dsa_user_dev_check(upper)) continue; if (netif_is_bridge_master(upper)) continue; - NL_SET_ERR_MSG_MOD(extack, "Cannot join master with unknown uppers"); + NL_SET_ERR_MSG_MOD(extack, "Cannot join conduit with unknown uppers"); return -EOPNOTSUPP; } =20 - /* Since we allow live-changing the DSA master, plus we auto-open the - * DSA master when the user port opens =3D> we need to ensure that the - * new DSA master is open too. + /* Since we allow live-changing the DSA conduit, plus we auto-open the + * DSA conduit when the user port opens =3D> we need to ensure that the + * new DSA conduit is open too. */ if (dev->flags & IFF_UP) { - err =3D dev_open(master, extack); + err =3D dev_open(conduit, extack); if (err) return err; } =20 - netdev_upper_dev_unlink(old_master, dev); + netdev_upper_dev_unlink(old_conduit, dev); =20 - err =3D netdev_upper_dev_link(master, dev, extack); + err =3D netdev_upper_dev_link(conduit, dev, extack); if (err) - goto out_revert_old_master_unlink; + goto out_revert_old_conduit_unlink; =20 - err =3D dsa_port_change_master(dp, master, extack); + err =3D dsa_port_change_conduit(dp, conduit, extack); if (err) - goto out_revert_master_link; + goto out_revert_conduit_link; =20 /* Update the MTU of the new CPU port through cross-chip notifiers */ - err =3D dsa_slave_change_mtu(dev, dev->mtu); + err =3D dsa_user_change_mtu(dev, dev->mtu); if (err && err !=3D -EOPNOTSUPP) { netdev_warn(dev, - "nonfatal error updating MTU with new master: %pe\n", + "nonfatal error updating MTU with new conduit: %pe\n", ERR_PTR(err)); } =20 /* If the port doesn't have its own MAC address and relies on the DSA - * master's one, inherit it again from the new DSA master. + * conduit's one, inherit it again from the new DSA conduit. */ if (is_zero_ether_addr(dp->mac)) - eth_hw_addr_inherit(dev, master); + eth_hw_addr_inherit(dev, conduit); =20 return 0; =20 -out_revert_master_link: - netdev_upper_dev_unlink(master, dev); -out_revert_old_master_unlink: - netdev_upper_dev_link(old_master, dev, NULL); +out_revert_conduit_link: + netdev_upper_dev_unlink(conduit, dev); +out_revert_old_conduit_unlink: + netdev_upper_dev_link(old_conduit, dev, NULL); return err; } =20 -bool dsa_slave_dev_check(const struct net_device *dev) +bool dsa_user_dev_check(const struct net_device *dev) { - return dev->netdev_ops =3D=3D &dsa_slave_netdev_ops; + return dev->netdev_ops =3D=3D &dsa_user_netdev_ops; } -EXPORT_SYMBOL_GPL(dsa_slave_dev_check); +EXPORT_SYMBOL_GPL(dsa_user_dev_check); =20 -static int dsa_slave_changeupper(struct net_device *dev, +static int dsa_user_changeupper(struct net_device *dev, struct netdev_notifier_changeupper_info *info) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct netlink_ext_ack *extack; int err =3D NOTIFY_DONE; =20 - if (!dsa_slave_dev_check(dev)) + if (!dsa_user_dev_check(dev)) return err; =20 extack =3D netdev_notifier_info_to_extack(&info->info); @@ -2885,12 +2885,12 @@ static int dsa_slave_changeupper(struct net_device = *dev, return err; } =20 -static int dsa_slave_prechangeupper(struct net_device *dev, +static int dsa_user_prechangeupper(struct net_device *dev, struct netdev_notifier_changeupper_info *info) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); =20 - if (!dsa_slave_dev_check(dev)) + if (!dsa_user_dev_check(dev)) return NOTIFY_DONE; =20 if (netif_is_bridge_master(info->upper_dev) && !info->linking) @@ -2898,14 +2898,14 @@ static int dsa_slave_prechangeupper(struct net_devi= ce *dev, else if (netif_is_lag_master(info->upper_dev) && !info->linking) dsa_port_pre_lag_leave(dp, info->upper_dev); /* dsa_port_pre_hsr_leave is not yet necessary since hsr cannot be - * meaningfully enslaved to a bridge yet + * meaningfully enuserd to a bridge yet */ =20 return NOTIFY_DONE; } =20 static int -dsa_slave_lag_changeupper(struct net_device *dev, +dsa_user_lag_changeupper(struct net_device *dev, struct netdev_notifier_changeupper_info *info) { struct net_device *lower; @@ -2917,15 +2917,15 @@ dsa_slave_lag_changeupper(struct net_device *dev, return err; =20 netdev_for_each_lower_dev(dev, lower, iter) { - if (!dsa_slave_dev_check(lower)) + if (!dsa_user_dev_check(lower)) continue; =20 - dp =3D dsa_slave_to_port(lower); + dp =3D dsa_user_to_port(lower); if (!dp->lag) /* Software LAG */ continue; =20 - err =3D dsa_slave_changeupper(lower, info); + err =3D dsa_user_changeupper(lower, info); if (notifier_to_errno(err)) break; } @@ -2933,11 +2933,11 @@ dsa_slave_lag_changeupper(struct net_device *dev, return err; } =20 -/* Same as dsa_slave_lag_changeupper() except that it calls - * dsa_slave_prechangeupper() +/* Same as dsa_user_lag_changeupper() except that it calls + * dsa_user_prechangeupper() */ static int -dsa_slave_lag_prechangeupper(struct net_device *dev, +dsa_user_lag_prechangeupper(struct net_device *dev, struct netdev_notifier_changeupper_info *info) { struct net_device *lower; @@ -2949,15 +2949,15 @@ dsa_slave_lag_prechangeupper(struct net_device *dev, return err; =20 netdev_for_each_lower_dev(dev, lower, iter) { - if (!dsa_slave_dev_check(lower)) + if (!dsa_user_dev_check(lower)) continue; =20 - dp =3D dsa_slave_to_port(lower); + dp =3D dsa_user_to_port(lower); if (!dp->lag) /* Software LAG */ continue; =20 - err =3D dsa_slave_prechangeupper(lower, info); + err =3D dsa_user_prechangeupper(lower, info); if (notifier_to_errno(err)) break; } @@ -2970,7 +2970,7 @@ dsa_prevent_bridging_8021q_upper(struct net_device *d= ev, struct netdev_notifier_changeupper_info *info) { struct netlink_ext_ack *ext_ack; - struct net_device *slave, *br; + struct net_device *user, *br; struct dsa_port *dp; =20 ext_ack =3D netdev_notifier_info_to_extack(&info->info); @@ -2978,11 +2978,11 @@ dsa_prevent_bridging_8021q_upper(struct net_device = *dev, if (!is_vlan_dev(dev)) return NOTIFY_DONE; =20 - slave =3D vlan_dev_real_dev(dev); - if (!dsa_slave_dev_check(slave)) + user =3D vlan_dev_real_dev(dev); + if (!dsa_user_dev_check(user)) return NOTIFY_DONE; =20 - dp =3D dsa_slave_to_port(slave); + dp =3D dsa_user_to_port(user); br =3D dsa_port_bridge_dev_get(dp); if (!br) return NOTIFY_DONE; @@ -2991,7 +2991,7 @@ dsa_prevent_bridging_8021q_upper(struct net_device *d= ev, if (br_vlan_enabled(br) && netif_is_bridge_master(info->upper_dev) && info->linking) { NL_SET_ERR_MSG_MOD(ext_ack, - "Cannot enslave VLAN device into VLAN aware bridge"); + "Cannot enuser VLAN device into VLAN aware bridge"); return notifier_from_errno(-EINVAL); } =20 @@ -2999,10 +2999,10 @@ dsa_prevent_bridging_8021q_upper(struct net_device = *dev, } =20 static int -dsa_slave_check_8021q_upper(struct net_device *dev, +dsa_user_check_8021q_upper(struct net_device *dev, struct netdev_notifier_changeupper_info *info) { - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); struct net_device *br =3D dsa_port_bridge_dev_get(dp); struct bridge_vlan_info br_info; struct netlink_ext_ack *extack; @@ -3030,17 +3030,17 @@ dsa_slave_check_8021q_upper(struct net_device *dev, } =20 static int -dsa_slave_prechangeupper_sanity_check(struct net_device *dev, +dsa_user_prechangeupper_sanity_check(struct net_device *dev, struct netdev_notifier_changeupper_info *info) { struct dsa_switch *ds; struct dsa_port *dp; int err; =20 - if (!dsa_slave_dev_check(dev)) + if (!dsa_user_dev_check(dev)) return dsa_prevent_bridging_8021q_upper(dev, info); =20 - dp =3D dsa_slave_to_port(dev); + dp =3D dsa_user_to_port(dev); ds =3D dp->ds; =20 if (ds->ops->port_prechangeupper) { @@ -3050,16 +3050,16 @@ dsa_slave_prechangeupper_sanity_check(struct net_de= vice *dev, } =20 if (is_vlan_dev(info->upper_dev)) - return dsa_slave_check_8021q_upper(dev, info); + return dsa_user_check_8021q_upper(dev, info); =20 return NOTIFY_DONE; } =20 -/* To be eligible as a DSA master, a LAG must have all lower interfaces be - * eligible DSA masters. Additionally, all LAG slaves must be DSA masters = of +/* To be eligible as a DSA conduit, a LAG must have all lower interfaces be + * eligible DSA conduits. Additionally, all LAG users must be DSA conduits= of * switches in the same switch tree. */ -static int dsa_lag_master_validate(struct net_device *lag_dev, +static int dsa_lag_conduit_validate(struct net_device *lag_dev, struct netlink_ext_ack *extack) { struct net_device *lower1, *lower2; @@ -3070,7 +3070,7 @@ static int dsa_lag_master_validate(struct net_device = *lag_dev, if (!netdev_uses_dsa(lower1) || !netdev_uses_dsa(lower2)) { NL_SET_ERR_MSG_MOD(extack, - "All LAG ports must be eligible as DSA masters"); + "All LAG ports must be eligible as DSA conduits"); return notifier_from_errno(-EINVAL); } =20 @@ -3080,7 +3080,7 @@ static int dsa_lag_master_validate(struct net_device = *lag_dev, if (!dsa_port_tree_same(lower1->dsa_ptr, lower2->dsa_ptr)) { NL_SET_ERR_MSG_MOD(extack, - "LAG contains DSA masters of disjoint switch trees"); + "LAG contains DSA conduits of disjoint switch trees"); return notifier_from_errno(-EINVAL); } } @@ -3090,40 +3090,40 @@ static int dsa_lag_master_validate(struct net_devic= e *lag_dev, } =20 static int -dsa_master_prechangeupper_sanity_check(struct net_device *master, +dsa_conduit_prechangeupper_sanity_check(struct net_device *conduit, struct netdev_notifier_changeupper_info *info) { struct netlink_ext_ack *extack =3D netdev_notifier_info_to_extack(&info->= info); =20 - if (!netdev_uses_dsa(master)) + if (!netdev_uses_dsa(conduit)) return NOTIFY_DONE; =20 if (!info->linking) return NOTIFY_DONE; =20 /* Allow DSA switch uppers */ - if (dsa_slave_dev_check(info->upper_dev)) + if (dsa_user_dev_check(info->upper_dev)) return NOTIFY_DONE; =20 - /* Allow bridge uppers of DSA masters, subject to further + /* Allow bridge uppers of DSA conduits, subject to further * restrictions in dsa_bridge_prechangelower_sanity_check() */ if (netif_is_bridge_master(info->upper_dev)) return NOTIFY_DONE; =20 /* Allow LAG uppers, subject to further restrictions in - * dsa_lag_master_prechangelower_sanity_check() + * dsa_lag_conduit_prechangelower_sanity_check() */ if (netif_is_lag_master(info->upper_dev)) - return dsa_lag_master_validate(info->upper_dev, extack); + return dsa_lag_conduit_validate(info->upper_dev, extack); =20 NL_SET_ERR_MSG_MOD(extack, - "DSA master cannot join unknown upper interfaces"); + "DSA conduit cannot join unknown upper interfaces"); return notifier_from_errno(-EBUSY); } =20 static int -dsa_lag_master_prechangelower_sanity_check(struct net_device *dev, +dsa_lag_conduit_prechangelower_sanity_check(struct net_device *dev, struct netdev_notifier_changeupper_info *info) { struct netlink_ext_ack *extack =3D netdev_notifier_info_to_extack(&info->= info); @@ -3139,14 +3139,14 @@ dsa_lag_master_prechangelower_sanity_check(struct n= et_device *dev, =20 if (!netdev_uses_dsa(dev)) { NL_SET_ERR_MSG(extack, - "Only DSA masters can join a LAG DSA master"); + "Only DSA conduits can join a LAG DSA conduit"); return notifier_from_errno(-EINVAL); } =20 netdev_for_each_lower_dev(lag_dev, lower, iter) { if (!dsa_port_tree_same(dev->dsa_ptr, lower->dsa_ptr)) { NL_SET_ERR_MSG(extack, - "Interface is DSA master for a different switch tree than this = LAG"); + "Interface is DSA conduit for a different switch tree than this= LAG"); return notifier_from_errno(-EINVAL); } =20 @@ -3156,13 +3156,13 @@ dsa_lag_master_prechangelower_sanity_check(struct n= et_device *dev, return NOTIFY_DONE; } =20 -/* Don't allow bridging of DSA masters, since the bridge layer rx_handler +/* Don't allow bridging of DSA conduits, since the bridge layer rx_handler * prevents the DSA fake ethertype handler to be invoked, so we don't get = the * chance to strip off and parse the DSA switch tag protocol header (the b= ridge * layer just returns RX_HANDLER_CONSUMED, stopping RX processing for these * frames). * The only case where that would not be an issue is when bridging can alr= eady - * be offloaded, such as when the DSA master is itself a DSA or plain swit= chdev + * be offloaded, such as when the DSA conduit is itself a DSA or plain swi= tchdev * port, and is bridged only with other ports from the same hardware devic= e. */ static int @@ -3188,7 +3188,7 @@ dsa_bridge_prechangelower_sanity_check(struct net_dev= ice *new_lower, =20 if (!netdev_port_same_parent_id(lower, new_lower)) { NL_SET_ERR_MSG(extack, - "Cannot do software bridging with a DSA master"); + "Cannot do software bridging with a DSA conduit"); return notifier_from_errno(-EINVAL); } } @@ -3196,45 +3196,45 @@ dsa_bridge_prechangelower_sanity_check(struct net_d= evice *new_lower, return NOTIFY_DONE; } =20 -static void dsa_tree_migrate_ports_from_lag_master(struct dsa_switch_tree = *dst, +static void dsa_tree_migrate_ports_from_lag_conduit(struct dsa_switch_tree= *dst, struct net_device *lag_dev) { - struct net_device *new_master =3D dsa_tree_find_first_master(dst); + struct net_device *new_conduit =3D dsa_tree_find_first_conduit(dst); struct dsa_port *dp; int err; =20 dsa_tree_for_each_user_port(dp, dst) { - if (dsa_port_to_master(dp) !=3D lag_dev) + if (dsa_port_to_conduit(dp) !=3D lag_dev) continue; =20 - err =3D dsa_slave_change_master(dp->slave, new_master, NULL); + err =3D dsa_user_change_conduit(dp->user, new_conduit, NULL); if (err) { - netdev_err(dp->slave, - "failed to restore master to %s: %pe\n", - new_master->name, ERR_PTR(err)); + netdev_err(dp->user, + "failed to restore conduit to %s: %pe\n", + new_conduit->name, ERR_PTR(err)); } } } =20 -static int dsa_master_lag_join(struct net_device *master, +static int dsa_conduit_lag_join(struct net_device *conduit, struct net_device *lag_dev, struct netdev_lag_upper_info *uinfo, struct netlink_ext_ack *extack) { - struct dsa_port *cpu_dp =3D master->dsa_ptr; + struct dsa_port *cpu_dp =3D conduit->dsa_ptr; struct dsa_switch_tree *dst =3D cpu_dp->dst; struct dsa_port *dp; int err; =20 - err =3D dsa_master_lag_setup(lag_dev, cpu_dp, uinfo, extack); + err =3D dsa_conduit_lag_setup(lag_dev, cpu_dp, uinfo, extack); if (err) return err; =20 dsa_tree_for_each_user_port(dp, dst) { - if (dsa_port_to_master(dp) !=3D master) + if (dsa_port_to_conduit(dp) !=3D conduit) continue; =20 - err =3D dsa_slave_change_master(dp->slave, lag_dev, extack); + err =3D dsa_user_change_conduit(dp->user, lag_dev, extack); if (err) goto restore; } @@ -3243,23 +3243,23 @@ static int dsa_master_lag_join(struct net_device *m= aster, =20 restore: dsa_tree_for_each_user_port_continue_reverse(dp, dst) { - if (dsa_port_to_master(dp) !=3D lag_dev) + if (dsa_port_to_conduit(dp) !=3D lag_dev) continue; =20 - err =3D dsa_slave_change_master(dp->slave, master, NULL); + err =3D dsa_user_change_conduit(dp->user, conduit, NULL); if (err) { - netdev_err(dp->slave, - "failed to restore master to %s: %pe\n", - master->name, ERR_PTR(err)); + netdev_err(dp->user, + "failed to restore conduit to %s: %pe\n", + conduit->name, ERR_PTR(err)); } } =20 - dsa_master_lag_teardown(lag_dev, master->dsa_ptr); + dsa_conduit_lag_teardown(lag_dev, conduit->dsa_ptr); =20 return err; } =20 -static void dsa_master_lag_leave(struct net_device *master, +static void dsa_conduit_lag_leave(struct net_device *conduit, struct net_device *lag_dev) { struct dsa_port *dp, *cpu_dp =3D lag_dev->dsa_ptr; @@ -3277,10 +3277,10 @@ static void dsa_master_lag_leave(struct net_device = *master, =20 if (new_cpu_dp) { /* Update the CPU port of the user ports still under the LAG - * so that dsa_port_to_master() continues to work properly + * so that dsa_port_to_conduit() continues to work properly */ dsa_tree_for_each_user_port(dp, dst) - if (dsa_port_to_master(dp) =3D=3D lag_dev) + if (dsa_port_to_conduit(dp) =3D=3D lag_dev) dp->cpu_dp =3D new_cpu_dp; =20 /* Update the index of the virtual CPU port to match the lowest @@ -3289,19 +3289,19 @@ static void dsa_master_lag_leave(struct net_device = *master, lag_dev->dsa_ptr =3D new_cpu_dp; wmb(); } else { - /* If the LAG DSA master has no ports left, migrate back all + /* If the LAG DSA conduit has no ports left, migrate back all * user ports to the first physical CPU port */ - dsa_tree_migrate_ports_from_lag_master(dst, lag_dev); + dsa_tree_migrate_ports_from_lag_conduit(dst, lag_dev); } =20 - /* This DSA master has left its LAG in any case, so let + /* This DSA conduit has left its LAG in any case, so let * the CPU port leave the hardware LAG as well */ - dsa_master_lag_teardown(lag_dev, master->dsa_ptr); + dsa_conduit_lag_teardown(lag_dev, conduit->dsa_ptr); } =20 -static int dsa_master_changeupper(struct net_device *dev, +static int dsa_conduit_changeupper(struct net_device *dev, struct netdev_notifier_changeupper_info *info) { struct netlink_ext_ack *extack; @@ -3314,11 +3314,11 @@ static int dsa_master_changeupper(struct net_device= *dev, =20 if (netif_is_lag_master(info->upper_dev)) { if (info->linking) { - err =3D dsa_master_lag_join(dev, info->upper_dev, + err =3D dsa_conduit_lag_join(dev, info->upper_dev, info->upper_info, extack); err =3D notifier_from_errno(err); } else { - dsa_master_lag_leave(dev, info->upper_dev); + dsa_conduit_lag_leave(dev, info->upper_dev); err =3D NOTIFY_OK; } } @@ -3326,7 +3326,7 @@ static int dsa_master_changeupper(struct net_device *= dev, return err; } =20 -static int dsa_slave_netdevice_event(struct notifier_block *nb, +static int dsa_user_netdevice_event(struct notifier_block *nb, unsigned long event, void *ptr) { struct net_device *dev =3D netdev_notifier_info_to_dev(ptr); @@ -3336,15 +3336,15 @@ static int dsa_slave_netdevice_event(struct notifie= r_block *nb, struct netdev_notifier_changeupper_info *info =3D ptr; int err; =20 - err =3D dsa_slave_prechangeupper_sanity_check(dev, info); + err =3D dsa_user_prechangeupper_sanity_check(dev, info); if (notifier_to_errno(err)) return err; =20 - err =3D dsa_master_prechangeupper_sanity_check(dev, info); + err =3D dsa_conduit_prechangeupper_sanity_check(dev, info); if (notifier_to_errno(err)) return err; =20 - err =3D dsa_lag_master_prechangelower_sanity_check(dev, info); + err =3D dsa_lag_conduit_prechangelower_sanity_check(dev, info); if (notifier_to_errno(err)) return err; =20 @@ -3352,11 +3352,11 @@ static int dsa_slave_netdevice_event(struct notifie= r_block *nb, if (notifier_to_errno(err)) return err; =20 - err =3D dsa_slave_prechangeupper(dev, ptr); + err =3D dsa_user_prechangeupper(dev, ptr); if (notifier_to_errno(err)) return err; =20 - err =3D dsa_slave_lag_prechangeupper(dev, ptr); + err =3D dsa_user_lag_prechangeupper(dev, ptr); if (notifier_to_errno(err)) return err; =20 @@ -3365,15 +3365,15 @@ static int dsa_slave_netdevice_event(struct notifie= r_block *nb, case NETDEV_CHANGEUPPER: { int err; =20 - err =3D dsa_slave_changeupper(dev, ptr); + err =3D dsa_user_changeupper(dev, ptr); if (notifier_to_errno(err)) return err; =20 - err =3D dsa_slave_lag_changeupper(dev, ptr); + err =3D dsa_user_lag_changeupper(dev, ptr); if (notifier_to_errno(err)) return err; =20 - err =3D dsa_master_changeupper(dev, ptr); + err =3D dsa_conduit_changeupper(dev, ptr); if (notifier_to_errno(err)) return err; =20 @@ -3384,13 +3384,13 @@ static int dsa_slave_netdevice_event(struct notifie= r_block *nb, struct dsa_port *dp; int err =3D 0; =20 - if (dsa_slave_dev_check(dev)) { - dp =3D dsa_slave_to_port(dev); + if (dsa_user_dev_check(dev)) { + dp =3D dsa_user_to_port(dev); =20 err =3D dsa_port_lag_change(dp, info->lower_state_info); } =20 - /* Mirror LAG port events on DSA masters that are in + /* Mirror LAG port events on DSA conduits that are in * a LAG towards their respective switch CPU ports */ if (netdev_uses_dsa(dev)) { @@ -3403,27 +3403,27 @@ static int dsa_slave_netdevice_event(struct notifie= r_block *nb, } case NETDEV_CHANGE: case NETDEV_UP: { - /* Track state of master port. - * DSA driver may require the master port (and indirectly + /* Track state of conduit port. + * DSA driver may require the conduit port (and indirectly * the tagger) to be available for some special operation. */ if (netdev_uses_dsa(dev)) { struct dsa_port *cpu_dp =3D dev->dsa_ptr; struct dsa_switch_tree *dst =3D cpu_dp->ds->dst; =20 - /* Track when the master port is UP */ - dsa_tree_master_oper_state_change(dst, dev, + /* Track when the conduit port is UP */ + dsa_tree_conduit_oper_state_change(dst, dev, netif_oper_up(dev)); =20 - /* Track when the master port is ready and can accept + /* Track when the conduit port is ready and can accept * packet. * NETDEV_UP event is not enough to flag a port as ready. * We also have to wait for linkwatch_do_dev to dev_activate * and emit a NETDEV_CHANGE event. - * We check if a master port is ready by checking if the dev + * We check if a conduit port is ready by checking if the dev * have a qdisc assigned and is not noop. */ - dsa_tree_master_admin_state_change(dst, dev, + dsa_tree_conduit_admin_state_change(dst, dev, !qdisc_tx_is_noop(dev)); =20 return NOTIFY_OK; @@ -3442,7 +3442,7 @@ static int dsa_slave_netdevice_event(struct notifier_= block *nb, cpu_dp =3D dev->dsa_ptr; dst =3D cpu_dp->ds->dst; =20 - dsa_tree_master_admin_state_change(dst, dev, false); + dsa_tree_conduit_admin_state_change(dst, dev, false); =20 list_for_each_entry(dp, &dst->ports, list) { if (!dsa_port_is_user(dp)) @@ -3451,7 +3451,7 @@ static int dsa_slave_netdevice_event(struct notifier_= block *nb, if (dp->cpu_dp !=3D cpu_dp) continue; =20 - list_add(&dp->slave->close_list, &close_list); + list_add(&dp->user->close_list, &close_list); } =20 dev_close_many(&close_list, true); @@ -3477,7 +3477,7 @@ dsa_fdb_offload_notify(struct dsa_switchdev_event_wor= k *switchdev_work) switchdev_work->orig_dev, &info.info, NULL); } =20 -static void dsa_slave_switchdev_event_work(struct work_struct *work) +static void dsa_user_switchdev_event_work(struct work_struct *work) { struct dsa_switchdev_event_work *switchdev_work =3D container_of(work, struct dsa_switchdev_event_work, work); @@ -3488,7 +3488,7 @@ static void dsa_slave_switchdev_event_work(struct wor= k_struct *work) struct dsa_port *dp; int err; =20 - dp =3D dsa_slave_to_port(dev); + dp =3D dsa_user_to_port(dev); ds =3D dp->ds; =20 switch (switchdev_work->event) { @@ -3530,7 +3530,7 @@ static void dsa_slave_switchdev_event_work(struct wor= k_struct *work) static bool dsa_foreign_dev_check(const struct net_device *dev, const struct net_device *foreign_dev) { - const struct dsa_port *dp =3D dsa_slave_to_port(dev); + const struct dsa_port *dp =3D dsa_user_to_port(dev); struct dsa_switch_tree *dst =3D dp->ds->dst; =20 if (netif_is_bridge_master(foreign_dev)) @@ -3543,13 +3543,13 @@ static bool dsa_foreign_dev_check(const struct net_= device *dev, return true; } =20 -static int dsa_slave_fdb_event(struct net_device *dev, +static int dsa_user_fdb_event(struct net_device *dev, struct net_device *orig_dev, unsigned long event, const void *ctx, const struct switchdev_notifier_fdb_info *fdb_info) { struct dsa_switchdev_event_work *switchdev_work; - struct dsa_port *dp =3D dsa_slave_to_port(dev); + struct dsa_port *dp =3D dsa_user_to_port(dev); bool host_addr =3D fdb_info->is_local; struct dsa_switch *ds =3D dp->ds; =20 @@ -3598,7 +3598,7 @@ static int dsa_slave_fdb_event(struct net_device *dev, orig_dev->name, fdb_info->addr, fdb_info->vid, host_addr ? " as host address" : ""); =20 - INIT_WORK(&switchdev_work->work, dsa_slave_switchdev_event_work); + INIT_WORK(&switchdev_work->work, dsa_user_switchdev_event_work); switchdev_work->event =3D event; switchdev_work->dev =3D dev; switchdev_work->orig_dev =3D orig_dev; @@ -3613,7 +3613,7 @@ static int dsa_slave_fdb_event(struct net_device *dev, } =20 /* Called under rcu_read_lock() */ -static int dsa_slave_switchdev_event(struct notifier_block *unused, +static int dsa_user_switchdev_event(struct notifier_block *unused, unsigned long event, void *ptr) { struct net_device *dev =3D switchdev_notifier_info_to_dev(ptr); @@ -3622,15 +3622,15 @@ static int dsa_slave_switchdev_event(struct notifie= r_block *unused, switch (event) { case SWITCHDEV_PORT_ATTR_SET: err =3D switchdev_handle_port_attr_set(dev, ptr, - dsa_slave_dev_check, - dsa_slave_port_attr_set); + dsa_user_dev_check, + dsa_user_port_attr_set); return notifier_from_errno(err); case SWITCHDEV_FDB_ADD_TO_DEVICE: case SWITCHDEV_FDB_DEL_TO_DEVICE: err =3D switchdev_handle_fdb_event_to_device(dev, event, ptr, - dsa_slave_dev_check, + dsa_user_dev_check, dsa_foreign_dev_check, - dsa_slave_fdb_event); + dsa_user_fdb_event); return notifier_from_errno(err); default: return NOTIFY_DONE; @@ -3639,7 +3639,7 @@ static int dsa_slave_switchdev_event(struct notifier_= block *unused, return NOTIFY_OK; } =20 -static int dsa_slave_switchdev_blocking_event(struct notifier_block *unuse= d, +static int dsa_user_switchdev_blocking_event(struct notifier_block *unused, unsigned long event, void *ptr) { struct net_device *dev =3D switchdev_notifier_info_to_dev(ptr); @@ -3648,52 +3648,52 @@ static int dsa_slave_switchdev_blocking_event(struc= t notifier_block *unused, switch (event) { case SWITCHDEV_PORT_OBJ_ADD: err =3D switchdev_handle_port_obj_add_foreign(dev, ptr, - dsa_slave_dev_check, + dsa_user_dev_check, dsa_foreign_dev_check, - dsa_slave_port_obj_add); + dsa_user_port_obj_add); return notifier_from_errno(err); case SWITCHDEV_PORT_OBJ_DEL: err =3D switchdev_handle_port_obj_del_foreign(dev, ptr, - dsa_slave_dev_check, + dsa_user_dev_check, dsa_foreign_dev_check, - dsa_slave_port_obj_del); + dsa_user_port_obj_del); return notifier_from_errno(err); case SWITCHDEV_PORT_ATTR_SET: err =3D switchdev_handle_port_attr_set(dev, ptr, - dsa_slave_dev_check, - dsa_slave_port_attr_set); + dsa_user_dev_check, + dsa_user_port_attr_set); return notifier_from_errno(err); } =20 return NOTIFY_DONE; } =20 -static struct notifier_block dsa_slave_nb __read_mostly =3D { - .notifier_call =3D dsa_slave_netdevice_event, +static struct notifier_block dsa_user_nb __read_mostly =3D { + .notifier_call =3D dsa_user_netdevice_event, }; =20 -struct notifier_block dsa_slave_switchdev_notifier =3D { - .notifier_call =3D dsa_slave_switchdev_event, +struct notifier_block dsa_user_switchdev_notifier =3D { + .notifier_call =3D dsa_user_switchdev_event, }; =20 -struct notifier_block dsa_slave_switchdev_blocking_notifier =3D { - .notifier_call =3D dsa_slave_switchdev_blocking_event, +struct notifier_block dsa_user_switchdev_blocking_notifier =3D { + .notifier_call =3D dsa_user_switchdev_blocking_event, }; =20 -int dsa_slave_register_notifier(void) +int dsa_user_register_notifier(void) { struct notifier_block *nb; int err; =20 - err =3D register_netdevice_notifier(&dsa_slave_nb); + err =3D register_netdevice_notifier(&dsa_user_nb); if (err) return err; =20 - err =3D register_switchdev_notifier(&dsa_slave_switchdev_notifier); + err =3D register_switchdev_notifier(&dsa_user_switchdev_notifier); if (err) goto err_switchdev_nb; =20 - nb =3D &dsa_slave_switchdev_blocking_notifier; + nb =3D &dsa_user_switchdev_blocking_notifier; err =3D register_switchdev_blocking_notifier(nb); if (err) goto err_switchdev_blocking_nb; @@ -3701,27 +3701,27 @@ int dsa_slave_register_notifier(void) return 0; =20 err_switchdev_blocking_nb: - unregister_switchdev_notifier(&dsa_slave_switchdev_notifier); + unregister_switchdev_notifier(&dsa_user_switchdev_notifier); err_switchdev_nb: - unregister_netdevice_notifier(&dsa_slave_nb); + unregister_netdevice_notifier(&dsa_user_nb); return err; } =20 -void dsa_slave_unregister_notifier(void) +void dsa_user_unregister_notifier(void) { struct notifier_block *nb; int err; =20 - nb =3D &dsa_slave_switchdev_blocking_notifier; + nb =3D &dsa_user_switchdev_blocking_notifier; err =3D unregister_switchdev_blocking_notifier(nb); if (err) pr_err("DSA: failed to unregister switchdev blocking notifier (%d)\n", e= rr); =20 - err =3D unregister_switchdev_notifier(&dsa_slave_switchdev_notifier); + err =3D unregister_switchdev_notifier(&dsa_user_switchdev_notifier); if (err) pr_err("DSA: failed to unregister switchdev notifier (%d)\n", err); =20 - err =3D unregister_netdevice_notifier(&dsa_slave_nb); + err =3D unregister_netdevice_notifier(&dsa_user_nb); if (err) - pr_err("DSA: failed to unregister slave notifier (%d)\n", err); + pr_err("DSA: failed to unregister user notifier (%d)\n", err); } diff --git a/net/dsa/user.h b/net/dsa/user.h new file mode 100644 index 000000000000..ee15a807c04b --- /dev/null +++ b/net/dsa/user.h @@ -0,0 +1,69 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef __DSA_OPERATIVE_H +#define __DSA_OPERATIVE_H + +#include +#include +#include +#include +#include +#include +#include + +struct net_device; +struct netlink_ext_ack; + +extern struct notifier_block dsa_user_switchdev_notifier; +extern struct notifier_block dsa_user_switchdev_blocking_notifier; + +struct dsa_user_priv { + /* Copy of CPU port xmit for faster access in user transmit hot path */ + struct sk_buff * (*xmit)(struct sk_buff *skb, + struct net_device *dev); + + struct gro_cells gcells; + + /* DSA port data, such as switch, port index, etc. */ + struct dsa_port *dp; + +#ifdef CONFIG_NET_POLL_CONTROLLER + struct netpoll *netpoll; +#endif + + /* TC context */ + struct list_head mall_tc_list; +}; + +void dsa_user_mii_bus_init(struct dsa_switch *ds); +int dsa_user_create(struct dsa_port *dp); +void dsa_user_destroy(struct net_device *user_dev); +int dsa_user_suspend(struct net_device *user_dev); +int dsa_user_resume(struct net_device *user_dev); +int dsa_user_register_notifier(void); +void dsa_user_unregister_notifier(void); +void dsa_user_sync_ha(struct net_device *dev); +void dsa_user_unsync_ha(struct net_device *dev); +void dsa_user_setup_tagger(struct net_device *user); +int dsa_user_change_mtu(struct net_device *dev, int new_mtu); +int dsa_user_change_conduit(struct net_device *dev, struct net_device *con= duit, + struct netlink_ext_ack *extack); +int dsa_user_manage_vlan_filtering(struct net_device *dev, + bool vlan_filtering); + +static inline struct dsa_port *dsa_user_to_port(const struct net_device *d= ev) +{ + struct dsa_user_priv *p =3D netdev_priv(dev); + + return p->dp; +} + +static inline struct net_device * +dsa_user_to_conduit(const struct net_device *dev) +{ + struct dsa_port *dp =3D dsa_user_to_port(dev); + + return dsa_port_to_conduit(dp); +} + +#endif --=20 2.34.1 --00000000000001cece0607638cf8 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQeQYJKoZIhvcNAQcCoIIQajCCEGYCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3QMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMDBaMFsxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTEwLwYDVQQDEyhHbG9iYWxTaWduIEdDQyBS MyBQZXJzb25hbFNpZ24gMiBDQSAyMDIwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA vbCmXCcsbZ/a0fRIQMBxp4gJnnyeneFYpEtNydrZZ+GeKSMdHiDgXD1UnRSIudKo+moQ6YlCOu4t rVWO/EiXfYnK7zeop26ry1RpKtogB7/O115zultAz64ydQYLe+a1e/czkALg3sgTcOOcFZTXk38e aqsXsipoX1vsNurqPtnC27TWsA7pk4uKXscFjkeUE8JZu9BDKaswZygxBOPBQBwrA5+20Wxlk6k1 e6EKaaNaNZUy30q3ArEf30ZDpXyfCtiXnupjSK8WU2cK4qsEtj09JS4+mhi0CTCrCnXAzum3tgcH cHRg0prcSzzEUDQWoFxyuqwiwhHu3sPQNmFOMwIDAQABo4IB2jCCAdYwDgYDVR0PAQH/BAQDAgGG MGAGA1UdJQRZMFcGCCsGAQUFBwMCBggrBgEFBQcDBAYKKwYBBAGCNxQCAgYKKwYBBAGCNwoDBAYJ KwYBBAGCNxUGBgorBgEEAYI3CgMMBggrBgEFBQcDBwYIKwYBBQUHAxEwEgYDVR0TAQH/BAgwBgEB /wIBADAdBgNVHQ4EFgQUljPR5lgXWzR1ioFWZNW+SN6hj88wHwYDVR0jBBgwFoAUj/BLf6guRSSu TVD6Y5qL3uLdG7wwegYIKwYBBQUHAQEEbjBsMC0GCCsGAQUFBzABhiFodHRwOi8vb2NzcC5nbG9i YWxzaWduLmNvbS9yb290cjMwOwYIKwYBBQUHMAKGL2h0dHA6Ly9zZWN1cmUuZ2xvYmFsc2lnbi5j b20vY2FjZXJ0L3Jvb3QtcjMuY3J0MDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwuZ2xvYmFs c2lnbi5jb20vcm9vdC1yMy5jcmwwWgYDVR0gBFMwUTALBgkrBgEEAaAyASgwQgYKKwYBBAGgMgEo CjA0MDIGCCsGAQUFBwIBFiZodHRwczovL3d3dy5nbG9iYWxzaWduLmNvbS9yZXBvc2l0b3J5LzAN BgkqhkiG9w0BAQsFAAOCAQEAdAXk/XCnDeAOd9nNEUvWPxblOQ/5o/q6OIeTYvoEvUUi2qHUOtbf jBGdTptFsXXe4RgjVF9b6DuizgYfy+cILmvi5hfk3Iq8MAZsgtW+A/otQsJvK2wRatLE61RbzkX8 9/OXEZ1zT7t/q2RiJqzpvV8NChxIj+P7WTtepPm9AIj0Keue+gS2qvzAZAY34ZZeRHgA7g5O4TPJ /oTd+4rgiU++wLDlcZYd/slFkaT3xg4qWDepEMjT4T1qFOQIL+ijUArYS4owpPg9NISTKa1qqKWJ jFoyms0d0GwOniIIbBvhI2MJ7BSY9MYtWVT5jJO3tsVHwj4cp92CSFuGwunFMzCCA18wggJHoAMC AQICCwQAAAAAASFYUwiiMA0GCSqGSIb3DQEBCwUAMEwxIDAeBgNVBAsTF0dsb2JhbFNpZ24gUm9v dCBDQSAtIFIzMRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTA5 MDMxODEwMDAwMFoXDTI5MDMxODEwMDAwMFowTDEgMB4GA1UECxMXR2xvYmFsU2lnbiBSb290IENB IC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wggEiMA0GCSqG SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDMJXaQeQZ4Ihb1wIO2hMoonv0FdhHFrYhy/EYCQ8eyip0E XyTLLkvhYIJG4VKrDIFHcGzdZNHr9SyjD4I9DCuul9e2FIYQebs7E4B3jAjhSdJqYi8fXvqWaN+J J5U4nwbXPsnLJlkNc96wyOkmDoMVxu9bi9IEYMpJpij2aTv2y8gokeWdimFXN6x0FNx04Druci8u nPvQu7/1PQDhBjPogiuuU6Y6FnOM3UEOIDrAtKeh6bJPkC4yYOlXy7kEkmho5TgmYHWyn3f/kRTv riBJ/K1AFUjRAjFhGV64l++td7dkmnq/X8ET75ti+w1s4FRpFqkD2m7pg5NxdsZphYIXAgMBAAGj QjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSP8Et/qC5FJK5N UPpjmove4t0bvDANBgkqhkiG9w0BAQsFAAOCAQEAS0DbwFCq/sgM7/eWVEVJu5YACUGssxOGhigH M8pr5nS5ugAtrqQK0/Xx8Q+Kv3NnSoPHRHt44K9ubG8DKY4zOUXDjuS5V2yq/BKW7FPGLeQkbLmU Y/vcU2hnVj6DuM81IcPJaP7O2sJTqsyQiunwXUaMld16WCgaLx3ezQA3QY/tRG3XUyiXfvNnBB4V 14qWtNPeTCekTBtzc3b0F5nCH3oO4y0IrQocLP88q1UOD5F+NuvDV0m+4S4tfGCLw0FREyOdzvcy a5QBqJnnLDMfOjsl0oZAzjsshnjJYS8Uuu7bVW/fhO4FCU29KNhyztNiUGUe65KXgzHZs7XKR1g/ XzCCBVgwggRAoAMCAQICDBP8P9hKRVySg3Qv5DANBgkqhkiG9w0BAQsFADBbMQswCQYDVQQGEwJC RTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTExMC8GA1UEAxMoR2xvYmFsU2lnbiBHQ0MgUjMg UGVyc29uYWxTaWduIDIgQ0EgMjAyMDAeFw0yMjA5MTAxMjE4MTFaFw0yNTA5MTAxMjE4MTFaMIGW MQswCQYDVQQGEwJJTjESMBAGA1UECBMJS2FybmF0YWthMRIwEAYDVQQHEwlCYW5nYWxvcmUxFjAU BgNVBAoTDUJyb2FkY29tIEluYy4xGTAXBgNVBAMTEEZsb3JpYW4gRmFpbmVsbGkxLDAqBgkqhkiG 9w0BCQEWHWZsb3JpYW4uZmFpbmVsbGlAYnJvYWRjb20uY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA+oi3jMmHltY4LMUy8Up5+1zjd1iSgUBXhwCJLj1GJQF+GwP8InemBbk5rjlC UwbQDeIlOfb8xGqHoQFGSW8p9V1XUw+cthISLkycex0AJ09ufePshLZygRLREU0H4ecNPMejxCte KdtB4COST4uhBkUCo9BSy1gkl8DJ8j/BQ1KNUx6oYe0CntRag+EnHv9TM9BeXBBLfmMRnWNhvOSk nSmRX0J3d9/G2A3FIC6WY2XnLW7eAZCQPa1Tz3n2B5BGOxwqhwKLGLNu2SRCPHwOdD6e0drURF7/ Vax85/EqkVnFNlfxtZhS0ugx5gn2pta7bTdBm1IG4TX+A3B1G57rVwIDAQABo4IB3jCCAdowDgYD VR0PAQH/BAQDAgWgMIGjBggrBgEFBQcBAQSBljCBkzBOBggrBgEFBQcwAoZCaHR0cDovL3NlY3Vy ZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQvZ3NnY2NyM3BlcnNvbmFsc2lnbjJjYTIwMjAuY3J0MEEG CCsGAQUFBzABhjVodHRwOi8vb2NzcC5nbG9iYWxzaWduLmNvbS9nc2djY3IzcGVyc29uYWxzaWdu MmNhMjAyMDBNBgNVHSAERjBEMEIGCisGAQQBoDIBKAowNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93 d3cuZ2xvYmFsc2lnbi5jb20vcmVwb3NpdG9yeS8wCQYDVR0TBAIwADBJBgNVHR8EQjBAMD6gPKA6 hjhodHRwOi8vY3JsLmdsb2JhbHNpZ24uY29tL2dzZ2NjcjNwZXJzb25hbHNpZ24yY2EyMDIwLmNy bDAoBgNVHREEITAfgR1mbG9yaWFuLmZhaW5lbGxpQGJyb2FkY29tLmNvbTATBgNVHSUEDDAKBggr BgEFBQcDBDAfBgNVHSMEGDAWgBSWM9HmWBdbNHWKgVZk1b5I3qGPzzAdBgNVHQ4EFgQUUwwfJ6/F KL0fRdVROal/Lp4lAF0wDQYJKoZIhvcNAQELBQADggEBAKBgfteDc1mChZjKBY4xAplC6uXGyBrZ kNGap1mHJ+JngGzZCz+dDiHRQKGpXLxkHX0BvEDZLW6LGOJ83ImrW38YMOo3ZYnCYNHA9qDOakiw 2s1RH00JOkO5SkYdwCHj4DB9B7KEnLatJtD8MBorvt+QxTuSh4ze96Jz3kEIoHMvwGFkgObWblsc 3/YcLBmCgaWpZ3Ksev1vJPr5n8riG3/N4on8gO5qinmmr9Y7vGeuf5dmZrYMbnb+yCBalkUmZQwY NxADYvcRBA0ySL6sZpj8BIIhWiXiuusuBmt2Mak2eEv0xDbovE6Z6hYyl/ZnRadbgK/ClgbY3w+O AfUXEZ0xggJtMIICaQIBATBrMFsxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52 LXNhMTEwLwYDVQQDEyhHbG9iYWxTaWduIEdDQyBSMyBQZXJzb25hbFNpZ24gMiBDQSAyMDIwAgwT /D/YSkVckoN0L+QwDQYJYIZIAWUDBAIBBQCggdQwLwYJKoZIhvcNAQkEMSIEIKwfc/a1DweOFxNb Bs5K1r56qUfs+BZVehe2eppefjniMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcN AQkFMQ8XDTIzMTAxMDIxMzk1MlowaQYJKoZIhvcNAQkPMVwwWjALBglghkgBZQMEASowCwYJYIZI AWUDBAEWMAsGCWCGSAFlAwQBAjAKBggqhkiG9w0DBzALBgkqhkiG9w0BAQowCwYJKoZIhvcNAQEH MAsGCWCGSAFlAwQCATANBgkqhkiG9w0BAQEFAASCAQBU2LRqbmEhzPwSwbXzi2z74BiSeP5TMhnm NwAtSAl0u+tj/vcWq7fIijsETO2QI51yX06B5/ttwPh2wRbssy1gCVizLaF9ZiGnEp+TtbjBRuWw J22JlJvoM06i4IFghouSoIo4HVzQZXMnKkv39k5B8cGNjMSx4IBdBMZ7dq+so1p7jAu9tazZ0hmI zJm0K5Ry9rnMTOTJb03shLo+jcFFYdeh8RV+yKS7J0KLSu1vpb8MlDdsMlCa+QlPJyhrGlyliuuo 7tWMjl47qZni31Kaw7mMW/U7O22NAqxbWlNC7jVa20uC6/R6ttg6jmAkxnpBx/qS5l5Df7xy31f5 fZ0G --00000000000001cece0607638cf8--