bhyvectl: support querying VM pid
Extend bhyvectl(8) to support querying VM pid using the
`--get-vm-pid` flag.
This is useful in monitor mode when the VM pid differs
from the main bhyve(8) process run by the user. Knowing the VM pid
is necessary, for example, to query process resource usage or
trigger ACPI shutdown with SIGTERM.
Of course, it could be obtained by matching the monitor process
children by the process title, but it's a little more complex
and fragile than it could be.
Implement that by adding the "get_vm_pid" IPC command,
and using it to implement `bhyvectl --get-vm-pid`, which
prints the VM PID.
When the VM PID is not known, ESRCH is returned.
[4 lines not shown]
UPDATING: bump __FreeBSD_version to 1501503 for LinuxKPI changes
The size of multiple embedded structs have changed and may lead to
problems (pci_error_handlers in pci_driver, dev_pm_info in struct device).
Allow these changes to be detected by bumping __FreeBSD_version.
(cherry picked from commit e1ad124136deb4f270d4cef759bf9e9debdb17d3)
LinuxKPI: 802.11: Always lock around lkpi_80211_mo_{remove_interface,stop}()
Add the missing locking to another two MO driver downcalls, as drivers
always expect it (e.g. rtw89 by assertion).
Add the lock and might_sleep assertions to the respective lkpi_80211_mo_*
downcalls.
PR: 298417
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D59608
(cherry picked from commit 73166d21bd831db264509cbdce1ab3b63ab5b189)
LinuxKPI: add can_wakeup option and accessor functions
We can implement device_set_wakeup_capable() in the !CONFIG_PM_SLEEP
case; we do not have the infrastructure in place for the CONFIG_PM_SLEEP
case so leave a pr_debug TODO.
Needed by an upcoming wireless driver.
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D58883
(cherry picked from commit a424fb3519ebf8fb972e7ba45ba19df322992b00)
LinuxKPI: add PCI_IRQ_AFFINITY #define
Add the #define for PCI_IRQ_AFFINITY and leave a pr_debug note in
pci_alloc_irq_vectors() that it is unimplemented.
The flag is needed by an upcoming WiFi driver.
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D58881
(cherry picked from commit b589e403a2c3bd2a94fb2ab88cd23255c68a9f05)
LinuxKPI: pci: add pci_select_bars() and pci_msix_vec_count()
For pci_select_bars() we use the LinuxKPI internal information, while
for pci_select_bars() we fall back to the native PCI stack.
Needed by a wifi driver.
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D58878
(cherry picked from commit 55c07af60172b211116be47010fc0831aafc99e8)
LinuxKPI: implement dma_{alloc,free}_{noncoherent,attrs}
We use one to implement the other given direction stays unused.
This is needed by an upcoming wifi driver.
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D58880
(cherry picked from commit c3fa17a6a331db8aad03e9cb89ba97e1811ab381)
LinuxKPI: fix argument type to lkpi_pci_msi_desc_alloc()
lkpi_pci_msi_desc_alloc() takes an unsigned int, not an int.
While here make sure the prototype is visibile in interrupt.h as
well before use to avoid -Wimplicit-function-declaration errors.
Discovered while working on a wireless driver.
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D58879
(cherry picked from commit cfb23b01e269e8a0a84066637b82b746f01b46b4)
LinuxKPI: rcu: add optional condition to list_for_each_entry_rcu()
list_for_each_entry_rcu() can take an optional condition. Add the
macro argument so code remains compiling but do not do anything with
it just yet.
Leave comments as list_for_each_entry_rcu() likely should have a
different implementation.
Sponsored by: The FreeBSD Foundation
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D59292
(cherry picked from commit e975ce86ff11a330128f5b21c7cd11c28d3aff87)
mlx5: remove init_timer()
The init_timer() was there from day one in (dc7e38ac4da50). It was
never needed as the setup_timer() below already did more than just
that part of the job.
This is part of trying to clear up the Linux pre-4.15 timer KPI
from LinuxKPI.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D59681
(cherry picked from commit 3769ee9bc4167d4f508ba4f14cf544dedf7c520e)
mlx4: convert to timer_setup() Linux KPI
The Linux driver switched away from using this timer in e22979d96a55d.
Locally adjust the code to use timer_setup/from_timer in order to get
us out of Linux version 4.15 (and earlier) KPIs.
Also, right away, apply 41cb08555c416 from_timer -> timer_container_of.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D59680
(cherry picked from commit 871c09c9b47eb0ef0f17a5a1fc2299dba7693516)
LinuxKPI: add #include of rculist.h to ethtool.h for Linux conformance
Add #include rculist.h to ethtool.h to fullfill expectations of
Linux drivers without having to modify them.
Reviewed by: dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D58874
(cherry picked from commit 4570a1bf760a3cd63eb7dd9e3ebbc3cf103bda4d)
bhyveload: do not hang on EOF from console input
Currently, when bhyveload(8) fails to boot the guest,
it drops into the loader prompt waiting for user input.
This behaviour is inconvenient when using bhyveload(8) from
scripts.
Make it exit when it receives EOF from console input.
PR: 286289
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59226
bhyve: fix byte order for manually set NVMe eui64
Manually specified eui64 value gets converted to big endian twice:
first using htobe64() and then using be64enc(). On little-endian hosts
that results in a little-endian value instead of a big-endian.
Fix by removing htobe64() for a user submitted value.
Fixes: 409a80e5a434 ("bhyve: Create EUI64 for NVMe namespaces")
Reviewed by: chuck
Relnotes: yes
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D59080
(cherry picked from commit 8bd30a72e7012126a1c8d52b3ba32f844a88f8dc)
clntrdma.h: Add a field to rpcrdma_xprt
Add a maxsegs field to rpcrdma_xprt, which is used to set
the number of segments allowed for a chunk based on device
attributes.
This commit should not affect non-RDMA behaviour.
MFC after: 3 months
Fixes: 884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
clnt_bck.c: Fix the "glue" for the nfsrdma.ko module
Without this patch, the code failed to acquire the error
return for clnt_bck_rdma_send() and could use "error" uninitialized.
No semantics change for non-RDMA NFS service.
MFC after: 3 months
Fixes: 7144a1d58c5c ("nfsd: Add glue for the nfsrdma.ko module")
bnxt: Initialize RSS with the common key
Use rss_getkey() for the initial VNIC key instead of generating a
per-attachment private key. Preserve the writable rss_key sysctl,
its override lifetime, the hardware DMA representation, and all hash
and indirection settings.
Reviewed by: gallatin
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59795
qlnx: Report the programmed RSS key and hash types
Implement SIOCGIFRSSKEY and SIOCGIFRSSHASH for qlnxe and qlnxev using
the cached vport RSS configuration. This lets hn(4) synchronize its
synthetic RSS configuration with the VF without assuming that every
driver programs all of the common RSS hash selections.
Serialize the queries with the device lock and reject them while the
interface is not running. Convert the firmware request's key words back
into network byte order and translate the six representable IPv4/IPv6
TCP/UDP hash selections. Report no hashing when RSS is disabled, including
the driver's single-queue configuration.
For VFs, require a successful RSS extension response from every hardware
function. The overall vport-update reply can succeed while its RSS TLV
is missing or rejected; recording that result prevents reporting an
unconfirmed configuration. Invalidate the confirmation before each RSS
request. Leave existing vport-update return semantics, queue setup, and
the receive datapath unchanged.
[5 lines not shown]