X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_pipeline%2Fkni.c;h=ed5f8942e21869e90b5268e369cfc1971a611833;hb=a9dbe1802226;hp=712775338274778b18b0b879bdfdc14655575d91;hpb=8728ccf37615904cf23fb8763895b05c9a3c6b0c;p=dpdk.git diff --git a/examples/ip_pipeline/kni.c b/examples/ip_pipeline/kni.c index 7127753382..ed5f8942e2 100644 --- a/examples/ip_pipeline/kni.c +++ b/examples/ip_pipeline/kni.c @@ -67,7 +67,7 @@ kni_config_network_interface(uint16_t port_id, uint8_t if_up) { int ret = 0; - if (port_id >= rte_eth_dev_count()) + if (!rte_eth_dev_is_valid_port(port_id)) return -EINVAL; ret = (if_up) ? @@ -82,7 +82,7 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu) { 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)