Currently, 'rte_eth_dev_get_port_by_name' changes transmitted
'port_id' unconditionally. This is undocumented and misleading
behaviour as user may expect unchanged value in case of error.
Otherwise, there is no sense having both return value and
a pointer in the function.
Fixes:
9c5b8d8b9feb ("ethdev: clean port id retrieval when attaching")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
if (!nb_ports)
return -ENODEV;
- *port_id = RTE_MAX_ETHPORTS;
RTE_ETH_FOREACH_DEV(i) {
if (!strncmp(name,
rte_eth_dev_data[i].name, strlen(name))) {
* @param port_id
* pointer to port identifier of the device
* @return
-* - (0) if successful.
+* - (0) if successful and port_id is filled.
* - (-ENODEV or -EINVAL) on failure.
*/
int