1. 24 7月, 2021 8 次提交
  2. 23 7月, 2021 7 次提交
  3. 22 7月, 2021 6 次提交
    • I
      dpaa2-switch: seed the buffer pool after allocating the swp · 7aaa0f31
      Ioana Ciornei 提交于
      Any interraction with the buffer pool (seeding a buffer, acquire one) is
      made through a software portal (SWP, a DPIO object).
      There are circumstances where the dpaa2-switch driver probes on a DPSW
      before any DPIO devices have been probed. In this case, seeding of the
      buffer pool will lead to a panic since no SWPs are initialized.
      
      To fix this, seed the buffer pool after making sure that the software
      portals have been probed and are ready to be used.
      
      Fixes: 0b1b7137 ("staging: dpaa2-switch: handle Rx path on control interface")
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7aaa0f31
    • R
      net: sparx5: fix unmet dependencies warning · 98c5b13f
      Randy Dunlap 提交于
      WARNING: unmet direct dependencies detected for PHY_SPARX5_SERDES
        Depends on [n]: (ARCH_SPARX5 || COMPILE_TEST [=n]) && OF [=y] && HAS_IOMEM [=y]
        Selected by [y]:
        - SPARX5_SWITCH [=y] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_MICROCHIP [=y] && NET_SWITCHDEV [=y] && HAS_IOMEM [=y] && OF [=y]
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Lars Povlsen <lars.povlsen@microchip.com>
      Cc: Steen Hegelund <Steen.Hegelund@microchip.com>
      Cc: UNGLinuxDriver@microchip.com
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      98c5b13f
    • B
      ravb: Remove extra TAB · 9f061b9a
      Biju Das 提交于
      Align the member description comments for struct ravb_desc by
      removing the extra TAB.
      Signed-off-by: NBiju Das <biju.das.jz@bp.renesas.com>
      Reviewed-by: NLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
      Reviewed-by: NSergei Shtylyov <sergei.shtylyov@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9f061b9a
    • B
      ravb: Fix a typo in comment · 291d0a2c
      Biju Das 提交于
      Fix the typo RX->TX in comment, as the code following the comment
      process TX and not RX.
      Signed-off-by: NBiju Das <biju.das.jz@bp.renesas.com>
      Reviewed-by: NLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
      Reviewed-by: NSergei Shtylyov <sergei.shtylyov@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      291d0a2c
    • V
      net: dsa: sja1105: make VID 4095 a bridge VLAN too · e40cba94
      Vladimir Oltean 提交于
      This simple series of commands:
      
      ip link add br0 type bridge vlan_filtering 1
      ip link set swp0 master br0
      
      fails on sja1105 with the following error:
      [   33.439103] sja1105 spi0.1: vlan-lookup-table needs to have at least the default untagged VLAN
      [   33.447710] sja1105 spi0.1: Invalid config, cannot upload
      Warning: sja1105: Failed to change VLAN Ethertype.
      
      For context, sja1105 has 3 operating modes:
      - SJA1105_VLAN_UNAWARE: the dsa_8021q_vlans are committed to hardware
      - SJA1105_VLAN_FILTERING_FULL: the bridge_vlans are committed to hardware
      - SJA1105_VLAN_FILTERING_BEST_EFFORT: both the dsa_8021q_vlans and the
        bridge_vlans are committed to hardware
      
      Swapping out a VLAN list and another in happens in
      sja1105_build_vlan_table(), which performs a delta update procedure.
      That function is called from a few places, notably from
      sja1105_vlan_filtering() which is called from the
      SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING handler.
      
      The above set of 2 commands fails when run on a kernel pre-commit
      8841f6e6 ("net: dsa: sja1105: make devlink property
      best_effort_vlan_filtering true by default"). So the priv->vlan_state
      transition that takes place is between VLAN-unaware and full VLAN
      filtering. So the dsa_8021q_vlans are swapped out and the bridge_vlans
      are swapped in.
      
      So why does it fail?
      
      Well, the bridge driver, through nbp_vlan_init(), first sets up the
      SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING attribute, and only then
      proceeds to call nbp_vlan_add for the default_pvid.
      
      So when we swap out the dsa_8021q_vlans and swap in the bridge_vlans in
      the SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING handler, there are no bridge
      VLANs (yet). So we have wiped the VLAN table clean, and the low-level
      static config checker complains of an invalid configuration. We _will_
      add the bridge VLANs using the dynamic config interface, albeit later,
      when nbp_vlan_add() calls us. So it is natural that it fails.
      
      So why did it ever work?
      
      Surprisingly, it looks like I only tested this configuration with 2
      things set up in a particular way:
      - a network manager that brings all ports up
      - a kernel with CONFIG_VLAN_8021Q=y
      
      It is widely known that commit ad1afb00 ("vlan_dev: VLAN 0 should be
      treated as "no vlan tag" (802.1p packet)") installs VID 0 to every net
      device that comes up. DSA treats these VLANs as bridge VLANs, and
      therefore, in my testing, the list of bridge_vlans was never empty.
      
      However, if CONFIG_VLAN_8021Q is not enabled, or the port is not up when
      it joins a VLAN-aware bridge, the bridge_vlans list will be temporarily
      empty, and the sja1105_static_config_reload() call from
      sja1105_vlan_filtering() will fail.
      
      To fix this, the simplest thing is to keep VID 4095, the one used for
      CPU-injected control packets since commit ed040abc ("net: dsa:
      sja1105: use 4095 as the private VLAN for untagged traffic"), in the
      list of bridge VLANs too, not just the list of tag_8021q VLANs. This
      ensures that the list of bridge VLANs will never be empty.
      
      Fixes: ec5ae610 ("net: dsa: sja1105: save/restore VLANs using a delta commit method")
      Reported-by: NRadu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e40cba94
    • A
      net: ixp46x: fix ptp build failure · 161dcc02
      Arnd Bergmann 提交于
      The rework of the ixp46x cpu detection left the network driver in
      a half broken state:
      
      drivers/net/ethernet/xscale/ptp_ixp46x.c: In function 'ptp_ixp_init':
      drivers/net/ethernet/xscale/ptp_ixp46x.c:290:51: error: 'IXP4XX_TIMESYNC_BASE_VIRT' undeclared (first use in this function)
        290 |                 (struct ixp46x_ts_regs __iomem *) IXP4XX_TIMESYNC_BASE_VIRT;
            |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/xscale/ptp_ixp46x.c:290:51: note: each undeclared identifier is reported only once for each function it appears in
      drivers/net/ethernet/xscale/ptp_ixp46x.c: At top level:
      drivers/net/ethernet/xscale/ptp_ixp46x.c:323:1: error: data definition has no type or storage class [-Werror]
        323 | module_init(ptp_ixp_init);
      
      I have patches to complete the transition for a future release, but
      for the moment, add the missing include statements to get it to build
      again.
      
      Fixes: 09aa9aab ("soc: ixp4xx: move cpu detection to linux/soc/ixp4xx/cpu.h")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      161dcc02
  4. 21 7月, 2021 3 次提交
    • S
      ibmvnic: Remove the proper scrq flush · bb55362b
      Sukadev Bhattiprolu 提交于
      Commit 65d6470d ("ibmvnic: clean pending indirect buffs during reset")
      intended to remove the call to ibmvnic_tx_scrq_flush() when the
      ->resetting flag is true and was tested that way. But during the final
      rebase to net-next, the hunk got applied to a block few lines below
      (which happened to have the same diff context) and the wrong call to
      ibmvnic_tx_scrq_flush() got removed.
      
      Fix that by removing the correct ibmvnic_tx_scrq_flush() and restoring
      the one that was incorrectly removed.
      
      Fixes: 65d6470d ("ibmvnic: clean pending indirect buffs during reset")
      Reported-by: NDany Madden <drt@linux.ibm.com>
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bb55362b
    • S
      r8169: Avoid duplicate sysfs entry creation error · e9a72f87
      Sayanta Pattanayak 提交于
      When registering the MDIO bus for a r8169 device, we use the PCI
      bus/device specifier as a (seemingly) unique device identifier.
      However the very same BDF number can be used on another PCI segment,
      which makes the driver fail probing:
      
      [ 27.544136] r8169 0002:07:00.0: enabling device (0000 -> 0003)
      [ 27.559734] sysfs: cannot create duplicate filename '/class/mdio_bus/r8169-700'
      ....
      [ 27.684858] libphy: mii_bus r8169-700 failed to register
      [ 27.695602] r8169: probe of 0002:07:00.0 failed with error -22
      
      Add the segment number to the device name to make it more unique.
      
      This fixes operation on ARM N1SDP boards, with two boards connected
      together to form an SMP system, and all on-board devices showing up
      twice, just on different PCI segments. A similar issue would occur on
      large systems with many PCI slots and multiple RTL8169 NICs.
      
      Fixes: f1e911d5 ("r8169: add basic phylib support")
      Signed-off-by: NSayanta Pattanayak <sayanta.pattanayak@arm.com>
      [Andre: expand commit message, use pci_domain_nr()]
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Acked-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9a72f87
    • M
      ixgbe: Fix packet corruption due to missing DMA sync · 09cfae9f
      Markus Boehme 提交于
      When receiving a packet with multiple fragments, hardware may still
      touch the first fragment until the entire packet has been received. The
      driver therefore keeps the first fragment mapped for DMA until end of
      packet has been asserted, and delays its dma_sync call until then.
      
      The driver tries to fit multiple receive buffers on one page. When using
      3K receive buffers (e.g. using Jumbo frames and legacy-rx is turned
      off/build_skb is being used) on an architecture with 4K pages, the
      driver allocates an order 1 compound page and uses one page per receive
      buffer. To determine the correct offset for a delayed DMA sync of the
      first fragment of a multi-fragment packet, the driver then cannot just
      use PAGE_MASK on the DMA address but has to construct a mask based on
      the actual size of the backing page.
      
      Using PAGE_MASK in the 3K RX buffer/4K page architecture configuration
      will always sync the first page of a compound page. With the SWIOTLB
      enabled this can lead to corrupted packets (zeroed out first fragment,
      re-used garbage from another packet) and various consequences, such as
      slow/stalling data transfers and connection resets. For example, testing
      on a link with MTU exceeding 3058 bytes on a host with SWIOTLB enabled
      (e.g. "iommu=soft swiotlb=262144,force") TCP transfers quickly fizzle
      out without this patch.
      
      Cc: stable@vger.kernel.org
      Fixes: 0c5661ec ("ixgbe: fix crash in build_skb Rx code path")
      Signed-off-by: NMarkus Boehme <markubo@amazon.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      09cfae9f
  5. 20 7月, 2021 12 次提交
  6. 19 7月, 2021 4 次提交
    • M
      bnxt_en: Fix PTP capability discovery · de5bf194
      Michael Chan 提交于
      The current PTP initialization logic does not account for firmware
      reset that may cause PTP capability to change.  The valid pointer
      bp->ptp_cfg is used to indicate that the device is capable of PTP
      and that it has been initialized.  So we must clean up bp->ptp_cfg
      and free it if the firmware after reset does not support PTP.
      
      Fixes: 93cb62d9 ("bnxt_en: Enable hardware PTP support")
      Cc: Richard Cochran <richardcochran@gmail.com>
      Reviewed-by: NPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de5bf194
    • M
      bnxt_en: Move bnxt_ptp_init() to bnxt_open() · d7859afb
      Michael Chan 提交于
      The device needs to be in ifup state for PTP to function, so move
      bnxt_ptp_init() to bnxt_open().  This means that the PHC will be
      registered during bnxt_open().
      
      This also makes firmware reset work correctly.  PTP configurations
      may change after firmware upgrade or downgrade.  bnxt_open() will
      be called after firmware reset, so it will work properly.
      
      bnxt_ptp_start() is now incorporated into bnxt_ptp_init().  We now
      also need to call bnxt_ptp_clear() in bnxt_close().
      
      Fixes: 93cb62d9 ("bnxt_en: Enable hardware PTP support")
      Cc: Richard Cochran <richardcochran@gmail.com>
      Reviewed-by: NPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7859afb
    • S
      bnxt_en: Check abort error state in bnxt_half_open_nic() · 11a39259
      Somnath Kotur 提交于
      bnxt_half_open_nic() is called during during ethtool self test and is
      protected by rtnl_lock.  Firmware reset can be happening at the same
      time.  Only critical portions of the entire firmware reset sequence
      are protected by the rtnl_lock.  It is possible that bnxt_half_open_nic()
      can be called when the firmware reset sequence is aborting.  In that
      case, bnxt_half_open_nic() needs to check if the ABORT_ERR flag is set
      and abort if it is.  The ethtool self test will fail but the NIC will be
      brought to a consistent IF_DOWN state.
      
      Without this patch, if bnxt_half_open_nic() were to continue in this
      error state, it may crash like this:
      
        bnxt_en 0000:82:00.1 enp130s0f1np1: FW reset in progress during close, FW reset will be aborted
        Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
        ...
        Process ethtool (pid: 333327, stack limit = 0x0000000046476577)
        Call trace:
        bnxt_alloc_mem+0x444/0xef0 [bnxt_en]
        bnxt_half_open_nic+0x24/0xb8 [bnxt_en]
        bnxt_self_test+0x2dc/0x390 [bnxt_en]
        ethtool_self_test+0xe0/0x1f8
        dev_ethtool+0x1744/0x22d0
        dev_ioctl+0x190/0x3e0
        sock_ioctl+0x238/0x480
        do_vfs_ioctl+0xc4/0x758
        ksys_ioctl+0x84/0xb8
        __arm64_sys_ioctl+0x28/0x38
        el0_svc_handler+0xb0/0x180
        el0_svc+0x8/0xc
      
      Fixes: a1301f08 ("bnxt_en: Check abort error state in bnxt_open_nic().")
      Signed-off-by: NSomnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      11a39259
    • M
      bnxt_en: Validate vlan protocol ID on RX packets · 96bdd4b9
      Michael Chan 提交于
      Only pass supported VLAN protocol IDs for stripped VLAN tags to the
      stack.  The stack will hit WARN() if the protocol ID is unsupported.
      
      Existing firmware sets up the chip to strip 0x8100, 0x88a8, 0x9100.
      Only the 1st two protocols are supported by the kernel.
      
      Fixes: a196e96b ("bnxt_en: clean up VLAN feature bit handling")
      Reviewed-by: NSomnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      96bdd4b9