1. 27 Feb, 2022 12 commits
    • Vladimir Oltean's avatar
      docs: net: dsa: sja1105: document limitations of tc-flower rule VLAN awareness · d27656d0
      Vladimir Oltean authored
      After change "net: dsa: tag_8021q: replace the SVL bridging with
      VLAN-unaware IVL bridging", tag_8021q enforces two different pvids on a
      port, depending on whether it is standalone or in a VLAN-unaware bridge.
      
      Up until now, there was a single pvid, represented by
      dsa_tag_8021q_rx_vid(), and that was used as the VLAN for VLAN-unaware
      virtual link rules, regardless of whether the port was bridged or
      standalone.
      
      To keep VLAN-unaware virtual links working, we need to follow whether
      the port is in a bridge or not, and update the VLAN ID from those rules.
      
      In fact we can't fully do that. Depending on whether the switch is
      VLAN-aware or not, we can accept Virtual Link rules with just the MAC
      DA, or with a MAC DA and a VID. So we already deny changes to the VLAN
      awareness of the switch. But the VLAN awareness may also change as a
      result of joining or leaving a bridge.
      
      One might say we could just allow the following: a port may leave a
      VLAN-unaware bridge while it has VLAN-unaware VL (tc-flower) rules, and
      the driver will update those with the new tag_8021q pvid for standalone
      mode, but the driver won't accept joining a bridge at all while VL rules
      were installed in standalone mode. This is sort of a compromise made
      because leaving a bridge is an operation that cannot be vetoed.
      But this sort of setup change is not fully supported, either: as
      mentioned, VLAN filtering changes can also be triggered by leaving a
      bridge, therefore, the existing veto we have in place for turning VLAN
      filtering off with VLAN-aware VL rules active still isn't fully
      effective.
      
      I really don't know how to deal with this in a way that produces
      predictable behavior for user space. Since at the moment, keeping this
      feature fully functional on constellation changes (not changing the
      tag_8021q port pvid when joining a bridge) is blocking progress for the
      DSA FDB isolation, I'd rather document it as a (potentially temporary)
      limitation and go on without it.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d27656d0
    • Vladimir Oltean's avatar
      net: dsa: tag_8021q: add support for imprecise RX based on the VBID · d7f9787a
      Vladimir Oltean authored
      The sja1105 switch can't populate the PORT field of the tag_8021q header
      when sending a frame to the CPU with a non-zero VBID.
      
      Similar to dsa_find_designated_bridge_port_by_vid() which performs
      imprecise RX for VLAN-aware bridges, let's introduce a helper in
      tag_8021q for performing imprecise RX based on the VLAN that it has
      allocated for a VLAN-unaware bridge.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7f9787a
    • Vladimir Oltean's avatar
      net: dsa: tag_8021q: replace the SVL bridging with VLAN-unaware IVL bridging · 91495f21
      Vladimir Oltean authored
      For VLAN-unaware bridging, tag_8021q uses something perhaps a bit too
      tied with the sja1105 switch: each port uses the same pvid which is also
      used for standalone operation (a unique one from which the source port
      and device ID can be retrieved when packets from that port are forwarded
      to the CPU). Since each port has a unique pvid when performing
      autonomous forwarding, the switch must be configured for Shared VLAN
      Learning (SVL) such that the VLAN ID itself is ignored when performing
      FDB lookups. Without SVL, packets would always be flooded, since FDB
      lookup in the source port's VLAN would never find any entry.
      
      First of all, to make tag_8021q more palatable to switches which might
      not support Shared VLAN Learning, let's just use a common VLAN for all
      ports that are under the same bridge.
      
      Secondly, using Shared VLAN Learning means that FDB isolation can never
      be enforced. But if all ports under the same VLAN-unaware bridge share
      the same VLAN ID, it can.
      
      The disadvantage is that the CPU port can no longer perform precise
      source port identification for these packets. But at least we have a
      mechanism which has proven to be adequate for that situation: imprecise
      RX (dsa_find_designated_bridge_port_by_vid), which is what we use for
      termination on VLAN-aware bridges.
      
      The VLAN ID that VLAN-unaware bridges will use with tag_8021q is the
      same one as we were previously using for imprecise TX (bridge TX
      forwarding offload). It is already allocated, it is just a matter of
      using it.
      
      Note that because now all ports under the same bridge share the same
      VLAN, the complexity of performing a tag_8021q bridge join decreases
      dramatically. We no longer have to install the RX VLAN of a newly
      joining port into the port membership of the existing bridge ports.
      The newly joining port just becomes a member of the VLAN corresponding
      to that bridge, and the other ports are already members of it from when
      they joined the bridge themselves. So forwarding works properly.
      
      This means that we can unhook dsa_tag_8021q_bridge_{join,leave} from the
      cross-chip notifier level dsa_switch_bridge_{join,leave}. We can put
      these calls directly into the sja1105 driver.
      
      With this new mode of operation, a port controlled by tag_8021q can have
      two pvids whereas before it could only have one. The pvid for standalone
      operation is different from the pvid used for VLAN-unaware bridging.
      This is done, again, so that FDB isolation can be enforced.
      Let tag_8021q manage this by deleting the standalone pvid when a port
      joins a bridge, and restoring it when it leaves it.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      91495f21
    • David S. Miller's avatar
      Merge branch 'FFungible-ethernet-driver' · 1bb1c5bc
      David S. Miller authored
      Dimitris Michailidis says:
      
      ====================
      new Fungible Ethernet driver
      
      This patch series contains a new network driver for the Ethernet
      functionality of Fungible cards.
      
      It contains two modules. The first one in patch 2 is a library module
      that implements some of the device setup, queue managenent, and support
      for operating an admin queue. These are placed in a separate module
      because the cards provide a number of PCI functions handled by different
      types of drivers and all use the same common means to interact with the
      device. Each of the drivers will be relying on this library module for
      them.
      
      The remaining patches provide the Ethernet driver for the cards.
      
      v2:
      - Fix set_pauseparam, remove get_wol, remove module param (Andrew Lunn)
      - Fix a register poll loop (Andrew)
      - Replace constants defined with 'static const'
      - make W=1 C=1 is clean
      - Remove devlink FW update (Jakub)
      - Remove duplicate ethtool stats covered by structured API (Jakub)
      
      v3:
      - Make TLS stats unconditional (Andrew)
      - Remove inline from .c (Andrew)
      - Replace some ifdef with IS_ENABLED (Andrew)
      - Fix build failure on 32b arches (build robot)
      - Fix build issue with make O= (Jakub)
      
      v4:
      - Fix for newer bpf_warn_invalid_xdp_action() (Jakub)
      - Remove 32b dma_set_mask_and_coherent()
      
      v5:
      - Make XDP enter/exit non-disruptive to active traffic
      - Remove dormant port state
      - Style fixes, unused stuff removal (Jakub)
      
      v6:
      - When changing queue depth or numbers allocate the new queues
        before shutting down the existing ones (Jakub)
      
      v7:
      - Convert IRQ bookeeping to use XArray.
      - Changes to the numbers of Tx/Rx queues are now incremental and
        do not disrupt ongoing traffic.
      - Implement .ndo_eth_ioctl instead of .ndo_do_ioctl.
      - Replace deprecated irq_set_affinity_hint.
      - Remove TLS 1.3 support (Jakub)
      - Remove hwtstamp_config.flags check (Jakub)
      - Add locking in SR-IOV enable/disable. (Jakub)
      
      v8:
      - Remove dropping of <33B packets and the associated counter (Jakub)
      - Report CQE size.
      - Show last MAC stats when the netdev isn't running (Andrew)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1bb1c5bc
    • Dimitris Michailidis's avatar
      net/fungible: Kconfig, Makefiles, and MAINTAINERS · 749efb1e
      Dimitris Michailidis authored
      Hook up the new driver to configuration and build.
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      749efb1e
    • Dimitris Michailidis's avatar
      net/funeth: add kTLS TX control part · a3662007
      Dimitris Michailidis authored
      This provides the control pieces for kTLS Tx offload, implementinng the
      offload operations.
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a3662007
    • Dimitris Michailidis's avatar
      net/funeth: add the data path · db37bc17
      Dimitris Michailidis authored
      Add the driver's data path. Tx handles skbs, XDP, and kTLS, Rx has skbs
      and XDP. Also included are Rx and Tx queue creation/tear-down and
      tracing.
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db37bc17
    • Dimitris Michailidis's avatar
      net/funeth: devlink support · d1d899f2
      Dimitris Michailidis authored
      The devlink part, which is minimal at this time giving just the driver
      name.
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d1d899f2
    • Dimitris Michailidis's avatar
      net/funeth: ethtool operations · 21c5ea95
      Dimitris Michailidis authored
      Add ethtool operations, primarily related to queues and ports, as well
      as device statistics.
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21c5ea95
    • Dimitris Michailidis's avatar
      net/funeth: probing and netdev ops · ee6373dd
      Dimitris Michailidis authored
      This is the first part of the Fungible ethernet driver. It deals with
      device probing, net_device creation, and netdev ops.
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee6373dd
    • Dimitris Michailidis's avatar
      net/fungible: Add service module for Fungible drivers · e1ffcc66
      Dimitris Michailidis authored
      Fungible cards have a number of different PCI functions and thus
      different drivers, all of which use a common method to initialize and
      interact with the device. This commit adds a library module that
      collects these common mechanisms. They mainly deal with device
      initialization, setting up and destroying queues, and operating an admin
      queue. A subset of the FW interface is also included here.
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e1ffcc66
    • Dimitris Michailidis's avatar
      PCI: Add Fungible Vendor ID to pci_ids.h · e8eb9e32
      Dimitris Michailidis authored
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: linux-pci@vger.kernel.org
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8eb9e32
  2. 26 Feb, 2022 15 commits
  3. 25 Feb, 2022 13 commits