This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, api-next has been updated
via cba5ed063304a619bd709a9f37400884dce90485 (commit)
from c4c5fbb7ab395443d53efed0741136d92ef13d7a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cba5ed063304a619bd709a9f37400884dce90485
Author: Honnappa Nagarahalli <honnappa.nagarahalli(a)linaro.org>
Date: Thu Apr 6 23:07:04 2017 -0500
helper: cuckoo: add queue size config to cuckoo table
Some queue implementations in ODP take queue size input. Cuckoo table is
modified to provide the queue size input while creating the queue.
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli(a)linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/helper/cuckootable.c b/helper/cuckootable.c
index 80ff4989..0d46300e 100644
--- a/helper/cuckootable.c
+++ b/helper/cuckootable.c
@@ -256,6 +256,7 @@ odph_cuckoo_table_create(
/* initialize free_slots queue */
odp_queue_param_init(&qparam);
qparam.type = ODP_QUEUE_TYPE_PLAIN;
+ qparam.size = capacity;
snprintf(queue_name, sizeof(queue_name), "fs_%s", name);
queue = odp_queue_create(queue_name, &qparam);
-----------------------------------------------------------------------
Summary of changes:
helper/cuckootable.c | 1 +
1 file changed, 1 insertion(+)
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via 5622f689653013b317842386a1aed81dd81fe749 (commit)
via 2e8f024440a1e770068b1e9a9d50770ab166e40d (commit)
via 51e3b8776b78180741fa57a621f9d13b9ae8bbfb (commit)
from d20f3a639d236066cbd76514df5c4faaa0ae17e9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5622f689653013b317842386a1aed81dd81fe749
Author: Bogdan Pricope <bogdan.pricope(a)linaro.org>
Date: Tue Apr 11 14:25:56 2017 +0300
example: generator: flush output messages
Signed-off-by: Bogdan Pricope <bogdan.pricope(a)linaro.org>
Reviewed-and-tested-by: Yi He <yi.he(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index 63e3f2b5..ede1cdf2 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -464,6 +464,7 @@ static int create_pktio(const char *dev, odp_pool_t pool,
" default pktio%02" PRIu64 "\n",
odp_pktio_to_u64(itf->pktio), dev,
odp_pktio_to_u64(itf->pktio));
+ fflush(NULL);
return 0;
}
@@ -773,6 +774,7 @@ static void print_global_stats(int num_workers)
pkts_snd, odp_atomic_load_u64(&counters.tx_drops),
pps_snd, maximum_pps_snd,
pkts_rcv, pps_rcv, maximum_pps_rcv);
+ fflush(NULL);
}
}
@@ -855,6 +857,7 @@ int main(int argc, char *argv[])
printf("num worker threads: %i\n", num_workers);
printf("first CPU: %i\n", odp_cpumask_first(&cpumask));
printf("cpu mask: %s\n", cpumaskstr);
+ fflush(NULL);
/* ping mode need two workers */
if (args->appl.mode == APPL_MODE_PING) {
commit 2e8f024440a1e770068b1e9a9d50770ab166e40d
Author: Bogdan Pricope <bogdan.pricope(a)linaro.org>
Date: Tue Apr 11 14:25:55 2017 +0300
example: generator: fix stop criteria - number of packets sent
Signed-off-by: Bogdan Pricope <bogdan.pricope(a)linaro.org>
Reviewed-and-tested-by: Yi He <yi.he(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index 95fb5432..63e3f2b5 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -513,8 +513,8 @@ static int gen_send_thread(void *arg)
for (;;) {
if (args->appl.number != -1 &&
- odp_atomic_fetch_add_u64(&counters.cnt, 1) >=
- (unsigned int)args->appl.number)
+ odp_atomic_fetch_add_u64(&counters.cnt, pkt_array_size) >=
+ (unsigned int)args->appl.number)
break;
if (args->appl.mode == APPL_MODE_UDP) {
commit 51e3b8776b78180741fa57a621f9d13b9ae8bbfb
Author: Maxim Uvarov <maxim.uvarov(a)linaro.org>
Date: Fri Mar 31 23:39:39 2017 +0300
test: tm: skip tm result under travis run
tm test fails time to time in Travis environment. Because
of we can not control that machine we can not do things like
taskset and core isolation there. So simple run test and ignore
it's result. Threat only segfault as actual error. Linaro CI
will still do full test.
https://bugs.linaro.org/show_bug.cgi?id=2881
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org>
diff --git a/test/common_plat/validation/api/traffic_mngr/Makefile.am b/test/common_plat/validation/api/traffic_mngr/Makefile.am
index 35e689a0..a012c1b3 100644
--- a/test/common_plat/validation/api/traffic_mngr/Makefile.am
+++ b/test/common_plat/validation/api/traffic_mngr/Makefile.am
@@ -1,10 +1,18 @@
include ../Makefile.inc
+TESTS_ENVIRONMENT += TEST_DIR=${builddir}
+
+TESTSCRIPTS = traffic_mngr.sh
+TEST_EXTENSIONS = .sh
+
+TESTS = $(TESTSCRIPTS)
+
noinst_LTLIBRARIES = libtesttraffic_mngr.la
libtesttraffic_mngr_la_SOURCES = traffic_mngr.c
-test_PROGRAMS = traffic_mngr_main$(EXEEXT)
+bin_PROGRAMS = traffic_mngr_main$(EXEEXT)
dist_traffic_mngr_main_SOURCES = traffic_mngr_main.c
traffic_mngr_main_LDADD = libtesttraffic_mngr.la -lm $(LIBCUNIT_COMMON) $(LIBODP)
-EXTRA_DIST = traffic_mngr.h
+EXTRA_DIST = traffic_mngr.h $(TESTSCRIPTS)
+dist_check_SCRIPTS = $(TESTSCRIPTS)
diff --git a/test/common_plat/validation/api/traffic_mngr/traffic_mngr.sh b/test/common_plat/validation/api/traffic_mngr/traffic_mngr.sh
new file mode 100755
index 00000000..a7d54162
--- /dev/null
+++ b/test/common_plat/validation/api/traffic_mngr/traffic_mngr.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Copyright (c) 2017, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# directory where test binaries have been built
+TEST_DIR="${TEST_DIR:-$(dirname $0)}"
+
+# exit codes expected by automake for skipped tests
+TEST_SKIPPED=77
+
+${TEST_DIR}/traffic_mngr_main${EXEEXT}
+ret=$?
+
+SIGSEGV=139
+
+if [ "${TRAVIS}" = "true" ] && [ $ret -ne 0 ] && [ $ret -ne ${SIGSEGV} ]; then
+ echo "SKIP: skip due to not isolated environment"
+ exit ${TEST_SKIPPED}
+fi
+
+exit $ret
-----------------------------------------------------------------------
Summary of changes:
example/generator/odp_generator.c | 7 ++++--
.../validation/api/traffic_mngr/Makefile.am | 12 +++++++++--
.../validation/api/traffic_mngr/traffic_mngr.sh | 25 ++++++++++++++++++++++
3 files changed, 40 insertions(+), 4 deletions(-)
create mode 100755 test/common_plat/validation/api/traffic_mngr/traffic_mngr.sh
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via d20f3a639d236066cbd76514df5c4faaa0ae17e9 (commit)
from 8eba3e76f32bb2d17b88ba13f633606fef61efe8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d20f3a639d236066cbd76514df5c4faaa0ae17e9
Author: Brian Brooks <brian.brooks(a)arm.com>
Date: Tue Apr 4 13:47:59 2017 -0500
test: odp_scheduling: handle dequeueing from a concurrent queue
Signed-off-by: Ola Liljedahl <ola.liljedahl(a)arm.com>
Reviewed-by: Brian Brooks <brian.brooks(a)arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli(a)arm.com>
Reviewed-by: Kevin Wang <kevin.wang(a)arm.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/test/common_plat/performance/odp_scheduling.c b/test/common_plat/performance/odp_scheduling.c
index c74a0713..38e76257 100644
--- a/test/common_plat/performance/odp_scheduling.c
+++ b/test/common_plat/performance/odp_scheduling.c
@@ -273,7 +273,7 @@ static int test_plain_queue(int thr, test_globals_t *globals)
test_message_t *t_msg;
odp_queue_t queue;
uint64_t c1, c2, cycles;
- int i;
+ int i, j;
/* Alloc test message */
buf = odp_buffer_alloc(globals->pool);
@@ -307,7 +307,15 @@ static int test_plain_queue(int thr, test_globals_t *globals)
return -1;
}
- ev = odp_queue_deq(queue);
+ /* When enqueue and dequeue are decoupled (e.g. not using a
+ * common lock), an enqueued event may not be immediately
+ * visible to dequeue. So we just try again for a while. */
+ for (j = 0; j < 100; j++) {
+ ev = odp_queue_deq(queue);
+ if (ev != ODP_EVENT_INVALID)
+ break;
+ odp_cpu_pause();
+ }
buf = odp_buffer_from_event(ev);
-----------------------------------------------------------------------
Summary of changes:
test/common_plat/performance/odp_scheduling.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via 8eba3e76f32bb2d17b88ba13f633606fef61efe8 (commit)
from 39be9572056ee715468214ad6d2d5c01054456d7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8eba3e76f32bb2d17b88ba13f633606fef61efe8
Author: Kevin Wang <kevin.wang(a)arm.com>
Date: Mon Apr 10 13:43:05 2017 +0800
linux-gen: pktio: miss an unlock operation before exit if error happens
Just set the return value, and remove the return() function at the
failure branch.
https://bugs.linaro.org/show_bug.cgi?id=2933
Signed-off-by: Kevin Wang <kevin.wang(a)arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl(a)arm.com>
Reviewed-by: Brian Brooks <brian.brooks(a)arm.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c
index 70962839..61e98ad8 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -176,7 +176,7 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED,
pktio_entry->s.stats.out_octets += bytes;
} else {
ODP_DBG("queue enqueue failed %i\n", ret);
- return -1;
+ ret = -1;
}
odp_ticketlock_unlock(&pktio_entry->s.txl);
-----------------------------------------------------------------------
Summary of changes:
platform/linux-generic/pktio/loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via 39be9572056ee715468214ad6d2d5c01054456d7 (commit)
from 3e5a07edf190614e739c8dba76cf165330e1b035 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 39be9572056ee715468214ad6d2d5c01054456d7
Author: Brian Brooks <brian.brooks(a)arm.com>
Date: Wed Apr 12 13:30:04 2017 -0500
configure.ac: fix native Clang build on ARMv8
The build is broken when using clang on ARM. -mcx16 is being passed to
clang when building natively on ARM. This combined with -Werror causes
the breakage. Fix it by skipping anything related to -mcx16 when not
building for x86-based architectures. See [1] for details.
Signed-off-by: Brian Brooks <brian.brooks(a)arm.com>
Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/configure.ac b/configure.ac
index 9320f360..d364b8dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -303,20 +303,22 @@ ODP_CFLAGS="$ODP_CFLAGS -std=c99"
# Extra flags for example to suppress certain warning types
ODP_CFLAGS="$ODP_CFLAGS $ODP_CFLAGS_EXTRA"
-#########################################################################
-# Check if compiler supports cmpxchng16
-##########################################################################
-if test "${CC}" != "gcc" -o ${CC_VERSION_MAJOR} -ge 5; then
- my_save_cflags="$CFLAGS"
-
- CFLAGS=-mcx16
- AC_MSG_CHECKING([whether CC supports -mcx16])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
- [AC_MSG_RESULT([yes])]
- [ODP_CFLAGS="$ODP_CFLAGS $CFLAGS"],
- [AC_MSG_RESULT([no])]
- )
- CFLAGS="$my_save_cflags"
+##########################################################################
+# Check if compiler supports cmpxchng16 on x86-based architectures
+##########################################################################
+if "${host}" == i?86* -o "${host}" == x86*; then
+ if test "${CC}" != "gcc" -o ${CC_VERSION_MAJOR} -ge 5; then
+ my_save_cflags="$CFLAGS"
+
+ CFLAGS=-mcx16
+ AC_MSG_CHECKING([whether CC supports -mcx16])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [AC_MSG_RESULT([yes])]
+ [ODP_CFLAGS="$ODP_CFLAGS $CFLAGS"],
+ [AC_MSG_RESULT([no])]
+ )
+ CFLAGS="$my_save_cflags"
+ fi
fi
##########################################################################
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via 3e5a07edf190614e739c8dba76cf165330e1b035 (commit)
from 8c0df898b6f90564037fba43b1e9e6224e4ee740 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3e5a07edf190614e739c8dba76cf165330e1b035
Author: Bill Fischofer <bill.fischofer(a)linaro.org>
Date: Sun Apr 2 17:55:20 2017 -0500
linux-generic: debug: enable helper use from c++ programs
The ODP_STATIC_ASSERT() macro expands to _Static_assert(), however when
used in C++ programs this needs to expand to static_assert().
This resolves Bug https://bugs.linaro.org/show_bug.cgi?id=2852
Reported-by: Moshe Tubul <moshe.tubul(a)firmitas-cs.com>
Signed-off-by: Bill Fischofer <bill.fischofer(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/platform/linux-generic/include/odp/api/debug.h b/platform/linux-generic/include/odp/api/debug.h
index 7db14339..b0f91b1c 100644
--- a/platform/linux-generic/include/odp/api/debug.h
+++ b/platform/linux-generic/include/odp/api/debug.h
@@ -19,17 +19,36 @@ extern "C" {
#include <odp/api/spec/debug.h>
-#if defined(__GNUC__) && !defined(__clang__)
-
-#if __GNUC__ < 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ < 6))
-
/**
- * @internal _Static_assert was only added in GCC 4.6. Provide a weak replacement
- * for previous versions.
+ * @internal _Static_assert was only added in GCC 4.6 and the C++ version
+ * static_assert for g++ 6 and above. Provide a weak replacement for previous
+ * versions.
*/
-#define _Static_assert(e, s) (extern int (*static_assert_checker(void)) \
- [sizeof(struct { unsigned int error_if_negative:(e) ? 1 : -1; })])
+#define _odp_merge(a, b) a##b
+#define _odp_label(a) _odp_merge(_ODP_SASSERT_, a)
+#define _ODP_SASSERT _odp_label(__COUNTER__)
+#define _ODP_SASSERT_ENUM(e) { _ODP_SASSERT = 1 / !!(e) }
+#define _odp_static_assert(e, s) enum _ODP_SASSERT_ENUM(e)
+
+#if defined(__clang__)
+#if defined(__cplusplus)
+#if !__has_feature(cxx_static_assert) && !defined(static_assert)
+#define static_assert(e, s) _odp_static_assert(e, s)
+#endif
+#elif !__has_feature(c_static_assert) && !defined(_Static_assert)
+#define _Static_assert(e, s) _odp_static_assert(e, s)
+#endif
+#elif defined(__GNUC__)
+#if __GNUC__ < 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ < 6)) || \
+ (__GNUC__ < 6 && defined(__cplusplus))
+#if defined(__cplusplus)
+#if !defined(static_assert)
+#define static_assert(e, s) _odp_static_assert(e, s)
+#endif
+#elif !defined(_Static_assert)
+#define _Static_assert(e, s) _odp_static_assert(e, s)
+#endif
#endif
#endif
@@ -39,9 +58,11 @@ extern "C" {
* if condition 'cond' is false. Macro definition is empty when compiler is not
* supported or the compiler does not support static assertion.
*/
-#define ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
+#ifndef __cplusplus
+#define ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
-#ifdef __cplusplus
+#else
+#define ODP_STATIC_ASSERT(cond, msg) static_assert(cond, msg)
}
#endif
diff --git a/test/common_plat/miscellaneous/odp_api_from_cpp.cpp b/test/common_plat/miscellaneous/odp_api_from_cpp.cpp
index 2b307864..4578ae4b 100644
--- a/test/common_plat/miscellaneous/odp_api_from_cpp.cpp
+++ b/test/common_plat/miscellaneous/odp_api_from_cpp.cpp
@@ -1,10 +1,9 @@
#include <cstdio>
#include <odp_api.h>
-#include <odp/helper/threads.h>
+#include <odp/helper/odph_api.h>
int main(int argc ODP_UNUSED, const char *argv[] ODP_UNUSED)
{
-
printf("\tODP API version: %s\n", odp_version_api_str());
printf("\tODP implementation version: %s\n", odp_version_impl_str());
-----------------------------------------------------------------------
Summary of changes:
platform/linux-generic/include/odp/api/debug.h | 41 ++++++++++++++++------
.../common_plat/miscellaneous/odp_api_from_cpp.cpp | 3 +-
2 files changed, 32 insertions(+), 12 deletions(-)
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, api-next has been updated
via dd36b4758d0cd9f9929a13d42ec2ac38ae972e37 (commit)
via f9a28807aaf8781c9b9576a04dce207f95fb8118 (commit)
from 186c93faeecb570db14da3d4ce3b192a25724de1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit dd36b4758d0cd9f9929a13d42ec2ac38ae972e37
Author: Petri Savolainen <petri.savolainen(a)linaro.org>
Date: Thu Apr 13 17:40:51 2017 +0300
validation: queue: test queue max_num per type
Updated implementation and test with type specific number of
queues.
Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli(a)linaro.org>
Reviewed-by: Balasubramanian Manoharan <bala.manoharan(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c
index fcf4bf5b..1114c95c 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -175,6 +175,8 @@ int odp_queue_capability(odp_queue_capability_t *capa)
capa->max_ordered_locks = sched_fn->max_ordered_locks();
capa->max_sched_groups = sched_fn->num_grps();
capa->sched_prios = odp_schedule_num_prio();
+ capa->plain.max_num = capa->max_queues;
+ capa->sched.max_num = capa->max_queues;
return 0;
}
diff --git a/test/common_plat/validation/api/queue/queue.c b/test/common_plat/validation/api/queue/queue.c
index 1f7913a1..6a13c006 100644
--- a/test/common_plat/validation/api/queue/queue.c
+++ b/test/common_plat/validation/api/queue/queue.c
@@ -56,7 +56,7 @@ void queue_test_capa(void)
odp_queue_param_t qparams;
char name[ODP_QUEUE_NAME_LEN];
odp_queue_t queue[MAX_QUEUES];
- uint32_t num_queues, i;
+ uint32_t num_queues, min, i, j;
memset(&capa, 0, sizeof(odp_queue_capability_t));
CU_ASSERT(odp_queue_capability(&capa) == 0);
@@ -65,34 +65,49 @@ void queue_test_capa(void)
CU_ASSERT(capa.max_ordered_locks != 0);
CU_ASSERT(capa.max_sched_groups != 0);
CU_ASSERT(capa.sched_prios != 0);
+ CU_ASSERT(capa.plain.max_num != 0);
+ CU_ASSERT(capa.sched.max_num != 0);
+
+ min = capa.plain.max_num;
+ if (min > capa.sched.max_num)
+ min = capa.sched.max_num;
+
+ CU_ASSERT(capa.max_queues >= min);
for (i = 0; i < ODP_QUEUE_NAME_LEN; i++)
name[i] = 'A' + (i % 26);
name[ODP_QUEUE_NAME_LEN - 1] = 0;
- if (capa.max_queues > MAX_QUEUES)
- num_queues = MAX_QUEUES;
- else
- num_queues = capa.max_queues;
-
odp_queue_param_init(&qparams);
- for (i = 0; i < num_queues; i++) {
- generate_name(name, i);
- queue[i] = odp_queue_create(name, &qparams);
+ for (j = 0; j < 2; j++) {
+ if (j == 0) {
+ num_queues = capa.plain.max_num;
+ } else {
+ num_queues = capa.sched.max_num;
+ qparams.type = ODP_QUEUE_TYPE_SCHED;
+ }
+
+ if (num_queues > MAX_QUEUES)
+ num_queues = MAX_QUEUES;
- if (queue[i] == ODP_QUEUE_INVALID) {
- CU_FAIL("Queue create failed");
- num_queues = i;
- break;
+ for (i = 0; i < num_queues; i++) {
+ generate_name(name, i);
+ queue[i] = odp_queue_create(name, &qparams);
+
+ if (queue[i] == ODP_QUEUE_INVALID) {
+ CU_FAIL("Queue create failed");
+ num_queues = i;
+ break;
+ }
+
+ CU_ASSERT(odp_queue_lookup(name) != ODP_QUEUE_INVALID);
}
- CU_ASSERT(odp_queue_lookup(name) != ODP_QUEUE_INVALID);
+ for (i = 0; i < num_queues; i++)
+ CU_ASSERT(odp_queue_destroy(queue[i]) == 0);
}
-
- for (i = 0; i < num_queues; i++)
- CU_ASSERT(odp_queue_destroy(queue[i]) == 0);
}
void queue_test_mode(void)
commit f9a28807aaf8781c9b9576a04dce207f95fb8118
Author: Petri Savolainen <petri.savolainen(a)linaro.org>
Date: Thu Apr 13 17:40:50 2017 +0300
api: queue: added queue size param
Added capability information about maximum number of queues
and queue sizes. Both are defined per queue type, since
plain and scheduled queues may have different implementations
(e.g. one uses HW while the other is SW).
Added queue size parameter, which specifies how large
storage size application requires in minimum.
Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli(a)linaro.org>
Reviewed-by: Balasubramanian Manoharan <bala.manoharan(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h
index 7972feac..9dd0a561 100644
--- a/include/odp/api/spec/queue.h
+++ b/include/odp/api/spec/queue.h
@@ -100,7 +100,9 @@ typedef enum odp_queue_op_mode_t {
* Queue capabilities
*/
typedef struct odp_queue_capability_t {
- /** Maximum number of event queues */
+ /** Maximum number of event queues of any type (default size). Use
+ * this in addition to queue type specific 'max_num', if both queue
+ * types are used simultaneously. */
uint32_t max_queues;
/** Maximum number of ordered locks per queue */
@@ -112,6 +114,32 @@ typedef struct odp_queue_capability_t {
/** Number of scheduling priorities */
unsigned sched_prios;
+ /** Plain queue capabilities */
+ struct {
+ /** Maximum number of plain queues of the default size. */
+ uint32_t max_num;
+
+ /** Maximum number of events a plain queue can store
+ * simultaneously. The value of zero means that plain
+ * queues do not have a size limit, but a single queue can
+ * store all available events. */
+ uint32_t max_size;
+
+ } plain;
+
+ /** Scheduled queue capabilities */
+ struct {
+ /** Maximum number of scheduled queues of the default size. */
+ uint32_t max_num;
+
+ /** Maximum number of events a scheduled queue can store
+ * simultaneously. The value of zero means that scheduled
+ * queues do not have a size limit, but a single queue can
+ * store all available events. */
+ uint32_t max_size;
+
+ } sched;
+
} odp_queue_capability_t;
/**
@@ -165,6 +193,15 @@ typedef struct odp_queue_param_t {
* The implementation may use this value as a hint for the number of
* context data bytes to prefetch. Default value is zero (no hint). */
uint32_t context_len;
+
+ /** Queue size
+ *
+ * The queue must be able to store at minimum this many events
+ * simultaneously. The value must not exceed 'max_size' queue
+ * capability. The value of zero means implementation specific
+ * default size. */
+ uint32_t size;
+
} odp_queue_param_t;
/**
-----------------------------------------------------------------------
Summary of changes:
include/odp/api/spec/queue.h | 39 ++++++++++++++++++++-
platform/linux-generic/odp_queue.c | 2 ++
test/common_plat/validation/api/queue/queue.c | 49 +++++++++++++++++----------
3 files changed, 72 insertions(+), 18 deletions(-)
hooks/post-receive
--