Switch DSA to inclusive terminology
Subsystems (21)
Florian Fainelli
maintainerv7 cover Switch DSA to inclusive terminology
One of the action items following Netconf'23 is to switch subsystems to use inclusive terminology. DSA has been making extensive use of the "master" and "slave" words which are now replaced by "conduit" and "user" respectively.
Changes in v7:
- rebased against latest change to drivers/net/dsa/bcm_sf2.c
- collected Vladimir's R-by tags
Changes in v6:
- fixed typo in if_link.h (insted vs. instead)
Changes in v5:
- actually collected Rob's acked-by tag
- added Stephen's Acked-by tag
- fixed the stray references spotted by Vladimir
Changes in v4:
- added clarification that we used "master" and "slave" terms for a while
- fixed include guard names in user.h
- fixed some improper subtitutions
- renamed STATE_CHANGE notifier
- added Rob's ack on the DT patches from the first review
Changes in v3:
- properly align arguments with the changed function names
- ensure markup delimiters lengths are corrected to the name word length
- maintain the existing wording about LAG devices
Changes in v2:
- addressed kbuild test robots reports
- preserve capitalization where relevant
- fixed build error in mtk_ppe_offload.c
Florian Fainelli (2):
net: dsa: Use conduit and user terms
net: dsa: Rename IFLA_DSA_MASTER to IFLA_DSA_CONDUIT
.../bindings/net/dsa/mediatek,mt7530.yaml | 2 +-
Documentation/networking/dsa/b53.rst | 14 +-
Documentation/networking/dsa/bcm_sf2.rst | 2 +-
.../networking/dsa/configuration.rst | 102 +-
Documentation/networking/dsa/dsa.rst | 162 +-
Documentation/networking/dsa/lan9303.rst | 2 +-
Documentation/networking/dsa/sja1105.rst | 6 +-
.../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 | 41 +-
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 | 18 +-
drivers/net/dsa/mv88e6xxx/chip.c | 4 +-
drivers/net/dsa/ocelot/felix.c | 68 +-
drivers/net/dsa/ocelot/felix.h | 6 +-
drivers/net/dsa/qca/qca8k-8xxx.c | 50 +-
drivers/net/dsa/qca/qca8k-common.c | 4 +-
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/realtek/rtl8365mb.c | 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 +-
.../net/ethernet/mediatek/mtk_ppe_offload.c | 2 +-
include/linux/dsa/sja1105.h | 2 +-
include/net/dsa.h | 56 +-
include/net/dsa_stubs.h | 22 +-
include/uapi/linux/if_link.h | 4 +-
net/core/dev_ioctl.c | 2 +-
net/dsa/Makefile | 6 +-
net/dsa/{master.c => conduit.c} | 118 +-
net/dsa/conduit.h | 22 +
net/dsa/dsa.c | 224 +--
net/dsa/dsa.h | 12 +-
net/dsa/master.h | 22 -
net/dsa/netlink.c | 22 +-
net/dsa/port.c | 124 +-
net/dsa/port.h | 4 +-
net/dsa/slave.h | 69 -
net/dsa/switch.c | 20 +-
net/dsa/switch.h | 8 +-
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 | 6 +-
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 => user.c} | 1464 ++++++++---------
net/dsa/user.h | 69 +
75 files changed, 1555 insertions(+), 1550 deletions(-)
rename net/dsa/{master.c => conduit.c} (76%)
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 => user.c} (62%)
create mode 100644 net/dsa/user.hSignature · 1 line
2.34.1
Florian Fainelli
maintainerPATCH v7 1/2 net: dsa: Use conduit and user terms
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.
---
.../bindings/net/dsa/mediatek,mt7530.yaml | 2 +-
Documentation/networking/dsa/b53.rst | 14 +-
Documentation/networking/dsa/bcm_sf2.rst | 2 +-
.../networking/dsa/configuration.rst | 100 +-
Documentation/networking/dsa/dsa.rst | 162 +-
Documentation/networking/dsa/lan9303.rst | 2 +-
Documentation/networking/dsa/sja1105.rst | 6 +-
.../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 | 41 +-
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 | 18 +-
drivers/net/dsa/mv88e6xxx/chip.c | 4 +-
drivers/net/dsa/ocelot/felix.c | 68 +-
drivers/net/dsa/ocelot/felix.h | 6 +-
drivers/net/dsa/qca/qca8k-8xxx.c | 50 +-
drivers/net/dsa/qca/qca8k-common.c | 4 +-
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/realtek/rtl8365mb.c | 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 +-
.../net/ethernet/mediatek/mtk_ppe_offload.c | 2 +-
include/linux/dsa/sja1105.h | 2 +-
include/net/dsa.h | 56 +-
include/net/dsa_stubs.h | 22 +-
net/core/dev_ioctl.c | 2 +-
net/dsa/Makefile | 6 +-
net/dsa/{master.c => conduit.c} | 118 +-
net/dsa/conduit.h | 22 +
net/dsa/dsa.c | 224 +--
net/dsa/dsa.h | 12 +-
net/dsa/master.h | 22 -
net/dsa/netlink.c | 14 +-
net/dsa/port.c | 124 +-
net/dsa/port.h | 4 +-
net/dsa/slave.h | 69 -
net/dsa/switch.c | 20 +-
net/dsa/switch.h | 8 +-
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 | 6 +-
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 => user.c} | 1464 ++++++++---------
net/dsa/user.h | 69 +
74 files changed, 1547 insertions(+), 1544 deletions(-)
rename net/dsa/{master.c => conduit.c} (76%)
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 => user.c} (62%)
create mode 100644 net/dsa/user.hDocumentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +1 -1
@@ -60,7 +60,7 @@ description: | Check out example 6. - - 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 port. 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 wired
Documentation/networking/dsa/b53.rst +7 -7
@@ -52,7 +52,7 @@ VLAN programming would basically change the CPU port's default PVID and make it untagged, undesirable. In difference to the configuration described in :ref:`dsa-vlan-configuration` -the default VLAN 1 has to be removed from the slave interface configuration 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 extra VLAN configuration in the bridge showcase.
@@ -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 - # 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 - # 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 - # 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 - # 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 - # 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 - # 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
Documentation/networking/dsa/bcm_sf2.rst +1 -1
@@ -67,7 +67,7 @@ MDIO indirect accesses ---------------------- 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 user MDIO bus in order to properly configure them. By default, the SF2 pseudo-PHY address, and an external switch pseudo-PHY address will both be snooping for incoming MDIO transactions, since they are at the same address (30), resulting in some kind of
Documentation/networking/dsa/configuration.rst +50 -50
226 lines not on this page · raw message
Documentation/networking/dsa/dsa.rst +83 -79
417 lines not on this page · raw message
Documentation/networking/dsa/lan9303.rst +1 -1
@@ -4,7 +4,7 @@ LAN9303 Ethernet switch driver The LAN9303 is a three port 10/100 Mbps ethernet switch with integrated phys for the two external ethernet ports. The third port is an RMII/MII interface to a -host master network interface (e.g. fixed link). +host conduit network interface (e.g. fixed link). Driver details
Documentation/networking/dsa/sja1105.rst +3 -3
@@ -79,7 +79,7 @@ The hardware tags all traffic internally with a port-based VLAN (pvid), or it decodes the VLAN information from the 802.1Q tag. Advanced VLAN classification 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 VLAN. -This behavior is available when switch ports are enslaved to a bridge with +This behavior is available when switch ports join a bridge with ``vlan_filtering 1``. Normally the hardware is not configurable with respect to VLAN awareness, but
@@ -122,7 +122,7 @@ on egress. Using ``vlan_filtering=1``, the behavior is 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 hardware 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. Management traffic (having DMAC 01-80-C2-xx-xx-xx or 01-19-1B-xx-xx-xx) is the
@@ -389,7 +389,7 @@ MDIO bus and PHY management The SJA1105 does not have an MDIO bus and does not perform in-band AN either. Therefore there is no link state notification coming from the switch device. 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 MDIO +MDIO bus available to Linux within the system (e.g. to the DSA conduit's MDIO bus). Link state management then works by the driver manually keeping in sync (over SPI commands) the MAC link speed with the settings negotiated by the PHY.
arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi +1 -1
@@ -13,7 +13,7 @@ / { aliases { ethernet0 = ð0; - /* for dsa slave device */ + /* for DSA user port device */ ethernet1 = &switch0port1; ethernet2 = &switch0port2; ethernet3 = &switch0port3;
drivers/net/dsa/b53/b53_common.c +2 -2
@@ -757,7 +757,7 @@ int b53_configure_vlan(struct dsa_switch *ds)/* 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 ; } -return mdiobus_get_phy (ds->slave_mii_bus, port); +return mdiobus_get_phy (ds->user_mii_bus, port); } void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset,
drivers/net/dsa/b53/b53_mdio.c +1 -1
@@ -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 ; dev =b53_switch_alloc (&mdiodev->dev, &b53_mdio_ops, mdiodev->bus);
drivers/net/dsa/bcm_sf2.c +20 -21
93 lines not on this page · raw message
drivers/net/dsa/bcm_sf2.h +1 -1
@@ -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;/* Bitmask of ports needing BRCM tags */
drivers/net/dsa/bcm_sf2_cfp.c +2 -2
@@ -1102,7 +1102,7 @@ static int bcm_sf2_cfp_rule_get_all(struct bcm_sf2_priv *priv,int bcm_sf2_get_rxnfc (struct dsa_switch *ds,int port,struct ethtool_rxnfc *nfc,u32 *rule_locs) { -struct net_device *p =dsa_port_to_master (dsa_to_port (ds, port)); +struct net_device *p =dsa_port_to_conduit (dsa_to_port (ds, port));struct bcm_sf2_priv *priv =bcm_sf2_to_priv (ds);int ret =0 ;
@@ -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 =dsa_port_to_master (dsa_to_port (ds, port)); +struct net_device *p =dsa_port_to_conduit (dsa_to_port (ds, port));struct bcm_sf2_priv *priv =bcm_sf2_to_priv (ds);int ret =0 ;
drivers/net/dsa/lan9303-core.c +2 -2
@@ -1084,7 +1084,7 @@ static int lan9303_port_enable(struct dsa_switch *ds, int port,if (!dsa_port_is_user (dp))return 0 ; -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);return lan9303_enable_processing_port (chip, port); }
@@ -1097,7 +1097,7 @@ static void lan9303_port_disable(struct dsa_switch *ds, int port)if (!dsa_port_is_user (dp))return ; -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);lan9303_disable_processing_port (chip, port);lan9303_phy_write (ds, chip->phy_addr_base + port,MII_BMCR ,BMCR_PDOWN );
drivers/net/dsa/lantiq_gswip.c +17 -17
@@ -510,22 +510,22 @@ static int gswip_mdio(struct gswip_priv *priv, struct device_node *mdio_np)struct dsa_switch *ds = priv->ds;int err; - ds->slave_mii_bus =mdiobus_alloc (); -if (!ds->slave_mii_bus) + ds->user_mii_bus =mdiobus_alloc (); +if (!ds->user_mii_bus)return -ENOMEM ; - ds->slave_mii_bus->priv = priv; - ds->slave_mii_bus->read = gswip_mdio_rd; - ds->slave_mii_bus->write = gswip_mdio_wr; - ds->slave_mii_bus->name ="lantiq,xrx200-mdio" ; -snprintf (ds->slave_mii_bus->id,MII_BUS_ID_SIZE ,"%s-mii" , + ds->user_mii_bus->priv = priv; + ds->user_mii_bus->read = gswip_mdio_rd; + ds->user_mii_bus->write = gswip_mdio_wr; + ds->user_mii_bus->name ="lantiq,xrx200-mdio" ; +snprintf (ds->user_mii_bus->id,MII_BUS_ID_SIZE ,"%s-mii" ,dev_name (priv->dev)); - ds->slave_mii_bus->parent = priv->dev; - ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask; + ds->user_mii_bus->parent = priv->dev; + ds->user_mii_bus->phy_mask = ~ds->phys_mii_mask; - err =of_mdiobus_register (ds->slave_mii_bus, mdio_np); + err =of_mdiobus_register (ds->user_mii_bus, mdio_np);if (err) -mdiobus_free (ds->slave_mii_bus); +mdiobus_free (ds->user_mii_bus);return err; }
@@ -2196,8 +2196,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);
@@ -2219,10 +2219,10 @@ static void gswip_remove(struct platform_device *pdev)dsa_unregister_switch (priv->ds); -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); }for (i =0 ; i < priv->num_gphy_fw; i++)
drivers/net/dsa/microchip/ksz9477.c +3 -3
@@ -1170,7 +1170,7 @@ int ksz9477_tc_cbs_set_cinc(struct ksz_device *dev, int port, u32 val)void ksz9477_hsr_join (struct dsa_switch *ds,int port,struct net_device *hsr) {struct ksz_device *dev = ds->priv; -struct net_device *slave; +struct net_device *user;struct dsa_port *hsr_dp;u8 data, hsr_ports =0 ;
@@ -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);/* Setup HW supported features for lan HSR ports */ - slave =dsa_to_port (ds, port)->slave; - slave->features |=KSZ9477_SUPPORTED_HSR_FEATURES ; + user =dsa_to_port (ds, port)->user; + user->features |=KSZ9477_SUPPORTED_HSR_FEATURES ; }void ksz9477_hsr_leave (struct dsa_switch *ds,int port,struct net_device *hsr)
drivers/net/dsa/microchip/ksz_common.c +10 -10
@@ -1945,14 +1945,14 @@ static int ksz_irq_phy_setup(struct ksz_device *dev) ret = irq; goto out; } - ds->slave_mii_bus->irq[phy] = irq; + ds->user_mii_bus->irq[phy] = 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]);return ret; }
@@ -1964,7 +1964,7 @@ static void ksz_irq_phy_free(struct ksz_device *dev)for (phy =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]); }static int ksz_mdio_register (struct ksz_device *dev)
@@ -1987,12 +1987,12 @@ static int ksz_mdio_register(struct ksz_device *dev) bus->priv = dev; bus->read = ksz_sw_mdio_read; bus->write = ksz_sw_mdio_write; - bus->name ="ksz slave smi" ; + bus->name ="ksz user smi" ;snprintf (bus->id,MII_BUS_ID_SIZE ,"SMI-%d" , ds->index); bus->parent = ds->dev; bus->phy_mask = ~ds->phys_mii_mask; - ds->slave_mii_bus = bus; + ds->user_mii_bus = bus;if (dev->irq >0 ) { ret =ksz_irq_phy_setup (dev);
@@ -2344,7 +2344,7 @@ static void ksz_mib_read_work(struct work_struct *work)if (!p->read) {const struct dsa_port *dp =dsa_to_port (dev->ds, i); -if (!netif_carrier_ok (dp->slave)) +if (!netif_carrier_ok (dp->user)) mib->cnt_ptr = 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);/* Only read dropped counters if no link. */ -if (!netif_carrier_ok (dp->slave)) +if (!netif_carrier_ok (dp->user)) mib->cnt_ptr = 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 ; -/* setup slave port */ +/* setup user port */ dev->dev_ops->port_setup (dev, port, false);/* 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 =dsa_to_port (ds, port)->slave; -const unsigned char *addr = slave->dev_addr; +struct net_device *user =dsa_to_port (ds, port)->user; +const unsigned char *addr = user->dev_addr;struct ksz_switch_macaddr *switch_macaddr;struct ksz_device *dev = ds->priv;const u16 *regs = dev->info->regs;
drivers/net/dsa/microchip/ksz_ptp.c +1 -1
@@ -557,7 +557,7 @@ static void ksz_ptp_txtstamp_skb(struct ksz_device *dev,struct skb_shared_hwtstamps hwtstamps = {};int ret; -/* 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 = wait_for_completion_timeout(&prt->tstamp_msg_comp,
drivers/net/dsa/mt7530.c +9 -9
@@ -1113,7 +1113,7 @@ mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)u32 val;/* When a new MTU is set, DSA always set the CPU port's MTU to the -* largest MTU of the slave ports. Because the switch only has a global +* largest MTU of the user ports. Because the switch only has a global * RX length register, only allowing CPU port here is enough. */ if (!dsa_is_cpu_port (ds, port))
@@ -2069,7 +2069,7 @@ mt7530_setup_mdio_irq(struct mt7530_priv *priv)unsigned int irq; irq =irq_create_mapping (priv->irq_domain, p); - ds->slave_mii_bus->irq[p] = irq; + ds->user_mii_bus->irq[p] = irq; } } }
@@ -2163,7 +2163,7 @@ mt7530_setup_mdio(struct mt7530_priv *priv)if (!bus)return -ENOMEM ; - ds->slave_mii_bus = bus; + ds->user_mii_bus = bus; bus->priv = priv; bus->name =KBUILD_MODNAME "-mii" ;snprintf (bus->id,MII_BUS_ID_SIZE ,KBUILD_MODNAME "-%d" , idx++);
@@ -2200,20 +2200,20 @@ mt7530_setup(struct dsa_switch *ds)u32 id, val;int ret, i; -/* 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 = cpu_dp->master->dev.of_node->parent; + dn = 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 ; }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 ; }
@@ -2488,7 +2488,7 @@ mt7531_setup(struct dsa_switch *ds)if (mt7531_dual_sgmii_supported (priv)) { priv->p5_intf_sel =P5_INTF_SEL_GMAC5_SGMII ; -/* 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,
@@ -2717,7 +2717,7 @@ mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,case PHY_INTERFACE_MODE_RGMII_RXID :case PHY_INTERFACE_MODE_RGMII_TXID : dp =dsa_to_port (ds, port); - phydev = dp->slave->phydev; + phydev = dp->user->phydev;return mt7531_rgmii_setup (priv, port, interface, phydev);case PHY_INTERFACE_MODE_SGMII :case PHY_INTERFACE_MODE_NA :
drivers/net/dsa/mv88e6xxx/chip.c +2 -2
@@ -2486,7 +2486,7 @@ static int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,else member =MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_TAGGED ; -/* net/dsa/slave.c will call dsa_port_vlan_add() for the affected port +/* net/dsa/user.c will call dsa_port_vlan_add() for the affected port * and then the CPU port. Do not warn for duplicates for the CPU port. */ warn = !dsa_is_cpu_port (ds, port) && !dsa_is_dsa_port (ds, port);
@@ -3719,7 +3719,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)return err; chip->ds = ds; - ds->slave_mii_bus =mv88e6xxx_default_mdio_bus (chip); + ds->user_mii_bus =mv88e6xxx_default_mdio_bus (chip);/* Since virtual bridges are mapped in the PVT, the number we support * depends on the physical switch topology. We need to let DSA figure
drivers/net/dsa/ocelot/felix.c +34 -34
180 lines not on this page · raw message
drivers/net/dsa/ocelot/felix.h +3 -3
@@ -77,9 +77,9 @@ 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, -struct netlink_ext_ack *extack); +int (*change_conduit)(struct dsa_switch *ds,int port, +struct net_device *conduit, +struct netlink_ext_ack *extack); };extern const struct dsa_switch_ops felix_switch_ops;
drivers/net/dsa/qca/qca8k-8xxx.c +25 -25
142 lines not on this page · raw message
drivers/net/dsa/qca/qca8k-common.c +2 -2
@@ -499,7 +499,7 @@ void qca8k_get_ethtool_stats(struct dsa_switch *ds, int port,u32 hi =0 ;int ret; -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 ;
@@ -761,7 +761,7 @@ int qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)int ret;/* We have only have a general MTU setting. -* DSA always set the CPU port's MTU to the largest MTU of the slave +* DSA always set the CPU port's MTU to the largest MTU of the user * ports. * Setting MTU just for the CPU port is sufficient to correctly set a * value for every port.
drivers/net/dsa/qca/qca8k-leds.c +3 -3
@@ -356,8 +356,8 @@ static struct device *qca8k_cled_hw_control_get_device(struct led_classdev *ldev dp =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 ; }
@@ -429,7 +429,7 @@ qca8k_parse_port_leds(struct qca8k_priv *priv, struct fwnode_handle *port, int p init_data.default_label =":port" ; init_data.fwnode = led; init_data.devname_mandatory = true; - init_data.devicename =kasprintf (GFP_KERNEL ,"%s:0%d" , ds->slave_mii_bus->id, + init_data.devicename =kasprintf (GFP_KERNEL ,"%s:0%d" , ds->user_mii_bus->id, port_num);if (!init_data.devicename)return -ENOMEM ;
drivers/net/dsa/qca/qca8k.h +1 -1
@@ -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 available */ +struct net_device *mgmt_conduit;/* Track if mdio/mib Ethernet is available */ struct qca8k_mgmt_eth_data mgmt_eth_data;struct qca8k_mib_eth_data mib_eth_data;struct qca8k_mdio_cache mdio_cache;
drivers/net/dsa/realtek/realtek-smi.c +14 -14
@@ -378,25 +378,25 @@ static int realtek_smi_setup_mdio(struct dsa_switch *ds)return -ENODEV ; } - priv->slave_mii_bus =devm_mdiobus_alloc (priv->dev); -if (!priv->slave_mii_bus) { + priv->user_mii_bus =devm_mdiobus_alloc (priv->dev); +if (!priv->user_mii_bus) { ret = -ENOMEM ; goto err_put_node; } - priv->slave_mii_bus->priv = priv; - priv->slave_mii_bus->name ="SMI slave MII" ; - priv->slave_mii_bus->read = realtek_smi_mdio_read; - priv->slave_mii_bus->write = realtek_smi_mdio_write; -snprintf (priv->slave_mii_bus->id,MII_BUS_ID_SIZE ,"SMI-%d" , + priv->user_mii_bus->priv = priv; + priv->user_mii_bus->name ="SMI user MII" ; + priv->user_mii_bus->read = realtek_smi_mdio_read; + priv->user_mii_bus->write = 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 = mdio_np; - priv->slave_mii_bus->parent = priv->dev; - ds->slave_mii_bus = priv->slave_mii_bus; + priv->user_mii_bus->dev.of_node = mdio_np; + priv->user_mii_bus->parent = priv->dev; + ds->user_mii_bus = priv->user_mii_bus; - ret =devm_of_mdiobus_register (priv->dev, priv->slave_mii_bus, mdio_np); + ret =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; }
@@ -514,8 +514,8 @@ static void realtek_smi_remove(struct platform_device *pdev)return ;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);/* leave the device reset asserted */ if (priv->reset)
drivers/net/dsa/realtek/realtek.h +1 -1
@@ -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;
drivers/net/dsa/realtek/rtl8365mb.c +1 -1
@@ -1144,7 +1144,7 @@ static int rtl8365mb_port_change_mtu(struct dsa_switch *ds, int port,int frame_size;/* When a new MTU is set, DSA always sets the CPU port's MTU to the -* largest MTU of the slave ports. Because the switch only has a global +* largest MTU of the user ports. Because the switch only has a global * RX length register, only allowing CPU port here is enough. */ if (!dsa_is_cpu_port (ds, port))
drivers/net/dsa/sja1105/sja1105_main.c +2 -2
@@ -2688,7 +2688,7 @@ static int sja1105_mgmt_xmit(struct dsa_switch *ds, int port, int slot, }/* 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);/* Wait until the switch has processed the frame */ do {
@@ -3081,7 +3081,7 @@ static int sja1105_port_bridge_flags(struct dsa_switch *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 MDIO. * 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. */
drivers/net/dsa/xrs700x/xrs700x.c +6 -6
@@ -554,7 +554,7 @@ static int xrs700x_hsr_join(struct dsa_switch *ds, int port,unsigned int val =XRS_HSR_CFG_HSR_PRP ;struct dsa_port *partner =NULL , *dp;struct xrs700x *priv = ds->priv; -struct net_device *slave; +struct net_device *user;int ret, i, hsr_pair[2 ];enum hsr_version ver;bool fwd = false;
@@ -638,8 +638,8 @@ static int xrs700x_hsr_join(struct dsa_switch *ds, int port, hsr_pair[0 ] = port; hsr_pair[1 ] = partner->index;for (i =0 ; i <ARRAY_SIZE (hsr_pair); i++) { - slave =dsa_to_port (ds, hsr_pair[i])->slave; - slave->features |=XRS7000X_SUPPORTED_HSR_FEATURES ; + user =dsa_to_port (ds, hsr_pair[i])->user; + user->features |=XRS7000X_SUPPORTED_HSR_FEATURES ; }return 0 ;
@@ -650,7 +650,7 @@ static int xrs700x_hsr_leave(struct dsa_switch *ds, int port, {struct dsa_port *partner =NULL , *dp;struct xrs700x *priv = ds->priv; -struct net_device *slave; +struct net_device *user;int i, hsr_pair[2 ];unsigned int val;
@@ -692,8 +692,8 @@ static int xrs700x_hsr_leave(struct dsa_switch *ds, int port, hsr_pair[0 ] = port; hsr_pair[1 ] = partner->index;for (i =0 ; i <ARRAY_SIZE (hsr_pair); i++) { - slave =dsa_to_port (ds, hsr_pair[i])->slave; - slave->features &= ~XRS7000X_SUPPORTED_HSR_FEATURES ; + user =dsa_to_port (ds, hsr_pair[i])->user; + user->features &= ~XRS7000X_SUPPORTED_HSR_FEATURES ; }return 0 ;
drivers/net/ethernet/broadcom/bcmsysport.c +1 -1
@@ -2430,7 +2430,7 @@ static int bcm_sysport_netdevice_event(struct notifier_block *nb,if (dev->netdev_ops != &bcm_sysport_netdev_ops)return NOTIFY_DONE ; -if (!dsa_slave_dev_check (info->upper_dev)) +if (!dsa_user_dev_check (info->upper_dev))return NOTIFY_DONE ;if (info->linking)
drivers/net/ethernet/mediatek/mtk_eth_soc.c +1 -1
@@ -3329,7 +3329,7 @@ static int mtk_device_event(struct notifier_block *n, unsigned long event, voidreturn NOTIFY_DONE ; found: -if (!dsa_slave_dev_check (dev)) +if (!dsa_user_dev_check (dev))return NOTIFY_DONE ;if (__ethtool_get_link_ksettings (dev, &s))
drivers/net/ethernet/mediatek/mtk_ppe_offload.c +1 -1
@@ -175,7 +175,7 @@ mtk_flow_get_dsa_port(struct net_device **dev)if (dp->cpu_dp->tag_ops->proto !=DSA_TAG_PROTO_MTK )return -ENODEV ; - *dev =dsa_port_to_master (dp); + *dev =dsa_port_to_conduit (dp);return dp->index;#else
include/linux/dsa/sja1105.h +1 -1
@@ -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 present -* 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 1588 * over L2 use this address for some purpose already. */
include/net/dsa.h +28 -28
142 lines not on this page · raw message
include/net/dsa_stubs.h +11 -11
@@ -13,14 +13,14 @@extern const struct dsa_stubs *dsa_stubs;struct dsa_stubs { -int (*master_hwtstamp_validate)(struct net_device *dev, -const struct kernel_hwtstamp_config *config, -struct netlink_ext_ack *extack); +int (*conduit_hwtstamp_validate)(struct net_device *dev, +const struct kernel_hwtstamp_config *config, +struct netlink_ext_ack *extack); }; -static inline int dsa_master_hwtstamp_validate (struct net_device *dev, -const struct kernel_hwtstamp_config *config, -struct netlink_ext_ack *extack) +static inline int dsa_conduit_hwtstamp_validate (struct net_device *dev, +const struct kernel_hwtstamp_config *config, +struct netlink_ext_ack *extack) {if (!netdev_uses_dsa (dev))return 0 ;
@@ -29,18 +29,18 @@ static inline int dsa_master_hwtstamp_validate(struct net_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 (); - return dsa_stubs->master_hwtstamp_validate(dev, config, extack); + return dsa_stubs->conduit_hwtstamp_validate(dev, config, extack); }#else -static inline int dsa_master_hwtstamp_validate (struct net_device *dev, -const struct kernel_hwtstamp_config *config, -struct netlink_ext_ack *extack) +static inline int dsa_conduit_hwtstamp_validate (struct net_device *dev, +const struct kernel_hwtstamp_config *config, +struct netlink_ext_ack *extack) {return 0 ; }
net/core/dev_ioctl.c +1 -1
@@ -382,7 +382,7 @@ static int dev_set_hwtstamp(struct net_device *dev, struct ifreq *ifr)if (err)return err; - err =dsa_master_hwtstamp_validate (dev, &kernel_cfg, &extack); + err =dsa_conduit_hwtstamp_validate (dev, &kernel_cfg, &extack);if (err) {if (extack._msg)netdev_err (dev,"%s\n" , extack._msg);
net/dsa/Makefile +3 -3
@@ -8,16 +8,16 @@ endif # the core obj-$(CONFIG_NET_DSA) += dsa_core.o dsa_core-y += \ + conduit.o \ devlink.o \ dsa.o \ - master.o \ netlink.o \ port.o \ - slave.o \ switch.o \ tag.o \ tag_8021q.o \ - trace.o + trace.o \ + user.o # tagging formats obj-$(CONFIG_NET_DSA_TAG_AR9331) += tag_ar9331.o
net/dsa/conduit.c renamed from net/dsa/master.c +59 -59
292 lines not on this page · raw message
net/dsa/conduit.h new file +22 -0
@@ -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
net/dsa/dsa.c +112 -112
536 lines not on this page · raw message
net/dsa/dsa.h +6 -6
@@ -21,16 +21,16 @@ void dsa_lag_map(struct dsa_switch_tree *dst, struct dsa_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_conduit_oper_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, -bool up);unsigned int dsa_bridge_num_get (const struct net_device *bridge_dev,int max);void dsa_bridge_num_put (const struct net_device *bridge_dev,unsigned int bridge_num);
net/dsa/master.h deleted +0 -22
@@ -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
net/dsa/netlink.c +7 -7
@@ -5,7 +5,7 @@#include <net/rtnetlink.h> #include "netlink.h" -#include "slave.h" +#include "user.h" static const struct nla_policy dsa_policy[IFLA_DSA_MAX +1 ] = { [IFLA_DSA_MASTER ] = { .type =NLA_U32 },
@@ -22,13 +22,13 @@ static int dsa_changelink(struct net_device *dev, struct nlattr *tb[],if (data[IFLA_DSA_MASTER ]) {u32 ifindex =nla_get_u32 (data[IFLA_DSA_MASTER ]); -struct net_device *master; +struct net_device *conduit; - master =__dev_get_by_index (dev_net (dev), ifindex); -if (!master) + conduit =__dev_get_by_index (dev_net (dev), ifindex); +if (!conduit)return -EINVAL ; - err =dsa_slave_change_master (dev, master, extack); + err =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)static int dsa_fill_info (struct sk_buff *skb,const struct net_device *dev) { -struct net_device *master =dsa_slave_to_master (dev); +struct net_device *conduit =dsa_user_to_conduit (dev); -if (nla_put_u32 (skb,IFLA_DSA_MASTER , master->ifindex)) +if (nla_put_u32 (skb,IFLA_DSA_MASTER , conduit->ifindex))return -EMSGSIZE ;return 0 ;
net/dsa/port.c +62 -62
194 lines not on this page · raw message
net/dsa/slave.h deleted +0 -69
69 lines not on this page · raw message
net/dsa/user.c renamed from net/dsa/slave.c +732 -732
1,464 lines not on this page · raw message
net/dsa/user.h new file +69 -0
69 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.34.1
Part of the diff is not shown here. View the raw message.
Florian Fainelli
maintainerPATCH v7 2/2 net: dsa: Rename IFLA_DSA_MASTER to IFLA_DSA_CONDUIT
In reply to Florian FainelliThis preserves the existing IFLA_DSA_MASTER which is part of the uAPI and creates an alias named IFLA_DSA_CONDUIT.
--- Documentation/networking/dsa/configuration.rst | 4 ++-- include/uapi/linux/if_link.h | 4 +++- net/dsa/netlink.c | 10 +++++----- 3 files changed, 10 insertions(+), 8 deletions(-)
Documentation/networking/dsa/configuration.rst +2 -2
@@ -393,7 +393,7 @@ description which has an ``ethernet`` property. It is up to the user to configure the system for the switch to use other conduits. DSA uses the ``rtnl_link_ops`` mechanism (with a "dsa" ``kind``) to allow -changing the DSA conduit of a user port. The ``IFLA_DSA_MASTER`` u32 netlink +changing the DSA conduit of a user port. The ``IFLA_DSA_CONDUIT`` u32 netlink 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 slaves which are valid
@@ -435,7 +435,7 @@ Using iproute2, the following manipulations are possible: dsa master bond0 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 +``IFLA_DSA_CONDUIT`` netlink attribute is not strictly needed, but rather, DSA reacts to the ``IFLA_MASTER`` attribute change of its present conduit (``eth0``) and migrates all user ports to the new upper of ``eth0``, ``bond0``. Similarly, when ``bond0`` is destroyed using ``RTM_DELLINK``, DSA migrates the user ports
include/uapi/linux/if_link.h +3 -1
@@ -1394,7 +1394,9 @@ enum {enum {IFLA_DSA_UNSPEC , -IFLA_DSA_MASTER , +IFLA_DSA_CONDUIT , +/* Deprecated, use IFLA_DSA_CONDUIT instead */ +IFLA_DSA_MASTER =IFLA_DSA_CONDUIT , __IFLA_DSA_MAX, };
net/dsa/netlink.c +5 -5
@@ -8,7 +8,7 @@#include "user.h" static const struct nla_policy dsa_policy[IFLA_DSA_MAX +1 ] = { - [IFLA_DSA_MASTER ] = { .type =NLA_U32 }, + [IFLA_DSA_CONDUIT ] = { .type =NLA_U32 }, }; static int dsa_changelink(struct net_device *dev, struct nlattr *tb[],
@@ -20,8 +20,8 @@ static int dsa_changelink(struct net_device *dev, struct nlattr *tb[],if (!data)return 0 ; -if (data[IFLA_DSA_MASTER ]) { -u32 ifindex =nla_get_u32 (data[IFLA_DSA_MASTER ]); +if (data[IFLA_DSA_CONDUIT ]) { +u32 ifindex =nla_get_u32 (data[IFLA_DSA_CONDUIT ]);struct net_device *conduit; conduit =__dev_get_by_index (dev_net (dev), ifindex);
@@ -38,7 +38,7 @@ static int dsa_changelink(struct net_device *dev, struct nlattr *tb[],static size_t dsa_get_size (const struct net_device *dev) { -return nla_total_size (sizeof (u32)) +/* IFLA_DSA_MASTER */ +return nla_total_size (sizeof (u32)) +/* IFLA_DSA_CONDUIT */ 0 ; }
@@ -46,7 +46,7 @@ static int dsa_fill_info(struct sk_buff *skb, const struct net_device *dev) {struct net_device *conduit =dsa_user_to_conduit (dev); -if (nla_put_u32 (skb,IFLA_DSA_MASTER , conduit->ifindex)) +if (nla_put_u32 (skb,IFLA_DSA_CONDUIT , conduit->ifindex))return -EMSGSIZE ;return 0 ;
Signature · 1 line
2.34.1
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Mon, 23 Oct 2023 11:17:27 -0700 you wrote:
One of the action items following Netconf'23 is to switch subsystems to use inclusive terminology. DSA has been making extensive use of the "master" and "slave" words which are now replaced by "conduit" and "user" respectively.
Changes in v7:
[...]
Here is the summary with links:
- [net-next,v7,1/2] net: dsa: Use conduit and user terms
https://git.kernel.org/netdev/net-next/c/6ca80638b90c - [net-next,v7,2/2] net: dsa: Rename IFLA_DSA_MASTER to IFLA_DSA_CONDUIT https://git.kernel.org/netdev/net-next/c/87cd83714f30
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html