Skip to content
  1. Apr 16, 2020
    • Vladimir Oltean's avatar
      net: mscc: ocelot: fix untagged packet drops when enslaving to vlan aware bridge · 87b0f983
      Vladimir Oltean authored
      
      
      To rehash a previous explanation given in commit 1c44ce56 ("net:
      mscc: ocelot: fix vlan_filtering when enslaving to bridge before link is
      up"), the switch driver operates the in a mode where a single VLAN can
      be transmitted as untagged on a particular egress port. That is the
      "native VLAN on trunk port" use case.
      
      The configuration for this native VLAN is driven in 2 ways:
       - Set the egress port rewriter to strip the VLAN tag for the native
         VID (as it is egress-untagged, after all).
       - Configure the ingress port to drop untagged and priority-tagged
         traffic, if there is no native VLAN. The intention of this setting is
         that a trunk port with no native VLAN should not accept untagged
         traffic.
      
      Since both of the above configurations for the native VLAN should only
      be done if VLAN awareness is requested, they are actually done from the
      ocelot_port_vlan_filtering function, after the basic procedure of
      toggling the VLAN awareness flag of the port.
      
      But there's a problem with that simplistic approach: we are trying to
      juggle with 2 independent variables from a single function:
       - Native VLAN of the port - its value is held in port->vid.
       - VLAN awareness state of the port - currently there are some issues
         here, more on that later*.
      The actual problem can be seen when enslaving the switch ports to a VLAN
      filtering bridge:
       0. The driver configures a pvid of zero for each port, when in
          standalone mode. While the bridge configures a default_pvid of 1 for
          each port that gets added as a slave to it.
       1. The bridge calls ocelot_port_vlan_filtering with vlan_aware=true.
          The VLAN-filtering-dependent portion of the native VLAN
          configuration is done, considering that the native VLAN is 0.
       2. The bridge calls ocelot_vlan_add with vid=1, pvid=true,
          untagged=true. The native VLAN changes to 1 (change which gets
          propagated to hardware).
       3. ??? - nobody calls ocelot_port_vlan_filtering again, to reapply the
          VLAN-filtering-dependent portion of the native VLAN configuration,
          for the new native VLAN of 1. One can notice that after toggling "ip
          link set dev br0 type bridge vlan_filtering 0 && ip link set dev br0
          type bridge vlan_filtering 1", the new native VLAN finally makes it
          through and untagged traffic finally starts flowing again. But
          obviously that shouldn't be needed.
      
      So it is clear that 2 independent variables need to both re-trigger the
      native VLAN configuration. So we introduce the second variable as
      ocelot_port->vlan_aware.
      
      *Actually both the DSA Felix driver and the Ocelot driver already had
      each its own variable:
       - Ocelot: ocelot_port_private->vlan_aware
       - Felix: dsa_port->vlan_filtering
      but the common Ocelot library needs to work with a single, common,
      variable, so there is some refactoring done to move the vlan_aware
      property from the private structure into the common ocelot_port
      structure.
      
      Fixes: 97bb69e1 ("net: mscc: ocelot: break apart ocelot_vlan_port_apply")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      87b0f983
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 78b87711
      David S. Miller authored
      
      
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2020-04-15
      
      The following pull-request contains BPF updates for your *net* tree.
      
      We've added 10 non-merge commits during the last 3 day(s) which contain
      a total of 11 files changed, 238 insertions(+), 95 deletions(-).
      
      The main changes are:
      
      1) Fix offset overflow for BPF_MEM BPF_DW insn mapping on arm32 JIT,
         from Luke Nelson and Xi Wang.
      
      2) Prevent mprotect() to make frozen & mmap()'ed BPF map writeable
         again, from Andrii Nakryiko and Jann Horn.
      
      3) Fix type of old_fd in bpf_xdp_set_link_opts to int in libbpf and add
         selftests, from Toke Høiland-Jørgensen.
      
      4) Fix AF_XDP to check that headroom cannot be larger than the available
         space in the chunk, from Magnus Karlsson.
      
      5) Fix reset of XDP prog when expected_fd is set, from David Ahern.
      
      6) Fix a segfault in bpftool's struct_ops command when BTF is not
         available, from Daniel T. Lee.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78b87711
    • David S. Miller's avatar
      Merge tag 'mac80211-for-net-2020-04-15' of... · 6058ee09
      David S. Miller authored
      Merge tag 'mac80211-for-net-2020-04-15' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
      
      
      
      Johannes Berg says:
      
      ====================
      A couple of fixes:
       * FTM responder policy netlink validation fix
         (but the only user validates again later)
       * kernel-doc fixes
       * a fix for a race in mac80211 radio registration vs. userspace
       * a mesh channel switch fix
       * a fix for a syzbot reported kasprintf() issue
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6058ee09
  2. Apr 15, 2020
  3. Apr 14, 2020
  4. Apr 13, 2020
  5. Apr 12, 2020
    • Clemens Gruber's avatar
      net: phy: marvell: Fix pause frame negotiation · 3b72f84f
      Clemens Gruber authored
      
      
      The negotiation of flow control / pause frame modes was broken since
      commit fcf1f59a ("net: phy: marvell: rearrange to use
      genphy_read_lpa()") moved the setting of phydev->duplex below the
      phy_resolve_aneg_pause call. Due to a check of DUPLEX_FULL in that
      function, phydev->pause was no longer set.
      
      Fix it by moving the parsing of the status variable before the blocks
      dealing with the pause frames.
      
      As the Marvell 88E1510 datasheet does not specify the timing between the
      link status and the "Speed and Duplex Resolved" bit, we have to force
      the link down as long as the resolved bit is not set, to avoid reporting
      link up before we even have valid Speed/Duplex.
      
      Tested with a Marvell 88E1510 (RGMII to Copper/1000Base-T)
      
      Fixes: fcf1f59a ("net: phy: marvell: rearrange to use genphy_read_lpa()")
      Signed-off-by: default avatarClemens Gruber <clemens.gruber@pqgruber.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3b72f84f