This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via b056efea2b416831e4d0ecf6494ee10c8da4b117 (commit) via 746455fcdf279fcef7ec6a3eb6c5f1b465588554 (commit) from ec8a54c9236925ea97ee154eb70093d6effb1311 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit b056efea2b416831e4d0ecf6494ee10c8da4b117 Author: Matias Elo matias.elo@nokia.com Date: Tue Mar 14 09:30:05 2017 +0200
test: bench_packet: add tests for reference functions
Add microbenchmarks for the new packet reference functions.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-and-tested-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/common_plat/performance/odp_bench_packet.c b/test/common_plat/performance/odp_bench_packet.c index 1aa9d81..7a3a004 100644 --- a/test/common_plat/performance/odp_bench_packet.c +++ b/test/common_plat/performance/odp_bench_packet.c @@ -338,6 +338,21 @@ static void alloc_concat_packets(void) TEST_REPEAT_COUNT); }
+static void alloc_ref_packets(void) +{ + int i; + odp_packet_t *pkt_tbl = gbl_args->pkt_tbl; + odp_packet_t *ref_tbl = gbl_args->pkt2_tbl; + + allocate_test_packets(gbl_args->pkt.len, pkt_tbl, TEST_REPEAT_COUNT); + + for (i = 0; i < TEST_REPEAT_COUNT; i++) { + ref_tbl[i] = odp_packet_ref(pkt_tbl[i], TEST_MIN_PKT_SIZE / 2); + if (ref_tbl[i] == ODP_PACKET_INVALID) + LOG_ABORT("Allocating packet reference failed\n"); + } +} + static void alloc_packets_twice(void) { allocate_test_packets(gbl_args->pkt.len, gbl_args->pkt_tbl, @@ -1212,6 +1227,67 @@ static int bench_packet_ts_set(void) return i; }
+static int bench_packet_ref_static(void) +{ + int i; + odp_packet_t *pkt_tbl = gbl_args->pkt_tbl; + odp_packet_t *ref_tbl = gbl_args->pkt2_tbl; + + for (i = 0; i < TEST_REPEAT_COUNT; i++) + ref_tbl[i] = odp_packet_ref_static(pkt_tbl[i]); + + return i; +} + +static int bench_packet_ref(void) +{ + int i; + uint32_t offset = TEST_MIN_PKT_SIZE / 2; + odp_packet_t *pkt_tbl = gbl_args->pkt_tbl; + odp_packet_t *ref_tbl = gbl_args->pkt2_tbl; + + for (i = 0; i < TEST_REPEAT_COUNT; i++) + ref_tbl[i] = odp_packet_ref(pkt_tbl[i], offset); + + return i; +} + +static int bench_packet_ref_pkt(void) +{ + int i; + uint32_t offset = TEST_MIN_PKT_SIZE / 2; + odp_packet_t *pkt_tbl = gbl_args->pkt_tbl; + odp_packet_t *hdr_tbl = gbl_args->pkt2_tbl; + + for (i = 0; i < TEST_REPEAT_COUNT; i++) + hdr_tbl[i] = odp_packet_ref_pkt(pkt_tbl[i], offset, hdr_tbl[i]); + + return i; +} + +static int bench_packet_unshared_len(void) +{ + int i; + uint32_t ret = 0; + + for (i = 0; i < TEST_REPEAT_COUNT; i++) + ret += odp_packet_unshared_len(gbl_args->pkt_tbl[i]); + + return ret; +} + +static int bench_packet_has_ref(void) +{ + int i; + uint32_t ret = 0; + odp_packet_t *pkt_tbl = gbl_args->pkt_tbl; + + for (i = 0; i < TEST_REPEAT_COUNT; i++) + ret += odp_packet_has_ref(pkt_tbl[i]); + + return i; +} + /** * Prinf usage information */ @@ -1445,6 +1521,16 @@ bench_info_t test_suite[] = { BENCH_INFO(bench_packet_ts, create_packets, free_packets, NULL), BENCH_INFO(bench_packet_ts_set, create_packets, free_packets, NULL), + BENCH_INFO(bench_packet_ref_static, create_packets, + free_packets_twice, NULL), + BENCH_INFO(bench_packet_ref, create_packets, + free_packets_twice, NULL), + BENCH_INFO(bench_packet_ref_pkt, alloc_packets_twice, + free_packets_twice, NULL), + BENCH_INFO(bench_packet_unshared_len, alloc_ref_packets, + free_packets_twice, NULL), + BENCH_INFO(bench_packet_has_ref, alloc_ref_packets, + free_packets_twice, NULL), };
/**
commit 746455fcdf279fcef7ec6a3eb6c5f1b465588554 Author: Petri Savolainen petri.savolainen@linaro.org Date: Mon Mar 13 17:14:57 2017 +0200
linux-gen: packet: make inline table visible
Add visibility markers to make inline offset table visible applications linking against an installed copy of the library.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 60eef3a..b8aac6b 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -24,6 +24,8 @@ /* Initial packet segment data length */ #define BASE_LEN CONFIG_PACKET_MAX_SEG_LEN
+#include <odp/visibility_begin.h> + /* Fill in packet header field offsets for inline functions */ const _odp_packet_inline_offset_t _odp_packet_inline ODP_ALIGNED_CACHE = { .data = offsetof(odp_packet_hdr_t, buf_hdr.seg[0].data), @@ -43,6 +45,8 @@ const _odp_packet_inline_offset_t _odp_packet_inline ODP_ALIGNED_CACHE = {
};
+#include <odp/visibility_end.h> + static inline odp_packet_hdr_t *packet_hdr(odp_packet_t pkt) { return (odp_packet_hdr_t *)(uintptr_t)pkt;
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/odp_packet.c | 4 ++ test/common_plat/performance/odp_bench_packet.c | 86 +++++++++++++++++++++++++ 2 files changed, 90 insertions(+)
hooks/post-receive