freebsd-skq/sys
Marius Strobl f855ec814d Make taskqgroup_attach{,_cpu}(9) work across architectures
So far, intr_{g,s}etaffinity(9) take a single int for identifying
a device interrupt. This approach doesn't work on all architectures
supported, as a single int isn't sufficient to globally specify a
device interrupt. In particular, with multiple interrupt controllers
in one system as found on e. g. arm and arm64 machines, an interrupt
number as returned by rman_get_start(9) may be only unique relative
to the bus and, thus, interrupt controller, a certain device hangs
off from.
In turn, this makes taskqgroup_attach{,_cpu}(9) and - internal to
the gtaskqueue implementation - taskqgroup_attach_deferred{,_cpu}()
not work across architectures. Yet in turn, iflib(4) as gtaskqueue
consumer so far doesn't fit architectures where interrupt numbers
aren't globally unique.
However, at least for intr_setaffinity(..., CPU_WHICH_IRQ, ...) as
employed by the gtaskqueue implementation to bind an interrupt to a
particular CPU, using bus_bind_intr(9) instead is equivalent from
a functional point of view, with bus_bind_intr(9) taking the device
and interrupt resource arguments required for uniquely specifying a
device interrupt.
Thus, change the gtaskqueue implementation to employ bus_bind_intr(9)
instead and intr_{g,s}etaffinity(9) to take the device and interrupt
resource arguments required respectively. This change also moves
struct grouptask from <sys/_task.h> to <sys/gtaskqueue.h> and wraps
struct gtask along with the gtask_fn_t typedef into #ifdef _KERNEL
as userland likes to include <sys/_task.h> or indirectly drags it
in - for better or worse also with _KERNEL defined -, which with
device_t and struct resource dependencies otherwise is no longer
as easily possible now.
The userland inclusion problem probably can be improved a bit by
introducing a _WANT_TASK (as well as a _WANT_MOUNT) akin to the
existing _WANT_PRISON etc., which is orthogonal to this change,
though, and likely needs an exp-run.

While at it:
- Change the gt_cpu member in the grouptask structure to be of type
  int as used elswhere for specifying CPUs (an int16_t may be too
  narrow sooner or later),
- move the gtaskqueue_enqueue_fn typedef from <sys/gtaskqueue.h> to
  the gtaskqueue implementation as it's only used and needed there,
- change the GTASK_INIT macro to use "gtask" rather than "task" as
  argument given that it actually operates on a struct gtask rather
  than a struct task, and
- let subr_gtaskqueue.c consistently use __func__ to print functions
  names.

Reported by:	mmel
Reviewed by:	mmel
Differential Revision:	https://reviews.freebsd.org/D19139
2019-02-12 21:23:59 +00:00
..
amd64 Implement Address Space Layout Randomization (ASLR) 2019-02-10 17:19:45 +00:00
arm Add sensors support for AXP803/AXP813. Sensor values such as 2019-02-11 14:31:19 +00:00
arm64 arm64: Fix compile when removing SOC_ROCKCHIP_* options 2019-02-10 08:14:06 +00:00
bsm Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
cam CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c 2019-02-11 22:09:26 +00:00
cddl s/Maximal/Maximum/ in sysctl description. 2019-02-04 20:09:22 +00:00
compat Make taskqgroup_attach{,_cpu}(9) work across architectures 2019-02-12 21:23:59 +00:00
conf Fix flags used when compiling kern_kcov.c and subr_coverage.c. 2019-02-11 15:38:05 +00:00
contrib Remove empty files 2019-02-12 08:16:05 +00:00
crypto Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
ddb ddb: Print the thread's pcb in 'show thread' 2019-02-09 21:08:19 +00:00
dev Remove entry for Intenso product. 2019-02-12 02:55:25 +00:00
dts Adapt FreeBSD specific DT stub for Jetson TK1 board to be consistent with 2019-02-06 06:03:44 +00:00
fs Un null_vptocnp(), cache vp->v_mount and use it for null_nodeget() call. 2019-02-08 08:20:18 +00:00
gdb
geom geom_uzip(4): set 'gp != NULL' assertion on top of the function 2019-01-26 17:17:25 +00:00
gnu Import DTS from Linux 4.20 2019-01-11 09:40:34 +00:00
i386 Implement Address Space Layout Randomization (ASLR) 2019-02-10 17:19:45 +00:00
isa
kern Make taskqgroup_attach{,_cpu}(9) work across architectures 2019-02-12 21:23:59 +00:00
kgssapi
libkern
mips Performance improvements for octe(4): 2019-02-10 20:13:59 +00:00
modules arm64: dtb: allwinner: Add the new pine64-lts dtb file to the build 2019-02-07 18:07:17 +00:00
net Make taskqgroup_attach{,_cpu}(9) work across architectures 2019-02-12 21:23:59 +00:00
net80211 net80211(4): hide casts for 'i_seq' field offset calculation inside 2019-02-10 23:58:56 +00:00
netgraph Remove remnants of byte order manipulation, back when FreeBSD stack 2019-02-09 03:00:00 +00:00
netinet garp: Fix vnet related panic for gratuitous arp 2019-02-12 21:22:57 +00:00
netinet6 New pfil(9) KPI together with newborn pfil API and control utility. 2019-01-31 23:01:03 +00:00
netipsec Remove unused argument to priv_check_cred. 2018-12-11 19:32:16 +00:00
netpfil Remove `set' field from state structure and use set from parent rule. 2019-02-11 18:10:55 +00:00
netsmb Remove unused argument to priv_check_cred. 2018-12-11 19:32:16 +00:00
nfs
nfsclient
nfsserver
nlm
ofed Mechanical cleanup of epoch(9) usage in network stack. 2019-01-09 01:11:19 +00:00
opencrypto As struct cryptop is wrapped in #ifdef _KERNEL, userland doesn't 2019-02-10 21:27:03 +00:00
powerpc [ppc64] prevent infinite loop on icache sync 2019-02-12 11:29:03 +00:00
riscv riscv: default to non-executable stack 2019-02-06 19:22:15 +00:00
rpc Add kern.rpc.gss.client_max, to make it possible to bump it easily. 2018-12-15 11:32:11 +00:00
security Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
sparc64 Make iflib a loadable module. 2019-01-31 19:05:56 +00:00
sys Make taskqgroup_attach{,_cpu}(9) work across architectures 2019-02-12 21:23:59 +00:00
teken My recent fix for programmable function keys in syscons only worked 2019-02-05 16:59:29 +00:00
tests Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
tools make_dtb.sh: Use $CPP instead of assuming that cpp is in $PATH 2018-12-14 23:53:28 +00:00
ufs This bug was introduced with the change to use softdep_bp_to_mp() in 2019-01-28 21:36:45 +00:00
vm UMA: unsign some variables related to allocation in hash_alloc(). 2019-02-12 04:33:05 +00:00
x86 Port sysctl kern.elf32.read_exec from amd64 to i386. 2019-02-07 02:17:34 +00:00
xdr
xen xen: introduce a new way to setup event channel upcall 2019-01-30 11:34:52 +00:00
Makefile