summaryrefslogtreecommitdiff
path: root/drivers/bus/ifpga
AgeCommit message (Collapse)Author
2018-10-18eal: allow probing a device againThomas Monjalon
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-18eal: add function to query device statusThomas Monjalon
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-17drivers/bus: move driver assignment to end of probingThomas Monjalon
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 1d20a073fa5e ("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-11eal: add bus pointer in device structureThomas Monjalon
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-11devargs: simplify parameters of removal functionThomas Monjalon
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-09-27bus/ifpga: remove useless driver castThomas Monjalon
The rte_afu_driver is assigned to rte_afu_device.driver during probing. There is no need of accessing the rte_afu_driver via rte_device.driver and type casting to its container. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Rosen Xu <rosen.xu@intel.com>
2018-07-12remove useless constructor headersThomas Monjalon
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-05-22bus/ifpga: fix null pointer dereference in scanRosen Xu
Fix ifpga_scan_one() null pointer dereferences issue. Coverity issue: 279454 Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library") Cc: stable@dpdk.org Signed-off-by: Rosen Xu <rosen.xu@intel.com>
2018-05-22bus/ifpga: fix memory leaks in scanRosen Xu
There are some resource leaks in ifpga_scan_one. This patch fixes it. Coverity issue: 279459 Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library") Cc: stable@dpdk.org Signed-off-by: Rosen Xu <rosen.xu@intel.com>
2018-05-22bus/ifpga: fix error check in unplugRosen Xu
The control variable should be afu_dev not dev. Coverity issue: 279455 Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library") Cc: stable@dpdk.org Signed-off-by: Rosen Xu <rosen.xu@intel.com>
2018-05-13bus/fpga: use strlcpy instead of strncpyPablo de Lara
Gcc 8 reports a build error: drivers/bus/ifpga/ifpga_bus.c:161:2: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation] strncpy(afu_pr_conf.bs_path, path, sizeof(afu_pr_conf.bs_path)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-05-11bus/ifpga: add Intel FPGA bus libraryRosen Xu
Defined FPGA-BUS for Acceleration Drivers of AFUs 1. FPGA PCI Scan (1st Scan) follows DPDK UIO/VFIO PCI Scan Process, probe Intel FPGA Rawdev Driver, it will be covered in following patches. 2. AFU Scan(2nd Scan) bind DPDK driver to FPGA Partial-Bitstream. This scan is trigged by hotplug of IFPGA Rawdev probe, in this scan the AFUs will be created and their drivers are also probed. This patch will introduce rte_afu_device which describe the AFU device listed in the FPGA-BUS. Signed-off-by: Rosen Xu <rosen.xu@intel.com> Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com> Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>