Skip to content
  1. Jul 20, 2023
  2. Jul 19, 2023
  3. Jul 18, 2023
    • Geetha sowjanya's avatar
      octeontx2-pf: Dont allocate BPIDs for LBK interfaces · 8fcd7c7b
      Geetha sowjanya authored
      
      
      Current driver enables backpressure for LBK interfaces.
      But these interfaces do not support this feature.
      Hence, this patch fixes the issue by skipping the
      backpressure configuration for these interfaces.
      
      Fixes: 75f36270 ("octeontx2-pf: Support to enable/disable pause frames via ethtool").
      Signed-off-by: default avatarGeetha sowjanya <gakula@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Link: https://lore.kernel.org/r/20230716093741.28063-1-gakula@marvell.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      8fcd7c7b
    • Ido Schimmel's avatar
      vrf: Fix lockdep splat in output path · 2033ab90
      Ido Schimmel authored
      
      
      Cited commit converted the neighbour code to use the standard RCU
      variant instead of the RCU-bh variant, but the VRF code still uses
      rcu_read_lock_bh() / rcu_read_unlock_bh() around the neighbour lookup
      code in its IPv4 and IPv6 output paths, resulting in lockdep splats
      [1][2]. Can be reproduced using [3].
      
      Fix by switching to rcu_read_lock() / rcu_read_unlock().
      
      [1]
      =============================
      WARNING: suspicious RCU usage
      6.5.0-rc1-custom-g9c099e6dbf98 #403 Not tainted
      -----------------------------
      include/net/neighbour.h:302 suspicious rcu_dereference_check() usage!
      
      other info that might help us debug this:
      
      rcu_scheduler_active = 2, debug_locks = 1
      2 locks held by ping/183:
       #0: ffff888105ea1d80 (sk_lock-AF_INET){+.+.}-{0:0}, at: raw_sendmsg+0xc6c/0x33c0
       #1: ffffffff85b46820 (rcu_read_lock_bh){....}-{1:2}, at: vrf_output+0x2e3/0x2030
      
      stack backtrace:
      CPU: 0 PID: 183 Comm: ping Not tainted 6.5.0-rc1-custom-g9c099e6dbf98 #403
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc37 04/01/2014
      Call Trace:
       <TASK>
       dump_stack_lvl+0xc1/0xf0
       lockdep_rcu_suspicious+0x211/0x3b0
       vrf_output+0x1380/0x2030
       ip_push_pending_frames+0x125/0x2a0
       raw_sendmsg+0x200d/0x33c0
       inet_sendmsg+0xa2/0xe0
       __sys_sendto+0x2aa/0x420
       __x64_sys_sendto+0xe5/0x1c0
       do_syscall_64+0x38/0x80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      [2]
      =============================
      WARNING: suspicious RCU usage
      6.5.0-rc1-custom-g9c099e6dbf98 #403 Not tainted
      -----------------------------
      include/net/neighbour.h:302 suspicious rcu_dereference_check() usage!
      
      other info that might help us debug this:
      
      rcu_scheduler_active = 2, debug_locks = 1
      2 locks held by ping6/182:
       #0: ffff888114b63000 (sk_lock-AF_INET6){+.+.}-{0:0}, at: rawv6_sendmsg+0x1602/0x3e50
       #1: ffffffff85b46820 (rcu_read_lock_bh){....}-{1:2}, at: vrf_output6+0xe9/0x1310
      
      stack backtrace:
      CPU: 0 PID: 182 Comm: ping6 Not tainted 6.5.0-rc1-custom-g9c099e6dbf98 #403
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc37 04/01/2014
      Call Trace:
       <TASK>
       dump_stack_lvl+0xc1/0xf0
       lockdep_rcu_suspicious+0x211/0x3b0
       vrf_output6+0xd32/0x1310
       ip6_local_out+0xb4/0x1a0
       ip6_send_skb+0xbc/0x340
       ip6_push_pending_frames+0xe5/0x110
       rawv6_sendmsg+0x2e6e/0x3e50
       inet_sendmsg+0xa2/0xe0
       __sys_sendto+0x2aa/0x420
       __x64_sys_sendto+0xe5/0x1c0
       do_syscall_64+0x38/0x80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      [3]
      #!/bin/bash
      
      ip link add name vrf-red up numtxqueues 2 type vrf table 10
      ip link add name swp1 up master vrf-red type dummy
      ip address add 192.0.2.1/24 dev swp1
      ip address add 2001:db8:1::1/64 dev swp1
      ip neigh add 192.0.2.2 lladdr 00:11:22:33:44:55 nud perm dev swp1
      ip neigh add 2001:db8:1::2 lladdr 00:11:22:33:44:55 nud perm dev swp1
      ip vrf exec vrf-red ping 192.0.2.2 -c 1 &> /dev/null
      ip vrf exec vrf-red ping6 2001:db8:1::2 -c 1 &> /dev/null
      
      Fixes: 09eed119 ("neighbour: switch to standard rcu, instead of rcu_bh")
      Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
      Link: https://lore.kernel.org/netdev/CA+G9fYtEr-=GbcXNDYo3XOkwR+uYgehVoDjsP0pFLUpZ_AZcyg@mail.gmail.com/
      
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20230715153605.4068066-1-idosch@nvidia.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      2033ab90
    • Paolo Abeni's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 03803083
      Paolo Abeni authored
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2023-07-14 (ice)
      
      This series contains updates to ice driver only.
      
      Petr Oros removes multiple calls made to unregister netdev and
      devlink_port.
      
      Michal fixes null pointer dereference that can occur during reload.
      ====================
      
      Link: https://lore.kernel.org/r/20230714201041.1717834-1-anthony.l.nguyen@intel.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      03803083
    • Fedor Ross's avatar
      can: mcp251xfd: __mcp251xfd_chip_set_mode(): increase poll timeout · 9efa1a54
      Fedor Ross authored
      
      
      The mcp251xfd controller needs an idle bus to enter 'Normal CAN 2.0
      mode' or . The maximum length of a CAN frame is 736 bits (64 data
      bytes, CAN-FD, EFF mode, worst case bit stuffing and interframe
      spacing). For low bit rates like 10 kbit/s the arbitrarily chosen
      MCP251XFD_POLL_TIMEOUT_US of 1 ms is too small.
      
      Otherwise during polling for the CAN controller to enter 'Normal CAN
      2.0 mode' the timeout limit is exceeded and the configuration fails
      with:
      
      | $ ip link set dev can1 up type can bitrate 10000
      | [  731.911072] mcp251xfd spi2.1 can1: Controller failed to enter mode CAN 2.0 Mode (6) and stays in Configuration Mode (4) (con=0x068b0760, osc=0x00000468).
      | [  731.927192] mcp251xfd spi2.1 can1: CRC read error at address 0x0e0c (length=4, data=00 00 00 00, CRC=0x0000) retrying.
      | [  731.938101] A link change request failed with some changes committed already. Interface can1 may have been left with an inconsistent configuration, please check.
      | RTNETLINK answers: Connection timed out
      
      Make MCP251XFD_POLL_TIMEOUT_US timeout calculation dynamic. Use
      maximum of 1ms and bit time of 1 full 64 data bytes CAN-FD frame in
      EFF mode, worst case bit stuffing and interframe spacing at the
      current bit rate.
      
      For easier backporting define the macro MCP251XFD_FRAME_LEN_MAX_BITS
      that holds the max frame length in bits, which is 736. This can be
      replaced by can_frame_bits(true, true, true, true, CANFD_MAX_DLEN) in
      a cleanup patch later.
      
      Fixes: 55e5b97f ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN")
      Signed-off-by: default avatarFedor Ross <fedor.ross@ifm.com>
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/all/20230717-mcp251xfd-fix-increase-poll-timeout-v5-1-06600f34c684@pengutronix.de
      
      
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      9efa1a54
    • Ahmed Zaki's avatar
      iavf: fix reset task race with iavf_remove() · c34743da
      Ahmed Zaki authored
      
      
      The reset task is currently scheduled from the watchdog or adminq tasks.
      First, all direct calls to schedule the reset task are replaced with the
      iavf_schedule_reset(), which is modified to accept the flag showing the
      type of reset.
      
      To prevent the reset task from starting once iavf_remove() starts, we need
      to check the __IAVF_IN_REMOVE_TASK bit before we schedule it. This is now
      easily added to iavf_schedule_reset().
      
      Finally, remove the check for IAVF_FLAG_RESET_NEEDED in the watchdog task.
      It is redundant since all callers who set the flag immediately schedules
      the reset task.
      
      Fixes: 3ccd54ef ("iavf: Fix init state closure on remove")
      Fixes: 14756b2a ("iavf: Fix __IAVF_RESETTING state usage")
      Signed-off-by: default avatarAhmed Zaki <ahmed.zaki@intel.com>
      Signed-off-by: default avatarMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: default avatarRafal Romanowski <rafal.romanowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      c34743da
    • Ahmed Zaki's avatar
      iavf: fix a deadlock caused by rtnl and driver's lock circular dependencies · d1639a17
      Ahmed Zaki authored
      
      
      A driver's lock (crit_lock) is used to serialize all the driver's tasks.
      Lockdep, however, shows a circular dependency between rtnl and
      crit_lock. This happens when an ndo that already holds the rtnl requests
      the driver to reset, since the reset task (in some paths) tries to grab
      rtnl to either change real number of queues of update netdev features.
      
        [566.241851] ======================================================
        [566.241893] WARNING: possible circular locking dependency detected
        [566.241936] 6.2.14-100.fc36.x86_64+debug #1 Tainted: G           OE
        [566.241984] ------------------------------------------------------
        [566.242025] repro.sh/2604 is trying to acquire lock:
        [566.242061] ffff9280fc5ceee8 (&adapter->crit_lock){+.+.}-{3:3}, at: iavf_close+0x3c/0x240 [iavf]
        [566.242167]
                     but task is already holding lock:
        [566.242209] ffffffff9976d350 (rtnl_mutex){+.+.}-{3:3}, at: iavf_remove+0x6b5/0x730 [iavf]
        [566.242300]
                     which lock already depends on the new lock.
      
        [566.242353]
                     the existing dependency chain (in reverse order) is:
        [566.242401]
                     -> #1 (rtnl_mutex){+.+.}-{3:3}:
        [566.242451]        __mutex_lock+0xc1/0xbb0
        [566.242489]        iavf_init_interrupt_scheme+0x179/0x440 [iavf]
        [566.242560]        iavf_watchdog_task+0x80b/0x1400 [iavf]
        [566.242627]        process_one_work+0x2b3/0x560
        [566.242663]        worker_thread+0x4f/0x3a0
        [566.242696]        kthread+0xf2/0x120
        [566.242730]        ret_from_fork+0x29/0x50
        [566.242763]
                     -> #0 (&adapter->crit_lock){+.+.}-{3:3}:
        [566.242815]        __lock_acquire+0x15ff/0x22b0
        [566.242869]        lock_acquire+0xd2/0x2c0
        [566.242901]        __mutex_lock+0xc1/0xbb0
        [566.242934]        iavf_close+0x3c/0x240 [iavf]
        [566.242997]        __dev_close_many+0xac/0x120
        [566.243036]        dev_close_many+0x8b/0x140
        [566.243071]        unregister_netdevice_many_notify+0x165/0x7c0
        [566.243116]        unregister_netdevice_queue+0xd3/0x110
        [566.243157]        iavf_remove+0x6c1/0x730 [iavf]
        [566.243217]        pci_device_remove+0x33/0xa0
        [566.243257]        device_release_driver_internal+0x1bc/0x240
        [566.243299]        pci_stop_bus_device+0x6c/0x90
        [566.243338]        pci_stop_and_remove_bus_device+0xe/0x20
        [566.243380]        pci_iov_remove_virtfn+0xd1/0x130
        [566.243417]        sriov_disable+0x34/0xe0
        [566.243448]        ice_free_vfs+0x2da/0x330 [ice]
        [566.244383]        ice_sriov_configure+0x88/0xad0 [ice]
        [566.245353]        sriov_numvfs_store+0xde/0x1d0
        [566.246156]        kernfs_fop_write_iter+0x15e/0x210
        [566.246921]        vfs_write+0x288/0x530
        [566.247671]        ksys_write+0x74/0xf0
        [566.248408]        do_syscall_64+0x58/0x80
        [566.249145]        entry_SYSCALL_64_after_hwframe+0x72/0xdc
        [566.249886]
                       other info that might help us debug this:
      
        [566.252014]  Possible unsafe locking scenario:
      
        [566.253432]        CPU0                    CPU1
        [566.254118]        ----                    ----
        [566.254800]   lock(rtnl_mutex);
        [566.255514]                                lock(&adapter->crit_lock);
        [566.256233]                                lock(rtnl_mutex);
        [566.256897]   lock(&adapter->crit_lock);
        [566.257388]
                        *** DEADLOCK ***
      
      The deadlock can be triggered by a script that is continuously resetting
      the VF adapter while doing other operations requiring RTNL, e.g:
      
      	while :; do
      		ip link set $VF up
      		ethtool --set-channels $VF combined 2
      		ip link set $VF down
      		ip link set $VF up
      		ethtool --set-channels $VF combined 4
      		ip link set $VF down
      	done
      
      Any operation that triggers a reset can substitute "ethtool --set-channles"
      
      As a fix, add a new task "finish_config" that do all the work which
      needs rtnl lock. With the exception of iavf_remove(), all work that
      require rtnl should be called from this task.
      
      As for iavf_remove(), at the point where we need to call
      unregister_netdevice() (and grab rtnl_lock), we make sure the finish_config
      task is not running (cancel_work_sync()) to safely grab rtnl. Subsequent
      finish_config work cannot restart after that since the task is guarded
      by the __IAVF_IN_REMOVE_TASK bit in iavf_schedule_finish_config().
      
      Fixes: 5ac49f3c ("iavf: use mutexes for locking of critical sections")
      Signed-off-by: default avatarAhmed Zaki <ahmed.zaki@intel.com>
      Signed-off-by: default avatarMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: default avatarRafal Romanowski <rafal.romanowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      d1639a17
    • Marcin Szycik's avatar
      Revert "iavf: Do not restart Tx queues after reset task failure" · d916d273
      Marcin Szycik authored
      
      
      This reverts commit 08f1c147.
      
      Netdev is no longer being detached during reset, so this fix can be
      reverted. We leave the removal of "hacky" IFF_UP flag update.
      
      Signed-off-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Signed-off-by: default avatarMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: default avatarRafal Romanowski <rafal.romanowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      d916d273