{
int ret = 0;
- if (port_id >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port_id))
return -EINVAL;
ret = (if_up) ?
{
int ret;
- if (port_id >= rte_eth_dev_count())
+ if (!rte_eth_dev_is_valid_port(port_id))
return -EINVAL;
if (new_mtu > ETHER_MAX_LEN)