opnsense-src/sys/dev/cxgbe
Navdeep Parhar 43bbae1948 cxgbe(4): Separate the sw- and hw-specific parts of resource allocations
The driver uses both software resources (locks, callouts, memory for
descriptors and for bookkeeping, sysctls, etc.) and hardware resources
(VIs, DMA queues, TCAM entries, etc.) to operate the NIC.  This commit
splits the single *_ALLOCATED flag used to track all these resources
into separate *_SW_ALLOCATED and *_HW_ALLOCATED flags.

This is the simplified pseudocode that now applies to most queues (foo
can be ctrlq/txq/rxq/ofld_txq/ofld_rxq):

/* Idempotent */
alloc_foo
{
	if (!SW_ALLOCATED)
		init_iq/init_eq/init_fl		no-fail sw init
		alloc_iq_fl/alloc_eq/alloc_wrq	may-fail sw alloc
		add_foo_sysctls, etc.		no-fail post-alloc items
	if (!HW_ALLOCATED)
		alloc_iq_fl_hwq/alloc_eq_hwq	hw resource allocation
}

/* Idempotent */
free_foo
{
	if (!HW_ALLOCATED)
		free_iq_fl_hwq/free_eq_hwq	release hw resources
	if (!SW_ALLOCATED)
		free_iq_fl/free_eq/free_wrq	release sw resources
}

The routines that take the driver to FULL_INIT_DONE and VI_INIT_DONE and
back are now all idempotent.  The quiesce routines pay attention to the
HW_ALLOCATED flag and will not wait on the hardware for pidx/cidx
updates and other completions if this flag is not set.

MFC after:	1 month
Sponsored by:	Chelsio Communications
2021-04-26 14:09:59 -07:00
..
common cxgbe(4): Allow a T6 adapter to switch between TOE and NIC TLS mode. 2021-03-25 12:39:41 -07:00
crypto ccr: Disable requests on port 1 when needed to workaround a firmware bug. 2021-03-12 10:59:35 -08:00
cudbg cxgbe(4): unimplemented cudbg routines should return the correct 2020-10-14 08:04:39 +00:00
cxgbei cxgbe: Add a struct sge_ofld_txq type. 2021-03-26 15:19:58 -07:00
firmware cxgbe(4): Allow a T6 adapter to switch between TOE and NIC TLS mode. 2021-03-25 12:39:41 -07:00
iw_cxgbe cxgbe: Add a struct sge_ofld_txq type. 2021-03-26 15:19:58 -07:00
tom cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-04-26 14:09:59 -07:00
adapter.h cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-04-26 14:09:59 -07:00
if_cc.c cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will 2016-09-16 00:08:37 +00:00
if_ccv.c cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will 2016-09-16 00:08:37 +00:00
if_cxl.c cxgbe(4): Add a minimal if_cxl module that pulls in the real driver as 2015-02-06 01:10:04 +00:00
if_cxlv.c Chelsio T4/T5 VF driver. 2016-09-07 18:13:57 +00:00
offload.h cxgbe/t4_tom: Implement tod_pmtu_update. 2021-04-22 14:48:57 -07:00
osdep.h cxgbe(4): make the logging helpers a little more robust. 2021-04-22 15:28:43 -07:00
t4_clip.c cxgbe: Ignore doomed virtual interfaces when updating the clip table. 2021-04-12 14:36:40 -07:00
t4_clip.h Move CLIP table handling out of TOM and into the base driver. 2018-11-29 01:15:53 +00:00
t4_filter.c cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-04-26 14:09:59 -07:00
t4_if.m Use the port device name for the iov device for Chelsio T4/T5 cards. 2016-08-03 17:11:08 +00:00
t4_ioctl.h cxgbe(4): Add a driver ioctl to set the filter mask. 2021-02-19 14:23:58 -08:00
t4_iov.c cxgbe(4): Allow the PF driver to set a VF's MAC address. 2020-11-09 00:08:35 +00:00
t4_l2t.c NIC KTLS for Chelsio T6 adapters. 2019-11-21 19:30:31 +00:00
t4_l2t.h NIC KTLS for Chelsio T6 adapters. 2019-11-21 19:30:31 +00:00
t4_main.c cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-04-26 14:09:59 -07:00
t4_mp_ring.c cxgbe(4): changes in the Tx path to help increase tx coalescing. 2020-07-03 04:44:23 +00:00
t4_mp_ring.h cxgbe(4): changes in the Tx path to help increase tx coalescing. 2020-07-03 04:44:23 +00:00
t4_netmap.c cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-04-26 14:09:59 -07:00
t4_sched.c cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-04-26 14:09:59 -07:00
t4_sge.c cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-04-26 14:09:59 -07:00
t4_smt.c cxgbe(4): Move all control queues to the adapter. 2018-08-11 21:10:08 +00:00
t4_smt.h cxgbe(4): Retire an old check. 2018-06-01 01:05:34 +00:00
t4_tracer.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
t4_vf.c cxgbe(4): Break up t4_read_chip_settings. 2021-02-18 01:22:42 -08:00