Skip to content
Snippets Groups Projects
  1. Jun 21, 2021
    • Vladimir Oltean's avatar
      net: dsa: targeted MTU notifiers should only match on one port · 88faba20
      Vladimir Oltean authored
      
      dsa_slave_change_mtu() calls dsa_port_mtu_change() twice:
      - it sends a cross-chip notifier with the MTU of the CPU port which is
        used to update the DSA links.
      - it sends one targeted MTU notifier which is supposed to only match the
        user port on which we are changing the MTU. The "propagate_upstream"
        variable is used here to bypass the cross-chip notifier system from
        switch.c
      
      But due to a mistake, the second, targeted notifier matches not only on
      the user port, but also on the DSA link which is a member of the same
      switch, if that exists.
      
      And because the DSA links of the entire dst were programmed in a
      previous round to the largest_mtu via a "propagate_upstream == true"
      notification, then the dsa_port_mtu_change(propagate_upstream == false)
      call that is immediately upcoming will break the MTU on the one DSA link
      which is chip-wise local to the dp whose MTU is changing right now.
      
      Example given this daisy chain topology:
      
         sw0p0     sw0p1     sw0p2     sw0p3     sw0p4
      [  cpu  ] [  user ] [  user ] [  dsa  ] [  user ]
      [   x   ] [       ] [       ] [   x   ] [       ]
                                        |
                                        +---------+
                                                  |
         sw1p0     sw1p1     sw1p2     sw1p3     sw1p4
      [  user ] [  user ] [  user ] [  dsa  ] [  dsa  ]
      [       ] [       ] [       ] [       ] [   x   ]
      
      ip link set sw0p1 mtu 9000
      ip link set sw1p1 mtu 9000 # at this stage, sw0p1 and sw1p1 can talk
                                 # to one another using jumbo frames
      ip link set sw0p2 mtu 1500 # this programs the sw0p3 DSA link first to
                                 # the largest_mtu of 9000, then reprograms it to
                                 # 1500 with the "propagate_upstream == false"
                                 # notifier, breaking communication between
                                 # sw0p1 and sw1p1
      
      To escape from this situation, make the targeted match really match on a
      single port - the user port, and rename the "propagate_upstream"
      variable to "targeted_match" to clarify the intention and avoid future
      issues.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88faba20
    • Vladimir Oltean's avatar
      net: dsa: calculate the largest_mtu across all ports in the tree · 4e4ab795
      Vladimir Oltean authored
      
      If we have a cross-chip topology like this:
      
         sw0p0     sw0p1     sw0p2     sw0p3     sw0p4
      [  cpu  ] [  user ] [  user ] [  dsa  ] [  user ]
                                        |
                                        +---------+
                                                  |
         sw1p0     sw1p1     sw1p2     sw1p3     sw1p4
      [  user ] [  user ] [  user ] [  dsa  ] [  dsa  ]
      
      and we issue the following commands:
      
      1. ip link set sw0p1 mtu 1700
      2. ip link set sw1p1 mtu 1600
      
      we notice the following happening:
      
      Command 1. emits a non-targeted MTU notifier for the CPU port (sw0p0)
      with the largest_mtu calculated across switch 0, of 1700. This matches
      sw0p0, sw0p3 and sw1p4 (all CPU ports and DSA links).
      Then, it emits a targeted MTU notifier for the user port (sw0p1), again
      with MTU 1700 (this doesn't matter).
      
      Command 2. emits a non-targeted MTU notifier for the CPU port (sw0p0)
      with the largest_mtu calculated across switch 1, of 1600. This matches
      the same group of ports as above, and decreases the MTU for the CPU port
      and the DSA links from 1700 to 1600.
      
      As a result, the sw0p1 user port can no longer communicate with its CPU
      port at MTU 1700.
      
      To address this, we should calculate the largest_mtu across all switches
      that may share a CPU port, and only emit MTU notifiers with that value.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e4ab795
    • Vladimir Oltean's avatar
      net: dsa: execute dsa_switch_mdb_add only for routing port in cross-chip topologies · abd49535
      Vladimir Oltean authored
      
      Currently, the notifier for adding a multicast MAC address matches on
      the targeted port and on all DSA links in the system, be they upstream
      or downstream links.
      
      This leads to a considerable amount of useless traffic.
      
      Consider this daisy chain topology, and a MDB add notifier emitted on
      sw0p0. It matches on sw0p0, sw0p3, sw1p3 and sw2p4.
      
         sw0p0     sw0p1     sw0p2     sw0p3     sw0p4
      [  user ] [  user ] [  user ] [  dsa  ] [  cpu  ]
      [   x   ] [       ] [       ] [   x   ] [       ]
                                        |
                                        +---------+
                                                  |
         sw1p0     sw1p1     sw1p2     sw1p3     sw1p4
      [  user ] [  user ] [  user ] [  dsa  ] [  dsa  ]
      [       ] [       ] [       ] [   x   ] [   x   ]
                                        |
                                        +---------+
                                                  |
         sw2p0     sw2p1     sw2p2     sw2p3     sw2p4
      [  user ] [  user ] [  user ] [  user ] [  dsa  ]
      [       ] [       ] [       ] [       ] [   x   ]
      
      But switch 0 has no reason to send the multicast traffic for that MAC
      address on sw0p3, which is how it reaches switches 1 and 2. Those
      switches don't expect, according to the user configuration, to receive
      this multicast address from switch 1, and they will drop it anyway,
      because the only valid destination is the port they received it on.
      They only need to configure themselves to deliver that multicast address
      _towards_ switch 1, where the MDB entry is installed.
      
      Similarly, switch 1 should not send this multicast traffic towards
      sw1p3, because that is how it reaches switch 2.
      
      With this change, the heat map for this MDB notifier changes as follows:
      
         sw0p0     sw0p1     sw0p2     sw0p3     sw0p4
      [  user ] [  user ] [  user ] [  dsa  ] [  cpu  ]
      [   x   ] [       ] [       ] [       ] [       ]
                                        |
                                        +---------+
                                                  |
         sw1p0     sw1p1     sw1p2     sw1p3     sw1p4
      [  user ] [  user ] [  user ] [  dsa  ] [  dsa  ]
      [       ] [       ] [       ] [       ] [   x   ]
                                        |
                                        +---------+
                                                  |
         sw2p0     sw2p1     sw2p2     sw2p3     sw2p4
      [  user ] [  user ] [  user ] [  user ] [  dsa  ]
      [       ] [       ] [       ] [       ] [   x   ]
      
      Now the mdb notifier behaves the same as the fdb notifier.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      abd49535
    • Vladimir Oltean's avatar
      net: dsa: export the dsa_port_is_{user,cpu,dsa} helpers · a8986681
      Vladimir Oltean authored
      
      The difference between dsa_is_user_port and dsa_port_is_user is that the
      former needs to look up the list of ports of the DSA switch tree in
      order to find the struct dsa_port, while the latter directly receives it
      as an argument.
      
      dsa_is_user_port is already in widespread use and has its place, so
      there isn't any chance of converting all callers to a single form.
      But being able to do:
      	dsa_port_is_user(dp)
      instead of
      	dsa_is_user_port(dp->ds, dp->index)
      
      is much more efficient too, especially when the "dp" comes from an
      iterator over the DSA switch tree - this reduces the complexity from
      quadratic to linear.
      
      Move these helpers from dsa2.c to include/net/dsa.h so that others can
      use them too.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a8986681
    • Vladimir Oltean's avatar
      net: dsa: assert uniqueness of dsa,member properties · 8674f8d3
      Vladimir Oltean authored
      
      The cross-chip notifiers work by comparing each ds->index against the
      info->sw_index value from the notifier. The ds->index is retrieved from
      the device tree dsa,member property.
      
      If a single tree cross-chip topology does not declare unique switch IDs,
      this will result in hard-to-debug issues/voodoo effects such as the
      cross-chip notifier for one switch port also matching the port with the
      same number from another switch.
      
      Check in dsa_switch_parse_member_of() whether the DSA switch tree
      contains a DSA switch with the index we're preparing to add, before
      actually adding it.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8674f8d3
  2. Jun 14, 2021
  3. Jun 11, 2021
    • Vladimir Oltean's avatar
      net: dsa: sja1105: implement TX timestamping for SJA1110 · 566b18c8
      Vladimir Oltean authored
      
      The TX timestamping procedure for SJA1105 is a bit unconventional
      because the transmit procedure itself is unconventional.
      
      Control packets (and therefore PTP as well) are transmitted to a
      specific port in SJA1105 using "management routes" which must be written
      over SPI to the switch. These are one-shot rules that match by
      destination MAC address on traffic coming from the CPU port, and select
      the precise destination port for that packet. So to transmit a packet
      from NET_TX softirq context, we actually need to defer to a process
      context so that we can perform that SPI write before we send the packet.
      The DSA master dev_queue_xmit() runs in process context, and we poll
      until the switch confirms it took the TX timestamp, then we annotate the
      skb clone with that TX timestamp. This is why the sja1105 driver does
      not need an skb queue for TX timestamping.
      
      But the SJA1110 is a bit (not much!) more conventional, and you can
      request 2-step TX timestamping through the DSA header, as well as give
      the switch a cookie (timestamp ID) which it will give back to you when
      it has the timestamp. So now we do need a queue for keeping the skb
      clones until their TX timestamps become available.
      
      The interesting part is that the metadata frames from SJA1105 haven't
      disappeared completely. On SJA1105 they were used as follow-ups which
      contained RX timestamps, but on SJA1110 they are actually TX completion
      packets, which contain a variable (up to 32) array of timestamps.
      Why an array? Because:
      - not only is the TX timestamp on the egress port being communicated,
        but also the RX timestamp on the CPU port. Nice, but we don't care
        about that, so we ignore it.
      - because a packet could be multicast to multiple egress ports, each
        port takes its own timestamp, and the TX completion packet contains
        the individual timestamps on each port.
      
      This is unconventional because switches typically have a timestamping
      FIFO and raise an interrupt, but this one doesn't. So the tagger needs
      to detect and parse meta frames, and call into the main switch driver,
      which pairs the timestamps with the skbs in the TX timestamping queue
      which are waiting for one.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      566b18c8
    • Vladimir Oltean's avatar
      net: dsa: add support for the SJA1110 native tagging protocol · 4913b8eb
      Vladimir Oltean authored
      
      The SJA1110 has improved a few things compared to SJA1105:
      
      - To send a control packet from the host port with SJA1105, one needed
        to program a one-shot "management route" over SPI. This is no longer
        true with SJA1110, you can actually send "in-band control extensions"
        in the packets sent by DSA, these are in fact DSA tags which contain
        the destination port and switch ID.
      
      - When receiving a control packet from the switch with SJA1105, the
        source port and switch ID were written in bytes 3 and 4 of the
        destination MAC address of the frame (which was a very poor shot at a
        DSA header). If the control packet also had an RX timestamp, that
        timestamp was sent in an actual follow-up packet, so there were
        reordering concerns on multi-core/multi-queue DSA masters, where the
        metadata frame with the RX timestamp might get processed before the
        actual packet to which that timestamp belonged (there is no way to
        pair a packet to its timestamp other than the order in which they were
        received). On SJA1110, this is no longer true, control packets have
        the source port, switch ID and timestamp all in the DSA tags.
      
      - Timestamps from the switch were partial: to get a 64-bit timestamp as
        required by PTP stacks, one would need to take the partial 24-bit or
        32-bit timestamp from the packet, then read the current PTP time very
        quickly, and then patch in the high bits of the current PTP time into
        the captured partial timestamp, to reconstruct what the full 64-bit
        timestamp must have been. That is awful because packet processing is
        done in NAPI context, but reading the current PTP time is done over
        SPI and therefore needs sleepable context.
      
      But it also aggravated a few things:
      
      - Not only is there a DSA header in SJA1110, but there is a DSA trailer
        in fact, too. So DSA needs to be extended to support taggers which
        have both a header and a trailer. Very unconventional - my understanding
        is that the trailer exists because the timestamps couldn't be prepared
        in time for putting them in the header area.
      
      - Like SJA1105, not all packets sent to the CPU have the DSA tag added
        to them, only control packets do:
      
        * the ones which match the destination MAC filters/traps in
          MAC_FLTRES1 and MAC_FLTRES0
        * the ones which match FDB entries which have TRAP or TAKETS bits set
      
        So we could in theory hack something up to request the switch to take
        timestamps for all packets that reach the CPU, and those would be
        DSA-tagged and contain the source port / switch ID by virtue of the
        fact that there needs to be a timestamp trailer provided. BUT:
      
      - The SJA1110 does not parse its own DSA tags in a way that is useful
        for routing in cross-chip topologies, a la Marvell. And the sja1105
        driver already supports cross-chip bridging from the SJA1105 days.
        It does that by automatically setting up the DSA links as VLAN trunks
        which contain all the necessary tag_8021q RX VLANs that must be
        communicated between the switches that span the same bridge. So when
        using tag_8021q on sja1105, it is possible to have 2 switches with
        ports sw0p0, sw0p1, sw1p0, sw1p1, and 2 VLAN-unaware bridges br0 and
        br1, and br0 can take sw0p0 and sw1p0, and br1 can take sw0p1 and
        sw1p1, and forwarding will happen according to the expected rules of
        the Linux bridge.
        We like that, and we don't want that to go away, so as a matter of
        fact, the SJA1110 tagger still needs to support tag_8021q.
      
      So the sja1110 tagger is a hybrid between tag_8021q for data packets,
      and the native hardware support for control packets.
      
      On RX, packets have a 13-byte trailer if they contain an RX timestamp.
      That trailer is padded in such a way that its byte 8 (the start of the
      "residence time" field - not parsed by Linux because we don't care) is
      aligned on a 16 byte boundary. So the padding has a variable length
      between 0 and 15 bytes. The DSA header contains the offset of the
      beginning of the padding relative to the beginning of the frame (and the
      end of the padding is obviously the end of the packet minus 13 bytes,
      the length of the trailer). So we discard it.
      
      Packets which don't have a trailer contain the source port and switch ID
      information in the header (they are "trap-to-host" packets). Packets
      which have a trailer contain the source port and switch ID in the trailer.
      
      On TX, the destination port mask and switch ID is always in the trailer,
      so we always need to say in the header that a trailer is present.
      
      The header needs a custom EtherType and this was chosen as 0xdadc, after
      0xdada which is for Marvell and 0xdadb which is for VLANs in
      VLAN-unaware mode on SJA1105 (and SJA1110 in fact too).
      
      Because we use tag_8021q in concert with the native tagging protocol,
      control packets will have 2 DSA tags.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4913b8eb
    • Vladimir Oltean's avatar
      net: dsa: sja1105: make SJA1105_SKB_CB fit a full timestamp · 617ef8d9
      Vladimir Oltean authored
      
      In SJA1105, RX timestamps for packets sent to the CPU are transmitted in
      separate follow-up packets (metadata frames). These contain partial
      timestamps (24 or 32 bits) which are kept in SJA1105_SKB_CB(skb)->meta_tstamp.
      
      Thankfully, SJA1110 improved that, and the RX timestamps are now
      transmitted in-band with the actual packet, in the timestamp trailer.
      The RX timestamps are now full-width 64 bits.
      
      Because we process the RX DSA tags in the rcv() method in the tagger,
      but we would like to preserve the DSA code structure in that we populate
      the skb timestamp in the port_rxtstamp() call which only happens later,
      the implication is that we must somehow pass the 64-bit timestamp from
      the rcv() method all the way to port_rxtstamp(). We can use the skb->cb
      for that.
      
      Rename the meta_tstamp from struct sja1105_skb_cb from "meta_tstamp" to
      "tstamp", and increase its size to 64 bits.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      617ef8d9
    • Vladimir Oltean's avatar
      net: dsa: tag_8021q: refactor RX VLAN parsing into a dedicated function · 233697b3
      Vladimir Oltean authored
      
      The added value of this function is that it can deal with both the case
      where the VLAN header is in the skb head, as well as in the offload field.
      This is something I was not able to do using other functions in the
      network stack.
      
      Since both ocelot-8021q and sja1105 need to do the same stuff, let's
      make it a common service provided by tag_8021q.
      
      This is done as refactoring for the new SJA1110 tagger, which partly
      uses tag_8021q as well (just like SJA1105), and will be the third caller.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      233697b3
    • Vladimir Oltean's avatar
      net: dsa: tag_sja1105: stop resetting network and transport headers · baa3ad08
      Vladimir Oltean authored
      
      This makes no sense and is not needed, it is probably a debugging
      leftover.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      baa3ad08
    • Vladimir Oltean's avatar
      net: dsa: generalize overhead for taggers that use both headers and trailers · 4e500251
      Vladimir Oltean authored
      
      Some really really weird switches just couldn't decide whether to use a
      normal or a tail tagger, so they just did both.
      
      This creates problems for DSA, because we only have the concept of an
      'overhead' which can be applied to the headroom or to the tailroom of
      the skb (like for example during the central TX reallocation procedure),
      depending on the value of bool tail_tag, but not to both.
      
      We need to generalize DSA to cater for these odd switches by
      transforming the 'overhead / tail_tag' pair into 'needed_headroom /
      needed_tailroom'.
      
      The DSA master's MTU is increased to account for both.
      
      The flow dissector code is modified such that it only calls the DSA
      adjustment callback if the tagger has a non-zero header length.
      
      Taggers are trivially modified to declare either needed_headroom or
      needed_tailroom, based on the tail_tag value that they currently
      declare.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e500251
  4. Jun 01, 2021
    • Vladimir Oltean's avatar
      net: dsa: tag_8021q: fix the VLAN IDs used for encoding sub-VLANs · 4ef8d857
      Vladimir Oltean authored
      
      When using sub-VLANs in the range of 1-7, the resulting value from:
      
      	rx_vid = dsa_8021q_rx_vid_subvlan(ds, port, subvlan);
      
      is wrong according to the description from tag_8021q.c:
      
       | 11  | 10  |  9  |  8  |  7  |  6  |  5  |  4  |  3  |  2  |  1  |  0  |
       +-----------+-----+-----------------+-----------+-----------------------+
       |    DIR    | SVL |    SWITCH_ID    |  SUBVLAN  |          PORT         |
       +-----------+-----+-----------------+-----------+-----------------------+
      
      For example, when ds->index == 0, port == 3 and subvlan == 1,
      dsa_8021q_rx_vid_subvlan() returns 1027, same as it returns for
      subvlan == 0, but it should have returned 1043.
      
      This is because the low portion of the subvlan bits are not masked
      properly when writing into the 12-bit VLAN value. They are masked into
      bits 4:3, but they should be masked into bits 5:4.
      
      Fixes: 3eaae1d0 ("net: dsa: tag_8021q: support up to 8 VLANs per port using sub-VLANs")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ef8d857
  5. May 10, 2021
  6. Apr 28, 2021
  7. Apr 27, 2021
  8. Apr 21, 2021
  9. Apr 20, 2021
  10. Apr 16, 2021
  11. Apr 13, 2021
    • Michael Walle's avatar
      of: net: pass the dst buffer to of_get_mac_address() · 83216e39
      Michael Walle authored
      
      of_get_mac_address() returns a "const void*" pointer to a MAC address.
      Lately, support to fetch the MAC address by an NVMEM provider was added.
      But this will only work with platform devices. It will not work with
      PCI devices (e.g. of an integrated root complex) and esp. not with DSA
      ports.
      
      There is an of_* variant of the nvmem binding which works without
      devices. The returned data of a nvmem_cell_read() has to be freed after
      use. On the other hand the return of_get_mac_address() points to some
      static data without a lifetime. The trick for now, was to allocate a
      device resource managed buffer which is then returned. This will only
      work if we have an actual device.
      
      Change it, so that the caller of of_get_mac_address() has to supply a
      buffer where the MAC address is written to. Unfortunately, this will
      touch all drivers which use the of_get_mac_address().
      
      Usually the code looks like:
      
        const char *addr;
        addr = of_get_mac_address(np);
        if (!IS_ERR(addr))
          ether_addr_copy(ndev->dev_addr, addr);
      
      This can then be simply rewritten as:
      
        of_get_mac_address(np, ndev->dev_addr);
      
      Sometimes is_valid_ether_addr() is used to test the MAC address.
      of_get_mac_address() already makes sure, it just returns a valid MAC
      address. Thus we can just test its return code. But we have to be
      careful if there are still other sources for the MAC address before the
      of_get_mac_address(). In this case we have to keep the
      is_valid_ether_addr() call.
      
      The following coccinelle patch was used to convert common cases to the
      new style. Afterwards, I've manually gone over the drivers and fixed the
      return code variable: either used a new one or if one was already
      available use that. Mansour Moufid, thanks for that coccinelle patch!
      
      <spml>
      @a@
      identifier x;
      expression y, z;
      @@
      - x = of_get_mac_address(y);
      + x = of_get_mac_address(y, z);
        <...
      - ether_addr_copy(z, x);
        ...>
      
      @@
      identifier a.x;
      @@
      - if (<+... x ...+>) {}
      
      @@
      identifier a.x;
      @@
        if (<+... x ...+>) {
            ...
        }
      - else {}
      
      @@
      identifier a.x;
      expression e;
      @@
      - if (<+... x ...+>@e)
      -     {}
      - else
      + if (!(e))
            {...}
      
      @@
      expression x, y, z;
      @@
      - x = of_get_mac_address(y, z);
      + of_get_mac_address(y, z);
        ... when != x
      </spml>
      
      All drivers, except drivers/net/ethernet/aeroflex/greth.c, were
      compile-time tested.
      
      Suggested-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMichael Walle <michael@walle.cc>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83216e39
  12. Mar 29, 2021
  13. Mar 26, 2021
  14. Mar 25, 2021
  15. Mar 24, 2021
  16. Mar 23, 2021
  17. Mar 22, 2021
    • Alexander Lobakin's avatar
      dsa: simplify Kconfig symbols and dependencies · 227d7206
      Alexander Lobakin authored
      
      1. Remove CONFIG_HAVE_NET_DSA.
      
      CONFIG_HAVE_NET_DSA is a legacy leftover from the times when drivers
      should have selected CONFIG_NET_DSA manually.
      Currently, all drivers has explicit 'depends on NET_DSA', so this is
      no more needed.
      
      2. CONFIG_HAVE_NET_DSA dependencies became CONFIG_NET_DSA's ones.
      
       - dropped !S390 dependency which was introduced to be sure NET_DSA
         can select CONFIG_PHYLIB. DSA migrated to Phylink almost 3 years
         ago and the PHY library itself doesn't depend on !S390 since
         commit 870a2b5e ("phylib: remove !S390 dependeny from Kconfig");
       - INET dependency is kept to be sure we can select NET_SWITCHDEV;
       - NETDEVICES dependency is kept to be sure we can select PHYLINK.
      
      3. DSA drivers menu now depends on NET_DSA.
      
      Instead on 'depends on NET_DSA' on every single driver, the entire
      menu now depends on it. This eliminates a lot of duplicated lines
      from Kconfig with no loss (when CONFIG_NET_DSA=m, drivers also can
      be only m or n).
      This also has a nice side effect that there's no more empty menu on
      configurations without DSA.
      
      4. Kbuild will now descend into 'drivers/net/dsa' only when
         CONFIG_NET_DSA is y or m.
      
      This is safe since no objects inside this folder can be built without
      DSA core, as well as when CONFIG_NET_DSA=m, no objects can be
      built-in.
      
      Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      227d7206
  18. Mar 18, 2021
  19. Mar 17, 2021
Loading