WSL2-Linux-Kernel/drivers/infiniband/hw/hfi1
Mike Marciniszyn 38fd98afee IB/hfi1: Add atomic triggered sleep/wakeup
When running iperf in a two host configuration the following trace can
occur:

[  319.728730] NETDEV WATCHDOG: ib0 (hfi1): transmit queue 0 timed out

The issue happens because the current implementation relies on the netif
txq being stopped to control the flushing of the tx list.

There are two resources that the transmit logic can wait on and stop the
txq:
- SDMA descriptors
- Ring space to hold completions

The ring space is tested on the sending side and relieved when the ring is
consumed in the napi tx reaping.

Unfortunately, that reaping can run conncurrently with the workqueue
flushing of the txlist.  If the txq is started just before the workitem
executes, the txlist will never be flushed, leading to the txq being
stuck.

Fix by:
- Adding sleep/wakeup wrappers
  * Use an atomic to control the call to the netif routines inside the
    wrappers

- Use another atomic to record ring space exhaustion
  * Only wakeup when the a ring space exhaustion has happened and it
    relieved

Add additional wrappers to clarify the ring space resource handling.

Fixes: d99dc602e2 ("IB/hfi1: Add functions to transmit datagram ipoib packets")
Link: https://lore.kernel.org/r/20200623204327.108092.4024.stgit@awfm-01.aw.intel.com
Reviewed-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2020-06-24 16:13:38 -03:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile IB/hfi1: Add functions to receive accelerated ipoib packets 2020-05-21 11:23:56 -03:00
affinity.c IB/hfi1: Add interrupt handler functions for accelerated ipoib 2020-05-21 11:23:56 -03:00
affinity.h IB/hfi1: Add interrupt handler functions for accelerated ipoib 2020-05-21 11:23:56 -03:00
aspm.c IB/hfi1: Reduce excessive aspm inlines 2019-06-28 22:34:26 -03:00
aspm.h IB/hfi1: Reduce excessive aspm inlines 2019-06-28 22:34:26 -03:00
chip.c IB/hfi1: Fix spelling mistake "enought" -> "enough" 2020-05-29 15:27:51 -03:00
chip.h IB/hfi1: Add interrupt handler functions for accelerated ipoib 2020-05-21 11:23:56 -03:00
chip_registers.h IB/hfi1: Add RcvShortLengthErrCnt to hfi1stats 2020-01-10 10:57:17 -04:00
common.h IB/hfi1: Enable the transmit side of the datagram ipoib netdev 2020-05-21 11:23:58 -03:00
debugfs.c IB/hfi1: Fix module use count flaw due to leftover module put calls 2020-06-24 15:54:08 -03:00
debugfs.h infiniband: hfi1: drop crazy DEBUGFS_SEQ_FILE_CREATE() macro 2019-01-24 09:22:29 -07:00
device.c infiniband: utilize the new cdev_set_parent function 2017-03-21 06:44:33 +01:00
device.h
driver.c IB/hfi1: Add packet histogram trace event 2020-05-21 11:23:57 -03:00
efivar.c infiniband: hfi1: Use EFI GetVariable only when available 2020-02-23 21:59:42 +01:00
efivar.h
eprom.c IB/hfi1: Check eeprom config partition validity 2017-09-27 11:10:36 -04:00
eprom.h IB/hfi1: Add ability to read platform config from the EPROM 2016-10-02 08:42:20 -04:00
exp_rcv.c IB/hfi1: Remove WARN_ON when freeing expected receive groups 2019-04-03 15:27:30 -03:00
exp_rcv.h IB/hfi1: Cleanup of exp_rcv 2018-05-24 09:39:25 -06:00
fault.c IB/hfi1: Use scnprintf() for avoiding potential buffer overflow 2020-03-26 15:06:14 -03:00
fault.h IB/hfi1: Rework fault injection machinery 2018-05-09 15:53:30 -04:00
file_ops.c IB/hfi1: Remove module parameter for KDETH qpns 2020-05-21 11:23:54 -03:00
firmware.c IB/hfi1: Fix infinite loop in 8051 command error path 2018-01-05 13:34:55 -05:00
hfi.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
init.c IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
intr.c IB/hfi1: Allow MgmtAllowed on B2B setups 2017-11-13 15:53:56 -05:00
iowait.c IB/hfi1: Don't cancel unused work item 2020-01-03 16:41:51 -04:00
iowait.h RDMA/hfi1: Fix trivial mis-spelling of 'descriptor' 2020-06-15 15:56:54 -03:00
ipoib.h IB/hfi1: Add atomic triggered sleep/wakeup 2020-06-24 16:13:38 -03:00
ipoib_main.c IB/hfi1: Add rx functions for dummy netdev 2020-05-21 11:23:56 -03:00
ipoib_rx.c IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
ipoib_tx.c IB/hfi1: Add atomic triggered sleep/wakeup 2020-06-24 16:13:38 -03:00
mad.c RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
mad.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
mmu_rb.c mmap locking API: convert mmap_sem comments 2020-06-09 09:39:14 -07:00
mmu_rb.h IB/hfi1: Don't remove RB entry when not needed. 2017-06-27 16:56:33 -04:00
msix.c IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
msix.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
netdev.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
netdev_rx.c IB/hfi1: Restore kfree in dummy_netdev cleanup 2020-06-24 15:54:08 -03:00
opa_compat.h IB/hfi1: Document phys port state bits not used in IB 2017-08-22 14:22:37 -04:00
opfn.c IB/hfi1: Add TID RDMA retry timer 2019-02-05 18:07:43 -05:00
opfn.h IB/hfi1: Make opfn.h self sufficient 2019-04-24 11:31:49 -03:00
pcie.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
pio.c Linux 5.2-rc6 2019-06-28 21:18:23 -03:00
pio.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
pio_copy.c IB/hfi1: Optimize pio_buf and send_context structs 2016-11-15 16:37:27 -05:00
platform.c IB/hfi1: remove redundant assignment to variable ret 2019-11-25 10:31:47 -04:00
platform.h IB/hfi1: Define platform_config_table_limits once 2016-12-11 15:29:42 -05:00
qp.c IB/ipoib: Increase ipoib Datagram mode MTU's upper limit 2020-05-21 11:23:55 -03:00
qp.h IB/hfi1: Add the dual leg code 2019-02-05 18:07:44 -05:00
qsfp.c IB/{hfi1, rdmavt}: Fix memory leak in hfi1_alloc_devdata() upon failure 2018-05-03 15:24:48 -04:00
qsfp.h IB/hfi1: Fetch monitor values on-demand for CableInfo query 2016-08-22 14:31:41 -04:00
rc.c IB/hfi1: use true,false for bool variable 2020-01-03 19:13:59 -04:00
rc.h IB/hfi1: Delay the release of destination mr for TID RDMA WRITE DATA 2019-04-03 15:27:30 -03:00
ruc.c IB/{rdmavt, hfi1): Miscellaneous comment fixes 2019-04-24 11:31:48 -03:00
sdma.c RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
sdma.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
sdma_txreq.h IB/hfi1: Prioritize the sending of ACK packets 2019-02-05 18:07:44 -05:00
sysfs.c IB/hfi1: Call kobject_put() when kobject_init_and_add() fails 2020-03-27 13:13:36 -03:00
tid_rdma.c IB/hfi1: Remove module parameter for KDETH qpns 2020-05-21 11:23:54 -03:00
tid_rdma.h IB/hfi1: Calculate flow weight based on QP MTU for TID RDMA 2019-11-06 13:15:36 -04:00
trace.c IB/hfi1: Add packet histogram trace event 2020-05-21 11:23:57 -03:00
trace.h IB/hfi1: Add static trace for OPFN 2019-01-31 11:37:40 -05:00
trace_ctxts.h IB/hfi1: Add packet histogram trace event 2020-05-21 11:23:57 -03:00
trace_dbg.h IB/hfi1: Fix two format strings 2019-03-28 11:03:49 -03:00
trace_ibhdrs.h IB/hfi1: Add missing INVALIDATE opcodes for trace 2019-06-28 22:34:26 -03:00
trace_iowait.h IB/hfi1: Add static trace for iowait 2018-09-30 19:21:12 -06:00
trace_misc.h IB/hfi1: Add traces for TID operations 2017-06-27 16:58:13 -04:00
trace_mmu.h IB/hif1: Remove static tracing from SDMA hot path 2017-08-28 19:12:27 -04:00
trace_rc.h IB/hfi1: Add static trace for TID RDMA READ protocol 2019-02-05 17:53:56 -05:00
trace_rx.h IB/hfi1: Add fast and slow handlers for receive context 2020-01-10 10:57:16 -04:00
trace_tid.h ftrace: Rework event_create_dir() 2019-11-27 07:44:25 +01:00
trace_tx.h ftrace: Rework event_create_dir() 2019-11-27 07:44:25 +01:00
uc.c IB/{hfi1, qib, rdmavt}: Put qp in error state when cq is full 2019-06-28 22:34:26 -03:00
ud.c IB/{rdmavt, hfi1, qib}: Add helpers to hide SWQE WR details 2019-06-28 22:34:26 -03:00
user_exp_rcv.c hfi1: get rid of pointless access_ok() 2020-05-29 11:06:32 -04:00
user_exp_rcv.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
user_pages.c mm, tree-wide: rename put_user_page*() to unpin_user_page*() 2020-01-31 10:30:38 -08:00
user_sdma.c IB/hfi1: Fix another case where pq is left on waitlist 2020-05-12 11:47:48 -03:00
user_sdma.h IB/hfi1: Remove unused define 2019-07-22 16:10:48 -03:00
verbs.c RDMA: Remove 'max_map_per_fmr' 2020-06-02 20:32:54 -03:00
verbs.h treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
verbs_txreq.c IB/hfi1: Silence txreq allocation warnings 2019-06-17 21:15:40 -04:00
verbs_txreq.h RDMA/hfi1: Fix trivial mis-spelling of 'descriptor' 2020-06-15 15:56:54 -03:00
vnic.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
vnic_main.c IB/hfi1: Fix hfi1_netdev_rx_init() error handling 2020-06-02 20:32:54 -03:00
vnic_sdma.c net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00