Commit Graph

331 Commits

Author SHA1 Message Date
Alejandro Lucero
0de9eb6138 mem: rename DMA mask check with proper prefix
Current name rte_eal_check_dma_mask does not follow the naming
used in the rest of the file.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-05 01:01:54 +01:00
Ferruh Yigit
74f2771012 bus/dpaa: fix build with gcc 9.0
build error:
In function ‘fman_if_init’,
    .../drivers/bus/dpaa/base/fman/fman.c:186:2:
    error: ‘strncpy’ output may be truncated copying 4095 bytes from a
           string of length 4095 [-Werror=stringop-truncation]
    strncpy(__if->node_path, dpa_node->full_name, PATH_MAX - 1);

strncpy may result a not null-terminated string,
replaced it with strlcpy

Fixes: 5b22cf7446 ("bus/dpaa: introducing FMan configurations")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-04 22:27:10 +01:00
Thomas Monjalon
df285f0e65 drivers: remove useless constructor headers
A constructor is usually declared with RTE_INIT* macros.
As it is a static function, no need to declare before its definition.
The macro is used directly in the function definition.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-11-01 22:38:00 +01:00
Qi Zhang
55e411b301 bus/pci: fix resource mapping override
When scanning an already plugged device, the virtual address
of mapped PCI resource in rte_pci_device will be overridden
with 0, that may cause driver does not work correctly.
The fix is not to update any rte_pci_device's field if the being
scanned device's driver is already probed.

Bugzilla ID: 85
Fixes: c752998b5e ("pci: introduce library and driver")
Cc: stable@dpdk.org

Reported-by: Geoffrey Lv <geoffrey.lv@gmail.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2018-10-31 19:43:34 +01:00
Ferruh Yigit
520dd9923b drivers: prefix global variables with module name
Some global variables are defined with generic names, add component name
as prefix to variables to prevent collusion with application variables.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
2018-10-29 02:34:21 +01:00
Ferruh Yigit
b74fd6b842 add missing static keyword to globals
Some global variables can indeed be static, add static keyword to them.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-29 02:01:08 +01:00
Darek Stojaczyk
3f2ef27972 bus/pci: propagate probing error codes
In a couple of places we check its error code against -EEXIST,
but this function returned either -1, 0, or 1.

This gets critical when hotplugging a device in secondary
process, while the same device is already plugged in the
primary. Failing to "hotplug" it in the primary will cause
the secondary to fail as well.

Fixes: e9d159c3d5 ("eal: allow probing a device again")

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-10-29 01:59:48 +01:00
Darek Stojaczyk
d59ba0296e vfio: fix interrupt unregister for hotplug notifier
This function is documented to return the number of unregistered
callbacks or negative numbers on error, but pci_vfio checks for
ret != 0 to detect failures. Not anymore.

Fixes: c115fd000c ("vfio: handle hotplug request notifier")

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-29 01:59:48 +01:00
Alejandro Lucero
630deed612 bus/pci: compare kernel driver instead of interrupt handler
Invoking the right pci read/write functions is based on interrupt
handler type. However, this is not configured for secondary processes
precluding to use those functions.

This patch fixes the issue using the driver name the device is bound
to instead.

Fixes: 632b2d1dee ("eal: provide functions to access PCI config")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-29 01:02:32 +01:00
Luca Boccassi
e8d435f1f3 bus/pci: harmonize return value of config read
On Linux, rte_pci_read_config on success returns the number of read
bytes, but on BSD it returns 0.
Document the return values, and have BSD behave as Linux does.

At least one case (bnx2x PMD) treats 0 as an error, so the change
makes sense also for that.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-10-29 00:32:14 +01:00
Alejandro Lucero
fe822eb8c5 bus/pci: use IOVA DMA mask check when setting IOVA mode
Currently the code precludes IOVA mode if IOMMU hardware reports
less addressing bits than necessary for full virtual memory range.

Although VT-d emulation currently only supports 39 bits, it could
be iovas for allocated memlory being within that supported range.
This patch allows IOVA mode in such a case adding a call to
rte_eal_check_dma_mask using the reported addressing bits by the
IOMMU hardware.

Indeed, memory initialization code has been modified for using lower
virtual addresses than those used by the kernel for 64 bits processes
by default, and therefore memsegs iovas can use 39 bits or less for
most systems. And this is likely 100% true for VMs.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-28 22:06:33 +01:00
Alejandro Lucero
f74d50a7df bus/pci: check IOMMU addressing limitation just once
Current code checks if IOMMU hardware reports enough addressing
bits for using IOVA mode but it repeats the same check for any
PCI device present. This is not necessary because the IOMMU hardware
is the same for all of them.

This patch only checks the IOMMU using first PCI device found.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-28 22:06:15 +01:00
Qi Zhang
f5b2eff084 bus/vdev: fix devargs after multi-process bus scan
It's not necessary to insert device argment to devargs_list
during bus scan, but this happens when we try to attach a
device on secondary process. The patch fix the issue.

Fixes: cdb068f031 ("bus/vdev: scan by multi-process channel")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2018-10-28 18:32:22 +01:00
Thomas Monjalon
2c29f879f2 bus/vdev: add iteration filter on name
A virtual device can be matched with following syntax:
	bus=vdev,name=X

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Paul Luse
66fd3a3b0f bus/vdev: fix multi-process IPC buffer leak on scan
This patch fixes an issue caught with ASAN where a vdev_scan()
to a secondary bus was failing to free some memory.

The doxygen comment in EAL is fixed at the same time.

Fixes: cdb068f031 ("bus/vdev: scan by multi-process channel")
Fixes: 783b6e5497 ("eal: add synchronous multi-process communication")
Cc: stable@dpdk.org

Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-25 10:28:13 +02:00
Shreyansh Jain
43cbea1edf bus/fslmc: ignore dpaax PA-VA table errors
Presence of PA-VA Table is transparent to the drivers. Ignoring the
return values from table update call.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-10-25 00:51:05 +02:00
Qi Zhang
9ffe2f4e18 bus/vdev: fix uninitialized device bus
Device bus should be initialized after bus scan.
While it does not happened when scan vdev from secondary process,
that cause segment fault at rte_dev_probe when call dev->bus->xxx.

Fixes: cdb068f031 ("bus/vdev: scan by multi-process channel")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-10-22 12:40:14 +02:00
Anatoly Burakov
edd035d241 vfio: improve musl compatibility
Musl already has PAGE_SIZE defined, and our define clashed with it.
Rename our define to SYS_PAGE_SIZE.

Bugzilla ID: 36

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-10-22 11:28:35 +02:00
Anatoly Burakov
5d7b673d5f mk: build with _GNU_SOURCE defined by default
We use _GNU_SOURCE all over the place, but often times we miss
defining it, resulting in broken builds on musl. Rather than
fixing every library's and driver's and application's makefile,
fix it by simply defining _GNU_SOURCE by default for all
builds.

Remove all usages of _GNU_SOURCE in source files and makefiles,
and also fixup a couple of instances of using __USE_GNU instead
of _GNU_SOURCE.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-22 11:28:27 +02:00
Thomas Monjalon
739e13bcc9 devargs: fix freeing during device removal
After calling unplug function of a bus, the device is expected
to be freed. It is too late for getting devargs to remove.
Anyway, the buses which implement unplug are already freeing
the devargs, except the PCI bus.
So the call to rte_devargs_remove() is removed from EAL and
added in PCI.

Fixes: 2effa126fb ("devargs: simplify parameters of removal function")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-10-19 22:37:10 +02:00
Thomas Monjalon
e9d159c3d5 eal: allow probing a device again
In the devargs syntax for device representors, it is possible to add
several devices at once: -w dbdf,representor=[0-3]
It will become a more frequent case when introducing wildcards
and ranges in the new devargs syntax.

If a devargs string is provided for probing, and updated with a bigger
range for a new probing, then we do not want it to fail because
part of this range was already probed previously.
There can be new ports to create from an existing rte_device.

That's why the check for an already probed device
is moved as bus responsibility.
In the case of vdev, a global check is kept in insert_vdev(),
assuming that a vdev will always have only one port.
In the case of ifpga and vmbus, already probed devices are checked.
In the case of NXP buses, the probing is done only once (no hotplug),
though a check is added at bus level for consistency.
In the case of PCI, a driver flag is added to allow PMD probing again.
Only the PMD knows the ports attached to one rte_device.

As another consequence of being able to probe in several steps,
the field rte_device.devargs must not be considered as a full
representation of the rte_device, but only the latest probing args.
Anyway, the field rte_device.devargs is used only for probing.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-18 01:49:52 +02:00
Thomas Monjalon
52897e7e70 eal: add function to query device status
The function rte_dev_is_probed() is added in order to improve semantic
and enforce proper check of the probing status of a device.

It will answer this rte_device query:
Is it already successfully probed or not?

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-18 01:49:28 +02:00
Thomas Monjalon
391797f042 drivers/bus: move driver assignment to end of probing
The PCI mapping requires to know the PCI driver to use,
even before the probing is done. That's why the PCI driver is
referenced early inside the PCI device structure. See
commit 1d20a073fa ("bus/pci: reference driver structure before mapping")

However the rte_driver does not need to be referenced in rte_device
before the device probing is done.
By moving back this assignment at the end of the device probing,
it becomes possible to make clear the status of a rte_device.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
2018-10-17 10:26:59 +02:00
Jerin Jacob
94d7265976 vfio: fix missing header inclusion
The following change set introduces HAVE_VFIO_DEV_REQ_INTERFACE
and used in the below files.

drivers/bus/pci/linux/pci_vfio.c
drivers/bus/pci/pci_common.c
lib/librte_eal/linuxapp/eal/eal_interrupts.c

However, Except the first file, the change missed to include
<rte_vfio.h> where HAVE_VFIO_DEV_REQ_INTERFACE defined.
This creates runtime following error on vfio-pci mode and
kernel >= 4.0.0 combination.

EAL: [rte_intr_enable] Unknown handle type of fd 95
EAL: [pci_vfio_enable_notifier]Fail to enable req notifier.
EAL: Fail to unregister req notifier handler.
EAL: Error setting up notifier!
EAL: Requested device 0000:07:00.1 cannot be used

Fixes: cda9441996 ("vfio: fix build with Linux < 4.0")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
2018-10-17 10:16:18 +02:00
Hemant Agrawal
fa21a6fec7 net/dpaa2: optimize fd reset in Tx path
various field of FD structure was getting reset in scattered
fashion. This patch align them in single macro.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:26 +02:00
Nipun Gupta
bd23b1a827 bus/fslmc: support 32 enqueues/dequeues for LX2
LX2 can support upto 32 frames in one hw pull request.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-10-16 14:54:26 +02:00
Nipun Gupta
293c0ca94c bus/fslmc: support memory backed portals with QBMAN 5.0
This new mode is available in LX2160 platform. The code
dynamically detect the underlying qbman version and choose
the mode at runtime.

Signed-off-by: Youri Querry <youri.querry_1@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-10-16 14:54:26 +02:00
Hemant Agrawal
b4a63e605d bus/fslmc: upgrade mc FW APIs to 10.10.0
This patch add the support for new Management Complex
Firmware version to 10.1x.x. One of the main changes in
the APIs ordered queue.

The fslmc bus lib ABI will need to be bumped to reflect
the MC FW API and structure changes.

This will also result in bumping of ABI verion of all dependent
libs as they internally use the MC FW APIs and structures.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:25 +02:00
Shreyansh Jain
e7d9285481 fslmc: enable dpaax library
With this patch, fslmc bus and ethernet devices on this bus
would start using the physical-virtual library interfaces.

This patch impacts mempool/dpaa2, event/dpaa2, net/dpaa2,
raw/dpaa2_cmdif and raw/dpaa2_qdma as they are dependent
on the bus/fslmc and thus impact linkage of libraries.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-16 14:54:25 +02:00
Shreyansh Jain
5a7dbb934d dpaa: enable dpaax library
With this patch, dpaa bus and ethernet devices on this bus
would start using the physical-virtual library interfaces.

This patch impacts mempool/dpaa, event/dpaa and net/dpaa as
they are dependent on the bus/dpaa and thus impact linkage of
libraries.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-16 14:54:25 +02:00
Shreyansh Jain
0947cfde25 bus/fslmc: fix physical addressing check
In case RTE_LIBRTE_DPAA2_USE_PHYS_IOVA is enabled, only supported
class is RTE_IOVA_PA.

Fixes: f7768afac1 ("bus/fslmc: support dynamic IOVA")
Cc: stable@dpdk.org

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-16 14:54:25 +02:00
Jeff Guo
cda9441996 vfio: fix build with Linux < 4.0
Since the older kernel version do not implement the device request
interface for vfio, so when build on the kernel < v4.0.0, which is
the version begin to add the device request interface, it will
throw the error to show “VFIO_PCI_REQ_IRQ_INDEX” is undeclared.
This patch aim to fix this compile issue by add the macro
“HAVE_VFIO_DEV_REQ_INTERFACE” after checking the kernel version.

Fixes: 0eb8a1c4c7 ("vfio: add request notifier interrupt")
Fixes: c115fd000c ("vfio: handle hotplug request notifier")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-16 14:54:25 +02:00
Jeff Guo
c115fd000c vfio: handle hotplug request notifier
When device is be hot-unplugged, the vfio kernel module will sent req
notifier to request user space to release the allocated resources at
first. After that, vfio kernel module will detect the device disappear,
and then delete the device in kernel.

This patch aim to add req notifier processing to enable hotplug for vfio.
By enable the req notifier monitoring and register the notifier callback,
when device be hot-unplugged, the hot-unplug handler will be called to
process hotplug for vfio.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-15 23:42:15 +02:00
Jeff Guo
44c976236e bus/pci: add VFIO request interrupt handle to device
There are some extended interrupt types in vfio pci device except from the
existing interrupts, such as err and req notifier, they could be useful for
device error monitoring. And these corresponding interrupt handler is
different from the other interrupt handler that register in PMDs, so a new
interrupt handler should be added. This patch will add specific req handler
in generic pci device.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-15 23:13:31 +02:00
Jeff Guo
5c96a29934 bus/pci: support sigbus handler
This patch implements the ops for the PCI bus sigbus handler. It finds the
PCI device that is being hot-unplugged and calls the relevant ops of the
hot-unplug handler to handle the hot-unplug failure of the device.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2018-10-15 22:17:26 +02:00
Jeff Guo
b01dc3da88 bus/pci: support hot-unplug handler
This patch implements the ops to handle hot-unplug on the PCI bus.
For UIO PCI, it could avoids BARs read/write errors by creating a
new dummy memory to remap the memory where the failure is. For VFIO
or other kernel driver, it could specific implement function to handle
hot-unplug case by case.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2018-10-15 22:16:48 +02:00
Thomas Monjalon
6844d146ff eal: add bus pointer in device structure
When a device is added with a devargs (hotplug or whitelist),
the bus pointer can be retrieved via its devargs.
But there is no such devargs.bus in case of standard scan.

A pointer to the rte_bus handle is added to rte_device.
When a device is allocated (during a scan),
the pointer to its bus is assigned.

It will make possible to remove a rte_device,
using the function pointer from its bus.

The function rte_bus_find_by_device() becomes useless,
and may be removed later.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
2018-10-11 14:09:24 +02:00
Thomas Monjalon
2effa126fb devargs: simplify parameters of removal function
The function rte_devargs_remove(), which is intended to be internal,
can take a devargs structure as argument.
The matching is still using string comparison of bus name and
device name.
It is simpler and may allow a different devargs matching in future.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
2018-10-11 14:09:24 +02:00
Thomas Monjalon
3f7a40c670 devargs: rename enum items with singular form
The enum names are *_params (plural form).
And the items are also using the plural form: *_PARAMS_*.
It looks more natural to use the singular form *_PARAM_* for items.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 13:57:29 +02:00
Thomas Monjalon
4e7a69c9d9 bus/pci: rename devargs parameter id to addr
We could match devices by their PCI id (vendor id, device id, etc).
But for now, only matching by PCI address is implemented.
The devargs parameter "id" is renamed "addr" to reflect its real meaning.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 13:57:29 +02:00
Anatoly Burakov
f32c7c9de9 malloc: enable event callbacks for external memory
When adding or removing external memory from the memory map, there
may be actions that need to be taken on account of this memory (e.g.
DMA mapping). Add support for triggering callbacks when adding,
removing, attaching or detaching external memory.

Some memory event callback handlers will need additional logic to
handle external memory regions. For example, virtio callback has to
completely ignore externally allocated memory, because there is no
way to find file descriptors backing the memory address in a
generic fashion. All other callbacks have also been adjusted to
handle RTE_BAD_IOVA as IOVA address, as this is one of the expected
use cases for external memory support.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-11 11:56:55 +02:00
Anatoly Burakov
5282bb1c36 mem: allow memseg lists to be marked as external
When we allocate and use DPDK memory, we need to be able to
differentiate between DPDK hugepage segments and segments that
were made part of DPDK but are externally allocated. Add such
a property to memseg lists.

This breaks the ABI, so document the change in release notes.
This also breaks a few internal assumptions about memory
contiguousness, so adjust malloc code in a few places.

All current calls for memseg walk functions were adjusted to
ignore external segments where it made sense.

Mempools is a special case, because we may be asked to allocate
a mempool on a specific socket, and we need to ignore all page
sizes on other heaps or other sockets. Previously, this
assumption of knowing all page sizes was not a problem, but it
will be now, so we have to match socket ID with page size when
calculating minimum page size for a mempool.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 10:24:29 +02:00
Anatoly Burakov
4104b2a485 mem: add length to memseg list
Previously, to calculate length of memory area covered by a memseg
list, we would've needed to multiply page size by length of fbarray
backing that memseg list. This is not obvious and unnecessarily
low level, so store length in the memseg list itself.

This breaks ABI, so bump the EAL ABI version and document the
change. Also, while we're breaking ABI, pack the members a little
better.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-11 10:24:16 +02:00
Anatoly Burakov
03ba15ca65 vfio: allow mapping MSI-X BARs if kernel allows it
Currently, DPDK will skip mapping some areas (or even an entire BAR)
if MSI-X table happens to be in them but is smaller than page size.

Kernels 4.16+ will allow mapping MSI-X BARs [1], and will report this
as a capability flag. Capability flags themselves are also only
supported since kernel 4.6 [2].

This commit will introduce support for checking VFIO capabilities,
and will use it to check if we are allowed to map BARs with MSI-X
tables in them, along with backwards compatibility for older
kernels, including a workaround for a variable rename in VFIO
region info structure [3].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git/commit/?id=a32295c612c57990d17fb0f41e7134394b2f35f6

[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git/commit/?id=c84982adb23bcf3b99b79ca33527cd2625fbe279

[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git/commit/?id=ff63eb638d63b95e489f976428f1df01391e15e4

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-04 00:45:50 +02:00
Gaetan Rivet
ac91bc493c bus/vdev: implement device iteration
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-10-03 14:22:39 +02:00
Gaetan Rivet
4410c1b0c0 bus/pci: add iteration filter on address
The PCI bus can now parse a matching field "id" as follows:

   "bus=pci,id=0000:00:00.0"

           or

   "bus=pci,id=00:00.0"

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-10-03 14:20:07 +02:00
Gaetan Rivet
46521ca27b bus/pci: implement device iteration
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-10-03 14:19:58 +02:00
Hemant Agrawal
539c80ca06 bus/dpaa: add check for re-definition in compat
Few fields in compat are giving re-defination error
with new drivers such as caam_jr.
Checks have been added.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Nipun Gupta
fa362cea28 bus/dpaa: avoid big endian conversions for contextb
minor optimization in packet handling path

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-09-28 01:41:02 +02:00
Nipun Gupta
b6ee63a763 bus/dpaa: avoid tag set for eqcr in Tx path
Minor optimization for TX path.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-09-28 01:41:02 +02:00