2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

netdev-dpdk: Use rte_eth_is_valid_port instead of manual check

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Mauricio Vásquez B <mauricio.vasquez@polito.it>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
This commit is contained in:
Ciara Loftus
2016-08-12 16:57:21 +01:00
committed by Daniele Di Proietto
parent c59b72b590
commit 7cd1261d13

View File

@@ -701,7 +701,7 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) OVS_REQUIRES(dpdk_mutex)
int diag;
int n_rxq, n_txq;
if (dev->port_id < 0 || dev->port_id >= rte_eth_dev_count()) {
if (!rte_eth_dev_is_valid_port(dev->port_id)) {
return ENODEV;
}
@@ -2160,8 +2160,9 @@ netdev_dpdk_get_status(const struct netdev *netdev, struct smap *args)
struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
struct rte_eth_dev_info dev_info;
if (dev->port_id < 0)
if (!rte_eth_dev_is_valid_port(dev->port_id)) {
return ENODEV;
}
ovs_mutex_lock(&dev->mutex);
rte_eth_dev_info_get(dev->port_id, &dev_info);