rte_lcore_has_role() returns 0 if role of lcore matches requested
role. The return value of the API is confusing, and this is a known
problem with a deprecation notice announcing the change to more
intuitive semantics:
Commit
064518f68d48 ("doc: announce EAL API change to lcore role function")
Implement changes announced in the deprecation notice, and remove it.
Also, fix usages of this API to reflect the change. Control thread patches
expected new behavior and were broken before, now they are fixed as well.
Fixes:
d651ee4919cd ("eal: set affinity for control threads")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
- ``eal_parse_pci_DomBDF`` replaced by ``rte_pci_addr_parse``
- ``rte_eal_compare_pci_addr`` replaced by ``rte_pci_addr_cmp``
-* eal: The semantics of the return value for the ``rte_lcore_has_role`` function
- are planned to change in v18.05. The function currently returns 0 and <0 for
- success and failure, respectively. This will change to 1 and 0 for true and
- false, respectively, to make use of the function more intuitive.
-
* eal: a new set of mbuf mempool ops name APIs for user, platform and best
mempool names have been defined in ``rte_mbuf`` in v18.02. The uses of
``rte_eal_mbuf_default_mempool_ops`` shall be replaced by
announced at least one release before the ABI change is made. There are no
ABI breaking changes planned.
+* eal: ``rte_lcore_has_role()`` return value changed.
+
+ This function now returns true or false, respectively,
+ rather than 0 or <0 for success or failure.
+ It makes use of the function more intuitive.
+
* mempool: capability flags and related functions have been removed.
Flags ``MEMPOOL_F_CAPA_PHYS_CONTIG`` and
if (lcore_id >= RTE_MAX_LCORE)
return -EINVAL;
- if (cfg->lcore_role[lcore_id] == role)
- return 0;
-
- return -EINVAL;
+ return cfg->lcore_role[lcore_id] == role;
}
int eal_cpuset_socket_id(rte_cpuset_t *cpusetp)
* @param role
* The role to be checked against.
* @return
- * On success, return 0; otherwise return a negative value.
+ * Boolean value: positive if test is true; otherwise returns 0.
*/
int
rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role);
if (unlikely((tim_lcore != (unsigned)LCORE_ID_ANY) &&
!(rte_lcore_is_enabled(tim_lcore) ||
- rte_lcore_has_role(tim_lcore, ROLE_SERVICE) == 0)))
+ rte_lcore_has_role(tim_lcore, ROLE_SERVICE))))
return -1;
if (type == PERIODICAL)