path: root/drivers/net/failsafe/failsafe_eal.c
AgeCommit message (Collapse)Author
2019-03-29net/failsafe: change back-reference from sub-deviceRaslan Darawsheh
In multiprocess context, the sub-device structure is shared between processes. The reference to the failsafe device was a per process pointer. It's changed to port id which is the same for all processes. Signed-off-by: Raslan Darawsheh <> Signed-off-by: Thomas Monjalon <> Acked-by: Gaetan Rivet <>
2018-10-11eal: simplify parameters of hotplug functionsThomas Monjalon
All information about a device to probe can be grouped in a common string, which is what we usually call devargs. An application should not have to parse this string before calling the EAL probe function. And the syntax could evolve to be more complex and support matching multiple devices in one string. That's why the bus name and device name should be removed from rte_eal_hotplug_add(). Instead of changing this function, a simpler one is added and used in the old one, which may be deprecated later. When removing a device, we already know its rte_device handle which can be directly passed as parameter of rte_eal_hotplug_remove(). If the rte_device is not known, it can be retrieved with the devargs, by iterating in the device list (future RTE_DEV_FOREACH()). Similarly to the probing case, a new function is added and used in the old one, which may be deprecated later. The new function is used in failsafe, because the replacement is easy. Signed-off-by: Thomas Monjalon <> Reviewed-by: Andrew Rybchenko <> Acked-by: Gaetan Rivet <> Reviewed-by: Stephen Hemminger <>
2018-07-15devargs: add non-variadic parsing functionGaetan Rivet
rte_devargs_parse becomes non-variadic, rte_devargs_parsef becomes the variadic version, to be used to compose device strings. Signed-off-by: Gaetan Rivet <> Acked-by: Shreyansh Jain <> Acked-by: Thomas Monjalon <>
2018-05-14net/failsafe: fix sub-device ownership raceMatan Azrad
There is time between the sub-device port probing by the sub-device PMD to the sub-device port ownership taking by a fail-safe port. In this time, the port is available for the application usage. For example, the port will be exposed to the applications which use RTE_ETH_FOREACH_DEV iterator. Thus, ownership unaware applications may manage the port in this time what may cause a lot of problematic behaviors in the fail-safe sub-device initialization. Register to the ethdev NEW event to take the sub-device port ownership before it becomes exposed to the application. Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD") Cc: Signed-off-by: Matan Azrad <> Acked-by: Gaetan Rivet <> Reviewed-by: Stephen Hemminger <>
2018-05-14net/failsafe: fix sub-device visibilityThomas Monjalon
The iterator function rte_eth_find_next_owned_by(), used by the iterator macro RTE_ETH_FOREACH_DEV_OWNED_BY, are ignoring the devices which are neither ATTACHED nor REMOVED. Thus sub-devices, having the state DEFERRED, cannot be seen with the ethdev iterator. The state RTE_ETH_DEV_DEFERRED can be replaced by RTE_ETH_DEV_ATTACHED + owner. Fixes: dcd0c9c32b8d ("net/failsafe: use ownership mechanism for slaves") Cc: Signed-off-by: Thomas Monjalon <> Acked-by: Matan Azrad <> Acked-by: Gaetan Rivet <> Reviewed-by: Andrew Rybchenko <> Reviewed-by: Stephen Hemminger <>
2018-04-25devargs: use proper namespace prefixGaetan Rivet
rte_eal_devargs is useless, rte_devargs is sufficient. Only experimental functions are changed for now. Signed-off-by: Gaetan Rivet <> Acked-by: Thomas Monjalon <>
2018-04-25devargs: make parsing variadicGaetan Rivet
rte_eal_devargs_parse can be used by EAL subsystems, drivers, applications alike. Device parameters may be presented with different structure each time; as a single declaration string or several strings each describing different parts of the declaration. To simplify the use of this parsing facility, its parameters are made variadic. Signed-off-by: Gaetan Rivet <> Acked-by: Thomas Monjalon <>
2018-04-11align SPDX Mellanox copyrightsShahaf Shuler
Aligning Mellanox SPDX copyrights to a single format. In addition replace to SPDX licence files which were missed. Signed-off-by: Shahaf Shuler <> Acked-by: Adrien Mazarguil <>
2018-02-05net/failsafe: fix error string after ownership callGaetan Rivet
Ownership API returns a negative value, strerror expects a valid errno value, thus positive. Coverity issue: 260401 Fixes: dcd0c9c32b8d ("net/failsafe: use ownership mechanism for slaves") Signed-off-by: Gaetan Rivet <>
2018-02-01net/failsafe: use SPDX tags in 6WIND copyrighted filesOlivier Matz
Signed-off-by: Olivier Matz <> Acked-by: Bruce Richardson <> Acked-by: Thomas Monjalon <>
2018-01-31net/failsafe: use ownership mechanism for slavesMatan Azrad
Fail-safe PMD sub devices management is based on ethdev port mechanism. So, the sub-devices management structures are exposed to other DPDK entities which may use them in parallel to fail-safe PMD. Use the new port ownership mechanism to avoid multiple managments of fail-safe PMD sub-devices. Signed-off-by: Matan Azrad <> Acked-by: Gaetan Rivet <>
2018-01-21net/failsafe: add probed device captureMatan Azrad
Previous fail-safe code didn't support probed sub-devices capture and failed when it tried to probe them. Skip fail-safe sub-device probing when it already was probed. Signed-off-by: Matan Azrad <> Acked-by: Gaetan Rivet <>
2017-10-26net/failsafe: fix PCI devices initRaslan Darawsheh
When trying to attach a port as a sub-device, the ethdev port was compared with devargs. In the case of a PCI device, the name in devargs is the PCI address. And since DPDK 17.08, the devargs name of the underlying device was used to match an ethdev port: a1e7c17555e8 ("ethdev: use device name from device structure") But the recent commit 72e3efb149cc has reverted this wrong matching to use the ethdev port name as identifier of the port. It impacts functions like rte_eth_dev_allocated() used in failsafe for matching ports with given devargs. The fix is to search for matching devargs in underlying device of all ethdev ports. If many ports match the same PCI device, only the first one is matched. This limitation was already present in previous implementation of rte_eth_dev_allocated(), and must be adressed later with a better devargs syntax. Fixes: 72e3efb149cc ("ethdev: revert use port name from device structure") Cc: Signed-off-by: Raslan Darawsheh <> Acked-by: Gaetan Rivet <>
2017-10-06net/failsafe: fix failsafe bus uninit return valueRaslan Darawsheh
fs_bus_uninit is always returning 0 no matter what was the status of each sub device bus_uninit value. Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD") Cc: Signed-off-by: Raslan Darawsheh <> Acked-by: Gaetan Rivet <>
2017-07-19net/failsafe: support device removalGaetan Rivet
Listen to INTR_RMV events issued by slaves. Add atomic flags on slave queues to detect use of slave bursts function. If a removal is detected, set the recollection flag on this slave. During a slave upkeep round, if its recollection flag is set and its burst functions are not in use by any thread, remove that slave. Signed-off-by: Gaetan Rivet <> Acked-by: Olga Shern <>
2017-07-19net/failsafe: support flow APIGaetan Rivet
Signed-off-by: Gaetan Rivet <> Acked-by: Olga Shern <>
2017-07-19net/failsafe: add plug-in supportGaetan Rivet
Periodically check for the existence of a device. If a device has not been initialized and exists on the system, then it is probed and configured. The configuration process strives to synchronize the states between the plugged-in sub-device and the fail-safe device. Signed-off-by: Gaetan Rivet <> Acked-by: Olga Shern <>
2017-07-19net/failsafe: add fail-safe PMDGaetan Rivet
Introduce the fail-safe poll mode driver initialization and enable its build infrastructure. This PMD allows for applications to benefit from true hot-plugging support without having to implement it. It intercepts and manages Ethernet device removal events issued by slave PMDs and re-initializes them transparently when brought back. It also allows defining a contingency to the removal of a device, by designating a fail-over device that will take on transmitting operations if the preferred device is removed. Applications only see a fail-safe instance, without caring for underlying activity ensuring their continued operations. Signed-off-by: Gaetan Rivet <> Acked-by: Olga Shern <>