ethdev: keep port id unchanged if obtaining by name failed
authorIlya Maximets <i.maximets@samsung.com>
Thu, 18 May 2017 12:19:40 +0000 (15:19 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 9 Jun 2017 16:35:01 +0000 (18:35 +0200)
commita6793d47f328354d0a3a3984060bbfb967e4f91d
treee444e6827b4e735fb6a7c4a82c8878fe9673194f
parent18872f511c17a0a3591d4bfa5d56eefa5b85339c
ethdev: keep port id unchanged if obtaining by name failed

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>
lib/librte_ether/rte_ethdev.c
lib/librte_ether/rte_ethdev.h