Re: [lng-odp] [API-NEXT PATCH v3 05/19] linux-gen: pool: reimplement pool with ring
tarted as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) passed Test: scheduler_test_mq_mt_prio_o ...linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) FAILED 1. scheduler.c:871 - bctx->sequence == seq 2. scheduler.c:871 - bctx->sequence == seq Test: scheduler_test_1q_mt_a_excl ...linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) passed Test: scheduler_test_multi_1q_1t_n ...passed Test: scheduler_test_multi_1q_1t_a ...passed Test: scheduler_test_multi_1q_1t_o ...passed Test: scheduler_test_multi_mq_1t_n ...passed Test: scheduler_test_multi_mq_1t_a ...passed Test: scheduler_test_multi_mq_1t_o ...passed Test: scheduler_test_multi_mq_1t_prio_n ...passed Test: scheduler_test_multi_mq_1t_prio_a ...passed Test: scheduler_test_multi_mq_1t_prio_o ...passed Test: scheduler_test_multi_mq_mt_prio_n ...linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) passed Test: scheduler_test_multi_mq_mt_prio_a ...linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) passed Test: scheduler_test_multi_mq_mt_prio_o ...linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) FAILED 1. scheduler.c:871 - bctx->sequence == seq 2. scheduler.c:871 - bctx->sequence == seq 3. scheduler.c:871 - bctx->sequence == seq 4. scheduler.c:871 - bctx->sequence == seq 5. scheduler.c:871 - bctx->sequence == seq 6. scheduler.c:871 - bctx->sequence == seq 7. scheduler.c:871 - bctx->sequence == seq 8. scheduler.c:871 - bctx->sequence == seq 9. scheduler.c:871 - bctx->sequence == seq 10. scheduler.c:871 - bctx->sequence == seq 11. scheduler.c:871 - bctx->sequence == seq 12. scheduler.c:871 - bctx->sequence == seq 13. scheduler.c:871 - bctx->sequence == seq Test: scheduler_test_multi_1q_mt_a_excl ...linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) linux.c:273:odpthread_run_start_routine():helper: ODP worker thread started as linux pthread. (pid=10162) passed Run Summary:Type Total Ran Passed Failed Inactive suites 1 1 n/a 00 tests 35 35 33 20 asserts 2948283 2948283 2948268 15 n/a Elapsed time =8.881 seconds FAIL ../../test/common_plat/validation/api/scheduler/scheduler_main (exit status: 255) So yes, this does look like an occasional issue we've seen before. Continuing review and will post more once that's complete. > > > > > *From:* Bill Fischofer [mailto:bill.fischo...@linaro.org] > *Sent:* Thursday, November 10, 2016 4:28 PM > *To:* Savolainen, Petri (Nokia - FI/Espoo) <petri.savolainen@nokia-
Re: [lng-odp] [API-NEXT PATCH v3 05/19] linux-gen: pool: reimplement pool with ring
What failed exactly ? I think order queue implementation has some bugs that are not caused by these changes but may surface those. I did see one time order queue test to fail, but most of the time all test pass. These modifications did not change how scheduler works. Also the patch 5 was not modified for v3 and I think you did run the test successfully on v2 already. -Petri From: Bill Fischofer [mailto:bill.fischo...@linaro.org] Sent: Thursday, November 10, 2016 4:28 PM To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolai...@nokia-bell-labs.com> Cc: lng-odp-forward <lng-odp@lists.linaro.org> Subject: Re: [lng-odp] [API-NEXT PATCH v3 05/19] linux-gen: pool: reimplement pool with ring This series fails bisectability with this patch: Using patch: 0005-linux-gen-pool-reimplement-pool-with-ring.patch Trying to apply patch Patch applied Building with patch PASS: odp_crypto PASS: odp_pktio_perf SKIP: odp_l2fwd_run.sh PASS: odp_sched_latency_run.sh PASS: odp_scheduling_run.sh Testsuite summary for OpenDataPlane 1.11.0.0 # TOTAL: 5 # PASS: 4 # SKIP: 1 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 Testsuite summary for OpenDataPlane 1.11.0.0 # TOTAL: 0 # PASS: 0 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 PASS: odp_scheduling_run_proc.sh Testsuite summary for OpenDataPlane 1.11.0.0 # TOTAL: 1 # PASS: 1 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 PASS: validation/api/pktio/pktio_run.sh SKIP: validation/api/pktio/pktio_run_tap.sh PASS: validation/api/shmem/shmem_linux PASS: ../../test/common_plat/validation/api/atomic/atomic_main PASS: ../../test/common_plat/validation/api/barrier/barrier_main PASS: ../../test/common_plat/validation/api/buffer/buffer_main PASS: ../../test/common_plat/validation/api/classification/classification_main PASS: ../../test/common_plat/validation/api/cpumask/cpumask_main PASS: ../../test/common_plat/validation/api/crypto/crypto_main PASS: ../../test/common_plat/validation/api/errno/errno_main PASS: ../../test/common_plat/validation/api/hash/hash_main PASS: ../../test/common_plat/validation/api/init/init_main_ok PASS: ../../test/common_plat/validation/api/init/init_main_abort PASS: ../../test/common_plat/validation/api/init/init_main_log PASS: ../../test/common_plat/validation/api/lock/lock_main PASS: ../../test/common_plat/validation/api/packet/packet_main PASS: ../../test/common_plat/validation/api/pool/pool_main PASS: ../../test/common_plat/validation/api/queue/queue_main PASS: ../../test/common_plat/validation/api/random/random_main FAIL: ../../test/common_plat/validation/api/scheduler/scheduler_main PASS: ../../test/common_plat/validation/api/std_clib/std_clib_main PASS: ../../test/common_plat/validation/api/thread/thread_main PASS: ../../test/common_plat/validation/api/time/time_main PASS: ../../test/common_plat/validation/api/timer/timer_main PASS: ../../test/common_plat/validation/api/traffic_mngr/traffic_mngr_main PASS: ../../test/common_plat/validation/api/shmem/shmem_main PASS: ../../test/common_plat/validation/api/system/system_main PASS: ../../test/common_plat/validation/drv/drvatomic/drvatomic_main PASS: ../../test/common_plat/validation/drv/drvshmem/drvshmem_main PASS: ring/ring_main PASS: validation/api/pktio/pktio_run_pcap.sh SKIP: mmap_vlan_ins/mmap_vlan_ins.sh Testsuite summary for OpenDataPlane 1.11.0.0 # TOTAL: 32 # PASS: 29 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 See test/linux-generic/test-suite.log Please report to lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>
Re: [lng-odp] [API-NEXT PATCH v3 05/19] linux-gen: pool: reimplement pool with ring
This series fails bisectability with this patch: Using patch: 0005-linux-gen-pool-reimplement-pool-with-ring.patch Trying to apply patch Patch applied Building with patch PASS: odp_crypto PASS: odp_pktio_perf SKIP: odp_l2fwd_run.sh PASS: odp_sched_latency_run.sh PASS: odp_scheduling_run.sh Testsuite summary for OpenDataPlane 1.11.0.0 # TOTAL: 5 # PASS: 4 # SKIP: 1 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 Testsuite summary for OpenDataPlane 1.11.0.0 # TOTAL: 0 # PASS: 0 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 PASS: odp_scheduling_run_proc.sh Testsuite summary for OpenDataPlane 1.11.0.0 # TOTAL: 1 # PASS: 1 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 PASS: validation/api/pktio/pktio_run.sh SKIP: validation/api/pktio/pktio_run_tap.sh PASS: validation/api/shmem/shmem_linux PASS: ../../test/common_plat/validation/api/atomic/atomic_main PASS: ../../test/common_plat/validation/api/barrier/barrier_main PASS: ../../test/common_plat/validation/api/buffer/buffer_main PASS: ../../test/common_plat/validation/api/classification/classification_main PASS: ../../test/common_plat/validation/api/cpumask/cpumask_main PASS: ../../test/common_plat/validation/api/crypto/crypto_main PASS: ../../test/common_plat/validation/api/errno/errno_main PASS: ../../test/common_plat/validation/api/hash/hash_main PASS: ../../test/common_plat/validation/api/init/init_main_ok PASS: ../../test/common_plat/validation/api/init/init_main_abort PASS: ../../test/common_plat/validation/api/init/init_main_log PASS: ../../test/common_plat/validation/api/lock/lock_main PASS: ../../test/common_plat/validation/api/packet/packet_main PASS: ../../test/common_plat/validation/api/pool/pool_main PASS: ../../test/common_plat/validation/api/queue/queue_main PASS: ../../test/common_plat/validation/api/random/random_main FAIL: ../../test/common_plat/validation/api/scheduler/scheduler_main PASS: ../../test/common_plat/validation/api/std_clib/std_clib_main PASS: ../../test/common_plat/validation/api/thread/thread_main PASS: ../../test/common_plat/validation/api/time/time_main PASS: ../../test/common_plat/validation/api/timer/timer_main PASS: ../../test/common_plat/validation/api/traffic_mngr/traffic_mngr_main PASS: ../../test/common_plat/validation/api/shmem/shmem_main PASS: ../../test/common_plat/validation/api/system/system_main PASS: ../../test/common_plat/validation/drv/drvatomic/drvatomic_main PASS: ../../test/common_plat/validation/drv/drvshmem/drvshmem_main PASS: ring/ring_main PASS: validation/api/pktio/pktio_run_pcap.sh SKIP: mmap_vlan_ins/mmap_vlan_ins.sh Testsuite summary for OpenDataPlane 1.11.0.0 # TOTAL: 32 # PASS: 29 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 See test/linux-generic/test-suite.log Please report to lng-odp@lists.linaro.org On Thu, Nov 10, 2016 at 5:07 AM, Petri Savolainen < petri.savolai...@nokia.com> wrote: > Used the ring data structure to implement pool. Also > buffer structure was simplified to enable future driver > interface. Every buffer includes a packet header, so each > buffer can be used as a packet head or segment. Segmentation > was disabled and segment size was fixed to a large number > (64kB) to limit the number of modification in the commit. > > Signed-off-by: Petri Savolainen> --- > .../include/odp/api/plat/pool_types.h |6 - > .../linux-generic/include/odp_buffer_inlines.h | 160 +-- > .../linux-generic/include/odp_buffer_internal.h| 104 +- > .../include/odp_classification_datamodel.h |2 +- > .../linux-generic/include/odp_config_internal.h| 34 +- > .../linux-generic/include/odp_packet_internal.h| 13 +- > platform/linux-generic/include/odp_pool_internal.h | 270 +--- > .../linux-generic/include/odp_timer_internal.h |4 - > platform/linux-generic/odp_buffer.c|8 - > platform/linux-generic/odp_classification.c| 25 +- > platform/linux-generic/odp_crypto.c
[lng-odp] [API-NEXT PATCH v3 05/19] linux-gen: pool: reimplement pool with ring
Used the ring data structure to implement pool. Also buffer structure was simplified to enable future driver interface. Every buffer includes a packet header, so each buffer can be used as a packet head or segment. Segmentation was disabled and segment size was fixed to a large number (64kB) to limit the number of modification in the commit. Signed-off-by: Petri Savolainen--- .../include/odp/api/plat/pool_types.h |6 - .../linux-generic/include/odp_buffer_inlines.h | 160 +-- .../linux-generic/include/odp_buffer_internal.h| 104 +- .../include/odp_classification_datamodel.h |2 +- .../linux-generic/include/odp_config_internal.h| 34 +- .../linux-generic/include/odp_packet_internal.h| 13 +- platform/linux-generic/include/odp_pool_internal.h | 270 +--- .../linux-generic/include/odp_timer_internal.h |4 - platform/linux-generic/odp_buffer.c|8 - platform/linux-generic/odp_classification.c| 25 +- platform/linux-generic/odp_crypto.c|4 +- platform/linux-generic/odp_packet.c| 99 +- platform/linux-generic/odp_pool.c | 1441 platform/linux-generic/odp_timer.c |1 + platform/linux-generic/pktio/socket.c | 16 +- platform/linux-generic/pktio/socket_mmap.c | 10 +- test/common_plat/performance/odp_pktio_perf.c |2 +- test/common_plat/performance/odp_scheduling.c |8 +- test/common_plat/validation/api/packet/packet.c|8 +- 19 files changed, 746 insertions(+), 1469 deletions(-) diff --git a/platform/linux-generic/include/odp/api/plat/pool_types.h b/platform/linux-generic/include/odp/api/plat/pool_types.h index 1ca8f02..4e39de5 100644 --- a/platform/linux-generic/include/odp/api/plat/pool_types.h +++ b/platform/linux-generic/include/odp/api/plat/pool_types.h @@ -39,12 +39,6 @@ typedef enum odp_pool_type_t { ODP_POOL_TIMEOUT = ODP_EVENT_TIMEOUT, } odp_pool_type_t; -/** Get printable format of odp_pool_t */ -static inline uint64_t odp_pool_to_u64(odp_pool_t hdl) -{ - return _odp_pri(hdl); -} - /** * @} */ diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index 2b1ab42..2f5eb88 100644 --- a/platform/linux-generic/include/odp_buffer_inlines.h +++ b/platform/linux-generic/include/odp_buffer_inlines.h @@ -18,43 +18,20 @@ extern "C" { #endif #include -#include -static inline odp_buffer_t odp_buffer_encode_handle(odp_buffer_hdr_t *hdr) -{ - odp_buffer_bits_t handle; - uint32_t pool_id = pool_handle_to_index(hdr->pool_hdl); - struct pool_entry_s *pool = get_pool_entry(pool_id); +odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf); +void _odp_buffer_event_type_set(odp_buffer_t buf, int ev); +int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf); - handle.handle = 0; - handle.pool_id = pool_id; - handle.index = ((uint8_t *)hdr - pool->pool_mdata_addr) / - ODP_CACHE_LINE_SIZE; - handle.seg = 0; - - return handle.handle; -} +void *buffer_map(odp_buffer_hdr_t *buf, uint32_t offset, uint32_t *seglen, +uint32_t limit); static inline odp_buffer_t odp_hdr_to_buf(odp_buffer_hdr_t *hdr) { return hdr->handle.handle; } -static inline odp_buffer_hdr_t *odp_buf_to_hdr(odp_buffer_t buf) -{ - odp_buffer_bits_t handle; - uint32_t pool_id; - uint32_t index; - struct pool_entry_s *pool; - - handle.handle = buf; - pool_id = handle.pool_id; - index = handle.index; - pool = get_pool_entry(pool_id); - - return (odp_buffer_hdr_t *)(void *) - (pool->pool_mdata_addr + (index * ODP_CACHE_LINE_SIZE)); -} +odp_buffer_hdr_t *odp_buf_to_hdr(odp_buffer_t buf); static inline uint32_t pool_id_from_buf(odp_buffer_t buf) { @@ -64,131 +41,6 @@ static inline uint32_t pool_id_from_buf(odp_buffer_t buf) return handle.pool_id; } -static inline odp_buffer_hdr_t *validate_buf(odp_buffer_t buf) -{ - odp_buffer_bits_t handle; - odp_buffer_hdr_t *buf_hdr; - handle.handle = buf; - - /* For buffer handles, segment index must be 0 and pool id in range */ - if (handle.seg != 0 || handle.pool_id >= ODP_CONFIG_POOLS) - return NULL; - - pool_entry_t *pool = - odp_pool_to_entry(_odp_cast_scalar(odp_pool_t, - handle.pool_id)); - - /* If pool not created, handle is invalid */ - if (pool->s.pool_shm == ODP_SHM_INVALID) - return NULL; - - uint32_t buf_stride = pool->s.buf_stride / ODP_CACHE_LINE_SIZE; - - /* A valid buffer index must be on stride, and must be in range */ - if ((handle.index % buf_stride != 0) || - ((uint32_t)(handle.index /