summaryrefslogtreecommitdiff
path: root/examples/ip_fragmentation
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2018-04-05 17:33:22 +0200
committerThomas Monjalon <thomas@monjalon.net>2018-04-18 00:48:41 +0200
commitd9a42a69febf453cdb735e77fc0e01463ddf4acc (patch)
tree02965fc7b153216e78ba1135d440d2085e46c1c0 /examples/ip_fragmentation
parenta9dbe180222680edf8c49e86791f972549ce5be3 (diff)
downloaddpdk-d9a42a69febf453cdb735e77fc0e01463ddf4acc.zip
dpdk-d9a42a69febf453cdb735e77fc0e01463ddf4acc.tar.gz
dpdk-d9a42a69febf453cdb735e77fc0e01463ddf4acc.tar.xz
ethdev: deprecate port count function
Some DPDK applications wrongly assume these requirements: - no hotplug, i.e. ports are never detached - all allocated ports are available to the application Such application iterates over ports by its own mean. The most common pattern is to request the port count and assume ports with index in the range [0..count[ can be used. In order to fix this common mistake in all external applications, the function rte_eth_dev_count is deprecated, while introducing the new functions rte_eth_dev_count_avail and rte_eth_dev_count_total. Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Diffstat (limited to 'examples/ip_fragmentation')
-rw-r--r--examples/ip_fragmentation/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index f525c3a..8952ea4 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -843,7 +843,7 @@ main(int argc, char **argv)
struct rte_eth_txconf *txconf;
struct rx_queue *rxq;
int socket, ret;
- unsigned nb_ports;
+ uint16_t nb_ports;
uint16_t queueid = 0;
unsigned lcore_id = 0, rx_lcore_id = 0;
uint32_t n_tx_queue, nb_lcores;
@@ -861,7 +861,7 @@ main(int argc, char **argv)
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid arguments");
- nb_ports = rte_eth_dev_count();
+ nb_ports = rte_eth_dev_count_avail();
if (nb_ports == 0)
rte_exit(EXIT_FAILURE, "No ports found!\n");