[lng-odp] [API-NEXT] api: pktio: updates classification configuration documentation.
From: Balasubramanian Manoharan Updates documentation for default CoS and pktin queue param configuration. Signed-off-by: Balasubramanian Manoharan --- include/odp/api/spec/packet_io.h | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index d46e405..9542c66 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -189,12 +189,11 @@ typedef struct odp_pktin_queue_param_t { /** Number of input queues to be created * - * When classifier is enabled the number of queues may be zero - * (in odp_pktin_queue_config() step), otherwise at least one - * queue is required. More than one input queues require either flow - * hashing or classifier enabled. The maximum value is defined by - * pktio capability 'max_input_queues'. Queue type is defined by the - * input mode. The default value is 1. */ + * When classifier is enabled (in odp_pktin_queue_config() step) this + * value is ignored, otherwise at least one queue is required. + * More than one input queues require flow hashing configured. + * The maximum value is defined by pktio capability 'max_input_queues'. + * Queue type is defined by the input mode. The default value is 1. */ unsigned num_queues; /** Queue parameters @@ -202,7 +201,9 @@ typedef struct odp_pktin_queue_param_t { * These are used for input queue creation in ODP_PKTIN_MODE_QUEUE * or ODP_PKTIN_MODE_SCHED modes. Scheduler parameters are considered * only in ODP_PKTIN_MODE_SCHED mode. Default values are defined in - * odp_queue_param_t documentation. */ + * odp_queue_param_t documentation. + * when classifier is enabled (in odp_pktin_queue_config() step) this + * value is ignored. */ odp_queue_param_t queue_param; } odp_pktin_queue_param_t; @@ -887,6 +888,8 @@ int odp_pktio_mac_addr(odp_pktio_t pktio, void *mac_addr, int size); * * @retval 0 on success * @retval <0 on failure + * + * @note The default_cos has to be unique per odp_pktio_t instance. */ int odp_pktio_default_cos_set(odp_pktio_t pktio, odp_cos_t default_cos); -- 1.9.1
Re: [lng-odp] [RFC 1/2] api: classification: Add queue group to classification
Regards, Bala On 15 September 2016 at 11:18, Radosław Biernacki wrote: > Hi > > I cannot find this patch either next nor api-next, so I assume that it was > not accepted yet. > > > 2016-04-25 14:31 GMT+02:00 Balasubramanian Manoharan > : >> >> Adds queue group to classification >> >> Signed-off-by: Balasubramanian Manoharan >> --- >> include/odp/api/spec/classification.h | 19 ++- >> 1 file changed, 18 insertions(+), 1 deletion(-) >> >> diff --git a/include/odp/api/spec/classification.h >> b/include/odp/api/spec/classification.h >> index 6eca9ab..cf56852 100644 >> --- a/include/odp/api/spec/classification.h >> +++ b/include/odp/api/spec/classification.h >> @@ -126,6 +126,12 @@ typedef struct odp_cls_capability_t { >> >> /** A Boolean to denote support of PMR range */ >> odp_bool_t pmr_range_supported; >> + >> + /** A Boolean to denote support of queue group */ >> + odp_bool_t queue_group_supported; >> + >> + /** A Boolena to denote support of queue */ >> + odp_bool_t queue_supported; >> } odp_cls_capability_t; >> >> /** >> @@ -162,7 +168,18 @@ typedef enum { >> * Used to communicate class of service creation options >> */ >> typedef struct odp_cls_cos_param { >> - odp_queue_t queue; /**< Queue associated with CoS */ >> + /** If True, odp_queue_t is linked with CoS, >> +* if False odp_queue_group_t is linked with CoS. >> +*/ >> + odp_bool_t enable_queue; > > > Since this flag defines either queue or queue_gropup field from union will > be used, it might be better to use some enum instead of bool. > Bool is OK for enable/disable flags but may be confusing when used as > selector type. The idea of this RFC was just to focus on the changes required when queue group concept gets introduced. It was kept as a Boolean since there are only two possible values for that can be attached to a CoS either a queue or a queue group. Regards, Bala > >> >> + >> + typedef union { >> + /** Queue associated with CoS */ >> + odp_queue_t queue; >> + >> + /** Queue Group associated with CoS */ >> + odp_queue_group_t queue_group; >> + }; >> odp_pool_t pool;/**< Pool associated with CoS */ >> odp_cls_drop_t drop_policy; /**< Drop policy associated with >> CoS */ >> } odp_cls_cos_param_t; >> -- >> 1.9.1 >> >> ___ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> https://lists.linaro.org/mailman/listinfo/lng-odp > >
Re: [lng-odp] [RFC 1/2] api: classification: Add queue group to classification
Hi I cannot find this patch either next nor api-next, so I assume that it was not accepted yet. 2016-04-25 14:31 GMT+02:00 Balasubramanian Manoharan < bala.manoha...@linaro.org>: > Adds queue group to classification > > Signed-off-by: Balasubramanian Manoharan > --- > include/odp/api/spec/classification.h | 19 ++- > 1 file changed, 18 insertions(+), 1 deletion(-) > > diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/ > classification.h > index 6eca9ab..cf56852 100644 > --- a/include/odp/api/spec/classification.h > +++ b/include/odp/api/spec/classification.h > @@ -126,6 +126,12 @@ typedef struct odp_cls_capability_t { > > /** A Boolean to denote support of PMR range */ > odp_bool_t pmr_range_supported; > + > + /** A Boolean to denote support of queue group */ > + odp_bool_t queue_group_supported; > + > + /** A Boolena to denote support of queue */ > + odp_bool_t queue_supported; > } odp_cls_capability_t; > > /** > @@ -162,7 +168,18 @@ typedef enum { > * Used to communicate class of service creation options > */ > typedef struct odp_cls_cos_param { > - odp_queue_t queue; /**< Queue associated with CoS */ > + /** If True, odp_queue_t is linked with CoS, > +* if False odp_queue_group_t is linked with CoS. > +*/ > + odp_bool_t enable_queue; > Since this flag defines either queue or queue_gropup field from union will be used, it might be better to use some enum instead of bool. Bool is OK for enable/disable flags but may be confusing when used as selector type. > + > + typedef union { > + /** Queue associated with CoS */ > + odp_queue_t queue; > + > + /** Queue Group associated with CoS */ > + odp_queue_group_t queue_group; > + }; > odp_pool_t pool;/**< Pool associated with CoS */ > odp_cls_drop_t drop_policy; /**< Drop policy associated with > CoS */ > } odp_cls_cos_param_t; > -- > 1.9.1 > > ___ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp >
[lng-odp] [Bug 2510] ODP build system broken
https://bugs.linaro.org/show_bug.cgi?id=2510 Bill Fischofer changed: What|Removed |Added CC||bill.fischo...@linaro.org --- Comment #1 from Bill Fischofer --- This appears to be a duplicate of https://bugs.linaro.org/show_bug.cgi?id=2507 which has been resolved. -- You are receiving this mail because: You are on the CC list for the bug.
Re: [lng-odp] [PATCHv3] test: linux-gen: add pcap playback test
On 2016-09-12 19:54, Bill Fischofer wrote: > On Mon, Sep 12, 2016 at 10:24 AM, Mike Holmes > wrote: > > > On 12 September 2016 at 10:43, Maxim Uvarov > > wrote: > > > > > if no comments than it can be merged? > > > > > > Not without a review, I am interested in this capability but I have not > > reviewed it. > > > > I had previously reviewed and tested v2 of this patch. v3 just incorporates > some additional comments by Anders. If Anders has no objection, my review > can be propagated to v3. I don't think we resolved this issue raised [1], and you (Bill) had a comment about not screwing up performance while tinkering with it [2]. Cheers, Anders [1] https://lists.linaro.org/pipermail/lng-odp/2016-August/025421.html [2] https://lists.linaro.org/pipermail/lng-odp/2016-August/025407.html > > > > > > I really believe ODP shoudl have as part of the validation the ability to > > pass packet streams though and confirm the exact result on the far side, > > Krishna ran into this issue with crypto on odp-dpdk which was giving > > different results. > > > > > > > > > > > > > Maxim. > > > > > > On 08/29/16 10:50, Maxim Uvarov wrote: > > > > > >> add pcap play back test which takes 2 arguments: 1 - pcap file, > > >> 2 - packet mask to match. Intend is to test odp with different > > >> input traffic to check internal implementation functions. In > > >> current case it's test for vlan tag instertion for packet mmap: > > >> pkt_mmap_vlan_insert(). > > >> > > >> Signed-off-by: Maxim Uvarov > > >> --- > > >> v3: fix comments noted by Anders > > >> > > >> test/linux-generic/.gitignore | 1 + > > >> test/linux-generic/Makefile.am | 10 +- > > >> test/linux-generic/cls/.gitignore | 1 + > > >> test/linux-generic/cls/Makefile.am | 13 ++ > > >> test/linux-generic/cls/cls.c| 351 > > ++ > > >> ++ > > >> test/linux-generic/cls/cls_main.c | 12 ++ > > >> test/linux-generic/cls/cls_suites.h | 1 + > > >> test/linux-generic/cls/vlan.pcap| Bin 0 -> 9728 bytes > > >> test/linux-generic/cls/vlan_run.sh | 49 + > > >> test/linux-generic/m4/configure.m4 | 1 + > > >> 10 files changed, 435 insertions(+), 4 deletions(-) > > >> create mode 100644 test/linux-generic/cls/.gitignore > > >> create mode 100644 test/linux-generic/cls/Makefile.am > > >> create mode 100644 test/linux-generic/cls/cls.c > > >> create mode 100644 test/linux-generic/cls/cls_main.c > > >> create mode 100644 test/linux-generic/cls/cls_suites.h > > >> create mode 100644 test/linux-generic/cls/vlan.pcap > > >> create mode 100755 test/linux-generic/cls/vlan_run.sh > > >> > > >> diff --git a/test/linux-generic/.gitignore > > b/test/linux-generic/.gitignor > > >> e > > >> index 5dabf91..f65c7c1 100644 > > >> --- a/test/linux-generic/.gitignore > > >> +++ b/test/linux-generic/.gitignore > > >> @@ -1,3 +1,4 @@ > > >> *.log > > >> *.trs > > >> tests-validation.env > > >> +test_out.pcap > > >> diff --git a/test/linux-generic/Makefile.am > > >> b/test/linux-generic/Makefile.am > > >> index 4660cf0..2554f8e 100644 > > >> --- a/test/linux-generic/Makefile.am > > >> +++ b/test/linux-generic/Makefile.am > > >> @@ -1,5 +1,8 @@ > > >> include $(top_srcdir)/test/Makefile.inc > > >> TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/ > > >> common_plat/validation > > >> +TEST_EXTENSIONS = .sh > > >> + > > >> +dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER) > > >> ALL_API_VALIDATION_DIR = ${top_builddir}/test/common_pl > > >> at/validation/api > > >> @@ -37,11 +40,14 @@ TESTS = validation/api/pktio/pktio_run.sh \ > > >> SUBDIRS += validation/api/pktio\ > > >>validation/api/shmem\ > > >> + cls\ > > >>pktio_ipc\ > > >>ring > > >> if HAVE_PCAP > > >> TESTS += validation/api/pktio/pktio_run_pcap.sh > > >> +TESTS += cls/vlan_run.sh > > >> +dist_check_SCRIPTS += cls/vlan_run.sh cls/vlan.pcap > > >> endif > > >> if netmap_support > > >> TESTS += validation/api/pktio/pktio_run_netmap.sh > > >> @@ -61,10 +67,6 @@ SUBDIRS += validation/api/pktio > > >> endif > > >> endif > > >> -TEST_EXTENSIONS = .sh > > >> - > > >> -dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER) > > >> - > > >> test_SCRIPTS = $(dist_check_SCRIPTS) > > >> tests-validation.env: > > >> diff --git a/test/linux-generic/cls/.gitignore > > >> b/test/linux-generic/cls/.gitignore > > >> new file mode 100644 > > >> index 000..5a652b7 > > >> --- /dev/null > > >> +++ b/test/linux-generic/cls/.gitignore > > >> @@ -0,0 +1 @@ > > >> +cls_main > > >> diff --git a/test/linux-generic/cls/Makefile.am > > >> b/test/linux-generic/cls/Makefile.am > > >> new file mode 100644 > > >> index 000..43fb0bc > > >> --- /dev/null > > >> +++ b/test/linux-generic/cls/Makefile.am > > >> @@ -0,0 +1,13 @@ > > >> +include ../Makefile.inc > > >> + > > >> +noinst_LTLIBRARIES = libtestcls.la > > >> +libtestcls_la_SOURCES = c
[lng-odp] [API-NEXT PATCHv2] api: odp_time_sub
Previously we had odp_time_sum but missing call to subtract some value from odp_time_t. Because on different platforms it can be implemented differently we need this call. Signed-off-by: Maxim Uvarov --- include/odp/api/spec/time.h | 10 ++ platform/linux-generic/odp_time.c | 17 + 2 files changed, 27 insertions(+) diff --git a/include/odp/api/spec/time.h b/include/odp/api/spec/time.h index fcc94c9..5e94b70 100644 --- a/include/odp/api/spec/time.h +++ b/include/odp/api/spec/time.h @@ -87,6 +87,16 @@ odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1); odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2); /** + * Time subtract + * + * @param t1Time stamp to subtract from + * @param t2Value to subtract + * + * @return Time stamp t1 - t2 + */ +odp_time_t odp_time_sub(odp_time_t t1, odp_time_t t2); + +/** * Convert time to nanoseconds * * @param time Time diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index 81e0522..7fef46f 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -81,6 +81,18 @@ static inline odp_time_t time_sum(odp_time_t t1, odp_time_t t2) return time; } +static inline odp_time_t time_sub(odp_time_t t1, odp_time_t t2) +{ + uint64_t ns; + odp_time_t time; + + ns = time_to_ns(t1) - time_to_ns(t2); + time.tv_sec = ns / ODP_TIME_SEC_IN_NS; + time.tv_nsec = ns - time.tv_sec * ODP_TIME_SEC_IN_NS; + + return time; +} + static inline odp_time_t time_local_from_ns(uint64_t ns) { odp_time_t time; @@ -152,6 +164,11 @@ odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2) return time_sum(t1, t2); } +odp_time_t odp_time_sub(odp_time_t t1, odp_time_t t2) +{ + return time_sub(t1, t2); +} + uint64_t odp_time_local_res(void) { return time_local_res(); -- 2.7.1.250.gff4ea60
[lng-odp] [API-NEXT PATCH] api: odp_time_sub
Previously we had odp_time_sum but missing call to subtract some value from odp_time_t. Because on different platforms it can be implemented differently we need this call. Signed-off-by: Maxim Uvarov --- include/odp/api/spec/time.h | 10 ++ platform/linux-generic/odp_time.c | 17 + test/common_plat/validation/api/time/time.c | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/include/odp/api/spec/time.h b/include/odp/api/spec/time.h index fcc94c9..5e94b70 100644 --- a/include/odp/api/spec/time.h +++ b/include/odp/api/spec/time.h @@ -87,6 +87,16 @@ odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1); odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2); /** + * Time subtract + * + * @param t1Time stamp to subtract from + * @param t2Value to subtract + * + * @return Time stamp t1 - t2 + */ +odp_time_t odp_time_sub(odp_time_t t1, odp_time_t t2); + +/** * Convert time to nanoseconds * * @param time Time diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index 81e0522..7fef46f 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -81,6 +81,18 @@ static inline odp_time_t time_sum(odp_time_t t1, odp_time_t t2) return time; } +static inline odp_time_t time_sub(odp_time_t t1, odp_time_t t2) +{ + uint64_t ns; + odp_time_t time; + + ns = time_to_ns(t1) - time_to_ns(t2); + time.tv_sec = ns / ODP_TIME_SEC_IN_NS; + time.tv_nsec = ns - time.tv_sec * ODP_TIME_SEC_IN_NS; + + return time; +} + static inline odp_time_t time_local_from_ns(uint64_t ns) { odp_time_t time; @@ -152,6 +164,11 @@ odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2) return time_sum(t1, t2); } +odp_time_t odp_time_sub(odp_time_t t1, odp_time_t t2) +{ + return time_sub(t1, t2); +} + uint64_t odp_time_local_res(void) { return time_local_res(); diff --git a/test/common_plat/validation/api/time/time.c b/test/common_plat/validation/api/time/time.c index 530d5c0..3885b65 100644 --- a/test/common_plat/validation/api/time/time.c +++ b/test/common_plat/validation/api/time/time.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Linaro Limited +b/* Copyright (c) 2015, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause -- 2.7.1.250.gff4ea60
Re: [lng-odp] [buggyPATCH] linux-generic: add vlan insertion test
ping, there was question about autotools inside the patch. Can somebody replay please? Thank you, Maxim. On 07/05/16 11:01, Maxim Uvarov wrote: Use vlan tagged traffic for example validation test to add code coverage for pkt_mmap_vlan_insert() internal function. Signed-off-by: Maxim Uvarov --- In general this patch work and tests internal function. But there is one small issue related to autotools which I don't know how to fix better: make; make check works, but make check after clean fails example/packet/odp_pktio binary is not yet build while tests going to be executed. The only thing which cames to my mind is to reorder root directory Makefile.am and add "-" between tests and examples. In that case examples should be compiled before any test compilation/execution. Is that a right way to do? Thanks, Maxim. test/platform/linux-generic/Makefile.am| 6 ++- test/platform/linux-generic/pktio/.gitignore | 1 + test/platform/linux-generic/pktio/Makefile.am | 1 + .../platform/linux-generic/pktio/pktio_run_vlan.sh | 46 + test/platform/linux-generic/pktio/vlan.pcap| Bin 0 -> 9728 bytes 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100755 test/platform/linux-generic/pktio/pktio_run_vlan.sh create mode 100644 test/platform/linux-generic/pktio/vlan.pcap diff --git a/test/platform/linux-generic/Makefile.am b/test/platform/linux-generic/Makefile.am index 2d58c57..597a1c1 100644 --- a/test/platform/linux-generic/Makefile.am +++ b/test/platform/linux-generic/Makefile.am @@ -39,6 +39,9 @@ SUBDIRS = $(ODP_MODULES) if HAVE_PCAP TESTS += pktio/pktio_run_pcap.sh +if test_example +TESTS += pktio/pktio_run_vlan.sh +endif endif if PKTIO_IPC TESTS += pktio_ipc/pktio_ipc_run.sh @@ -54,7 +57,8 @@ endif TEST_EXTENSIONS = .sh -dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER) +dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER) \ +pktio/vlan.pcap test_SCRIPTS = $(dist_check_SCRIPTS) diff --git a/test/platform/linux-generic/pktio/.gitignore b/test/platform/linux-generic/pktio/.gitignore index 7e563b8..5f75e14 100644 --- a/test/platform/linux-generic/pktio/.gitignore +++ b/test/platform/linux-generic/pktio/.gitignore @@ -1,2 +1,3 @@ *.log *.trs +*.pcap diff --git a/test/platform/linux-generic/pktio/Makefile.am b/test/platform/linux-generic/pktio/Makefile.am index 4a14343..094a222 100644 --- a/test/platform/linux-generic/pktio/Makefile.am +++ b/test/platform/linux-generic/pktio/Makefile.am @@ -4,6 +4,7 @@ dist_check_SCRIPTS = pktio_env \ if HAVE_PCAP dist_check_SCRIPTS += pktio_run_pcap.sh +dist_check_SCRIPTS += pktio_run_vlan.sh endif if netmap_support dist_check_SCRIPTS += pktio_run_netmap.sh diff --git a/test/platform/linux-generic/pktio/pktio_run_vlan.sh b/test/platform/linux-generic/pktio/pktio_run_vlan.sh new file mode 100755 index 000..b58aacb --- /dev/null +++ b/test/platform/linux-generic/pktio/pktio_run_vlan.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Copyright (c) 2016, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +# +# This test is intend to test pkt_mmap_vlan_insert() feature for +# linux-generic packet mmap pktio. +# +# + +# any parameter passed as arguments to this script is passed unchanged to +# the test itself (pktio_main) + +# directories where pktio_main binary can be found: +# -in the validation dir when running make check (intree or out of tree) +# -in the script directory, when running after 'make install', or +# -in the validation when running standalone intree. +# -in the current directory. +# running stand alone out of tree requires setting PATH +PATH=${TEST_DIR}/pktio:$PATH +PATH=$(dirname $0):$PATH +PATH=../../../example/packet:$PATH +PATH=../../../../_inst/bin:$PATH +PATH=.:$PATH + +odp_pktio_path=$(which odp_pktio${EXEEXT}) +if [ -x "$odp_pktio_path" ] ; then + echo "running with $odp_pktio_path" +else + pwd + echo $PATH + echo "cannot find odp_pktio${EXEEXT}: please set you PATH for it." + exit 1 +fi + +PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name vlan.pcap -print -quit` +echo "using PCAP_IN = ${PCAP_IN}" +PCAP_OUT=vlan_out.pcap +odp_pktio${EXEEXT} -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 1 -m 0 +ret=$? +rm -f ${PCAP_OUT} +exit $ret diff --git a/test/platform/linux-generic/pktio/vlan.pcap b/test/platform/linux-generic/pktio/vlan.pcap new file mode 100644 index ..106ccb682e51495b4025337518a0bce63c2c7681 GIT binary patch literal 9728 zcmeHNeQXrR6@Rikyh3QAN~9xK+}$ z4T)^-QnlAgC4W>Yk*X>mRlo92km}Nw!c|oiNTn)LBLcyK0BKSYLZiA0xI}f|@6FEc z&CT8}Zu4i?dS2hYnK$pf`MuxF&iVB}9(>lN6zOYfipb#)S3BqRK6jeva#{)P%KZ4H z2`Z!uf1f`})Rm#nP-l2Nx8d?iyv8ohr8v56pV)=ly+yzZvNmzS?$(tvQ({ zN`3H(bKv=xSCLCcs6x0O=6jaXv{mjz%{=NyEc#gk|LwB0u=KHqz1)uIAM9Usn@mg_ zk2Z3jR&?;MUcTp8vTSb+>k8B@8d$;SEO~No<@;@ZpT?k%M|X%lk9
Re: [lng-odp] [API-NEXT PATCHv2] linux-generic: _fdserver: allocating data table dynamicaly
Merged, Maxim. On 09/13/16 15:46, Christophe Milard wrote: Hi Bill, and thanks for your review/comments: I don't think that there any reason (at this time, at least) to worry about table alignment: The server is -hopefully- used only at non critical times (such as init...). It is based on socket communications which will be dead slow compared to the alignment gain anyway. So I don't think there is much to gain with the alignment. Christophe. On 13 September 2016 at 14:02, Bill Fischofer wrote: This looks good now. Only question is whether you need to worry about cache-aligning the table, but that's a tuning option that can be considered later if needed. On Tue, Sep 13, 2016 at 7:40 AM, Christophe Milard < christophe.mil...@linaro.org> wrote: The table containing the saved file-descriptors<->{context, key} couples is now dynamically malloc'd in the fd server process, hence avoiding the memory waste which happened in other process when the table was staticaly reserved in all processes. Signed-off-by: Christophe Milard Reviewed-by: Bill Fischofer --- platform/linux-generic/_fdserver.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/_fdserver.c b/platform/linux-generic/_fdserver.c index bf36eb2..5cef806 100644 --- a/platform/linux-generic/_fdserver.c +++ b/platform/linux-generic/_fdserver.c @@ -73,7 +73,7 @@ typedef struct fdentry_s { uint64_t key; int fd; } fdentry_t; -static fdentry_t fd_table[FDSERVER_MAX_ENTRIES]; +static fdentry_t *fd_table; static int fd_table_nb_entries; /* @@ -622,8 +622,20 @@ int _odp_fdserver_init_global(void) /* TODO: pin the server on appropriate service cpu mask */ /* when (if) we can agree on the usage of service mask */ + /* allocate the space for the file descriptor<->key table: */ + fd_table = malloc(FDSERVER_MAX_ENTRIES * sizeof(fdentry_t)); + if (!fd_table) { + ODP_ERR("maloc failed!\n"); + exit(1); + } + + /* wait for clients requests */ wait_requests(sock); /* Returns when server is stopped */ close(sock); + + /* release the file descriptor table: */ + free(fd_table); + exit(0); } -- 2.7.4
Re: [lng-odp] [API-NEXT PATCH] linux-generic: _fdserver: fixing comment typo
Merged, Maxim. On 09/13/16 14:24, Bill Fischofer wrote: On Tue, Sep 13, 2016 at 5:05 AM, Christophe Milard < christophe.mil...@linaro.org> wrote: Signed-off-by: Christophe Milard Reviewed-by: Bill Fischofer --- platform/linux-generic/_fdserver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/_fdserver.c b/platform/linux-generic/_ fdserver.c index bf36eb2..97661d0 100644 --- a/platform/linux-generic/_fdserver.c +++ b/platform/linux-generic/_fdserver.c @@ -103,7 +103,7 @@ typedef struct fd_server_msg { * Send a fdserver_msg, possibly including a file descriptor, on the socket * This function is used both by: * -the client (sending a FD_REGISTER_REQ with a file descriptor to be shared, - * or FD_LOOKUP_REQ/FD_DEREGISTER_REQ without a file descirptor) + * or FD_LOOKUP_REQ/FD_DEREGISTER_REQ without a file descriptor) * -the server (sending FD_REGISTER_ACK/NACK, FD_LOOKUP_NACK, * FD_DEREGISTER_ACK/NACK... without a fd or a * FD_LOOKUP_ACK with a fd) @@ -165,7 +165,7 @@ static int send_fdserver_msg(int sock, int command, * given socket. * This function is used both by: * -the server (receiving a FD_REGISTER_REQ with a file descriptor to be shared, - * or FD_LOOKUP_REQ, FD_DEREGISTER_REQ without a file descirptor) + * or FD_LOOKUP_REQ, FD_DEREGISTER_REQ without a file descriptor) * -the client (receiving FD_REGISTER_ACK...without a fd or a FD_LOOKUP_ACK with * a fd) * This function make use of the ancillary data (control data) to pass and -- 2.7.4
Re: [lng-odp] [PATCH] example: generator: actually use specified default
Merged, Maxim. On 09/14/16 05:50, Bill Fischofer wrote: On Tue, Sep 13, 2016 at 12:35 PM, Mike Holmes wrote: The help states default is 1000ms. 0 for flood mode, however the default was incorrectly set to zero. Signed-off-by: Mike Holmes Reviewed-by: Bill Fischofer --- example/generator/odp_generator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/example/generator/odp_generator.c b/example/generator/odp_ generator.c index b0053b9..48d7f5f 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -946,6 +946,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) appl_args->number = -1; appl_args->payload = 56; appl_args->timeout = -1; + appl_args->interval = DEFAULT_PKT_INTERVAL; opterr = 0; /* do not issue errors on helper options */ -- 2.7.4
Re: [lng-odp] [PATCH] linux-gen: build: de-couple abi compatibility from shared lib
> > +ODP_ABI_COMPAT=0 > > +AC_ARG_ENABLE([abi-compat], > > +[ --enable-abi-compat build in ABI specification compatible > mode], > > +[if test "x$enableval" = "xyes"; then > > + ODP_ABI_COMPAT=1 > > + else > > + ODP_ABI_COMPAT=0 > > if we disable ABI compat mode I think we should set the SO-version to > 0:0:0, to make > it clear that we don't try to be ABI compatible. > > Cheers, > Anders > Didn't address this in v2, since we have not been ABI compatible before either. Not sure how lib versioning should indicate ABI compatibility. Strictly speaking we are not ABI spec compatible yet, since there's no ABI spec defined anywhere. A next step towards ABI compatibility would be to add new ABI spec header files e.g. under odp/include/api/abi_x86_64 and include those files instead/in addition of platform/xxx/include/api/plat/xxx_types.h files (== force ABI spec). -Petri
[lng-odp] [PATCH v2] linux-gen: build: de-couple abi compatibility from shared lib
Building ABI compatible or shared library are two different targets. A shared library may be used also without ABI compatibility. A new --enable-abi-compat configuration option is introduced. By default libraries are not built in ABI compat mode to enable function inlining. There is a noticeable performance difference when e.g. odp_atomic_xxx calls are not inlined. Signed-off-by: Petri Savolainen --- v2: * ABI compat enabled by default * print static/shared/abi_compat selection in config results * added missing header file include guards configure.ac | 26 - platform/linux-generic/.gitignore | 1 - platform/linux-generic/include/odp/api/atomic.h| 2 +- platform/linux-generic/include/odp/api/byteorder.h | 2 +- .../linux-generic/include/odp/api/plat/inlines.h | 30 .../include/odp/api/plat/inlines.h.in | 33 -- platform/linux-generic/include/odp/api/std_clib.h | 2 +- platform/linux-generic/include/odp/api/sync.h | 2 +- platform/linux-generic/m4/configure.m4 | 3 +- platform/linux-generic/odp_atomic.c| 2 +- platform/linux-generic/odp_byteorder.c | 2 +- platform/linux-generic/odp_std_clib.c | 2 +- platform/linux-generic/odp_sync.c | 2 +- 13 files changed, 58 insertions(+), 51 deletions(-) delete mode 100644 platform/linux-generic/.gitignore create mode 100644 platform/linux-generic/include/odp/api/plat/inlines.h delete mode 100644 platform/linux-generic/include/odp/api/plat/inlines.h.in diff --git a/configure.ac b/configure.ac index 982aff7..e05d4dd 100644 --- a/configure.ac +++ b/configure.ac @@ -176,13 +176,6 @@ AM_CONDITIONAL([test_example], [test x$test_example = xyes ]) AM_CONDITIONAL([HAVE_DOXYGEN], [test "x${DOXYGEN}" = "xdoxygen"]) AM_CONDITIONAL([user_guide], [test "x${user_guides}" = "xyes" ]) AM_CONDITIONAL([HAVE_MSCGEN], [test "x${MSCGEN}" = "xmscgen"]) -if test x$enable_shared != xyes; -then - _ODP_INLINES="_ODP_INLINES" -else - _ODP_INLINES="_ODP_NO_INLINES" -fi -AC_SUBST(_ODP_INLINES) ## # Setup doxygen documentation @@ -225,6 +218,22 @@ AC_ARG_ENABLE([debug], ODP_CFLAGS="$ODP_CFLAGS -DODP_DEBUG=$ODP_DEBUG" ## +# Enable/disable ABI compatible build +## +ODP_ABI_COMPAT=1 +abi_compat=yes +AC_ARG_ENABLE([abi-compat], +[ --enable-abi-compat build all targets in ABI compatible mode (default=yes)], +[if test "x$enableval" = "xyes"; then + ODP_ABI_COMPAT=1 + abi_compat=yes + else + ODP_ABI_COMPAT=0 + abi_compat=no +fi]) +ODP_CFLAGS="$ODP_CFLAGS -DODP_ABI_COMPAT=$ODP_ABI_COMPAT" + +## # Default warning setup ## ODP_CFLAGS="$ODP_CFLAGS -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes" @@ -307,6 +316,9 @@ AC_MSG_RESULT([ am_ldflags: ${AM_LDFLAGS} libs: ${LIBS} defs: ${DEFS} + static libraries: ${enable_static} + shared libraries: ${enable_shared} + ABI compatible: ${abi_compat} cunit: ${cunit_support} test_vald: ${test_vald} test_perf: ${test_perf} diff --git a/platform/linux-generic/.gitignore b/platform/linux-generic/.gitignore deleted file mode 100644 index ec6ca37..000 --- a/platform/linux-generic/.gitignore +++ /dev/null @@ -1 +0,0 @@ -include/odp/api/plat/inlines.h diff --git a/platform/linux-generic/include/odp/api/atomic.h b/platform/linux-generic/include/odp/api/atomic.h index c18e68b..66cfef7 100644 --- a/platform/linux-generic/include/odp/api/atomic.h +++ b/platform/linux-generic/include/odp/api/atomic.h @@ -25,7 +25,7 @@ extern "C" { */ #include -#ifdef _ODP_INLINES +#if ODP_ABI_COMPAT == 0 #include #endif diff --git a/platform/linux-generic/include/odp/api/byteorder.h b/platform/linux-generic/include/odp/api/byteorder.h index 84d1173..37f5636 100644 --- a/platform/linux-generic/include/odp/api/byteorder.h +++ b/platform/linux-generic/include/odp/api/byteorder.h @@ -26,7 +26,7 @@ extern "C" { */ #include -#ifdef _ODP_INLINES +#if ODP_ABI_COMPAT == 0 #include #endif diff --git a/platform/linux-generic/include/odp/api/plat/inlines.h b/platform/linux-generic/include/odp/api/plat/inlines.h new file mode 100644 index 000..297a199 --- /dev/null +++ b/platform/linux-generic/include/odp/api/plat/inlines.h @@ -0,0 +1,30 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-C
[lng-odp] [PATCH v2 1/2] test: perf: add new scheduling latency test
Add new scheduling latency benchmark application. The application measures delays (avg, min, max) for high and low priority events. The test has a configurable number of TRAFFIC events and few SAMPLE events (one common or one per priority). The scheduling latency is only measured from the SAMPLE events to minimize measurement overhead. The application's command line arguments enable configuring: - Number of processing threads - Number of high/low priority queues - Number of high/low priority events - Use separate SAMPLE events for each priority - Scheduled queue type (PARALLEL, ATOMIC, ORDERED) Signed-off-by: Matias Elo --- V2: - Remove unnecessary 'num_workers' initialization (Maxim) test/common_plat/performance/.gitignore | 1 + test/common_plat/performance/Makefile.am | 4 + test/common_plat/performance/odp_sched_latency.c | 767 +++ 3 files changed, 772 insertions(+) create mode 100644 test/common_plat/performance/odp_sched_latency.c diff --git a/test/common_plat/performance/.gitignore b/test/common_plat/performance/.gitignore index edcc832..1527d25 100644 --- a/test/common_plat/performance/.gitignore +++ b/test/common_plat/performance/.gitignore @@ -4,4 +4,5 @@ odp_atomic odp_crypto odp_l2fwd odp_pktio_perf +odp_sched_latency odp_scheduling diff --git a/test/common_plat/performance/Makefile.am b/test/common_plat/performance/Makefile.am index d23bb3e..f5dd8dd 100644 --- a/test/common_plat/performance/Makefile.am +++ b/test/common_plat/performance/Makefile.am @@ -5,6 +5,7 @@ TESTS_ENVIRONMENT += TEST_DIR=${builddir} EXECUTABLES = odp_crypto$(EXEEXT) odp_pktio_perf$(EXEEXT) COMPILE_ONLY = odp_l2fwd$(EXEEXT) \ + odp_sched_latency$(EXEEXT) \ odp_scheduling$(EXEEXT) TESTSCRIPTS = odp_l2fwd_run.sh \ @@ -20,6 +21,8 @@ bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY) odp_crypto_LDFLAGS = $(AM_LDFLAGS) -static odp_crypto_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test +odp_sched_latency_LDFLAGS = $(AM_LDFLAGS) -static +odp_sched_latency_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test odp_scheduling_LDFLAGS = $(AM_LDFLAGS) -static odp_scheduling_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test @@ -27,6 +30,7 @@ noinst_HEADERS = \ $(top_srcdir)/test/test_debug.h dist_odp_crypto_SOURCES = odp_crypto.c +dist_odp_sched_latency_SOURCES = odp_sched_latency.c dist_odp_scheduling_SOURCES = odp_scheduling.c dist_odp_pktio_perf_SOURCES = odp_pktio_perf.c diff --git a/test/common_plat/performance/odp_sched_latency.c b/test/common_plat/performance/odp_sched_latency.c new file mode 100644 index 000..063fb21 --- /dev/null +++ b/test/common_plat/performance/odp_sched_latency.c @@ -0,0 +1,767 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * @example odp_sched_latency.c ODP scheduling latency benchmark application + */ + +#include +#include +#include + +#include + +/* ODP main header */ +#include + +/* ODP helper for Linux apps */ +#include + +/* GNU lib C */ +#include + +#define MAX_WORKERS 64/**< Maximum number of worker threads */ +#define MAX_QUEUES 4096 /**< Maximum number of queues */ +#define EVENT_POOL_SIZE (1024 * 1024) /**< Event pool size */ +#define TEST_ROUNDS (4 * 1024 * 1024) /**< Test rounds for each thread */ +#define MAIN_THREAD 1 /**< Thread ID performing maintenance tasks */ + +/* Default values for command line arguments */ +#define SAMPLE_EVENT_PER_PRIO0 /**< Allocate a separate sample event for +each priority */ +#define HI_PRIO_EVENTS 0 /**< Number of high priority events */ +#define LO_PRIO_EVENTS 32 /**< Number of low priority events */ +#define HI_PRIO_QUEUES 16 /**< Number of high priority queues */ +#define LO_PRIO_QUEUES 64 /**< Number of low priority queues */ + +#define EVENTS_PER_HI_PRIO_QUEUE 0 /**< Alloc HI_PRIO_QUEUES x HI_PRIO_EVENTS +events */ +#define EVENTS_PER_LO_PRIO_QUEUE 1 /**< Alloc LO_PRIO_QUEUES x LO_PRIO_EVENTS +events */ +ODP_STATIC_ASSERT(HI_PRIO_QUEUES <= MAX_QUEUES, "Too many HI priority queues"); +ODP_STATIC_ASSERT(LO_PRIO_QUEUES <= MAX_QUEUES, "Too many LO priority queues"); + +#define CACHE_ALIGN_ROUNDUP(x)\ + ((ODP_CACHE_LINE_SIZE) * \ +(((x) + ODP_CACHE_LINE_SIZE - 1) / (ODP_CACHE_LINE_SIZE))) + +/* Test priorities */ +#define NUM_PRIOS 2 /**< Number of tested priorities */ +#define HI_PRIO 0 +#define LO_PRIO 1 + +/** Test event types */ +typedef enum { + WARM_UP, /**< Warm up event */ + TRAFFIC, /**< Event used only as traffic load */ + SAMPLE /**< Event used to measure latency */ +} event_type_t; + +/** Test event */ +typedef struct { + uint64_t ts;/**< Send timestamp */ + even
[lng-odp] [PATCH v2 2/2] test: sched_latency: add test script
Signed-off-by: Matias Elo --- V2: - Exit on first failure (Maxim) test/common_plat/performance/Makefile.am | 1 + .../performance/odp_sched_latency_run.sh | 28 ++ 2 files changed, 29 insertions(+) create mode 100755 test/common_plat/performance/odp_sched_latency_run.sh diff --git a/test/common_plat/performance/Makefile.am b/test/common_plat/performance/Makefile.am index f5dd8dd..f184609 100644 --- a/test/common_plat/performance/Makefile.am +++ b/test/common_plat/performance/Makefile.am @@ -9,6 +9,7 @@ COMPILE_ONLY = odp_l2fwd$(EXEEXT) \ odp_scheduling$(EXEEXT) TESTSCRIPTS = odp_l2fwd_run.sh \ + odp_sched_latency_run.sh \ odp_scheduling_run.sh TEST_EXTENSIONS = .sh diff --git a/test/common_plat/performance/odp_sched_latency_run.sh b/test/common_plat/performance/odp_sched_latency_run.sh new file mode 100755 index 000..6048f58 --- /dev/null +++ b/test/common_plat/performance/odp_sched_latency_run.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Copyright (c) 2016, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Script that passes command line arguments to odp_sched_latency test when +# launched by 'make check' + +TEST_DIR="${TEST_DIR:-$(dirname $0)}" +ALL=0 + +run() +{ + echo odp_sched_latency_run starts requesting $1 worker threads + echo === + + $TEST_DIR/odp_sched_latency${EXEEXT} -c $1 || exit $? +} + +run 1 +run 5 +run 8 +run 11 +run $ALL + +exit 0 -- 2.7.4