1. Jun 25, 2020
    • Doug Berger's avatar
      net: bcmgenet: use __be16 for htons(ETH_P_IP) · d966d2ef
      Doug Berger authored
      The 16-bit value that holds a short in network byte order should
      be declared as a restricted big endian type to allow type checks
      to succeed during assignment.
      
      Fixes: 3e370952
      
       ("net: bcmgenet: add support for ethtool rxnfc flows")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d966d2ef
    • Doug Berger's avatar
      net: bcmgenet: re-remove bcmgenet_hfb_add_filter · 673bafd5
      Doug Berger authored
      This function was originally removed by Baoyou Xie in
      commit e2072600 ("net: bcmgenet: remove unused function in
      bcmgenet.c") to prevent a build warning.
      
      Some of the functions removed by Baoyou Xie are now used for
      WAKE_FILTER support so his commit was reverted, but this function
      is still unused and the kbuild test robot dutifully reported the
      warning.
      
      This commit once again removes the remaining unused hfb functions.
      
      Fixes: 14da1510
      
       ("Revert "net: bcmgenet: remove unused function in bcmgenet.c"")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      673bafd5
    • Colin Ian King's avatar
      qed: add missing error test for DBG_STATUS_NO_MATCHING_FRAMING_MODE · a5124386
      Colin Ian King authored
      The error DBG_STATUS_NO_MATCHING_FRAMING_MODE was added to the enum
      enum dbg_status however there is a missing corresponding entry for
      this in the array s_status_str. This causes an out-of-bounds read when
      indexing into the last entry of s_status_str.  Fix this by adding in
      the missing entry.
      
      Addresses-Coverity: ("Out-of-bounds read").
      Fixes: 2d22bc83
      
       ("qed: FW 8.42.2.0 debug features")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a5124386
    • David S. Miller's avatar
      Merge branch 'net-phy-call-phy_disable_interrupts-in-phy_init_hw' · 482f3bae
      David S. Miller authored
      
      
      Jisheng Zhang says:
      
      ====================
      net: phy: call phy_disable_interrupts() in phy_init_hw()
      
      We face an issue with rtl8211f, a pin is shared between INTB and PMEB,
      and the PHY Register Accessible Interrupt is enabled by default, so
      the INTB/PMEB pin is always active in polling mode case.
      
      As Heiner pointed out "I was thinking about calling
      phy_disable_interrupts() in phy_init_hw(), to have a defined init
      state as we don't know in which state the PHY is if the PHY driver is
      loaded. We shouldn't assume that it's the chip power-on defaults, BIOS
      or boot loader could have changed this. Or in case of dual-boot
      systems the other OS could leave the PHY in whatever state."
      
      patch1 makes phy_disable_interrupts() non-static so that it could be used
      in phy_init_hw() to have a defined init state.
      
      patch2 calls phy_disable_interrupts() in phy_init_hw() to have a
      defined init state.
      
      Since v3:
        - call phy_disable_interrupts() have interrupts disabled first then
          config_init, thank Florian
      
      Since v2:
        - Don't export phy_disable_interrupts() but just make it non-static
      
      Since v1:
        - EXPORT the correct symbol
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      482f3bae
    • Jisheng Zhang's avatar
      net: phy: call phy_disable_interrupts() in phy_init_hw() · 9886a4db
      Jisheng Zhang authored
      
      
      Call phy_disable_interrupts() in phy_init_hw() to "have a defined init
      state as we don't know in which state the PHY is if the PHY driver is
      loaded. We shouldn't assume that it's the chip power-on defaults, BIOS
      or boot loader could have changed this. Or in case of dual-boot
      systems the other OS could leave the PHY in whatever state." as pointed
      out by Heiner.
      
      Suggested-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarJisheng Zhang <Jisheng.Zhang@synaptics.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9886a4db
    • Jisheng Zhang's avatar
      net: phy: make phy_disable_interrupts() non-static · 3dd4ef1b
      Jisheng Zhang authored
      
      
      We face an issue with rtl8211f, a pin is shared between INTB and PMEB,
      and the PHY Register Accessible Interrupt is enabled by default, so
      the INTB/PMEB pin is always active in polling mode case.
      
      As Heiner pointed out "I was thinking about calling
      phy_disable_interrupts() in phy_init_hw(), to have a defined init
      state as we don't know in which state the PHY is if the PHY driver is
      loaded. We shouldn't assume that it's the chip power-on defaults, BIOS
      or boot loader could have changed this. Or in case of dual-boot
      systems the other OS could leave the PHY in whatever state."
      
      Make phy_disable_interrupts() non-static so that it could be used in
      phy_init_hw() to have a defined init state.
      
      Suggested-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarJisheng Zhang <Jisheng.Zhang@synaptics.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3dd4ef1b
    • Sascha Hauer's avatar
      net: ethernet: mvneta: Add back interface mode validation · 41c2b6b4
      Sascha Hauer authored
      When writing the serdes configuration register was moved to
      mvneta_config_interface() the whole code block was removed from
      mvneta_port_power_up() in the assumption that its only purpose was to
      write the serdes configuration register. As mentioned by Russell King
      its purpose was also to check for valid interface modes early so that
      later in the driver we do not have to care for unexpected interface
      modes.
      Add back the test to let the driver bail out early on unhandled
      interface modes.
      
      Fixes: b4748553
      
       ("net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy")
      Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Reviewed-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41c2b6b4
    • Sascha Hauer's avatar
      net: ethernet: mvneta: Do not error out in non serdes modes · d3d239dc
      Sascha Hauer authored
      In mvneta_config_interface() the RGMII modes are catched by the default
      case which is an error return. The RGMII modes are valid modes for the
      driver, so instead of returning an error add a break statement to return
      successfully.
      
      This avoids this warning for non comphy SoCs which use RGMII, like
      SolidRun Clearfog:
      
      WARNING: CPU: 0 PID: 268 at drivers/net/ethernet/marvell/mvneta.c:3512 mvneta_start_dev+0x220/0x23c
      
      Fixes: b4748553
      
       ("net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy")
      Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Reviewed-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d3d239dc
    • Daniel Mack's avatar
      dsa: Allow forwarding of redirected IGMP traffic · 1ed9ec9b
      Daniel Mack authored
      
      
      The driver for Marvell switches puts all ports in IGMP snooping mode
      which results in all IGMP/MLD frames that ingress on the ports to be
      forwarded to the CPU only.
      
      The bridge code in the kernel can then interpret these frames and act
      upon them, for instance by updating the mdb in the switch to reflect
      multicast memberships of stations connected to the ports. However,
      the IGMP/MLD frames must then also be forwarded to other ports of the
      bridge so external IGMP queriers can track membership reports, and
      external multicast clients can receive query reports from foreign IGMP
      queriers.
      
      Currently, this is impossible as the EDSA tagger sets offload_fwd_mark
      on the skb when it unwraps the tagged frames, and that will make the
      switchdev layer prevent the skb from egressing on any other port of
      the same switch.
      
      To fix that, look at the To_CPU code in the DSA header and make
      forwarding of the frame possible for trapped IGMP packets.
      
      Introduce some #defines for the frame types to make the code a bit more
      comprehensive.
      
      This was tested on a Marvell 88E6352 variant.
      
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Tested-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ed9ec9b
    • Lorenzo Bianconi's avatar
      openvswitch: take into account de-fragmentation/gso_size in execute_check_pkt_len · 17843655
      Lorenzo Bianconi authored
      ovs connection tracking module performs de-fragmentation on incoming
      fragmented traffic. Take info account if traffic has been de-fragmented
      in execute_check_pkt_len action otherwise we will perform the wrong
      nested action considering the original packet size. This issue typically
      occurs if ovs-vswitchd adds a rule in the pipeline that requires connection
      tracking (e.g. OVN stateful ACLs) before execute_check_pkt_len action.
      Moreover take into account GSO fragment size for GSO packet in
      execute_check_pkt_len routine
      
      Fixes: 4d5ec89f
      
       ("net: openvswitch: Add a new action check_pkt_len")
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      17843655
  2. Jun 24, 2020