History log of /freebsd/sys/dev/pci/pci_iov.c (Results 1 – 25 of 54)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 18250ec6 06-Dec-2024 John Baldwin <jhb@FreeBSD.org>

Replace calls to bus_generic_attach with bus_attach_children

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47675


Revision tags: release/14.2.0
# 6a4f0c06 26-Sep-2024 Val Packett <val@packett.cool>

pci_iov: Add a device_printf if out of bus numbers

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20591


Revision tags: release/13.4.0
# 871b33ad 05-Jun-2024 John Baldwin <jhb@FreeBSD.org>

pci: Consistently use pci_vf_* for suballocated VF memory resources

Some of the bus resource methods were passing these up to the parent
which triggered rman mismatch assertions in INVARIANTS kernel

pci: Consistently use pci_vf_* for suballocated VF memory resources

Some of the bus resource methods were passing these up to the parent
which triggered rman mismatch assertions in INVARIANTS kernels.

Reported by: kp
Reviewed by: imp
Tested by: kp (earlier version)
Differential Revision: https://reviews.freebsd.org/D45406

show more ...


Revision tags: release/14.1.0
# 9dbf5b0e 13-Mar-2024 John Baldwin <jhb@FreeBSD.org>

new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE

The public bus_release_resource() API still accepts both forms, but
the internal kobj method no longer passes the arguments.

new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE

The public bus_release_resource() API still accepts both forms, but
the internal kobj method no longer passes the arguments.
Implementations which need the rid or type now use rman_get_rid() or
rman_get_type() to fetch the value from the allocated resource.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44131

show more ...


# 1b9bcfff 13-Mar-2024 John Baldwin <jhb@FreeBSD.org>

sys: Set the type of allocated bus resources

Use rman_set_type to set the type of allocated resources everywhere
rman_set_rid is currently called.

Reviewed by: imp
Differential Revision: https://re

sys: Set the type of allocated bus resources

Use rman_set_type to set the type of allocated resources everywhere
rman_set_rid is currently called.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44123

show more ...


Revision tags: release/13.3.0, release/14.0.0
# 7063f942 01-Sep-2023 John Baldwin <jhb@FreeBSD.org>

pci_iov: Refuse to create VFs which require ARI if ARI is not available

If a parent downstream port doesn't support ARI, the code would try to
create VFs anyway but then all PCI config space access

pci_iov: Refuse to create VFs which require ARI if ARI is not available

If a parent downstream port doesn't support ARI, the code would try to
create VFs anyway but then all PCI config space access to those VFs
would fail.

Tested by: np
Sponsored by: Chelsio Communications

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0
# 4db93fb2 28-Feb-2022 Mark Johnston <markj@FreeBSD.org>

pci: Fix a -Wunused-but-set-variable warning

MFC after: 1 week


Revision tags: release/12.3.0
# 1f960e64 09-Nov-2021 Mark Johnston <markj@FreeBSD.org>

pci: Implement pci_bar_enabled() for SR-IOV VFs

In a VF's configuration space, "memory space enable" is hard-wired to 0,
so the existing implementation always returns false. We need to read
the SR-

pci: Implement pci_bar_enabled() for SR-IOV VFs

In a VF's configuration space, "memory space enable" is hard-wired to 0,
so the existing implementation always returns false. We need to read
the SR-IOV control register from the PF device to get the value of the
MSE bit.

Fix pci_bar_enabled() to read this register instead for VFs. I don't
see any way to access the PF's config space without a backpointer in the
pci device ivars, so I added one.

This fixes a regression where bhyve(8) fails to map the MSI-X table
after commit 7fa233534736 ("bhyve: Map the MSI-X table unconditionally
for passthrough") when a VF is passed through, since with that commit we
use PCIOCBARMMAP to map the table and that ioctl always fails for VFs
without this change. As a bonus, pciconf(8) now correctly reports the
enablement of BARs for VFs.

Reported and tested by: Raúl Muñoz <raul.munoz@custos.es>
Reviewed by: rstone, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32839

show more ...


Revision tags: release/13.0.0
# 94f5c1cc 18-Dec-2020 Konstantin Belousov <kib@FreeBSD.org>

pci_iov: When pci_iov_detach(9) is called, destroy VF children

instead of bailing out with EBUSY if there are any.

If driver module is unloaded, or just device is forcibly detached from
the driver,

pci_iov: When pci_iov_detach(9) is called, destroy VF children

instead of bailing out with EBUSY if there are any.

If driver module is unloaded, or just device is forcibly detached from
the driver, there is no way for driver to correctly unload otherwise.
Esp. if there are resources dedicated to the VFs which prevent turning
down other resources.

Reviewed by: jhb
Sponsored by: Mellanox Technologies / NVidia Networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D27615

show more ...


Revision tags: release/12.2.0
# 04e8183f 02-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

pci: clean up empty lines in .c and .h files


Revision tags: release/11.4.0, release/12.1.0, release/11.3.0
# 0269ae4c 06-Jun-2019 Alan Somers <asomers@FreeBSD.org>

MFHead @348740

Sponsored by: The FreeBSD Foundation


# e2e050c8 20-May-2019 Conrad Meyer <cem@FreeBSD.org>

Extract eventfilter declarations to sys/_eventfilter.h

This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces hea

Extract eventfilter declarations to sys/_eventfilter.h

This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
pollution substantially.

EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).

As a side effect of reduced header pollution, many .c files and headers no
longer contain needed definitions. The remainder of the patch addresses
adding appropriate includes to fix those files.

LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
sys/mutex.h since r326106 (but silently protected by header pollution prior
to this change).

No functional change (intended). Of course, any out of tree modules that
relied on header pollution for sys/eventhandler.h, sys/lock.h, or
sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped.

show more ...


Revision tags: release/12.0.0, release/11.2.0, release/10.4.0, release/11.1.0, release/11.0.1, release/11.0.0
# 27067774 16-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r303250 through r304235.


# 0aee83cc 03-Aug-2016 John Baldwin <jhb@FreeBSD.org>

Permit the name of the /dev/iov entry to be set by the driver.

The PCI_IOV option creates character devices in /dev/iov for each PF
device driver that registers support for creating VFs. By default

Permit the name of the /dev/iov entry to be set by the driver.

The PCI_IOV option creates character devices in /dev/iov for each PF
device driver that registers support for creating VFs. By default the
character device is named after the PF device (e.g. /dev/iov/foo0).
This change adds a variant of pci_iov_attach() called pci_iov_attach_name()
that allows the name of the /dev/iov entry to be specified by the
driver.

Reviewed by: rstone
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7400

show more ...


# e402d55c 03-May-2016 John Baldwin <jhb@FreeBSD.org>

Save and restore SRIOV-related config registers.

Save the value of the IOV control and page size registers and restore
them (along with the VF count) in pci_cfg_save/pci_cfg_restore. This
ensures A

Save and restore SRIOV-related config registers.

Save the value of the IOV control and page size registers and restore
them (along with the VF count) in pci_cfg_save/pci_cfg_restore. This
ensures ARI remains enabled if a PF driver resets itself during the
PCI_IOV_INIT callback. This might also properly restore SRIOV state
across suspend/resume.

Reviewed by: rstone, vangyzen
Differential Revision: https://reviews.freebsd.org/D6192

show more ...


# b83c5d07 03-May-2016 John Baldwin <jhb@FreeBSD.org>

Use the correct location of the SRIOV capability when enabling ARI.

While here, check if ARI was enabled by re-reading the config register
after writing it and return an error if the write fails.

R

Use the correct location of the SRIOV capability when enabling ARI.

While here, check if ARI was enabled by re-reading the config register
after writing it and return an error if the write fails.

Reviewed by: rstone, vangyzen

show more ...


# 0edd2576 16-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 6cd99ae8 15-Apr-2016 John Baldwin <jhb@FreeBSD.org>

Add a new PCI bus interface method to alloc the ivars (dinfo) for a device.

The ACPI and OFW PCI bus drivers as well as CardBus override this to
allocate the larger ivars to hold additional info bey

Add a new PCI bus interface method to alloc the ivars (dinfo) for a device.

The ACPI and OFW PCI bus drivers as well as CardBus override this to
allocate the larger ivars to hold additional info beyond the stock PCI ivars.

This removes the need to pass the size to functions like pci_add_iov_child()
and pci_read_device() simplifying IOV and bus rescanning implementations.

As a result of this and earlier changes, the ACPI PCI bus driver no longer
needs its own device_attach and pci_create_iov_child methods but can use
the methods in the stock PCI bus driver instead.

Differential Revision: https://reviews.freebsd.org/D5891

show more ...


# 876d357f 11-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 496dfa89 06-Apr-2016 John Baldwin <jhb@FreeBSD.org>

Convert pci_delete_child() to a bus_child_deleted() method.

Instead of providing a wrapper around device_delete_child() that the PCI
bus and child bus drivers must call explicitly, move the bulk of

Convert pci_delete_child() to a bus_child_deleted() method.

Instead of providing a wrapper around device_delete_child() that the PCI
bus and child bus drivers must call explicitly, move the bulk of the logic
from pci_delete_child() into a bus_child_deleted() method
(pci_child_deleted()). This allows PCI devices to be safely deleted via
device_delete_child().
- Add a bus_child_deleted method to the ACPI PCI bus which clears the
device_t associated with the corresponding ACPI handle in addition to
the normal PCI bus cleanup.
- Change cardbus_detach_card to call device_delete_children() and move
CardBus-specific delete logic into a new cardbus_child_deleted() method.
- Use device_delete_child() instead of pci_delete_child() in the SRIOV code.
- Add a bus_child_deleted method to the OpenFirmware PCI bus drivers which
frees the OpenFirmware device info for each PCI device.

Reviewed by: imp
Tested on: amd64 (CardBus and PCI-e hotplug)
Differential Revision: https://reviews.freebsd.org/D5831

show more ...


Revision tags: release/10.3.0
# 53835448 14-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# faf139cc 14-Mar-2016 Ryan Stone <rstone@FreeBSD.org>

Clean up repeated "All rights reserved"


# b655ec97 06-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 82aa34e6 04-Mar-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r296007 through r296368.


123