summaryrefslogtreecommitdiff
path: root/examples/qos_sched
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/qos_sched
parenta9dbe180222680edf8c49e86791f972549ce5be3 (diff)
downloaddpdk-draft-windows-d9a42a69febf453cdb735e77fc0e01463ddf4acc.zip
dpdk-draft-windows-d9a42a69febf453cdb735e77fc0e01463ddf4acc.tar.gz
dpdk-draft-windows-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/qos_sched')
-rw-r--r--examples/qos_sched/Makefile3
-rw-r--r--examples/qos_sched/init.c2
-rw-r--r--examples/qos_sched/meson.build1
3 files changed, 5 insertions, 1 deletions
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index 0f0a31f..e6dfbef 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -23,6 +23,8 @@ CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
@@ -55,6 +57,7 @@ all:
clean:
else
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
CFLAGS_args.o := -D_GNU_SOURCE
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 8914f76..c9e4879 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -298,7 +298,7 @@ int app_init(void)
char ring_name[MAX_NAME_LEN];
char pool_name[MAX_NAME_LEN];
- if (rte_eth_dev_count() == 0)
+ if (rte_eth_dev_count_avail() == 0)
rte_exit(EXIT_FAILURE, "No Ethernet port - bye\n");
/* load configuration profile */
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81c..5101652 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
# DPDK instance, use 'make'
deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
sources = files(
'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
'init.c', 'main.c', 'stats.c'