History log of /dpdk/drivers/bus/pci/linux/pci.c (Results 1 – 25 of 56)
Revision Date Author Comments
# 849f773b 25-Jun-2024 David Marchand <david.marchand@redhat.com>

bus/pci: use a dynamic logtype

Register a logtype for this bus driver and stop logging as EAL.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbox@nvidia.com>


# 095cf6e6 31-May-2023 Chenbo Xia <chenbo.xia@intel.com>

bus/pci: introduce MMIO read/write

The MMIO regions may not be mmap-able for VFIO-PCI devices.
In this case, the driver should explicitly do read and write
to access these regions.

Signed-off-by: C

bus/pci: introduce MMIO read/write

The MMIO regions may not be mmap-able for VFIO-PCI devices.
In this case, the driver should explicitly do read and write
to access these regions.

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Yahui Cao <yahui.cao@intel.com>

show more ...


# 4b741542 31-May-2023 Chenbo Xia <chenbo.xia@intel.com>

bus/pci: avoid depending on private kernel value

The value 40 used in VFIO_GET_REGION_ADDR() is a private value
(VFIO_PCI_OFFSET_SHIFT) defined in Linux kernel source [1]. It
is not part of VFIO API

bus/pci: avoid depending on private kernel value

The value 40 used in VFIO_GET_REGION_ADDR() is a private value
(VFIO_PCI_OFFSET_SHIFT) defined in Linux kernel source [1]. It
is not part of VFIO API, and we should not depend on it.

[1] https://github.com/torvalds/linux/blob/v6.2/include/linux/vfio_pci_core.h

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Yahui Cao <yahui.cao@intel.com>

show more ...


# 87a02023 31-May-2023 Chenbo Xia <chenbo.xia@intel.com>

bus/pci: introduce internal representation of device

This patch introduces an internal representation of the PCI device
which will be used to store the internal information that don't have
to be exp

bus/pci: introduce internal representation of device

This patch introduces an internal representation of the PCI device
which will be used to store the internal information that don't have
to be exposed to drivers, e.g., the VFIO region sizes/offsets.

In this patch, the internal structure is simply a wrapper of the
rte_pci_device structure. More fields will be added.

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Yahui Cao <yahui.cao@intel.com>

show more ...


# f13604fa 04-Oct-2022 David Marchand <david.marchand@redhat.com>

bus/pci: remove VFIO status log in scan

Linux EAL triggers a scan on all buses, PCI included.
Once done, it configures VFIO.
Checking for VFIO status in the PCI bus scan is pointless.

Signed-off-by

bus/pci: remove VFIO status log in scan

Linux EAL triggers a scan on all buses, PCI included.
Once done, it configures VFIO.
Checking for VFIO status in the PCI bus scan is pointless.

Signed-off-by: David Marchand <david.marchand@redhat.com>

show more ...


# 7dcd73e3 04-Oct-2022 Olivier Matz <olivier.matz@6wind.com>

drivers/bus: set device NUMA node to unknown by default

The dev->device.numa_node field is set by each bus driver for
every device it manages to indicate on which NUMA node this device lies.

When t

drivers/bus: set device NUMA node to unknown by default

The dev->device.numa_node field is set by each bus driver for
every device it manages to indicate on which NUMA node this device lies.

When this information is unknown, the assigned value is not consistent
across the bus drivers.

Set the default value to SOCKET_ID_ANY (-1) by all bus drivers
when the NUMA information is unavailable. This change impacts
rte_eth_dev_socket_id() in the same manner.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

show more ...


# 8f4de2db 28-Jul-2022 David Marchand <david.marchand@redhat.com>

bus/pci: fill bus specific information

For diagnostic, it may be useful to provide the PCI vendor and device
id.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson

bus/pci: fill bus specific information

For diagnostic, it may be useful to provide the PCI vendor and device
id.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

show more ...


# 1f37cb2b 28-Jul-2022 David Marchand <david.marchand@redhat.com>

bus/pci: make driver-only headers private

The pci bus interface is for drivers only.
Mark as internal and move the header in the driver headers list.

While at it, cleanup the code:
- fix indentatio

bus/pci: make driver-only headers private

The pci bus interface is for drivers only.
Mark as internal and move the header in the driver headers list.

While at it, cleanup the code:
- fix indentation,
- remove unneeded reference to bus specific singleton object,
- remove unneeded list head structure type,
- reorder the definitions and macro manipulating the bus singleton object,
- remove inclusion of rte_bus.h and fix the code that relied on implicit
inclusion,

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>

show more ...


# d61138d4 22-Oct-2021 Harman Kalra <hkalra@marvell.com>

drivers: remove direct access to interrupt handle

Removing direct access to interrupt handle structure fields,
rather use respective get set APIs for the same.
Making changes to all the drivers acce

drivers: remove direct access to interrupt handle

Removing direct access to interrupt handle structure fields,
rather use respective get set APIs for the same.
Making changes to all the drivers access the interrupt handle fields.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Raslan Darawsheh <rasland@nvidia.com>

show more ...


# 7c83a1e3 16-Jun-2021 David Marchand <david.marchand@redhat.com>

bus/pci: fix leak for unbound devices

For devices not bound to any Linux kernel module, we leak a pci object
since it is never added to the PCI bus device list.

Fixes: c79a1c67465d ("bus/pci: optim

bus/pci: fix leak for unbound devices

For devices not bound to any Linux kernel module, we leak a pci object
since it is never added to the PCI bus device list.

Fixes: c79a1c67465d ("bus/pci: optimize bus scan")
Cc: stable@dpdk.org

Reported-by: Owen Hilyard <ohilyard@iol.unh.edu>
Signed-off-by: David Marchand <david.marchand@redhat.com>

show more ...


# aa777f00 02-May-2021 Thomas Monjalon <thomas@monjalon.net>

bus/pci: update files description

Some files were starting with some outdated introductions.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.

bus/pci: update files description

Some files were starting with some outdated introductions.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>

show more ...


# fc5bffb8 23-Jun-2021 David Christensen <drc@linux.vnet.ibm.com>

bus/pci: support IOVA as VA in PowerVM LPARs

Add IOMMU detection logic for PowerVM LPARs.

PowerNV $ cat /proc/cpuinfo
...
timebase     : 512000000
platform     : PowerNV
model        : 8335-GTW

Po

bus/pci: support IOVA as VA in PowerVM LPARs

Add IOMMU detection logic for PowerVM LPARs.

PowerNV $ cat /proc/cpuinfo
...
timebase     : 512000000
platform     : PowerNV
model        : 8335-GTW

PowerVM LPAR $ cat /proc/cpuinfo
...
timebase     : 512000000
platform     : pSeries
model        : IBM,9009-22A
machine      : CHRP IBM,9009-22A
MMU         : Hash

PowerNV KVM Guest $ cat /proc/cpuinfo
...
timebase     : 512000000
platform     : pSeries
model        : IBM pSeries (emulated by qemu)
machine      : CHRP IBM pSeries (emulated by qemu)
MMU         : Radix

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>

show more ...


# cc4219d1 15-Jun-2021 David Christensen <drc@linux.vnet.ibm.com>

bus/pci: fix IOVA as VA support for PowerNV

Fix the IOMMU detection logic that looks for the "platform" field of
/proc/cpuinfo on POWER systems.

Fixes: 905215731833 ("bus/pci: support IOVA as VA on

bus/pci: fix IOVA as VA support for PowerNV

Fix the IOMMU detection logic that looks for the "platform" field of
/proc/cpuinfo on POWER systems.

Fixes: 905215731833 ("bus/pci: support IOVA as VA on PowerNV systems")
Cc: stable@dpdk.org

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>

show more ...


# df58e45e 10-Mar-2021 Huawei Xie <huawei.xhw@alibaba-inc.com>

bus/pci: support MMIO for ioport

With I/O BAR, we get PIO (port-mapped I/O) address.
With MMIO (memory-mapped I/O) BAR, we get mapped virtual address.
We distinguish PIO and MMIO by their address ra

bus/pci: support MMIO for ioport

With I/O BAR, we get PIO (port-mapped I/O) address.
With MMIO (memory-mapped I/O) BAR, we get mapped virtual address.
We distinguish PIO and MMIO by their address range like how kernel does,
i.e, address below 64K is PIO.
ioread/write8/16/32 is provided to access PIO/MMIO.
By the way, for virtio on arch other than x86, BAR flag indicates PIO
but is mapped.

Signed-off-by: Huawei Xie <huawei.xhw@alibaba-inc.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>

show more ...


# 46dcbccd 10-Mar-2021 Huawei Xie <huawei.xhw@alibaba-inc.com>

bus/pci: use Linux PCI sysfs to get PIO address

Currently virtio PMD assumes legacy device uses PIO bar.
There are three ways to get PIO (port-mapped I/O) address for virtio
legacy device.
1) under

bus/pci: use Linux PCI sysfs to get PIO address

Currently virtio PMD assumes legacy device uses PIO bar.
There are three ways to get PIO (port-mapped I/O) address for virtio
legacy device.
1) under igb_uio
- get PIO address from uio/uio# sysfs attribute, for instance:
/sys/bus/pci/devices/0000:00:09.0/uio/uio0/portio/port0/start
2) under uio_pci_generic
- for X86, get PIO address from /proc/ioport
- for other ARCH, get PIO address from standard PCI sysfs attribute,
for instance: /sys/bus/pci/devices/0000:00:09.0/resource

Actually, "port0/start" in igb_uio and "resource" point to exactly the
same thing, i.e, pci_dev->resource[0] in kernel source code.

This patch refactors these messy things, and uses standard PCI sysfs
attribute "resource".

Signed-off-by: Huawei Xie <huawei.xhw@alibaba-inc.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>

show more ...


# 59440fba 14-Oct-2020 Thomas Monjalon <thomas@monjalon.net>

bus/pci: remove unused scan by address

The function pci_update_device was used to scan a device
for probing by PCI address.
This private function (and implementations) are unused
since such probing

bus/pci: remove unused scan by address

The function pci_update_device was used to scan a device
for probing by PCI address.
This private function (and implementations) are unused
since such probing is removed.

Fixes: f3bac43b60da ("bus/pci: remove unused function to probe by address")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


# 9d3ad80a 13-Oct-2020 Jim Harris <james.r.harris@intel.com>

bus/pci: copy new id for inserted device on Linux

When a device is inserted into an existing BDF slot
that has not been probed, we must overwrite the old
PCI ID with the ID of the new function. Othe

bus/pci: copy new id for inserted device on Linux

When a device is inserted into an existing BDF slot
that has not been probed, we must overwrite the old
PCI ID with the ID of the new function. Otherwise
we may not probe the function with the correct driver,
if at all.

Signed-off-by: Jim Harris <james.r.harris@intel.com>

show more ...


# 7c0d798a 17-Sep-2020 David Marchand <david.marchand@redhat.com>

bus/pci: switch to private kernel driver enum

The rte_kernel_driver enum actually only pointed at PCI drivers and is
only used in the PCI subsystem.
Remove it from the generic device API and use a p

bus/pci: switch to private kernel driver enum

The rte_kernel_driver enum actually only pointed at PCI drivers and is
only used in the PCI subsystem.
Remove it from the generic device API and use a private enum in the PCI
code.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>

show more ...


# c79a1c67 24-Jun-2020 Jerin Jacob <jerinj@marvell.com>

bus/pci: optimize bus scan

In order to optimize the PCI management, RTE_KDRV_NONE based
device driver probing removed by not adding them to list in
the scan phase.

The legacy virtio is the only con

bus/pci: optimize bus scan

In order to optimize the PCI management, RTE_KDRV_NONE based
device driver probing removed by not adding them to list in
the scan phase.

The legacy virtio is the only consumer of RTE_KDRV_NONE based device
driver probe scheme. The legacy virtio support will be available
through the existing VFIO/UIO based kernel driver scheme.

This patch also removes the deprecation notice for the same.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>

show more ...


# 463a5245 02-May-2020 Sunil Kumar Kori <skori@marvell.com>

bus/pci: optimise scanning with whitelist/blacklist

rte_bus_scan API scans all the available PCI devices irrespective of white
or black listing parameters then further devices are probed based on wh

bus/pci: optimise scanning with whitelist/blacklist

rte_bus_scan API scans all the available PCI devices irrespective of white
or black listing parameters then further devices are probed based on white
or black listing parameters. So unnecessary CPU cycles are wasted during
rte_pci_scan.

For Octeontx2 platform with core frequency 2.4 Ghz, rte_bus_scan consumes
around 26ms to scan around 90 PCI devices but all may not be used by the
application. So for the application which uses 2 NICs, rte_bus_scan
consumes few microseconds and rest time is saved with this patch.

Patch restricts devices to be scanned as per below mentioned conditions:
- All devices will be scanned if no parameters are passed.
- Only white listed devices will be scanned if white list is available.
- All devices, except black listed, will be scanned if black list is
available.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Gaetan Rivet <grive@u256.net>

show more ...


# 90521573 16-Mar-2020 David Christensen <drc@linux.vnet.ibm.com>

bus/pci: support IOVA as VA on PowerNV systems

All recent POWER systems, Power 8 and 9 specifically, support an IOMMU
(it can't be disabled). The functionality of the IOMMU is different
depending on

bus/pci: support IOVA as VA on PowerNV systems

All recent POWER systems, Power 8 and 9 specifically, support an IOMMU
(it can't be disabled). The functionality of the IOMMU is different
depending on whether it's running on a bare metal PowerNV system or in
a virtual environment (PowerVM LPAR or KVM/QEMU). DPDK currently
supports the IOMMU found on PowerNV platforms, sPAPRv2, so IOVA=VA
mode can be enabled when the correct platform is detected.

The POWER IOMMU type can't be detected through mechanisms such as
parsing files in the /sys hierarchy like x86_64 systems so the
/proc/cpuinfo file is parsed to determine whether Linux is running
on bare metal (i.e. PowerNV) or in a virtual environment (KVM/QEMU).

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>

show more ...


# fc67ae91 14-Feb-2020 Somnath Kotur <somnath.kotur@broadcom.com>

bus/pci: fix devargs on probing again

As per the comments in this code section, since there is a matching device,
it is now its responsibility to manage the devargs we've just inserted.
But the matc

bus/pci: fix devargs on probing again

As per the comments in this code section, since there is a matching device,
it is now its responsibility to manage the devargs we've just inserted.
But the matching device ptr's devargs is still uninitialized or not pointing
to the newest dev_args that were passed as a parameter to local_dev_probe().
This is needed particularly in the case when *probe is called again* on an
already probed device as part of adding a representor port to OVS-DPDK.

Fixes: 7e8b26650146 ("eal: fix hotplug add / remove")
Cc: stable@dpdk.org

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Gaetan Rivet <grive@u256.net>

show more ...


# e02b661b 22-Oct-2019 David Marchand <david.marchand@redhat.com>

bus/pci: check IO permissions for UIO only

On x86, calling inb/outb special instructions (used in UIO ioport
read/write parts) is only possible if the right IO permissions has been
granted.

The onl

bus/pci: check IO permissions for UIO only

On x86, calling inb/outb special instructions (used in UIO ioport
read/write parts) is only possible if the right IO permissions has been
granted.

The only user of this API (the net/virtio pmd) checks this
unconditionnaly but this should be hidden by the rte_pci_ioport API
itself and only checked when the device is bound to a UIO driver.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

show more ...


# 2e8d5cf7 13-Aug-2019 Stephen Hemminger <stephen@networkplumber.org>

bus/pci: fix Intel IOMMU sysfs access check

Just open the sysfs file and handle failure, rather than using access().
This eliminates Coverity warnings about TOCTOU
"time of check versus time of use"

bus/pci: fix Intel IOMMU sysfs access check

Just open the sysfs file and handle failure, rather than using access().
This eliminates Coverity warnings about TOCTOU
"time of check versus time of use"; although for this sysfs file that is
not really an issue anyway.

Coverity issue: 347276
Fixes: 54a328f552ff ("bus/pci: forbid IOVA mode if IOMMU address width too small")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>

show more ...


# 8ac35916 12-Aug-2019 David Marchand <david.marchand@redhat.com>

remove useless include of EAL memory config header

Restrict this header inclusion to its real users.

Fixes: 028669bc9f0d ("eal: hide shared memory config")
Cc: stable@dpdk.org

Signed-off-by: David

remove useless include of EAL memory config header

Restrict this header inclusion to its real users.

Fixes: 028669bc9f0d ("eal: hide shared memory config")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

show more ...


123