freebsd-dev/sys
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
..
amd64 Add FIB_ALGO to GENERIC on amd64/arm64. 2021-04-24 23:22:58 +00:00
arm arm: Add no-cftconvert for sdma-imx6 files 2021-04-14 15:43:37 +02:00
arm64 Add FIB_ALGO to GENERIC on amd64/arm64. 2021-04-24 23:22:58 +00:00
bsm
cam cam: make sure to clear even more CCBs allocated on the stack 2021-04-11 15:24:22 +01:00
cddl fbt: Remove some handling for multiple CTF containers 2021-04-02 17:49:13 -04:00
compat linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() 2021-04-26 08:25:33 -07:00
conf newvers.sh: better regexp for the FreeBSD_version line 2021-04-22 11:45:12 -06:00
contrib zfs: restore copyright disclaimer change from 4b84b4cca 2021-04-26 22:16:50 +02:00
crypto ossl: Don't encryt/decrypt too much data for chacha20. 2021-04-01 15:49:07 -07:00
ddb ddb: replace watchpoint set/clear functions 2021-03-29 12:05:44 -03:00
dev cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-04-26 14:09:59 -07:00
dts dts: Bump the freebsd branding version to 5.10 2021-03-23 15:02:21 +01:00
fs nfscl: return delegations in the NFS VOP_RECLAIM() 2021-04-25 17:57:55 -07:00
gdb gdb: report specific stop reason for watchpoints 2021-03-30 11:36:41 -03:00
geom gmirror: Pre-allocate the timeout event structure 2021-03-11 15:45:15 -05:00
gnu Remove the old dts imported tree. 2021-01-15 20:09:55 +01:00
i386 Create VM_MEMATTR_DEVICE on all architectures 2021-04-12 06:15:31 +00:00
isa Remove more remnants of sio(4) 2021-04-07 14:33:02 -04:00
kern imgact_elf: Ensure that the return value in parse_notes is initialized 2021-04-26 14:53:16 -04:00
kgssapi opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
libkern x86: remove gcov kernel support 2021-04-02 15:41:51 +03:00
mips OCF: Remove support for asymmetric cryptographic operations. 2021-04-12 14:28:43 -07:00
modules modules: remove stale if_wg reference 2021-04-15 19:59:13 -05:00
net pfsync: Expose PFSYNCF_OK flag to userspace 2021-04-26 14:31:17 +02:00
net80211 net80211: prefix get_random_bytes() with net80211_ 2021-03-24 22:16:09 +00:00
netgraph ng_ubt: Block attachment of uninitialized Intel Wireless 7265 2021-04-15 17:26:32 +03:00
netinet sctp: improve handling of illegal packets containing INIT chunks 2021-04-26 10:43:58 +02:00
netinet6 Re-enable network ioctls in capability mode 2021-04-23 09:22:49 -04:00
netipsec Revert "SO_RERROR indicates that receive buffer overflows should be handled as errors." 2021-02-08 22:32:32 +00:00
netpfil pf: Fix parsing of long table names 2021-04-26 18:08:15 +02:00
netsmb
nfs Fix panic when using BOOTP to resolve root path. 2021-03-28 14:02:40 -05:00
nfsclient nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nfsserver nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nlm
ofed LinuxKPI/OFED: (re)move inetdevice.h implementation 2021-03-30 14:40:46 +00:00
opencrypto OCF: Remove support for asymmetric cryptographic operations. 2021-04-12 14:28:43 -07:00
powerpc opal_console: fix serial console output corruption on powerpc64 2021-04-16 20:10:09 -03:00
riscv riscv: Assert that SUM is not set in SSTATUS for exceptions. 2021-04-21 13:57:20 -07:00
rpc nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
security tcp_input/syncache: acquire only read lock on PCB for SYN,!ACK packets 2021-04-12 08:25:31 -07:00
sys linuxkpi: Implement atomic_dec_and_lock_irqsave() 2021-04-26 08:15:49 -07:00
teken
tests Add IPv4 fib lookup performance tests with uniform keys. 2021-03-30 14:32:28 +01:00
tools newbus: remove support for SINGLETON 2021-04-26 11:41:08 -06:00
ufs b_vflags update requries bufobj lock 2021-04-15 15:47:42 +03:00
vm sysctl vm.objects: report backing object and swap use 2021-04-19 21:32:01 +03:00
x86 amd64: Add MD bits for KASAN 2021-04-13 17:42:20 -04:00
xdr
xen xen: move x86-specific xen_vector_callback_enabled to sys/x86 2021-03-15 14:20:21 +01:00
Makefile