1. 04 Oct, 2021 14 commits
  2. 03 Oct, 2021 6 commits
  3. 02 Oct, 2021 20 commits
    • M Chetan Kumar's avatar
      net: wwan: iosm: correct devlink extra params · b8aa1654
      M Chetan Kumar authored
      1. Removed driver specific extra params like download_region,
         address & region_count. The required information is passed
         as part of flash API.
      2. IOSM Devlink documentation updated to reflect the same.
      Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b8aa1654
    • David S. Miller's avatar
      Merge branch 'hw_addr_set' · e9637775
      David S. Miller authored
      Jakub Kicinski says:
      
      ====================
      Use netdev->dev_addr write helpers (part 1)
      
      Commit 406f42fa ("net-next: When a bond have a massive amount
      of VLANs...") introduced a rbtree for faster Ethernet address look
      up. To maintain netdev->dev_addr in this tree we need to make all
      the writes to it got through appropriate helpers.
      
      This is the first installment of predictably tedious conversion.
      It tackles:
      
        memcpy(netdev->dev_addr, something, ETH_ADDR)
      
      and
      
        ether_addr_copy(netdev->dev_addr, something)
      
      replacing both with eth_hw_addr_set().
      
      The first 7 patches are done entirely by sparse.
      Next 4 were semi-manual because the sparse conversion
      resulted in errors.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9637775
    • Jakub Kicinski's avatar
      ethernet: use eth_hw_addr_set() - casts · 16be9a16
      Jakub Kicinski authored
      eth_hw_addr_set() takes a u8 pointer, like other
      etherdevice helpers. Convert the few drivers which
      require casts because they memcpy from "endian marked"
      types.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16be9a16
    • Jakub Kicinski's avatar
      fddi: use eth_hw_addr_set() · 4d3d2c8d
      Jakub Kicinski authored
      Convert from memcpy(), include is needed.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d3d2c8d
    • Jakub Kicinski's avatar
      ethernet: s2io: use eth_hw_addr_set() · 1235568b
      Jakub Kicinski authored
      Manual conversions because we need to get to the member
      which is inside an array to have a u8 pointer which
      eth_hw_addr_set() expects.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1235568b
    • Jakub Kicinski's avatar
      ethernet: chelsio: use eth_hw_addr_set() · 47d71f45
      Jakub Kicinski authored
      Convert chelsio drivers from memcpy() and ether_addr_copy()
      to eth_hw_addr_set(). They lack includes.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      47d71f45
    • Jakub Kicinski's avatar
      net: usb: use eth_hw_addr_set() instead of ether_addr_copy() · af804e6d
      Jakub Kicinski authored
      Commit 406f42fa ("net-next: When a bond have a massive amount
      of VLANs...") introduced a rbtree for faster Ethernet address look
      up. To maintain netdev->dev_addr in this tree we need to make all
      the writes to it got through appropriate helpers.
      
      Convert net/usb from ether_addr_copy() to eth_hw_addr_set():
      
        @@
        expression dev, np;
        @@
        - ether_addr_copy(dev->dev_addr, np)
        + eth_hw_addr_set(dev, np)
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      af804e6d
    • Jakub Kicinski's avatar
      ethernet: use eth_hw_addr_set() instead of ether_addr_copy() · f3956ebb
      Jakub Kicinski authored
      Convert Ethernet from ether_addr_copy() to eth_hw_addr_set():
      
        @@
        expression dev, np;
        @@
        - ether_addr_copy(dev->dev_addr, np)
        + eth_hw_addr_set(dev, np)
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f3956ebb
    • Jakub Kicinski's avatar
      net: use eth_hw_addr_set() instead of ether_addr_copy() · e35b8d7d
      Jakub Kicinski authored
      Convert from ether_addr_copy() to eth_hw_addr_set():
      
        @@
        expression dev, np;
        @@
        - ether_addr_copy(dev->dev_addr, np)
        + eth_hw_addr_set(dev, np)
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e35b8d7d
    • Jakub Kicinski's avatar
      net: usb: use eth_hw_addr_set() · 16813717
      Jakub Kicinski authored
      Commit 406f42fa ("net-next: When a bond have a massive amount
      of VLANs...") introduced a rbtree for faster Ethernet address look
      up. To maintain netdev->dev_addr in this tree we need to make all
      the writes to it got through appropriate helpers.
      
      Convert usb drivers from memcpy(... ETH_ADDR) to eth_hw_addr_set():
      
        @@
        expression dev, np;
        @@
        - memcpy(dev->dev_addr, np, ETH_ALEN)
        + eth_hw_addr_set(dev, np)
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16813717
    • Jakub Kicinski's avatar
      ethernet: use eth_hw_addr_set() · a96d317f
      Jakub Kicinski authored
      Convert all Ethernet drivers from memcpy(... ETH_ADDR)
      to eth_hw_addr_set():
      
        @@
        expression dev, np;
        @@
        - memcpy(dev->dev_addr, np, ETH_ALEN)
        + eth_hw_addr_set(dev, np)
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a96d317f
    • Jakub Kicinski's avatar
      net: use eth_hw_addr_set() · 2f23e5ce
      Jakub Kicinski authored
      Convert sw drivers from memcpy(... ETH_ADDR) to eth_hw_addr_set():
      
        @@
        expression dev, np;
        @@
        - memcpy(dev->dev_addr, np, ETH_ALEN)
        + eth_hw_addr_set(dev, np)
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2f23e5ce
    • Jakub Kicinski's avatar
      arch: use eth_hw_addr_set() · 4e9b9de6
      Jakub Kicinski authored
      Commit 406f42fa ("net-next: When a bond have a massive amount
      of VLANs...") introduced a rbtree for faster Ethernet address look
      up. To maintain netdev->dev_addr in this tree we need to make all
      the writes to it got through appropriate helpers.
      
      Convert misc arch drivers from memcpy(... ETH_ADDR) to eth_hw_addr_set():
      
        @@
        expression dev, np;
        @@
        - memcpy(dev->dev_addr, np, ETH_ALEN)
        + eth_hw_addr_set(dev, np)
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e9b9de6
    • David S. Miller's avatar
      Merge branch 'ocelot-vlan' · fa8274b7
      David S. Miller authored
      Vladimir Oltean says:
      
      ====================
      Egress VLAN modification using VCAP ES0 on Ocelot switches
      
      This patch set adds support for modifying a VLAN ID at the egress stage
      of Ocelot/Felix switch ports. It is useful for replicating a packet on
      multiple ports, and each egress port sends it using a different VLAN ID.
      
      Tested by rewriting the VLAN ID of both
      (a) packets injected from the CPU port
      (b) packets received from an external station on a front-facing port
      
      Adding a selftest to make sure it doesn't bit-rot, and if it does, that
      it can be traced back easily.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa8274b7
    • Vladimir Oltean's avatar
      selftests: net: mscc: ocelot: add a test for egress VLAN modification · 434ef350
      Vladimir Oltean authored
      For this test we are exercising the VCAP ES0 block's ability to match on
      a packet with a given VLAN ID, and push an ES0 TAG A with a VID derived
      from VID_A_VAL plus the classified VLAN.
      
      $eth3.200 is the generator port
      $eth0 is the bridged DUT port that receives
      $eth1 is the bridged DUT port that forwards and rewrites VID 200 to 300
            on egress via VCAP ES0
      $eth2 is the port that receives from the DUT port $eth1
      
      Since the egress rewriting happens outside the bridging service, VID 300
      does not need to be in the bridge VLAN table of $eth1.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      434ef350
    • Vladimir Oltean's avatar
      selftests: net: mscc: ocelot: rename the VLAN modification test to ingress · 4a907f65
      Vladimir Oltean authored
      There will be one more VLAN modification selftest added, this time for
      egress. Rename the one that exists right now to be more specific.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4a907f65
    • Vladimir Oltean's avatar
      selftests: net: mscc: ocelot: bring up the ports automatically · 239f163c
      Vladimir Oltean authored
      Looks like when I wrote the selftests I was using a network manager that
      brought up the ports automatically. In order to not rely on that, let
      the script open them up.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      239f163c
    • Vladimir Oltean's avatar
      net: dsa: tag_ocelot: set the classified VLAN during xmit · 5ca721c5
      Vladimir Oltean authored
      Currently, all packets injected into Ocelot switches are classified to
      VLAN 0, regardless of whether they are VLAN-tagged or not. This is
      because the switch only looks at the VLAN TCI from the DSA tag.
      
      VLAN 0 is then stripped on egress due to REW_TAG_CFG_TAG_CFG. There are
      2 cases really, below is the explanation for ocelot_port_set_native_vlan:
      
      - Port is VLAN-aware, we set REW_TAG_CFG_TAG_CFG to 1 (egress-tag all
        frames except VID 0 and the native VLAN) if a native VLAN exists, or
        to 3 otherwise (tag all frames, including VID 0).
      
      - Port is VLAN-unaware, we set REW_TAG_CFG_TAG_CFG to 0 (port tagging
        disabled, classified VLAN never appears in the packet).
      
      One can already see an inconsistency: when a native VLAN exists, VID 0
      is egress-untagged, but when it doesn't, VID 0 is egress-tagged.
      
      So when we do this:
      ip link add br0 type bridge vlan_filtering 1
      ip link set swp0 master br0
      bridge vlan del dev swp0 vid 1
      bridge vlan add dev swp0 vid 1 pvid # but not untagged
      
      and we ping through swp0, packets will look like this:
      
      MAC > 33:33:00:00:00:02, ethertype 802.1Q (0x8100): vlan 0, p 0,
      	ethertype 802.1Q (0x8100), vlan 1, p 0, ethertype IPv6 (0x86dd),
      	ICMP6, router solicitation, length 16
      
      So VID 1 frames (sent that way by the Linux bridge) are encapsulated in
      a VID 0 header - the classified VLAN of the packets as far as the hw is
      concerned. To avoid that, what we really need to do is stop injecting
      packets using the classified VLAN of 0.
      
      This patch strips the VLAN header from the skb payload, if that VLAN
      exists and if the port is under a VLAN-aware bridge. Then it copies that
      VLAN header into the DSA injection frame header.
      
      A positive side effect is that VCAP ES0 VLAN rewriting rules now work
      for packets injected from the CPU into a port that's under a VLAN-aware
      bridge, and we are able to match those packets by the VLAN ID that was
      sent by the network stack, and not by VLAN ID 0.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5ca721c5
    • Vladimir Oltean's avatar
      net: mscc: ocelot: write full VLAN TCI in the injection header · e8c07229
      Vladimir Oltean authored
      The VLAN TCI contains more than the VLAN ID, it also has the VLAN PCP
      and Drop Eligibility Indicator.
      
      If the ocelot driver is going to write the VLAN header inside the DSA
      tag, it could just as well write the entire TCI.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8c07229
    • Vladimir Oltean's avatar
      net: mscc: ocelot: support egress VLAN rewriting via VCAP ES0 · de5bbb6f
      Vladimir Oltean authored
      Currently the ocelot driver does support the 'vlan modify' action, but
      in the ingress chain, and it is offloaded to VCAP IS1. This action
      changes the classified VLAN before the packet enters the bridging
      service, and the bridging works with the classified VLAN modified by
      VCAP IS1.
      
      That is good for some use cases, but there are others where the VLAN
      must be modified at the stage of the egress port, after the packet has
      exited the bridging service. One example is simulating IEEE 802.1CB
      active stream identification filters ("active" means that not only the
      rule matches on a packet flow, but it is also able to change some
      headers). For example, a stream is replicated on two egress ports, but
      they must have different VLAN IDs on egress ports A and B.
      
      This seems like a task for the VCAP ES0, but that currently only
      supports pushing the ES0 tag A, which is specified in the rule. Pushing
      another VLAN header is not what we want, but rather overwriting the
      existing one.
      
      It looks like when we push the ES0 tag A, it is actually possible to not
      only take the ES0 tag A's value from the rule itself (VID_A_VAL), but
      derive it from the following formula:
      
      ES0_TAG_A = Classified VID + VID_A_VAL
      
      Otherwise said, ES0_TAG_A can be used to increment with a given value
      the VLAN ID that the packet was already classified to, and the packet
      will have this value as an outer VLAN tag. This new VLAN ID value then
      gets stripped on egress (or not) according to the value of the native
      VLAN from the bridging service.
      
      While the hardware will happily increment the classified VLAN ID for all
      packets that match the ES0 rule, in practice this would be rather
      insane, so we only allow this kind of ES0 action if the ES0 filter
      contains a VLAN ID too, so as to restrict the matching on a known
      classified VLAN. If we program VID_A_VAL with the delta between the
      desired final VLAN (ES0_TAG_A) and the classified VLAN, we obtain the
      desired behavior.
      
      It doesn't look like it is possible with the tc-vlan action to modify
      the VLAN ID but not the PCP. In hardware it is possible to leave the PCP
      to the classified value, but we unconditionally program it to overwrite
      it with the PCP value from the rule.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de5bbb6f