#
1bd1ab6f |
| 16-Jul-2024 |
Mingjin Ye <mingjinx.ye@intel.com> |
bus/vdev: fix device reinitialization
In secondary processes, insert_vdev() may be called multiple times on the same device due to multi-process hot-plugging of the vdev bus and EAL parameters to ad
bus/vdev: fix device reinitialization
In secondary processes, insert_vdev() may be called multiple times on the same device due to multi-process hot-plugging of the vdev bus and EAL parameters to add the same vdev.
In this case, when rte_devargs_insert() is called, the devargs->name reference will be invalidated because rte_devargs_insert() destroys the just-allocated devargs and replaces the pointer from the devargs list. As a result, the reference to devargs->name stored in dev->device.name will be invalid.
This patch fixes the issue by setting the device name after calling rte_devargs_insert().
Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Cc: stable@dpdk.org
Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
show more ...
|
#
22ce39b3 |
| 14-Mar-2024 |
Mingjin Ye <mingjinx.ye@intel.com> |
bus/vdev: revert fix devargs in secondary process
The ASan tool detected a memory leak in the vdev driver alloc_devargs. The previous commit was that when inserting a vdev device, the primary proces
bus/vdev: revert fix devargs in secondary process
The ASan tool detected a memory leak in the vdev driver alloc_devargs. The previous commit was that when inserting a vdev device, the primary process alloc devargs and the secondary process looks for devargs. This causes the device to not be created if the secondary process does not initialise the vdev device. And, this is not the root cause.
Therefore the following commit was reverted accordingly.
After restoring this commit, the memory leak still exists.
Bugzilla ID: 1450 Fixes: 6666628362c9 ("bus/vdev: fix devargs in secondary process") Cc: stable@dpdk.org
Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
show more ...
|
#
66666283 |
| 01-Sep-2023 |
Mingjin Ye <mingjinx.ye@intel.com> |
bus/vdev: fix devargs in secondary process
When a device is created by a secondary process, an empty devargs is temporarily generated and bound to it. This causes the device to not be associated wit
bus/vdev: fix devargs in secondary process
When a device is created by a secondary process, an empty devargs is temporarily generated and bound to it. This causes the device to not be associated with the correct devargs, and the empty devargs are not released when the resource is freed.
This patch fixes the issue by matching the devargs when inserting a device in secondary process.
Fixes: dda987315ca2 ("vdev: make virtual bus use its device struct") Fixes: a16040453968 ("eal: extract vdev infra") Cc: stable@dpdk.org
Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
show more ...
|
#
83f275fa |
| 10-Nov-2023 |
Chengwen Feng <fengchengwen@huawei.com> |
bus/vdev: verify strdup return
Add verify strdup return value logic.
Fixes: 64051bb1f144 ("devargs: unify scratch buffer storage") Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@hu
bus/vdev: verify strdup return
Add verify strdup return value logic.
Fixes: 64051bb1f144 ("devargs: unify scratch buffer storage") Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Huisong Li <lihuisong@huawei.com>
show more ...
|
#
deb44af7 |
| 09-Feb-2023 |
Volodymyr Fialko <vfialko@marvell.com> |
drivers/bus: fix leak for devices without driver
During the bus scan, memory for device configuration is allocated. Currently, if a driver wasn't attached to the device during initialization, memory
drivers/bus: fix leak for devices without driver
During the bus scan, memory for device configuration is allocated. Currently, if a driver wasn't attached to the device during initialization, memory for that device will not be released at bus cleanup. This patch address this issue and releases the memory for all allocated devices.
Fixes: 1cab1a40ea9b ("bus: cleanup devices on shutdown") Cc: stable@dpdk.org
Signed-off-by: Volodymyr Fialko <vfialko@marvell.com> Acked-by: Kevin Laatz <kevin.laatz@intel.com>
show more ...
|
#
3f27defe |
| 19-Oct-2022 |
Zhangfei Gao <zhangfei.gao@linaro.org> |
bus/vdev: fix crash in device cleanup
vdev_probe calls driver->probe and set dev->device.driver, which will be NULL if the probe fails.
In vdev_cleanup, drv = container_of(dev->device.driver) drv w
bus/vdev: fix crash in device cleanup
vdev_probe calls driver->probe and set dev->device.driver, which will be NULL if the probe fails.
In vdev_cleanup, drv = container_of(dev->device.driver) drv will be !NULL in this case, causing drv->remove Segmentation fault.
Fixed by checking dev->device.driver before.
Log: $ sudo dpdk-test --vdev=crypto_uadk --log-level=6 vdev_probe(): failed to initialize crypto_uadk device EAL: Bus (vdev) probe failed. RTE>>quit Segmentation fault
Fixes: 1cab1a40ea9b ("bus: cleanup devices on shutdown")
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Reviewed-by: David Marchand <david.marchand@redhat.com>
show more ...
|
#
1cab1a40 |
| 04-Oct-2022 |
Kevin Laatz <kevin.laatz@intel.com> |
bus: cleanup devices on shutdown
During EAL init, all buses are probed and the devices found are initialized. On eal_cleanup(), the inverse does not happen, meaning any allocated memory and other co
bus: cleanup devices on shutdown
During EAL init, all buses are probed and the devices found are initialized. On eal_cleanup(), the inverse does not happen, meaning any allocated memory and other configuration will not be cleaned up appropriately on exit.
Currently, in order for device cleanup to take place, applications must call the driver-relevant functions to ensure proper cleanup is done before the application exits. Since initialization occurs for all devices on the bus, not just the devices used by an application, it requires a) application awareness of all bus devices that could have been probed on the system, and b) code duplication across applications to ensure cleanup is performed. An example of this is rte_eth_dev_close() which is commonly used across the example applications.
This patch proposes adding bus cleanup to the eal_cleanup() to make EAL's init/exit more symmetrical, ensuring all bus devices are cleaned up appropriately without the application needing to be aware of all bus types that may have been probed during initialization.
Contained in this patch are the changes required to perform cleanup for devices on the PCI bus and VDEV bus during eal_cleanup(). There would be an ask for bus maintainers to add the relevant cleanup for their buses since they have the domain expertise.
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
#
1acb7f54 |
| 28-Jul-2022 |
David Marchand <david.marchand@redhat.com> |
dev: hide driver object
Make rte_driver opaque for non internal users. This will make extending this object possible without breaking the ABI.
Introduce a new driver header and move rte_driver defi
dev: hide driver object
Make rte_driver opaque for non internal users. This will make extending this object possible without breaking the ABI.
Introduce a new driver header and move rte_driver definition. Update drivers and library to use the internal header.
Some applications may have been dereferencing rte_driver objects, mark this object's accessors as stable.
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Acked-by: Akhil Goyal <gakhil@marvell.com> Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
show more ...
|
#
a04322f6 |
| 28-Jul-2022 |
David Marchand <david.marchand@redhat.com> |
bus: hide bus object
Make rte_bus opaque for non internal users. This will make extending this object possible without breaking the ABI.
Introduce a new driver header and move rte_bus definition an
bus: hide bus object
Make rte_bus opaque for non internal users. This will make extending this object possible without breaking the ABI.
Introduce a new driver header and move rte_bus definition and helpers. Update drivers and library to use the internal header.
Some applications may have been dereferencing rte_bus objects, mark this object's accessors as stable.
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
#
4851ef2b |
| 28-Jul-2022 |
David Marchand <david.marchand@redhat.com> |
bus/vdev: make driver-only headers private
The vdev 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 indentat
bus/vdev: make driver-only headers private
The vdev 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: Rosen Xu <rosen.xu@intel.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
show more ...
|
#
f1f6ebc0 |
| 24-Aug-2021 |
William Tu <u9012063@gmail.com> |
eal: remove sys/queue.h from public headers
Currently there are some public headers that include 'sys/queue.h', which is not POSIX, but usually provided by the Linux/BSD system library. (Not in POSI
eal: remove sys/queue.h from public headers
Currently there are some public headers that include 'sys/queue.h', which is not POSIX, but usually provided by the Linux/BSD system library. (Not in POSIX.1, POSIX.1-2001, or POSIX.1-2008. Present on the BSDs.) The file is missing on Windows. During the Windows build, DPDK uses a bundled copy, so building a DPDK library works fine. But when OVS or other applications use DPDK as a library, because some DPDK public headers include 'sys/queue.h', on Windows, it triggers an error due to no such file.
One solution is to install the 'lib/eal/windows/include/sys/queue.h' into Windows environment, such as [1]. However, this means DPDK exports the functionalities of 'sys/queue.h' into the environment, which might cause symbols, macros, headers clashing with other applications.
The patch fixes it by removing the "#include <sys/queue.h>" from DPDK public headers, so programs including DPDK headers don't depend on the system to provide 'sys/queue.h'. When these public headers use macros such as TAILQ_xxx, we replace it by the ones with RTE_ prefix. For Windows, we copy the definitions from <sys/queue.h> to rte_os.h in Windows EAL. Note that these RTE_ macros are compatible with <sys/queue.h>, both at the level of API (to use with <sys/queue.h> macros in C files) and ABI (to avoid breaking it).
Additionally, the TAILQ_FOREACH_SAFE is not part of <sys/queue.h>, the patch replaces it with RTE_TAILQ_FOREACH_SAFE.
[1] http://mails.dpdk.org/archives/dev/2021-August/216304.html
Suggested-by: Nick Connolly <nick.connolly@mayadata.io> Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Signed-off-by: William Tu <u9012063@gmail.com> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>
show more ...
|
#
eeded204 |
| 26-Apr-2021 |
David Marchand <david.marchand@redhat.com> |
log: register with standardized names
Let's try to enforce the convention where most drivers use a pmd. logtype with their class reflected in it, and libraries use a lib. logtype.
Introduce two new
log: register with standardized names
Let's try to enforce the convention where most drivers use a pmd. logtype with their class reflected in it, and libraries use a lib. logtype.
Introduce two new macros: - RTE_LOG_REGISTER_DEFAULT can be used when a single logtype is used in a component. It is associated to the default name provided by the build system, - RTE_LOG_REGISTER_SUFFIX can be used when multiple logtypes are used, and then the passed name is appended to the default name,
RTE_LOG_REGISTER is left untouched for existing external users and for components that do not comply with the convention.
There is a new Meson variable log_prefix to adapt the default name for baseband (pmd.bb.), bus (no pmd.) and mempool (no pmd.) classes.
Note: achieved with below commands + reverted change on net/bonding + edits on crypto/virtio, compress/mlx5, regex/mlx5
$ git grep -l RTE_LOG_REGISTER drivers/ | while read file; do pattern=${file##drivers/}; class=${pattern%%/*}; pattern=${pattern#$class/}; drv=${pattern%%/*}; case "$class" in baseband) pattern=pmd.bb.$drv;; bus) pattern=bus.$drv;; mempool) pattern=mempool.$drv;; *) pattern=pmd.$class.$drv;; esac sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file; sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file; done
$ git grep -l RTE_LOG_REGISTER lib/ | while read file; do pattern=${file##lib/}; pattern=lib.${pattern%%/*}; sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file; sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file; done
Signed-off-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
#
64051bb1 |
| 13-Apr-2021 |
Xueming Li <xuemingl@nvidia.com> |
devargs: unify scratch buffer storage
In current design, legacy parser rte_devargs_parse() saved scratch buffer to devargs.args while new parser rte_devargs_layers_parse() saved to devargs.data. Cod
devargs: unify scratch buffer storage
In current design, legacy parser rte_devargs_parse() saved scratch buffer to devargs.args while new parser rte_devargs_layers_parse() saved to devargs.data. Code using devargs had to know the difference and cleaned up memory accordingly - error prone.
This patch unifies scratch buffer to data field, introduces rte_devargs_reset() function to wrap the memory clean up logic.
Signed-off-by: Xueming Li <xuemingl@nvidia.com> Acked-by: Ray Kinsella <mdr@ashroe.eu> Reviewed-by: Gaetan Rivet <grive@u256.net>
show more ...
|
#
8d935fff |
| 26-Jan-2021 |
Maxime Coquelin <maxime.coquelin@redhat.com> |
bus/vdev: add driver IOVA VA mode requirement
This patch adds driver flag in vdev bus driver so that vdev drivers can require VA IOVA mode to be used, which for example the case of Virtio-user PMD.
bus/vdev: add driver IOVA VA mode requirement
This patch adds driver flag in vdev bus driver so that vdev drivers can require VA IOVA mode to be used, which for example the case of Virtio-user PMD.
The patch implements the .get_iommu_class() callback, that is called before devices probing to determine the IOVA mode to be used, and adds a check right before the device is probed to ensure compatible IOVA mode has been selected.
It also adds a ABI exception rule to accommodate with an update on the driver registration API
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
show more ...
|
#
c753160d |
| 16-Nov-2020 |
David Marchand <david.marchand@redhat.com> |
bus/vdev: fix comment
RTE_DEV_WHITELISTED is now replaced with RTE_DEV_ALLOWED.
Fixes: a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums")
Signed-off-by: David Marchand <david.marc
bus/vdev: fix comment
RTE_DEV_WHITELISTED is now replaced with RTE_DEV_ALLOWED.
Fixes: a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums")
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
show more ...
|
#
6a2288ed |
| 29-Sep-2020 |
Maxime Coquelin <maxime.coquelin@redhat.com> |
bus/vdev: add DMA mapping ops
Add DMA map/unmap operation callbacks to the vdev bus, which could be used by DMA capable vdev drivers.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Rev
bus/vdev: add DMA mapping ops
Add DMA map/unmap operation callbacks to the vdev bus, which could be used by DMA capable vdev drivers.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
show more ...
|
#
9c99878a |
| 01-Jul-2020 |
Jerin Jacob <jerinj@marvell.com> |
log: introduce logtype register macro
Introduce the RTE_LOG_REGISTER macro to avoid the code duplication in the logtype registration process.
It is a wrapper macro for declaring the logtype, regist
log: introduce logtype register macro
Introduce the RTE_LOG_REGISTER macro to avoid the code duplication in the logtype registration process.
It is a wrapper macro for declaring the logtype, registering it and setting its level in the constructor context.
Signed-off-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com> Acked-by: Sachin Saxena <sachin.saxena@nxp.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
show more ...
|
#
edf73dd3 |
| 25-Apr-2019 |
Anatoly Burakov <anatoly.burakov@intel.com> |
ipc: handle unsupported IPC in action register
Currently, IPC API will silently ignore unsupported IPC. Fix the API call and its callers to explicitly handle unsupported IPC cases.
For primary proc
ipc: handle unsupported IPC in action register
Currently, IPC API will silently ignore unsupported IPC. Fix the API call and its callers to explicitly handle unsupported IPC cases.
For primary processes, it is OK to not have IPC because there may not be any secondary processes in the first place, and there are valid use cases that disable IPC support, so all primary process usages are fixed up to ignore IPC failures.
For secondary processes, IPC will be crucial, so leave all of the error handling as is.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
show more ...
|
#
f9acaf84 |
| 03-Apr-2019 |
Bruce Richardson <bruce.richardson@intel.com> |
replace snprintf with strlcpy without adding extra include
For files that already have rte_string_fns.h included in them, we can do a straight replacement of snprintf(..."%s",...) with strlcpy. The
replace snprintf with strlcpy without adding extra include
For files that already have rte_string_fns.h included in them, we can do a straight replacement of snprintf(..."%s",...) with strlcpy. The changes in this patch were auto-generated via command:
spatch --sp-file devtools/cocci/strlcpy-with-header.cocci --dir . --in-place
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
#
e892fa59 |
| 21-Feb-2019 |
Raslan Darawsheh <rasland@mellanox.com> |
bus/vdev: fix hotplug twice
In case vdev was already probed, it shouldn't be probed again, and it should return -EEXIST as error. There are some checks in vdev_probe() and insert_vdev(), but a check
bus/vdev: fix hotplug twice
In case vdev was already probed, it shouldn't be probed again, and it should return -EEXIST as error. There are some checks in vdev_probe() and insert_vdev(), but a check was missing in vdev_plug(). The check is moved in vdev_probe_all_drivers() which is called in all code paths.
Fixes: e9d159c3d534 ("eal: allow probing a device again") Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
show more ...
|
#
4169ed6e |
| 21-Feb-2019 |
Thomas Monjalon <thomas@monjalon.net> |
bus/vdev: fix debug message on probing
The log was printing the device name two times, first one being supposed to be the driver name. As we don't know yet the driver name, the log is simplified.
F
bus/vdev: fix debug message on probing
The log was printing the device name two times, first one being supposed to be the driver name. As we don't know yet the driver name, the log is simplified.
Fixes: 9bf4901d1a11 ("bus/vdev: remove probe with driver name option") Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Rami Rosen <ramirose@gmail.com> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
show more ...
|
#
c7ad7754 |
| 07-Nov-2018 |
Thomas Monjalon <thomas@monjalon.net> |
devargs: do not replace already inserted device
The devargs of a device can be replaced by a newly allocated one when trying to probe again the same device (multi-process or multi-ports scenarios).
devargs: do not replace already inserted device
The devargs of a device can be replaced by a newly allocated one when trying to probe again the same device (multi-process or multi-ports scenarios). This is breaking some pointer references.
It can be avoided by copying the new content, freeing the new devargs, and returning the already inserted pointer.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Tested-by: Qi Zhang <qi.z.zhang@intel.com> Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
show more ...
|
#
b74fd6b8 |
| 28-Oct-2018 |
Ferruh Yigit <ferruh.yigit@intel.com> |
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
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>
show more ...
|
#
f5b2eff0 |
| 25-Oct-2018 |
Qi Zhang <qi.z.zhang@intel.com> |
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.
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: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
show more ...
|
#
66fd3a3b |
| 21-Sep-2018 |
Paul Luse <paul.e.luse@intel.com> |
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
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: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Fixes: 783b6e54971d ("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>
show more ...
|