1. 22 Jul, 2021 1 commit
  2. 21 Jul, 2021 8 commits
    • Xin Long's avatar
      sctp: do not update transport pathmtu if SPP_PMTUD_ENABLE is not set · 02dc2ee7
      Xin Long authored
      Currently, in sctp_packet_config(), sctp_transport_pmtu_check() is
      called to update transport pathmtu with dst's mtu when dst's mtu
      has been changed by non sctp stack like xfrm.
      
      However, this should only happen when SPP_PMTUD_ENABLE is set, no
      matter where dst's mtu changed. This patch is to fix by checking
      SPP_PMTUD_ENABLE flag before calling sctp_transport_pmtu_check().
      
      Thanks Jacek for reporting and looking into this issue.
      
      v1->v2:
        - add the missing "{" to fix the build error.
      
      Fixes: 69fec325 ('Revert "sctp: remove sctp_transport_pmtu_check"')
      Reported-by: default avatarJacek Szafraniec <jacek.szafraniec@nokia.com>
      Tested-by: default avatarJacek Szafraniec <jacek.szafraniec@nokia.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02dc2ee7
    • Arnd Bergmann's avatar
      net: ixp46x: fix ptp build failure · 161dcc02
      Arnd Bergmann authored
      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: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      161dcc02
    • Sukadev Bhattiprolu's avatar
      ibmvnic: Remove the proper scrq flush · bb55362b
      Sukadev Bhattiprolu authored
      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: default avatarDany Madden <drt@linux.ibm.com>
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb55362b
    • David S. Miller's avatar
      Merge branch 'pmtu-esp' · 3ddaed6b
      David S. Miller authored
      Vadim Fedorenko ays:
      
      ====================
      Fix PMTU for ESP-in-UDP encapsulation
      
      Bug 213669 uncovered regression in PMTU discovery for UDP-encapsulated
      routes and some incorrect usage in udp tunnel fields. This series fixes
      problems and also adds such case for selftests
      
      v3:
       - update checking logic to account SCTP use case
      v2:
       - remove refactor code that was in first patch
       - move checking logic to __udp{4,6}_lib_err_encap
       - add more tests, especially routed configuration
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ddaed6b
    • Vadim Fedorenko's avatar
      selftests: net: add ESP-in-UDP PMTU test · ece1278a
      Vadim Fedorenko authored
      The case of ESP in UDP encapsulation was not covered before. Add
      cases of local changes of MTU and difference on routed path.
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ece1278a
    • Vadim Fedorenko's avatar
      udp: check encap socket in __udp_lib_err · 9bfce73c
      Vadim Fedorenko authored
      Commit d26796ae ("udp: check udp sock encap_type in __udp_lib_err")
      added checks for encapsulated sockets but it broke cases when there is
      no implementation of encap_err_lookup for encapsulation, i.e. ESP in
      UDP encapsulation. Fix it by calling encap_err_lookup only if socket
      implements this method otherwise treat it as legal socket.
      
      Fixes: d26796ae ("udp: check udp sock encap_type in __udp_lib_err")
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9bfce73c
    • Xin Long's avatar
      sctp: update active_key for asoc when old key is being replaced · 58acd100
      Xin Long authored
      syzbot reported a call trace:
      
        BUG: KASAN: use-after-free in sctp_auth_shkey_hold+0x22/0xa0 net/sctp/auth.c:112
        Call Trace:
         sctp_auth_shkey_hold+0x22/0xa0 net/sctp/auth.c:112
         sctp_set_owner_w net/sctp/socket.c:131 [inline]
         sctp_sendmsg_to_asoc+0x152e/0x2180 net/sctp/socket.c:1865
         sctp_sendmsg+0x103b/0x1d30 net/sctp/socket.c:2027
         inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:821
         sock_sendmsg_nosec net/socket.c:703 [inline]
         sock_sendmsg+0xcf/0x120 net/socket.c:723
      
      This is an use-after-free issue caused by not updating asoc->shkey after
      it was replaced in the key list asoc->endpoint_shared_keys, and the old
      key was freed.
      
      This patch is to fix by also updating active_key for asoc when old key is
      being replaced with a new one. Note that this issue doesn't exist in
      sctp_auth_del_key_id(), as it's not allowed to delete the active_key
      from the asoc.
      
      Fixes: 1b1e0bc9 ("sctp: add refcnt support for sh_key")
      Reported-by: syzbot+b774577370208727d12b@syzkaller.appspotmail.com
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58acd100
    • Sayanta Pattanayak's avatar
      r8169: Avoid duplicate sysfs entry creation error · e9a72f87
      Sayanta Pattanayak authored
      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: default avatarSayanta Pattanayak <sayanta.pattanayak@arm.com>
      [Andre: expand commit message, use pci_domain_nr()]
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Acked-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9a72f87
  3. 20 Jul, 2021 16 commits
  4. 19 Jul, 2021 15 commits
    • Subbaraya Sundeep's avatar
      octeontx2-af: Introduce internal packet switching · 23109f8d
      Subbaraya Sundeep authored
      As of now any communication between CGXs PFs and
      their VFs within the system is possible only by
      external switches sending packets back to the
      system. This patch adds internal switching support.
      Broadcast packet replication is not covered here.
      RVU admin function (AF) maintains MAC addresses
      of all interfaces in the system. When switching is
      enabled, MCAM entries are allocated to install rules
      such that packets with DMAC matching any of the
      internal interface MAC addresses is punted back
      into the system via the loopback channel.
      On the receive side the default unicast rules
      are modified to not check for ingress channel.
      So any packet with matching DMAC irrespective of
      which interface it is coming from will be forwarded
      to the respective PF/VF interface.
      The transmit side rules and default unicast rules
      are updated if user changes MAC address of an interface.
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarSunil Kovvuri Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23109f8d
    • Subbaraya Sundeep's avatar
      octeontx2-af: Prepare for allocating MCAM rules for AF · cb7a6b3b
      Subbaraya Sundeep authored
      AF till now only manages the allocation and freeing of
      MCAM rules for other PF/VFs in system. To implement
      L2 switching between all CGX mapped PF and VFs, AF
      requires MCAM entries for DMAC rules for each PF and VF.
      This patch modifies AF driver such that AF can also
      allocate MCAM rules and install rules for other
      PFs and VFs. All the checks like channel verification
      for RX rules and PF_FUNC verification for TX rules are
      relaxed in case AF is allocating or installing rules.
      Also all the entry and counter to owner mappings are
      set to NPC_MCAM_INVALID_MAP when they are free indicating
      those are not allocated to AF nor PF/VFs.
      This patch also ensures that AF allocated and installed
      entries are displayed in debugfs.
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarSunil Kovvuri Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb7a6b3b
    • Subbaraya Sundeep's avatar
      octeontx2-af: Enable transmit side LBK link · fa2bf6ba
      Subbaraya Sundeep authored
      For enabling VF-VF switching the packets egressing
      out of CGX mapped VFs needed to be sent to LBK
      so that same packets are received back to the system.
      But the LBK link also needs to be enabled in addition
      to a VF's mapped CGX_LMAC link otherwise hardware
      raises send error interrupt indicating selected LBK
      link is not enabled in NIX_AF_TL3_TL2X_LINKX_CFG register.
      Hence this patch enables all LBK links in
      TL3_TL2_LINKX_CFG registers.
      Also to enable packet flow between PFs/VFs of NIX0
      to PFs/VFs of NIX1(in 98xx silicon) the NPC TX DMAC
      rules has to be installed such that rules must be hit
      for any TX interface i.e., NIX0-TX or NIX1-TX provided
      DMAC match creteria is met. Hence this patch changes the
      behavior such that MCAM is programmed to match with any
      NIX0/1-TX interface for TX rules.
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarSunil Kovvuri Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa2bf6ba
    • Eric Dumazet's avatar
      net/tcp_fastopen: fix data races around tfo_active_disable_stamp · 6f20c8ad
      Eric Dumazet authored
      tfo_active_disable_stamp is read and written locklessly.
      We need to annotate these accesses appropriately.
      
      Then, we need to perform the atomic_inc(tfo_active_disable_times)
      after the timestamp has been updated, and thus add barriers
      to make sure tcp_fastopen_active_should_disable() wont read
      a stale timestamp.
      
      Fixes: cf1ef3f0 ("net/tcp_fastopen: Disable active side TFO in certain scenarios")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Wei Wang <weiwan@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Acked-by: default avatarWei Wang <weiwan@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f20c8ad
    • David S. Miller's avatar
      Merge branch 'dt-bindinga-dwmac' · a0050653
      David S. Miller authored
      Joakim Zhang says:
      
      ====================
      dt-bindings: net: dwmac-imx: convert
      
      This patch set intends to convert imx dwmac binding to schema, and fixes
      found by dt_binding_check and dtbs_check.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a0050653
    • Joakim Zhang's avatar
      arm64: dts: imx8mp: change interrupt order per dt-binding · 77e5253d
      Joakim Zhang authored
      This patch changs interrupt order which found by dtbs_check.
      
      $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
      arch/arm64/boot/dts/freescale/imx8mp-evk.dt.yaml: ethernet@30bf0000: interrupt-names:0: 'macirq' was expected
      arch/arm64/boot/dts/freescale/imx8mp-evk.dt.yaml: ethernet@30bf0000: interrupt-names:1: 'eth_wake_irq' was expected
      
      According to Documentation/devicetree/bindings/net/snps,dwmac.yaml, we
      should list interrupt in it's order.
      Signed-off-by: default avatarJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77e5253d
    • Joakim Zhang's avatar
      dt-bindings: net: imx-dwmac: convert imx-dwmac bindings to yaml · e314a07e
      Joakim Zhang authored
      In order to automate the verification of DT nodes covert imx-dwmac to
      nxp,dwmac-imx.yaml, and pass below checking.
      
      $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
      $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
      Signed-off-by: default avatarJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e314a07e
    • Joakim Zhang's avatar
      dt-bindings: net: snps,dwmac: add missing DWMAC IP version · bdad810e
      Joakim Zhang authored
      Add missing DWMAC IP version in snps,dwmac.yaml which found by below
      command, as NXP i.MX8 families support SNPS DWMAC 5.10a IP.
      
      $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
      Documentation/devicetree/bindings/net/nxp,dwmac-imx.example.dt.yaml:
      ethernet@30bf0000: compatible: None of ['nxp,imx8mp-dwmac-eqos', 'snps,dwmac-5.10a'] are valid under the given schema
      Signed-off-by: default avatarJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bdad810e
    • Randy Dunlap's avatar
      net: hisilicon: rename CACHE_LINE_MASK to avoid redefinition · b16f3299
      Randy Dunlap authored
      Building on ARCH=arc causes a "redefined" warning, so rename this
      driver's CACHE_LINE_MASK to avoid the warning.
      
      ../drivers/net/ethernet/hisilicon/hip04_eth.c:134: warning: "CACHE_LINE_MASK" redefined
        134 | #define CACHE_LINE_MASK   0x3F
      In file included from ../include/linux/cache.h:6,
                       from ../include/linux/printk.h:9,
                       from ../include/linux/kernel.h:19,
                       from ../include/linux/list.h:9,
                       from ../include/linux/module.h:12,
                       from ../drivers/net/ethernet/hisilicon/hip04_eth.c:7:
      ../arch/arc/include/asm/cache.h:17: note: this is the location of the previous definition
         17 | #define CACHE_LINE_MASK  (~(L1_CACHE_BYTES - 1))
      
      Fixes: d413779c ("net: hisilicon: Add an tx_desc to adapt HI13X1_GMAC")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Jiangfeng Xiao <xiaojiangfeng@huawei.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b16f3299
    • David S. Miller's avatar
      Merge branch 'bnxt_en-fixes' · 1dd271d9
      David S. Miller authored
      Michael Chan says:
      
      ====================
      bnxt_en: Bug fixes
      
      Most of the fixes in this series have to do with error recovery.  They
      include error path handling when the error recovery has to abort, and
      the rediscovery of capabilities (PTP and RoCE) after firmware reset
      that may result in capability changes.
      
      Two other fixes are to reject invalid ETS settings and to validate
      VLAN protocol in the RX path.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1dd271d9
    • Michael Chan's avatar
      bnxt_en: Fix PTP capability discovery · de5bf194
      Michael Chan authored
      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: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de5bf194
    • Michael Chan's avatar
      bnxt_en: Move bnxt_ptp_init() to bnxt_open() · d7859afb
      Michael Chan authored
      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: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7859afb
    • Somnath Kotur's avatar
      bnxt_en: Check abort error state in bnxt_half_open_nic() · 11a39259
      Somnath Kotur authored
      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: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      11a39259
    • Michael Chan's avatar
      bnxt_en: Validate vlan protocol ID on RX packets · 96bdd4b9
      Michael Chan authored
      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: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      96bdd4b9
    • Somnath Kotur's avatar
      bnxt_en: fix error path of FW reset · 3958b1da
      Somnath Kotur authored
      When bnxt_open() fails in the firmware reset path, the driver needs to
      gracefully abort, but it is executing code that should be invoked only
      in the success path.  Define a function to abort FW reset and
      consolidate all error paths to call this new function.
      
      Fixes: dab62e7c ("bnxt_en: Implement faster recovery for firmware fatal error.")
      Signed-off-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3958b1da