[lng-odp] [PATCH] validation: timer: save expected expiration tick only on success
otherwise tt[i].tick in handle_tmo will be a wrong value in case timer set failed due to ODP_TIMER_NOEVENT(failed to cancel the outstanding timer). some hardware timer implementations needs at least two ticks gap between current tick and future tick to cancel the outstanding active timer. Signed-off-by: Jerin Jacob jerin.ja...@caviumnetworks.com --- test/validation/odp_timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c index 554b353..852343a 100644 --- a/test/validation/odp_timer.c +++ b/test/validation/odp_timer.c @@ -365,9 +365,9 @@ static void *worker_entrypoint(void *arg TEST_UNUSED) } else if (rc != ODP_TIMER_SUCCESS) { /* Set/reset failed, timer already expired */ ntoolate++; - } - /* Save expected expiration tick */ - tt[i].tick = cur_tick + tck; + } else if (rc == ODP_TIMER_SUCCESS) + /* Save expected expiration tick on success */ + tt[i].tick = cur_tick + tck; } struct timespec ts; ts.tv_sec = 0; -- 2.1.0 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
Re: [lng-odp] [API-NEXT PATCH] api: codespell: correct spelling
why this is for api-next? Patch fixes only spelling in doxygen description. It does not modify API. It has to go to master. Maxim. On 06/05/15 06:17, Bill Fischofer wrote: On Thu, Jun 4, 2015 at 12:18 PM, Mike Holmes mike.hol...@linaro.org mailto:mike.hol...@linaro.org wrote: Signed-off-by: Mike Holmes mike.hol...@linaro.org mailto:mike.hol...@linaro.org Reviewed-by: Bill Fischofer bill.fischo...@linaro.org mailto:bill.fischo...@linaro.org --- include/odp/api/crypto.h| 4 ++-- include/odp/api/packet_io.h | 2 +- include/odp/api/pool.h | 2 +- include/odp/api/queue.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/odp/api/crypto.h b/include/odp/api/crypto.h index 792549c..a9a2a1d 100644 --- a/include/odp/api/crypto.h +++ b/include/odp/api/crypto.h @@ -110,7 +110,7 @@ typedef struct odp_crypto_data_range { } odp_crypto_data_range_t; /** - * Crypto API session creation paramters + * Crypto API session creation parameters * * @todo Add odp_session_proc_info_t */ @@ -133,7 +133,7 @@ typedef struct odp_crypto_session_params { * Controls ordering of authentication and cipher operations, * and is relative to the operation (encode vs decode). * When encoding, @c TRUE indicates the authentication operation - * should be peformed @b after the cipher operation else before. + * should be performed @b after the cipher operation else before. * When decoding, @c TRUE indicates the reverse order of operation. * * @var odp_crypto_session_params_t::compl_queue diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 89356a6..5b04737 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -64,7 +64,7 @@ extern C { * * @note Packets arriving via this interface assigned to a CoS by the * classifier are received into the pool associated with that CoS. This - * will occur either becuase this pktio is assigned a default CoS via + * will occur either because this pktio is assigned a default CoS via * the odp_pktio_default_cos_set() routine, or because a matching PMR * assigned the packet to a specific CoS. The default pool specified * here is applicable only for those packets that are not assigned to a diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h index e5061ab..1ae7119 100644 --- a/include/odp/api/pool.h +++ b/include/odp/api/pool.h @@ -37,7 +37,7 @@ extern C { * Invalid pool */ -/** Maximum queue name lenght in chars */ +/** Maximum queue name length in chars */ #define ODP_POOL_NAME_LEN 32 /** diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h index 6a8b15f..f7a0777 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.h @@ -41,7 +41,7 @@ extern C { /** * @def ODP_QUEUE_NAME_LEN - * Maximum queue name lenght in chars + * Maximum queue name length in chars */ @@ -213,7 +213,7 @@ odp_queue_t odp_queue_lookup(const char *name); /** * Set queue context * - * Its the responsability of the interface user to make sure + * It is the responsibility of the interface user to make sure * queue context allocation is done in an area reachable for * all EOs accessing the context * -- 2.1.4 ___ lng-odp mailing list lng-odp@lists.linaro.org mailto:lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
Re: [lng-odp] [PATCH 1/2] codespell: fix spelling
Merged. Maxim. On 06/04/15 20:42, Mike Holmes wrote: Signed-off-by: Mike Holmes mike.hol...@linaro.org --- configure.ac| 2 +- doc/api_guide_lines.dox | 4 ++-- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec_sa_db.h | 4 ++-- helper/include/odp/helper/ip.h | 2 +- helper/ring.c | 2 +- platform/linux-generic/odp_pool.c | 2 +- platform/linux-generic/odp_rwlock.c | 2 +- platform/linux-generic/odp_timer.c | 2 +- test/performance/odp_atomic.c | 2 +- test/validation/odp_cpumask.c | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 89b0846..69365fe 100644 --- a/configure.ac +++ b/configure.ac @@ -49,7 +49,7 @@ AC_TYPE_UINT64_T AX_VALGRIND_CHECK ## -# Which archetecture optimizations will we use +# Which architecture optimizations will we use ## AS_CASE([$host], [x86*], [ARCH=x86], diff --git a/doc/api_guide_lines.dox b/doc/api_guide_lines.dox index 0832cae..f3f7799 100644 --- a/doc/api_guide_lines.dox +++ b/doc/api_guide_lines.dox @@ -90,7 +90,7 @@ An api with is or has are both considered @ref boolean questions. They can o An example might be a packet interface, you might want to know if it is in promiscuous mode. @code odp_bool_t state = odp_pktio_is_promiscuous(pktio handle) @endcode -In addtion you might want to know if it has the ability to be in promiscuous mode. +In addition you might want to know if it has the ability to be in promiscuous mode. @code odp_bool_t state = odp_pktio_has_promiscuous(pktio handle) @endcode Another case might be if a packet has a vlan flag set @@ -150,7 +150,7 @@ When an interface is defined in a header file and is intended to to be reused in - All the required definitions for the API are to use an underscore, this includes MACROS, typedefs, enums and function names. @subsection variables Declaring variables -- Variables shall be declared at the begining of scope, for example :- +- Variables shall be declared at the beginning of scope, for example :- @code int start_of_global_scope; diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 8ae5b29..cbe93b5 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -534,7 +534,7 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len) } /** - * Main receive funtion + * Main receive function * * @param arg thread arguments of type 'thread_args_t *' */ diff --git a/example/ipsec/odp_ipsec_sa_db.h b/example/ipsec/odp_ipsec_sa_db.h index c30cbdb..671f266 100644 --- a/example/ipsec/odp_ipsec_sa_db.h +++ b/example/ipsec/odp_ipsec_sa_db.h @@ -14,7 +14,7 @@ extern C { #include odp_ipsec_misc.h /** - * Security Assocation (SA) data base entry + * Security Association (SA) data base entry */ typedef struct sa_db_entry_s { struct sa_db_entry_s *next; /** Next entry on list */ @@ -29,7 +29,7 @@ typedef struct sa_db_entry_s { } sa_db_entry_t; /** - * Security Assocation (SA) data base global structure + * Security Association (SA) data base global structure */ typedef struct sa_db_s { uint32_t index; /** Index of next available entry */ diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h index 627c82d..41408a3 100644 --- a/helper/include/odp/helper/ip.h +++ b/helper/include/odp/helper/ip.h @@ -154,7 +154,7 @@ _ODP_STATIC_ASSERT(sizeof(odph_ipv6hdr_t) == ODPH_IPV6HDR_LEN, ODPH_IPV6HDR_T__ */ typedef struct ODP_PACKED { uint8_tnext_hdr; /** Protocol of next header */ - uint8_text_len; /** Length of this extention in 8 byte units, + uint8_text_len; /** Length of this extension in 8 byte units, not counting first 8 bytes, so 0 = 8 bytes 1 = 16 bytes, etc. */ uint8_tfiller[6];/** Fill out first 8 byte segment */ diff --git a/helper/ring.c b/helper/ring.c index 721c1fc..67fece9 100644 --- a/helper/ring.c +++ b/helper/ring.c @@ -279,7 +279,7 @@ int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table, } /* -* If there are other enqueues in progress that preceeded us, +* If there are other enqueues in progress that preceded us, * we need to wait for them to complete */ while (odp_unlikely(r-prod.tail != prod_head)) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index f2bf0c7..35e79a0 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -161,7 +161,7 @@ odp_pool_t odp_pool_create(const char *name,
[lng-odp] [PATCH] configure: remove extra result message
Signed-off-by: Nicolas Morey-Chaisemartin nmo...@kalray.eu --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 89b0846..ed74b4a 100644 --- a/configure.ac +++ b/configure.ac @@ -229,7 +229,7 @@ AC_HELP_STRING([--with-openssl-path=DIR path to openssl libs and headers], [OPENSSL_PATH=$withval AM_CPPFLAGS=$AM_CPPFLAGS -I$OPENSSL_PATH/include AM_LDFLAGS=$AM_LDFLAGS -L$OPENSSL_PATH/lib -],[AC_MSG_RESULT([no])]) +],[]) ## # Save and set temporary compilation flags ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v2 2/3] api: cpumask: added default masks
Added default cpumask functions for worker and control threads. These will replace odph_linux_cpumask_default() helper. CPU masks and IDs are system specific, API is generic. Signed-off-by: Petri Savolainen petri.savolai...@nokia.com --- include/odp/api/cpumask.h| 24 +++ platform/linux-generic/odp_cpumask.c | 38 2 files changed, 62 insertions(+) diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h index 217bb5b..5cfc495 100644 --- a/include/odp/api/cpumask.h +++ b/include/odp/api/cpumask.h @@ -194,6 +194,30 @@ int odp_cpumask_last(const odp_cpumask_t *mask); int odp_cpumask_next(const odp_cpumask_t *mask, int cpu); /** + * Default cpumask for worker threads + * + * Initializes cpumask with CPUs available for worker threads. Sets up to 'num' + * CPUs and returns the count actually set. Use zero for all available CPUs. + * + * @param[out] mask CPU mask to initialize + * @param num Number of worker threads, zero for all available CPUs + * @return Actual number of CPUs used to create the mask + */ +int odp_cpumask_def_worker(odp_cpumask_t *mask, int num); + +/** + * Default cpumask for control threads + * + * Initializes cpumask with CPUs available for control threads. Sets up to 'num' + * CPUs and returns the count actually set. Use zero for all available CPUs. + * + * @param[out] mask CPU mask to initialize + * @param num Number of control threads, zero for all available CPUs + * @return Actual number of CPUs used to create the mask + */ +int odp_cpumask_def_control(odp_cpumask_t *mask, int num); + +/** * @} */ diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c index a27e80c..aaf5df3 100644 --- a/platform/linux-generic/odp_cpumask.c +++ b/platform/linux-generic/odp_cpumask.c @@ -8,6 +8,7 @@ #define _GNU_SOURCE #endif #include sched.h +#include pthread.h #include odp/cpumask.h #include odp_debug_internal.h @@ -204,3 +205,40 @@ int odp_cpumask_next(const odp_cpumask_t *mask, int cpu) return cpu; return -1; } + +int odp_cpumask_def_worker(odp_cpumask_t *mask, int num) +{ + int ret, cpu, i; + cpu_set_t cpuset; + + ret = pthread_getaffinity_np(pthread_self(), +sizeof(cpu_set_t), cpuset); + if (ret != 0) + ODP_ABORT(failed to read CPU affinity value\n); + + odp_cpumask_zero(mask); + + /* +* If no user supplied number or it's too large, then attempt +* to use all CPUs +*/ + if (0 == num || CPU_SETSIZE num) + num = CPU_COUNT(cpuset); + + /* build the mask, allocating down from highest numbered CPU */ + for (cpu = 0, i = CPU_SETSIZE - 1; i = 0 cpu num; --i) { + if (CPU_ISSET(i, cpuset)) { + odp_cpumask_set(mask, i); + cpu++; + } + } + + return cpu; +} + +int odp_cpumask_def_control(odp_cpumask_t *mask, int num ODP_UNUSED) +{ + /* By default all control threads on CPU 0 */ + odp_cpumask_set(mask, 0); + return 1; +} -- 2.4.2 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v2 3/3] api: helper: deleted odph_linux_cpumask_default
The linux specific helper was replaced by default cpumask calls (odp_cpumask_def_worker()) in the cpumask API. Signed-off-by: Petri Savolainen petri.savolai...@nokia.com --- example/classifier/odp_classifier.c | 7 ++- example/generator/odp_generator.c | 7 ++- example/ipsec/odp_ipsec.c | 7 ++- example/packet/odp_pktio.c| 7 ++- example/timer/odp_timer_test.c| 7 ++- helper/include/odp/helper/linux.h | 11 --- helper/linux.c| 31 --- helper/test/odp_process.c | 2 +- helper/test/odp_thread.c | 2 +- test/api_test/odp_common.c| 2 +- test/performance/odp_atomic.c | 2 +- test/performance/odp_l2fwd.c | 7 ++- test/performance/odp_pktio_perf.c | 4 ++-- test/performance/odp_scheduling.c | 7 ++- test/validation/common/odp_cunit_common.c | 2 +- 15 files changed, 21 insertions(+), 84 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 3d18ea2..eeffb9f 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -419,11 +419,8 @@ int main(int argc, char *argv[]) if (args-cpu_count) num_workers = args-cpu_count; - /* -* By default CPU #0 runs Linux kernel background tasks. -* Start mapping thread from CPU #1 -*/ - num_workers = odph_linux_cpumask_default(cpumask, num_workers); + /* Get default worker cpumask */ + num_workers = odp_cpumask_def_worker(cpumask, num_workers); (void)odp_cpumask_to_str(cpumask, cpumaskstr, sizeof(cpumaskstr)); printf(num worker threads: %i\n, num_workers); diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 0f4620b..5d65230 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -640,11 +640,8 @@ int main(int argc, char *argv[]) if (args-appl.mode == APPL_MODE_PING) num_workers = 2; - /* -* By default CPU #0 runs Linux kernel background tasks. -* Start mapping thread from CPU #1 -*/ - num_workers = odph_linux_cpumask_default(cpumask, num_workers); + /* Get default worker cpumask */ + num_workers = odp_cpumask_def_worker(cpumask, num_workers); (void)odp_cpumask_to_str(cpumask, cpumaskstr, sizeof(cpumaskstr)); printf(num worker threads: %i\n, num_workers); diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 99ccd6b..aea82cf 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1203,11 +1203,8 @@ main(int argc, char *argv[]) if (args-appl.cpu_count) num_workers = args-appl.cpu_count; - /* -* By default CPU #0 runs Linux kernel background tasks. -* Start mapping thread from CPU #1 -*/ - num_workers = odph_linux_cpumask_default(cpumask, num_workers); + /* Get default worker cpumask */ + num_workers = odp_cpumask_def_worker(cpumask, num_workers); (void)odp_cpumask_to_str(cpumask, cpumaskstr, sizeof(cpumaskstr)); printf(num worker threads: %i\n, num_workers); diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index a281d69..d1c017f 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -367,11 +367,8 @@ int main(int argc, char *argv[]) if (args-appl.cpu_count) num_workers = args-appl.cpu_count; - /* -* By default CPU #0 runs Linux kernel background tasks. -* Start mapping thread from CPU #1 -*/ - num_workers = odph_linux_cpumask_default(cpumask, num_workers); + /* Get default worker cpumask */ + num_workers = odp_cpumask_def_worker(cpumask, num_workers); (void)odp_cpumask_to_str(cpumask, cpumaskstr, sizeof(cpumaskstr)); printf(num worker threads: %i\n, num_workers); diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 5e4306e..4b5870b 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -395,11 +395,8 @@ int main(int argc, char *argv[]) if (gbls-args.cpu_count) num_workers = gbls-args.cpu_count; - /* -* By default CPU #0 runs Linux kernel background tasks. -* Start mapping thread from CPU #1 -*/ - num_workers = odph_linux_cpumask_default(cpumask, num_workers); + /* Get default worker cpumask */ + num_workers = odp_cpumask_def_worker(cpumask, num_workers); (void)odp_cpumask_to_str(cpumask, cpumaskstr, sizeof(cpumaskstr)); printf(num worker threads: %i\n, num_workers); diff --git a/helper/include/odp/helper/linux.h b/helper/include/odp/helper/linux.h index 44ee787..ce61fdf 100644 ---
[lng-odp] [API-NEXT PATCH v2 9/9] queue: handle return value of odp_queue_enq_multi()
Unsent packet has to be released. If the event type is obvious from the context, use directly the relevant release functions, otherwise odp_event(free). Wider error handling is attempted, but this patch can't fix all the flaws in the many calling functions of odp_queue_enq() Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- test/performance/odp_pktio_perf.c | 15 ++- test/performance/odp_scheduling.c | 10 -- test/validation/odp_pktio.c | 5 + test/validation/odp_queue.c | 6 ++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index f572633..4bef389 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -268,6 +268,9 @@ static int alloc_packets(odp_event_t *event_tbl, int num_pkts) static int send_packets(odp_queue_t outq, odp_event_t *event_tbl, unsigned num_pkts) { + int ret; + unsigned cnt; + if (num_pkts == 0) return 0; else if (num_pkts == 1) { @@ -279,7 +282,17 @@ static int send_packets(odp_queue_t outq, } } - return odp_queue_enq_multi(outq, event_tbl, num_pkts); + ret = odp_queue_enq_multi(outq, event_tbl, num_pkts); + if (ret == (signed)num_pkts) + return ret; + + if (ret 0) + ret = 0; + cnt = ret; + do + odp_event_free(event_tbl[cnt]); + while (++cnt num_pkts); + return ret; } /* diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 1283986..8b46eb2 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -535,9 +535,15 @@ static int test_schedule_multi(const char *str, int thr, } /* Assume we can enqueue all events */ - if (odp_queue_enq_multi(queue, ev, MULTI_BUFS_MAX) != - MULTI_BUFS_MAX) { + j = odp_queue_enq_multi(queue, ev, MULTI_BUFS_MAX); + if (j != MULTI_BUFS_MAX) { LOG_ERR( [%i] Queue enqueue failed.\n, thr); + if (j 0) + j = 0; + do + odp_event_free(ev[j]); + while (++j MULTI_BUFS_MAX); + return -1; } } diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index 3027b25..d25e5fa 100644 --- a/test/validation/odp_pktio.c +++ b/test/validation/odp_pktio.c @@ -387,6 +387,11 @@ static void pktio_txrx_multi(pktio_info_t *pktio_a, pktio_info_t *pktio_b, ret = odp_queue_enq_multi(pktio_a-outq, tx_ev, num_pkts); if (ret != num_pkts) { CU_FAIL(failed to enqueue test packets); + if (ret 0) + ret = 0; + do + odp_packet_free(tx_pkt[ret]); + while (++ret num_pkts); return; } } diff --git a/test/validation/odp_queue.c b/test/validation/odp_queue.c index 4bd95ff..9d01f45 100644 --- a/test/validation/odp_queue.c +++ b/test/validation/odp_queue.c @@ -96,6 +96,12 @@ static void test_odp_queue_sunnyday(void) */ ret = odp_queue_enq_multi(queue_id, enev, MAX_BUFFER_QUEUE); CU_ASSERT(MAX_BUFFER_QUEUE == ret); + if (ret 0) + ret = 0; + do + odp_event_free(enev[ret]); + while (++ret MAX_BUFFER_QUEUE); + pev_tmp = deev; do { deq_ret = odp_queue_deq_multi(queue_id, pev_tmp, -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [Bug 1617] New: Build fails on api-next branch
https://bugs.linaro.org/show_bug.cgi?id=1617 Bug ID: 1617 Summary: Build fails on api-next branch Product: OpenDataPlane Version: 1.0 Hardware: Other OS: Linux Status: UNCONFIRMED Severity: enhancement Priority: --- Component: Validation Assignee: lng-odp@lists.linaro.org Reporter: petri.savolai...@linaro.org test/validation/odp_pktio.c odp_pktio.c: In function \u2018test_odp_pktio_inq_remdef\u2019: odp_pktio.c:556:2: error: too few arguments to function \u2018create_pktio\u2019 pktio = create_pktio(iface_name[0], ODP_QUEUE_TYPE_SCHED); static void test_odp_pktio_inq_remdef(void) { odp_pktio_t pktio; odp_queue_t inq; odp_event_t ev; int i; pktio = create_pktio(iface_name[0], ODP_QUEUE_TYPE_SCHED); -- You are receiving this mail because: You are the assignee for the bug.___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v2 1/3] api: cpumask: added cpumask_setall
The call sets all possible CPUs in the mask. It's system specific which CPUs are actually available to the application. Signed-off-by: Petri Savolainen petri.savolai...@nokia.com --- include/odp/api/cpumask.h| 15 +-- platform/linux-generic/odp_cpumask.c | 8 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h index dbac7b9..217bb5b 100644 --- a/include/odp/api/cpumask.h +++ b/include/odp/api/cpumask.h @@ -65,6 +65,17 @@ void odp_cpumask_zero(odp_cpumask_t *mask); void odp_cpumask_set(odp_cpumask_t *mask, int cpu); /** + * Set all CPUs in mask + * + * Set all possible CPUs in the mask. All CPUs from 0 to odp_cpumask_count() + * minus one are set. It's system specific which CPUs are actually available + * to the application. + * + * @param mask CPU mask to set + */ +void odp_cpumask_setall(odp_cpumask_t *mask); + +/** * Remove CPU from mask * @param mask CPU mask to update * @param cpu CPU number @@ -82,7 +93,7 @@ void odp_cpumask_clr(odp_cpumask_t *mask, int cpu); int odp_cpumask_isset(const odp_cpumask_t *mask, int cpu); /** - * Count number of CPU's in mask + * Count number of CPUs set in mask * * @param mask CPU mask * @return population count @@ -120,7 +131,7 @@ void odp_cpumask_xor(odp_cpumask_t *dest, const odp_cpumask_t *src1, const odp_cpumask_t *src2); /** - * Test if two CPU masks contain the same CPU's + * Test if two CPU masks contain the same CPUs * * @param mask1CPU mask 1 * @param mask2CPU mask 2 diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c index 0ca1071..a27e80c 100644 --- a/platform/linux-generic/odp_cpumask.c +++ b/platform/linux-generic/odp_cpumask.c @@ -125,6 +125,14 @@ void odp_cpumask_set(odp_cpumask_t *mask, int cpu) CPU_SET(cpu, mask-set); } +void odp_cpumask_setall(odp_cpumask_t *mask) +{ + int cpu; + + for (cpu = 0; cpu CPU_SETSIZE - 1; cpu++) + CPU_SET(cpu, mask-set); +} + void odp_cpumask_clr(odp_cpumask_t *mask, int cpu) { CPU_CLR(cpu, mask-set); -- 2.4.2 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v2 0/9]
This series clarifies what happens when not all packets were sent, whether in odp_pktio_send() or odp_queue_enq*(). It also introduces odp_event_free() to make it easier the release of an event with not obvious type. It also fixes the many places in the examples and tests where this issue were not handled properly. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [Bug 1617] Build fails on api-next branch
https://bugs.linaro.org/show_bug.cgi?id=1617 --- Comment #1 from Petri Savolainen petri.savolai...@linaro.org --- Also Git log documents a merge conflict commit 0da7ce4d558dfe63e9f42ace43e61b7fcdd56b09 Merge: 03181a7 1da1a0d Author: Maxim Uvarov maxim.uva...@linaro.org Date: Thu Jun 4 20:14:58 2015 +0300 Merge branch 'master' into api-next Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org Conflicts: test/validation/odp_pktio.c -- You are receiving this mail because: You are the assignee for the bug.___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v2 4/9] event: define odp_event_free()
We need a convenient function which calls the right type-depending free() function. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- include/odp/api/event.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/odp/api/event.h b/include/odp/api/event.h index 63b476f..7ec5e76 100644 --- a/include/odp/api/event.h +++ b/include/odp/api/event.h @@ -78,6 +78,16 @@ int odp_event_type(odp_event_t event); uint64_t odp_event_to_u64(odp_event_t hdl); /** + * Call the free function of the event's type + * + * @param eventEvent handle + * + * @note This routine aborts if event type is unsupported + * + */ +void odp_event_free(odp_event_t event); + +/** * @} */ -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v2 6/9] odp_timer_test: remove redundant free function
Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- example/timer/odp_timer_test.c | 26 +- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 5e4306e..735c4c6 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -66,30 +66,6 @@ static const char *timerset2str(odp_timer_set_t val) } }; - -/** @private test timeout */ -static void free_event(odp_event_t ev) -{ - switch (odp_event_type(ev)) { - case ODP_EVENT_BUFFER: - odp_buffer_free(odp_buffer_from_event(ev)); - break; - case ODP_EVENT_PACKET: - odp_packet_free(odp_packet_from_event(ev)); - break; - case ODP_EVENT_TIMEOUT: - odp_timeout_free(odp_timeout_from_event(ev)); - break; - case ODP_EVENT_CRYPTO_COMPL: - odp_crypto_compl_free(odp_crypto_compl_from_event(ev)); - break; - default: - fprintf(stderr, Unrecognized event type %d\n, - odp_event_type(ev)); - abort(); - } -} - /** @private test timeout */ static void remove_prescheduled_events(void) { @@ -98,7 +74,7 @@ static void remove_prescheduled_events(void) odp_schedule_pause(); while ((ev = odp_schedule(queue, ODP_SCHED_NO_WAIT)) != ODP_EVENT_INVALID) { - free_event(ev); + odp_event_free(ev); } } -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [PATCH] doc: use only WITH_PLATFORM and not always linux-generic
Signed-off-by: Nicolas Morey-Chaisemartin nmo...@kalray.eu --- doc/doxygen.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg index 6283387..213a903 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg @@ -13,7 +13,6 @@ WARN_NO_PARAMDOC = YES INPUT = $(SRCDIR)/doc \ $(SRCDIR)/doc/users-guide \ $(SRCDIR)/include \ - $(SRCDIR)/platform/linux-generic/include/odp \ $(SRCDIR)/platform/$(WITH_PLATFORM)/include/odp \ $(SRCDIR)/helper/include FILE_PATTERNS = *.h odp*.c *.dox ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v2 2/9] packet_socket: do not release packets in odp_pktio_send
It happens with ODP_PKTIO_TYPE_SOCKET_BASIC. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- platform/linux-generic/odp_packet_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 9272146..0526166 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -276,7 +276,7 @@ int send_pkt_sock_basic(pkt_sock_t *const pkt_sock, unsigned i; unsigned flags; int sockfd; - int nb_tx; + unsigned nb_tx; int ret; sockfd = pkt_sock-sockfd; @@ -301,7 +301,7 @@ int send_pkt_sock_basic(pkt_sock_t *const pkt_sock, } /* end while */ nb_tx = i; - for (i = 0; i len; i++) + for (i = 0; i nb_tx; i++) odp_packet_free(pkt_table[i]); return nb_tx; -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v2 8/9] queue: handle return value of odp_queue_enq()
Unsent packet has to be released. If the event type is obvious from the context, use directly the relevant release functions, otherwise odp_event(free). Wider error handling is attempted, but this patch can't fix all the flaws in the many calling functions of odp_queue_enq() Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- example/classifier/odp_classifier.c | 7 ++- example/generator/odp_generator.c | 1 + example/ipsec/odp_ipsec.c | 11 --- example/ipsec/odp_ipsec_stream.c | 6 +- example/packet/odp_pktio.c| 6 +- platform/linux-generic/include/odp_schedule_internal.h| 4 ++-- platform/linux-generic/odp_crypto.c | 5 - platform/linux-generic/odp_queue.c| 8 platform/linux-generic/odp_schedule.c | 14 ++ platform/linux-generic/odp_timer.c| 4 +++- test/performance/odp_l2fwd.c | 6 +- test/performance/odp_pktio_perf.c | 10 -- test/performance/odp_scheduling.c | 7 +++ test/validation/classification/odp_classification_tests.c | 3 ++- test/validation/odp_pktio.c | 1 + test/validation/odp_queue.c | 9 ++--- test/validation/odp_scheduler.c | 12 17 files changed, 85 insertions(+), 29 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 48fc1ab..129b042 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -292,7 +292,12 @@ static void *pktio_receive_thread(void *arg) if (appl-appl_mode == APPL_MODE_DROP) odp_packet_free(pkt); else - odp_queue_enq(outq_def, ev); + if (odp_queue_enq(outq_def, ev)) { + EXAMPLE_ERR( [%i] Queue enqueue failed.\n, + thr); + odp_packet_free(pkt); + continue; + } } return NULL; diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 8ae5b29..4dcaff5 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -410,6 +410,7 @@ static void *gen_send_thread(void *arg) err = odp_queue_enq(outq_def, odp_packet_to_event(pkt)); if (err != 0) { EXAMPLE_ERR( [%02i] send pkt err!\n, thr); + odp_packet_free(pkt); return NULL; } diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index cb8f535..1d034dd 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1078,7 +1078,8 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) ctx-state = PKT_STATE_TRANSMIT; } else { ctx-state = PKT_STATE_IPSEC_OUT_SEQ; - odp_queue_enq(seqnumq, ev); + if (odp_queue_enq(seqnumq, ev)) + rc = PKT_DROP; } break; @@ -1096,8 +1097,12 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) case PKT_STATE_TRANSMIT: - odp_queue_enq(ctx-outq, ev); - rc = PKT_DONE; + if (odp_queue_enq(ctx-outq, ev)) { + odp_event_free(ev); + rc = PKT_DROP; + } else { + rc = PKT_DONE; + } break; default: diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index 35042f5..af143ee 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -494,7 +494,11 @@ int create_stream_db_inputs(void) break; } stream-created++; - odp_queue_enq(queue, odp_packet_to_event(pkt)); + if (odp_queue_enq(queue, odp_packet_to_event(pkt))) { + odp_packet_free(pkt); + printf(Queue enqueue failed\n); + break; + } /* Count this stream when we create first packet */
Re: [lng-odp] [API-NEXT PATCH v2 7/9] event: replace complicated buffer releases with odp_event_free()
This patch doesn't apply to me to either the tip or to the api-next branch of odp.git On Fri, Jun 5, 2015 at 6:53 AM, Zoltan Kiss zoltan.k...@linaro.org wrote: Instead of converting types let odp_event_free() to do the right thing. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- example/timer/odp_timer_test.c| 2 +- platform/linux-generic/odp_schedule.c | 5 + test/performance/odp_pktio_perf.c | 4 ++-- test/performance/odp_scheduling.c | 4 +--- test/validation/classification/odp_classification_tests.c | 2 +- test/validation/odp_pktio.c | 6 +++--- test/validation/odp_scheduler.c | 11 +++ test/validation/odp_timer.c | 2 +- 8 files changed, 13 insertions(+), 23 deletions(-) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 735c4c6..6ea5773 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -167,7 +167,7 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls) /* Cancel and free last timer used */ (void)odp_timer_cancel(ttp-tim, ttp-ev); if (ttp-ev != ODP_EVENT_INVALID) - odp_timeout_free(odp_timeout_from_event(ttp-ev)); + odp_event_free(ttp-ev); else EXAMPLE_ERR(Lost timeout event at timer cancel\n); /* Since we have cancelled the timer, there is no timeout event to diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 7fe42d7..9206d5c 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -328,10 +328,7 @@ int schedule_queue_init(queue_entry_t *qe) void schedule_queue_destroy(queue_entry_t *qe) { - odp_buffer_t buf; - - buf = odp_buffer_from_event(qe-s.cmd_ev); - odp_buffer_free(buf); + odp_event_free(qe-s.cmd_ev); pri_clr_queue(queue_handle(qe), queue_prio(qe)); diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index fbe27a0..d362669 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -395,7 +395,7 @@ static void *run_thread_rx(void *arg TEST_UNUSED) stats-s.rx_ignore++; } - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); } else if (odp_atomic_load_u32(shutdown)) { break; } @@ -732,7 +732,7 @@ static int destroy_inq(odp_pktio_t pktio) ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); if (ev != ODP_EVENT_INVALID) - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); else break; } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 99f0f9b..558fec8 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -69,7 +69,6 @@ typedef struct { static void clear_sched_queues(void) { odp_event_t ev; - odp_buffer_t buf; while (1) { ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); @@ -77,8 +76,7 @@ static void clear_sched_queues(void) if (ev == ODP_EVENT_INVALID) break; - buf = odp_buffer_from_event(ev); - odp_buffer_free(buf); + odp_event_free(ev); } } diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 131ac91..441c194 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -176,7 +176,7 @@ static int destroy_inq(odp_pktio_t pktio) ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); if (ev != ODP_EVENT_INVALID) - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); else break; } diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index 7c1a666..090057b 100644 --- a/test/validation/odp_pktio.c +++ b/test/validation/odp_pktio.c @@ -283,7 +283,7 @@ static int destroy_inq(odp_pktio_t pktio) ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); if (ev != ODP_EVENT_INVALID) - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); else break; } @@ -332,7 +332,7 @@ static odp_packet_t
Re: [lng-odp] [API-NEXT PATCH v2 7/9] event: replace complicated buffer releases with odp_event_free()
I've fixed that in a new series On 05/06/15 16:40, Bill Fischofer wrote: This patch doesn't apply to me to either the tip or to the api-next branch of odp.git On Fri, Jun 5, 2015 at 6:53 AM, Zoltan Kiss zoltan.k...@linaro.org mailto:zoltan.k...@linaro.org wrote: Instead of converting types let odp_event_free() to do the right thing. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org mailto:zoltan.k...@linaro.org --- example/timer/odp_timer_test.c| 2 +- platform/linux-generic/odp_schedule.c | 5 + test/performance/odp_pktio_perf.c | 4 ++-- test/performance/odp_scheduling.c | 4 +--- test/validation/classification/odp_classification_tests.c | 2 +- test/validation/odp_pktio.c | 6 +++--- test/validation/odp_scheduler.c | 11 +++ test/validation/odp_timer.c | 2 +- 8 files changed, 13 insertions(+), 23 deletions(-) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 735c4c6..6ea5773 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -167,7 +167,7 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls) /* Cancel and free last timer used */ (void)odp_timer_cancel(ttp-tim, ttp-ev); if (ttp-ev != ODP_EVENT_INVALID) - odp_timeout_free(odp_timeout_from_event(ttp-ev)); + odp_event_free(ttp-ev); else EXAMPLE_ERR(Lost timeout event at timer cancel\n); /* Since we have cancelled the timer, there is no timeout event to diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 7fe42d7..9206d5c 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -328,10 +328,7 @@ int schedule_queue_init(queue_entry_t *qe) void schedule_queue_destroy(queue_entry_t *qe) { - odp_buffer_t buf; - - buf = odp_buffer_from_event(qe-s.cmd_ev); - odp_buffer_free(buf); + odp_event_free(qe-s.cmd_ev); pri_clr_queue(queue_handle(qe), queue_prio(qe)); diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index fbe27a0..d362669 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -395,7 +395,7 @@ static void *run_thread_rx(void *arg TEST_UNUSED) stats-s.rx_ignore++; } - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); } else if (odp_atomic_load_u32(shutdown)) { break; } @@ -732,7 +732,7 @@ static int destroy_inq(odp_pktio_t pktio) ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); if (ev != ODP_EVENT_INVALID) - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); else break; } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 99f0f9b..558fec8 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -69,7 +69,6 @@ typedef struct { static void clear_sched_queues(void) { odp_event_t ev; - odp_buffer_t buf; while (1) { ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); @@ -77,8 +76,7 @@ static void clear_sched_queues(void) if (ev == ODP_EVENT_INVALID) break; - buf = odp_buffer_from_event(ev); - odp_buffer_free(buf); + odp_event_free(ev); } } diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 131ac91..441c194 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -176,7 +176,7 @@ static int destroy_inq(odp_pktio_t pktio) ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); if (ev != ODP_EVENT_INVALID) - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); else break; } diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index 7c1a666..090057b 100644 ---
Re: [lng-odp] [PATCHv3 0/8] pktio test move to platform side
On Thu, Jun 04, 2015 at 08:06:52PM +0200, Christophe Milard wrote: since v2: -history rewritten regarding PRE_LDADD -missing .gitignore added -correction for finding pktio_main in different cases -patch 8 added, removing obsolete test environment variables in validation For the series Reviewed-by: Stuart Haslam stuart.has...@linaro.org [I'm sure the other 18 modules will be easier :)] -- Stuart. ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v3 1/9] api: packet_io: clarify what happens when not all packets are sent
Currently our examples are not handling this situation as well. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- include/odp/api/packet_io.h | 4 +++- include/odp/api/queue.h | 7 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 89356a6..5a71e52 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -111,7 +111,9 @@ int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t pkt_table[], int len); * @param pkt_table[] Array of packets to send * @param len length of pkt_table[] * - * @return Number of packets sent + * @return Number of packets sent. If it is less than 'len', the remaining + * packets at the end of pkt_table[] are not consumed, and caller has to take + * care of them. * @retval 0 on failure */ int odp_pktio_send(odp_pktio_t pktio, odp_packet_t pkt_table[], int len); diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h index 6a8b15f..ac4147d 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.h @@ -242,7 +242,8 @@ void *odp_queue_get_context(odp_queue_t queue); * @param ev Event handle * * @retval 0 on success - * @retval 0 on failure (e.g. queue full) + * @retval 0 on failure (e.g. queue full), the event is not consumed, caller + * has to take care of it. */ int odp_queue_enq(odp_queue_t queue, odp_event_t ev); @@ -253,7 +254,9 @@ int odp_queue_enq(odp_queue_t queue, odp_event_t ev); * @param[in] events Array of event handles * @param num Number of event handles to enqueue * - * @return Number of events actually enqueued (0 ... num) + * @return Number of events actually enqueued (0 ... num). If it is less than + * 'num', the remaining events at the end of events[] are not consumed, and + * caller has to take care of them. * @retval 0 on failure */ int odp_queue_enq_multi(odp_queue_t queue, const odp_event_t events[], int num); -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v3 2/9] packet_socket: do not release packets in odp_pktio_send
It happens with ODP_PKTIO_TYPE_SOCKET_BASIC. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- platform/linux-generic/odp_packet_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 9272146..0526166 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -276,7 +276,7 @@ int send_pkt_sock_basic(pkt_sock_t *const pkt_sock, unsigned i; unsigned flags; int sockfd; - int nb_tx; + unsigned nb_tx; int ret; sockfd = pkt_sock-sockfd; @@ -301,7 +301,7 @@ int send_pkt_sock_basic(pkt_sock_t *const pkt_sock, } /* end while */ nb_tx = i; - for (i = 0; i len; i++) + for (i = 0; i nb_tx; i++) odp_packet_free(pkt_table[i]); return nb_tx; -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
Re: [lng-odp] [API-NEXT PATCH v2 1/9] packet_io: clarify what happens when not all packets are sent
I've fixed that in a new series On 05/06/15 17:27, Mike Holmes wrote: This touches the api b/include/odp/api/packet_io.h so the subject should add api: like this api: packet_io: clarify what happens when not all packets are sent Generally for ODP the approximate path to the code is in the subject include/odp/api/packet_io.h becomes include/odp/api -- api: then the module area or file name as appropriate - packet_io: in this case as you have it. On 5 June 2015 at 07:53, Zoltan Kiss zoltan.k...@linaro.org mailto:zoltan.k...@linaro.org wrote: Currently our examples are not handling this situation as well. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org mailto:zoltan.k...@linaro.org --- include/odp/api/packet_io.h | 4 +++- include/odp/api/queue.h | 7 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 89356a6..5a71e52 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -111,7 +111,9 @@ int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t pkt_table[], int len); * @param pkt_table[] Array of packets to send * @param len length of pkt_table[] * - * @return Number of packets sent + * @return Number of packets sent. If it is less than 'len', the remaining + * packets at the end of pkt_table[] are not consumed, and caller has to take + * care of them. * @retval 0 on failure */ int odp_pktio_send(odp_pktio_t pktio, odp_packet_t pkt_table[], int len); diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h index 6a8b15f..ac4147d 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.h @@ -242,7 +242,8 @@ void *odp_queue_get_context(odp_queue_t queue); * @param ev Event handle * * @retval 0 on success - * @retval 0 on failure (e.g. queue full) + * @retval 0 on failure (e.g. queue full), the event is not consumed, caller + * has to take care of it. */ int odp_queue_enq(odp_queue_t queue, odp_event_t ev); @@ -253,7 +254,9 @@ int odp_queue_enq(odp_queue_t queue, odp_event_t ev); * @param[in] events Array of event handles * @param num Number of event handles to enqueue * - * @return Number of events actually enqueued (0 ... num) + * @return Number of events actually enqueued (0 ... num). If it is less than + * 'num', the remaining events at the end of events[] are not consumed, and + * caller has to take care of them. * @retval 0 on failure */ int odp_queue_enq_multi(odp_queue_t queue, const odp_event_t events[], int num); -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org mailto:lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp -- Mike Holmes Technical Manager - Linaro Networking Group Linaro.org http://www.linaro.org/***│ *Open source software for ARM SoCs __ ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
Re: [lng-odp] [API-NEXT PATCH v3 0/9] Handle unsent packets
This series applies and builds fine, however with check-odp I'm seeing consistent failures on the odp_pktio tests. I double checked and am seeing the same with the base odp.git code so not sure what changed (don't think these patches really changed anything in that regard). On Fri, Jun 5, 2015 at 12:51 PM, Zoltan Kiss zoltan.k...@linaro.org wrote: This series clarifies what happens when not all packets were sent, whether in odp_pktio_send() or odp_queue_enq*(). It also introduces odp_event_free() to make it easier the release of an event with not obvious type. It also fixes the many places in the examples and tests where this issue were not handled properly. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v3 5/9] event: implement odp_event_free()
Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- platform/linux-generic/odp_event.c | 24 1 file changed, 24 insertions(+) diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index 17f4f43..e93dfca 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -6,8 +6,12 @@ #include odp/event.h #include odp/buffer.h +#include odp/crypto.h +#include odp/packet.h +#include odp/timer.h #include odp/pool.h #include odp_buffer_internal.h +#include odp_debug_internal.h int odp_event_type(odp_event_t event) { @@ -17,3 +21,23 @@ int odp_event_type(odp_event_t event) return _odp_buffer_type(buf); } + +void odp_event_free(odp_event_t event) +{ + switch (odp_event_type(event)) { + case ODP_EVENT_BUFFER: + odp_buffer_free(odp_buffer_from_event(event)); + break; + case ODP_EVENT_PACKET: + odp_packet_free(odp_packet_from_event(event)); + break; + case ODP_EVENT_TIMEOUT: + odp_timeout_free(odp_timeout_from_event(event)); + break; + case ODP_EVENT_CRYPTO_COMPL: + odp_crypto_compl_free(odp_crypto_compl_from_event(event)); + break; + default: + ODP_ABORT(Invalid event type: %d\n, odp_event_type(event)); + } +} -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v3 6/9] odp_timer_test: remove redundant free function
Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- example/timer/odp_timer_test.c | 26 +- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 5e4306e..735c4c6 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -66,30 +66,6 @@ static const char *timerset2str(odp_timer_set_t val) } }; - -/** @private test timeout */ -static void free_event(odp_event_t ev) -{ - switch (odp_event_type(ev)) { - case ODP_EVENT_BUFFER: - odp_buffer_free(odp_buffer_from_event(ev)); - break; - case ODP_EVENT_PACKET: - odp_packet_free(odp_packet_from_event(ev)); - break; - case ODP_EVENT_TIMEOUT: - odp_timeout_free(odp_timeout_from_event(ev)); - break; - case ODP_EVENT_CRYPTO_COMPL: - odp_crypto_compl_free(odp_crypto_compl_from_event(ev)); - break; - default: - fprintf(stderr, Unrecognized event type %d\n, - odp_event_type(ev)); - abort(); - } -} - /** @private test timeout */ static void remove_prescheduled_events(void) { @@ -98,7 +74,7 @@ static void remove_prescheduled_events(void) odp_schedule_pause(); while ((ev = odp_schedule(queue, ODP_SCHED_NO_WAIT)) != ODP_EVENT_INVALID) { - free_event(ev); + odp_event_free(ev); } } -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v3 4/9] api: event: define odp_event_free()
We need a convenient function which calls the right type-depending free() function. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- include/odp/api/event.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/odp/api/event.h b/include/odp/api/event.h index 63b476f..7ec5e76 100644 --- a/include/odp/api/event.h +++ b/include/odp/api/event.h @@ -78,6 +78,16 @@ int odp_event_type(odp_event_t event); uint64_t odp_event_to_u64(odp_event_t hdl); /** + * Call the free function of the event's type + * + * @param eventEvent handle + * + * @note This routine aborts if event type is unsupported + * + */ +void odp_event_free(odp_event_t event); + +/** * @} */ -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v3 3/9] packet_io: release unsent packets after odp_pktio_send()
Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- example/packet/odp_pktio.c | 10 +- test/performance/odp_l2fwd.c | 12 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index f08d9f4..0b4a8f1 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -282,9 +282,17 @@ static void *pktio_ifburst_thread(void *arg) /* Drop packets with errors */ pkts_ok = drop_err_pkts(pkt_tbl, pkts); if (pkts_ok 0) { + int sent; + /* Swap Eth MACs and IP-addrs */ swap_pkt_addrs(pkt_tbl, pkts_ok); - odp_pktio_send(pktio, pkt_tbl, pkts_ok); + sent = odp_pktio_send(pktio, pkt_tbl, pkts_ok); + if (odp_unlikely(sent pkts_ok)) { + err_cnt += pkts_ok - sent; + do + odp_packet_free(pkt_tbl[sent]); + while (++sent pkts_ok); + } } if (odp_unlikely(pkts_ok != pkts)) diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 5d4b833..dd0b4b1 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -224,8 +224,16 @@ static void *pktio_ifburst_thread(void *arg) /* Drop packets with errors */ pkts_ok = drop_err_pkts(pkt_tbl, pkts); - if (pkts_ok 0) - odp_pktio_send(pktio_dst, pkt_tbl, pkts_ok); + if (pkts_ok 0) { + int sent = odp_pktio_send(pktio_dst, pkt_tbl, pkts_ok); + + if (odp_unlikely(sent pkts_ok)) { + stats-drops += pkts_ok - sent; + do + odp_packet_free(pkt_tbl[sent]); + while (++sent pkts_ok); + } + } if (odp_unlikely(pkts_ok != pkts)) stats-drops += pkts - pkts_ok; -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v3 0/9] Handle unsent packets
This series clarifies what happens when not all packets were sent, whether in odp_pktio_send() or odp_queue_enq*(). It also introduces odp_event_free() to make it easier the release of an event with not obvious type. It also fixes the many places in the examples and tests where this issue were not handled properly. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v3 8/9] queue: handle return value of odp_queue_enq()
Unsent packet has to be released. If the event type is obvious from the context, use directly the relevant release functions, otherwise odp_event(free). Wider error handling is attempted, but this patch can't fix all the flaws in the many calling functions of odp_queue_enq() Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- example/classifier/odp_classifier.c | 7 ++- example/generator/odp_generator.c | 1 + example/ipsec/odp_ipsec.c | 11 --- example/ipsec/odp_ipsec_stream.c | 6 +- example/packet/odp_pktio.c| 6 +- platform/linux-generic/include/odp_schedule_internal.h| 4 ++-- platform/linux-generic/odp_crypto.c | 5 - platform/linux-generic/odp_queue.c| 8 platform/linux-generic/odp_schedule.c | 14 ++ platform/linux-generic/odp_timer.c| 4 +++- test/performance/odp_l2fwd.c | 6 +- test/performance/odp_pktio_perf.c | 10 -- test/performance/odp_scheduling.c | 7 +++ test/validation/classification/odp_classification_tests.c | 3 ++- test/validation/odp_pktio.c | 1 + test/validation/odp_queue.c | 9 ++--- test/validation/odp_scheduler.c | 12 17 files changed, 85 insertions(+), 29 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 48fc1ab..129b042 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -292,7 +292,12 @@ static void *pktio_receive_thread(void *arg) if (appl-appl_mode == APPL_MODE_DROP) odp_packet_free(pkt); else - odp_queue_enq(outq_def, ev); + if (odp_queue_enq(outq_def, ev)) { + EXAMPLE_ERR( [%i] Queue enqueue failed.\n, + thr); + odp_packet_free(pkt); + continue; + } } return NULL; diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index cbe93b5..c4ef361 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -410,6 +410,7 @@ static void *gen_send_thread(void *arg) err = odp_queue_enq(outq_def, odp_packet_to_event(pkt)); if (err != 0) { EXAMPLE_ERR( [%02i] send pkt err!\n, thr); + odp_packet_free(pkt); return NULL; } diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index cb8f535..1d034dd 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1078,7 +1078,8 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) ctx-state = PKT_STATE_TRANSMIT; } else { ctx-state = PKT_STATE_IPSEC_OUT_SEQ; - odp_queue_enq(seqnumq, ev); + if (odp_queue_enq(seqnumq, ev)) + rc = PKT_DROP; } break; @@ -1096,8 +1097,12 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) case PKT_STATE_TRANSMIT: - odp_queue_enq(ctx-outq, ev); - rc = PKT_DONE; + if (odp_queue_enq(ctx-outq, ev)) { + odp_event_free(ev); + rc = PKT_DROP; + } else { + rc = PKT_DONE; + } break; default: diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index 35042f5..af143ee 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -494,7 +494,11 @@ int create_stream_db_inputs(void) break; } stream-created++; - odp_queue_enq(queue, odp_packet_to_event(pkt)); + if (odp_queue_enq(queue, odp_packet_to_event(pkt))) { + odp_packet_free(pkt); + printf(Queue enqueue failed\n); + break; + } /* Count this stream when we create first packet */
[lng-odp] [API-NEXT PATCH v3 9/9] queue: handle return value of odp_queue_enq_multi()
Unsent packet has to be released. If the event type is obvious from the context, use directly the relevant release functions, otherwise odp_event(free). Wider error handling is attempted, but this patch can't fix all the flaws in the many calling functions of odp_queue_enq() Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- test/performance/odp_pktio_perf.c | 15 ++- test/performance/odp_scheduling.c | 10 -- test/validation/odp_pktio.c | 5 + test/validation/odp_queue.c | 6 ++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 1ef07ae..27d0fef 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -270,6 +270,9 @@ static int alloc_packets(odp_event_t *event_tbl, int num_pkts) static int send_packets(odp_queue_t outq, odp_event_t *event_tbl, unsigned num_pkts) { + int ret; + unsigned cnt; + if (num_pkts == 0) return 0; else if (num_pkts == 1) { @@ -281,7 +284,17 @@ static int send_packets(odp_queue_t outq, } } - return odp_queue_enq_multi(outq, event_tbl, num_pkts); + ret = odp_queue_enq_multi(outq, event_tbl, num_pkts); + if (ret == (signed)num_pkts) + return ret; + + if (ret 0) + ret = 0; + cnt = ret; + do + odp_event_free(event_tbl[cnt]); + while (++cnt num_pkts); + return ret; } /* diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 1283986..8b46eb2 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -535,9 +535,15 @@ static int test_schedule_multi(const char *str, int thr, } /* Assume we can enqueue all events */ - if (odp_queue_enq_multi(queue, ev, MULTI_BUFS_MAX) != - MULTI_BUFS_MAX) { + j = odp_queue_enq_multi(queue, ev, MULTI_BUFS_MAX); + if (j != MULTI_BUFS_MAX) { LOG_ERR( [%i] Queue enqueue failed.\n, thr); + if (j 0) + j = 0; + do + odp_event_free(ev[j]); + while (++j MULTI_BUFS_MAX); + return -1; } } diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index 3027b25..d25e5fa 100644 --- a/test/validation/odp_pktio.c +++ b/test/validation/odp_pktio.c @@ -387,6 +387,11 @@ static void pktio_txrx_multi(pktio_info_t *pktio_a, pktio_info_t *pktio_b, ret = odp_queue_enq_multi(pktio_a-outq, tx_ev, num_pkts); if (ret != num_pkts) { CU_FAIL(failed to enqueue test packets); + if (ret 0) + ret = 0; + do + odp_packet_free(tx_pkt[ret]); + while (++ret num_pkts); return; } } diff --git a/test/validation/odp_queue.c b/test/validation/odp_queue.c index f8c64f7..341b702 100644 --- a/test/validation/odp_queue.c +++ b/test/validation/odp_queue.c @@ -90,6 +90,12 @@ static void test_odp_queue_sunnyday(void) */ ret = odp_queue_enq_multi(queue_id, enev, MAX_BUFFER_QUEUE); CU_ASSERT(MAX_BUFFER_QUEUE == ret); + if (ret 0) + ret = 0; + do + odp_event_free(enev[ret]); + while (++ret MAX_BUFFER_QUEUE); + pev_tmp = deev; do { deq_ret = odp_queue_deq_multi(queue_id, pev_tmp, -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
Re: [lng-odp] [API-NEXT PATCH v2 1/9] packet_io: clarify what happens when not all packets are sent
This touches the api b/include/odp/api/packet_io.h so the subject should add api: like this api: packet_io: clarify what happens when not all packets are sent Generally for ODP the approximate path to the code is in the subject include/odp/api/packet_io.h becomes include/odp/api -- api: then the module area or file name as appropriate - packet_io: in this case as you have it. On 5 June 2015 at 07:53, Zoltan Kiss zoltan.k...@linaro.org wrote: Currently our examples are not handling this situation as well. Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- include/odp/api/packet_io.h | 4 +++- include/odp/api/queue.h | 7 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 89356a6..5a71e52 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -111,7 +111,9 @@ int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t pkt_table[], int len); * @param pkt_table[] Array of packets to send * @param len length of pkt_table[] * - * @return Number of packets sent + * @return Number of packets sent. If it is less than 'len', the remaining + * packets at the end of pkt_table[] are not consumed, and caller has to take + * care of them. * @retval 0 on failure */ int odp_pktio_send(odp_pktio_t pktio, odp_packet_t pkt_table[], int len); diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h index 6a8b15f..ac4147d 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.h @@ -242,7 +242,8 @@ void *odp_queue_get_context(odp_queue_t queue); * @param ev Event handle * * @retval 0 on success - * @retval 0 on failure (e.g. queue full) + * @retval 0 on failure (e.g. queue full), the event is not consumed, caller + * has to take care of it. */ int odp_queue_enq(odp_queue_t queue, odp_event_t ev); @@ -253,7 +254,9 @@ int odp_queue_enq(odp_queue_t queue, odp_event_t ev); * @param[in] events Array of event handles * @param num Number of event handles to enqueue * - * @return Number of events actually enqueued (0 ... num) + * @return Number of events actually enqueued (0 ... num). If it is less than + * 'num', the remaining events at the end of events[] are not consumed, and + * caller has to take care of them. * @retval 0 on failure */ int odp_queue_enq_multi(odp_queue_t queue, const odp_event_t events[], int num); -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp -- Mike Holmes Technical Manager - Linaro Networking Group Linaro.org http://www.linaro.org/ *│ *Open source software for ARM SoCs ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
Re: [lng-odp] [API-NEXT PATCH] api: codespell: correct spelling
On 5 June 2015 at 04:26, Maxim Uvarov maxim.uva...@linaro.org wrote: why this is for api-next? Patch fixes only spelling in doxygen description. It does not modify API. It has to go to master. All changes in the include directory go into api-next, every time we try a short cut we open ourselves up to discussion on was it wise. See this kernel discussion http://www.kegel.com/kerspell/. Importantly Correcting spelling mistakes is not as easy as it sounds; it cannot really be automated, as many reasonable-sounding corrections could actually change the meaning of the comments. If it makes it in api-next it can be quickly cherry picked back to master, but the API might have been affected if the description is now incorrect. Maxim. On 06/05/15 06:17, Bill Fischofer wrote: On Thu, Jun 4, 2015 at 12:18 PM, Mike Holmes mike.hol...@linaro.org mailto:mike.hol...@linaro.org wrote: Signed-off-by: Mike Holmes mike.hol...@linaro.org mailto:mike.hol...@linaro.org Reviewed-by: Bill Fischofer bill.fischo...@linaro.org mailto: bill.fischo...@linaro.org --- include/odp/api/crypto.h| 4 ++-- include/odp/api/packet_io.h | 2 +- include/odp/api/pool.h | 2 +- include/odp/api/queue.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/odp/api/crypto.h b/include/odp/api/crypto.h index 792549c..a9a2a1d 100644 --- a/include/odp/api/crypto.h +++ b/include/odp/api/crypto.h @@ -110,7 +110,7 @@ typedef struct odp_crypto_data_range { } odp_crypto_data_range_t; /** - * Crypto API session creation paramters + * Crypto API session creation parameters * * @todo Add odp_session_proc_info_t */ @@ -133,7 +133,7 @@ typedef struct odp_crypto_session_params { * Controls ordering of authentication and cipher operations, * and is relative to the operation (encode vs decode). * When encoding, @c TRUE indicates the authentication operation - * should be peformed @b after the cipher operation else before. + * should be performed @b after the cipher operation else before. * When decoding, @c TRUE indicates the reverse order of operation. * * @var odp_crypto_session_params_t::compl_queue diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 89356a6..5b04737 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -64,7 +64,7 @@ extern C { * * @note Packets arriving via this interface assigned to a CoS by the * classifier are received into the pool associated with that CoS. This - * will occur either becuase this pktio is assigned a default CoS via + * will occur either because this pktio is assigned a default CoS via * the odp_pktio_default_cos_set() routine, or because a matching PMR * assigned the packet to a specific CoS. The default pool specified * here is applicable only for those packets that are not assigned to a diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h index e5061ab..1ae7119 100644 --- a/include/odp/api/pool.h +++ b/include/odp/api/pool.h @@ -37,7 +37,7 @@ extern C { * Invalid pool */ -/** Maximum queue name lenght in chars */ +/** Maximum queue name length in chars */ #define ODP_POOL_NAME_LEN 32 /** diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h index 6a8b15f..f7a0777 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.h @@ -41,7 +41,7 @@ extern C { /** * @def ODP_QUEUE_NAME_LEN - * Maximum queue name lenght in chars + * Maximum queue name length in chars */ @@ -213,7 +213,7 @@ odp_queue_t odp_queue_lookup(const char *name); /** * Set queue context * - * Its the responsability of the interface user to make sure + * It is the responsibility of the interface user to make sure * queue context allocation is done in an area reachable for * all EOs accessing the context * -- 2.1.4 ___ lng-odp mailing list lng-odp@lists.linaro.org mailto:lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp -- Mike Holmes Technical Manager - Linaro Networking Group Linaro.org http://www.linaro.org/ *│ *Open source software for ARM SoCs ___ lng-odp mailing list
Re: [lng-odp] [API-NEXT PATCH] api: codespell: correct spelling
OK. Merged, Maxim. On 06/05/15 13:52, Mike Holmes wrote: On 5 June 2015 at 04:26, Maxim Uvarov maxim.uva...@linaro.org mailto:maxim.uva...@linaro.org wrote: why this is for api-next? Patch fixes only spelling in doxygen description. It does not modify API. It has to go to master. All changes in the include directory go into api-next, every time we try a short cut we open ourselves up to discussion on was it wise. See this kernel discussion http://www.kegel.com/kerspell/. Importantly Correcting spelling mistakes is not as easy as it sounds; it cannot really be automated, as many reasonable-sounding corrections could actually change the meaning of the comments. If it makes it in api-next it can be quickly cherry picked back to master, but the API might have been affected if the description is now incorrect. Maxim. On 06/05/15 06:17, Bill Fischofer wrote: On Thu, Jun 4, 2015 at 12:18 PM, Mike Holmes mike.hol...@linaro.org mailto:mike.hol...@linaro.org mailto:mike.hol...@linaro.org mailto:mike.hol...@linaro.org wrote: Signed-off-by: Mike Holmes mike.hol...@linaro.org mailto:mike.hol...@linaro.org mailto:mike.hol...@linaro.org mailto:mike.hol...@linaro.org Reviewed-by: Bill Fischofer bill.fischo...@linaro.org mailto:bill.fischo...@linaro.org mailto:bill.fischo...@linaro.org mailto:bill.fischo...@linaro.org --- include/odp/api/crypto.h| 4 ++-- include/odp/api/packet_io.h | 2 +- include/odp/api/pool.h | 2 +- include/odp/api/queue.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/odp/api/crypto.h b/include/odp/api/crypto.h index 792549c..a9a2a1d 100644 --- a/include/odp/api/crypto.h +++ b/include/odp/api/crypto.h @@ -110,7 +110,7 @@ typedef struct odp_crypto_data_range { } odp_crypto_data_range_t; /** - * Crypto API session creation paramters + * Crypto API session creation parameters * * @todo Add odp_session_proc_info_t */ @@ -133,7 +133,7 @@ typedef struct odp_crypto_session_params { * Controls ordering of authentication and cipher operations, * and is relative to the operation (encode vs decode). * When encoding, @c TRUE indicates the authentication operation - * should be peformed @b after the cipher operation else before. + * should be performed @b after the cipher operation else before. * When decoding, @c TRUE indicates the reverse order of operation. * * @var odp_crypto_session_params_t::compl_queue diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 89356a6..5b04737 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -64,7 +64,7 @@ extern C { * * @note Packets arriving via this interface assigned to a CoS by the * classifier are received into the pool associated with that CoS. This - * will occur either becuase this pktio is assigned a default CoS via + * will occur either because this pktio is assigned a default CoS via * the odp_pktio_default_cos_set() routine, or because a matching PMR * assigned the packet to a specific CoS. The default pool specified * here is applicable only for those packets that are not assigned to a diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h index e5061ab..1ae7119 100644 --- a/include/odp/api/pool.h +++ b/include/odp/api/pool.h @@ -37,7 +37,7 @@ extern C { * Invalid pool */ -/** Maximum queue name lenght in chars */ +/** Maximum queue name length in chars */ #define ODP_POOL_NAME_LEN 32 /** diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h index 6a8b15f..f7a0777 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.h @@ -41,7 +41,7 @@ extern C { /** * @def ODP_QUEUE_NAME_LEN - * Maximum queue name lenght in chars + * Maximum queue name length in chars */ @@ -213,7 +213,7 @@ odp_queue_t odp_queue_lookup(const char *name); /** * Set queue context * - *
[lng-odp] [API-NEXT PATCH v2 5/9] event: implement odp_event_free()
Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- platform/linux-generic/odp_event.c | 24 1 file changed, 24 insertions(+) diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index 17f4f43..e93dfca 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -6,8 +6,12 @@ #include odp/event.h #include odp/buffer.h +#include odp/crypto.h +#include odp/packet.h +#include odp/timer.h #include odp/pool.h #include odp_buffer_internal.h +#include odp_debug_internal.h int odp_event_type(odp_event_t event) { @@ -17,3 +21,23 @@ int odp_event_type(odp_event_t event) return _odp_buffer_type(buf); } + +void odp_event_free(odp_event_t event) +{ + switch (odp_event_type(event)) { + case ODP_EVENT_BUFFER: + odp_buffer_free(odp_buffer_from_event(event)); + break; + case ODP_EVENT_PACKET: + odp_packet_free(odp_packet_from_event(event)); + break; + case ODP_EVENT_TIMEOUT: + odp_timeout_free(odp_timeout_from_event(event)); + break; + case ODP_EVENT_CRYPTO_COMPL: + odp_crypto_compl_free(odp_crypto_compl_from_event(event)); + break; + default: + ODP_ABORT(Invalid event type: %d\n, odp_event_type(event)); + } +} -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
[lng-odp] [API-NEXT PATCH v2 3/9] packet_io: release unsent packets after odp_pktio_send()
Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org --- example/packet/odp_pktio.c | 10 +- test/performance/odp_l2fwd.c | 12 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index f08d9f4..0b4a8f1 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -282,9 +282,17 @@ static void *pktio_ifburst_thread(void *arg) /* Drop packets with errors */ pkts_ok = drop_err_pkts(pkt_tbl, pkts); if (pkts_ok 0) { + int sent; + /* Swap Eth MACs and IP-addrs */ swap_pkt_addrs(pkt_tbl, pkts_ok); - odp_pktio_send(pktio, pkt_tbl, pkts_ok); + sent = odp_pktio_send(pktio, pkt_tbl, pkts_ok); + if (odp_unlikely(sent pkts_ok)) { + err_cnt += pkts_ok - sent; + do + odp_packet_free(pkt_tbl[sent]); + while (++sent pkts_ok); + } } if (odp_unlikely(pkts_ok != pkts)) diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 5d4b833..dd0b4b1 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -224,8 +224,16 @@ static void *pktio_ifburst_thread(void *arg) /* Drop packets with errors */ pkts_ok = drop_err_pkts(pkt_tbl, pkts); - if (pkts_ok 0) - odp_pktio_send(pktio_dst, pkt_tbl, pkts_ok); + if (pkts_ok 0) { + int sent = odp_pktio_send(pktio_dst, pkt_tbl, pkts_ok); + + if (odp_unlikely(sent pkts_ok)) { + stats-drops += pkts_ok - sent; + do + odp_packet_free(pkt_tbl[sent]); + while (++sent pkts_ok); + } + } if (odp_unlikely(pkts_ok != pkts)) stats-drops += pkts - pkts_ok; -- 1.9.1 ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
Re: [lng-odp] [PATCH] doc: use only WITH_PLATFORM and not always linux-generic
This works for linux-generic, but derived platforms such as odp-dpdk depend on this link back to linux-generic becasue they inherit from it. Having this in linux-generic makes it simpler for the derived works, but I could also see the argument that it should be removed in linux-generic and added back into to odp-dpdk, odp-KS2 and odp-netmap. I think I agree with this patch, but welcome others thoughts on how much the reference code should include support it does not itsself need so that it helps other platforms. On 5 June 2015 at 08:22, Nicolas Morey-Chaisemartin nmo...@kalray.eu wrote: Signed-off-by: Nicolas Morey-Chaisemartin nmo...@kalray.eu --- doc/doxygen.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg index 6283387..213a903 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg @@ -13,7 +13,6 @@ WARN_NO_PARAMDOC = YES INPUT = $(SRCDIR)/doc \ $(SRCDIR)/doc/users-guide \ $(SRCDIR)/include \ - $(SRCDIR)/platform/linux-generic/include/odp \ $(SRCDIR)/platform/$(WITH_PLATFORM)/include/odp \ $(SRCDIR)/helper/include FILE_PATTERNS = *.h odp*.c *.dox ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp -- Mike Holmes Technical Manager - Linaro Networking Group Linaro.org http://www.linaro.org/ *│ *Open source software for ARM SoCs ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp
Re: [lng-odp] [PATCH] doc: use only WITH_PLATFORM and not always linux-generic
The linux-generic platform is indeed used as a base class however given this it would seem that the include order should be reversed so that $(WITH_PLATFORM) is first. This would have the effect of allowing it to override any linux-generic include files of the same name. On Fri, Jun 5, 2015 at 3:14 PM, Mike Holmes mike.hol...@linaro.org wrote: This works for linux-generic, but derived platforms such as odp-dpdk depend on this link back to linux-generic becasue they inherit from it. Having this in linux-generic makes it simpler for the derived works, but I could also see the argument that it should be removed in linux-generic and added back into to odp-dpdk, odp-KS2 and odp-netmap. I think I agree with this patch, but welcome others thoughts on how much the reference code should include support it does not itsself need so that it helps other platforms. On 5 June 2015 at 08:22, Nicolas Morey-Chaisemartin nmo...@kalray.eu wrote: Signed-off-by: Nicolas Morey-Chaisemartin nmo...@kalray.eu --- doc/doxygen.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg index 6283387..213a903 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg @@ -13,7 +13,6 @@ WARN_NO_PARAMDOC = YES INPUT = $(SRCDIR)/doc \ $(SRCDIR)/doc/users-guide \ $(SRCDIR)/include \ - $(SRCDIR)/platform/linux-generic/include/odp \ $(SRCDIR)/platform/$(WITH_PLATFORM)/include/odp \ $(SRCDIR)/helper/include FILE_PATTERNS = *.h odp*.c *.dox ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp -- Mike Holmes Technical Manager - Linaro Networking Group Linaro.org http://www.linaro.org/ *│ *Open source software for ARM SoCs ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp ___ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp