aboutsummaryrefslogtreecommitdiff
path: root/example
AgeCommit message (Collapse)Author
2022-02-07Merge tag 'v1.34.0.0' of https://github.com/OpenDataPlane/odp into odp-dpdkMatias Elo
Signed-off-by: Matias Elo <matias.elo@nokia.com>
2022-01-28example: tm: set dual_rate when requesting dual rate shapingNithin Dabilpuram
Set the dual_dual rate shaper parameter to true when setting peak_rate and peak_burst in addition to commit_rate and commit_burst. Rely on the dual_rate parameter set false, instead of zero peak_rate and peak_burst, to indicate that dual rate shaping is not used. This makes the example code follow the API spec. Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2022-01-28example: traffic_mgmt: clamp shaper profile rate and burstNithin Dabilpuram
Clamp shaper profile rate and burst to limits from capability. Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2022-01-28example: ipsec_crypto: use the new session creation error namesJanne Peltonen
Use the new shorter session creation error names. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
2022-01-28example: ipsec_crypto: use new cipher IV APIJanne Peltonen
Use the new cipher_iv_len session parameter for IV length and leave the cipher IV data to its default value now that the API allows it. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
2022-01-28example: ipsec_crypto: indicate when hash result is in the auth rangeJanne Peltonen
In AH the ICV field is in the authenticated packet range. Set the hash_result_in_auth_range flag in crypto session creation for AH. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
2022-01-07example: timer_accuracy: set exit code on failureMatias Elo
Set correct application exit code on failure. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-01-07example: timer_accuracy: close output file on failureMatias Elo
Previously, the output file was not closed if odp_init_global() or odp_init_local() call failed. Fixes: https://github.com/OpenDataPlane/odp/issues/1457 Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2021-12-23example: ipfragreass: use standard 128-bit atomic operationsMatias Elo
Remove application specific atomic operations and use ODP API functions and types instead. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2021-12-22example: ipsec_crypto: remove unnecessary IP ID randomizationJanne Peltonen
Randomizing the initial IP ID (fragment identification) value of a tunnel may reduce IP ID clashes, but there does not seem to be any clear benefit of jumping to a new random ID value when the ID wraps around. Remove the re-randomization to make the code simpler. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2021-12-22example: ipsec_crypto: fix outbound ESP processing to not reuse IVsJanne Peltonen
Reusing the same ESP IV within the same SA should not be done. Fix the code to not reuse pre-generated IVs but generate a new random IV for every outbound ESP packet. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2021-12-16Merge tag 'v1.33.0.0' of https://github.com/OpenDataPlane/odp into odp-dpdkMatias Elo
Signed-off-by: Matias Elo <matias.elo@nokia.com>
2021-12-10example: classifier: fix potential memory leaksTuomas Taipale
Fix memory leak that would occur if pattern matching rule policy parsing is stopped due to an error. Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-12-09test: timer: use timer pool param init functionPetri Savolainen
Update test applications to use odp_timer_pool_param_init() instead of memset() in timer pool parameter initialization. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-11-23Merge tag 'v1.32.1.0' of https://github.com/OpenDataPlane/odp into odp-dpdkMatias Elo
Signed-off-by: Matias Elo <matias.elo@nokia.com>
2021-11-12helper: cli: remove unused instance parameter from odph_cli_init()Jere Leppänen
Now that the CLI helper no longer creates a thread, the ODP instance is not needed by odph_cli_init(). Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-10-21example: ipfragreass: fix unsupported types build errorsMatias Elo
Fix "ISO C does not support '__int128' types" errors when building with 'pedantic' option. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-21example: tm: fix range expression build errorsMatias Elo
Fix "ISO C forbids specifying range of elements to initialize" and "range expressions in switch statements are non-standard" errors when building with 'pedantic' option. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-21example: timer: fix extra semicolon build errorsMatias Elo
Fix "ISO C does not allow extra ';' outside of a function" errors when building with 'pedantic' option. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-21example: ipsec_crypto: tm: fix zero-size array build errorsMatias Elo
Fix "ISO C forbids zero-size array" errors when building with 'pedantic' option. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-21example: generator: fix braced-groups within expressions build errorsMatias Elo
Fix "ISO C forbids braced-groups within expressions" errors when building with 'pedantic' option. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-21example: ipsec_crypto: fix sscanf format build errorsMatias Elo
Fix "format '%x' expects argument of type 'unsigned int *'" errors when building with 'pedantic' option. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-05Merge tag 'v1.32.0.0' of https://github.com/OpenDataPlane/odp into odp-dpdkMatias Elo
Signed-off-by: Matias Elo <matias.elo@nokia.com>
2021-09-30helper: cli: don't create the server threadJere Leppänen
Add odph_cli_run() and remove odph_cli_start(). Don't create a thread in the CLI helper. Instead, the caller may create a thread and call odph_cli_run() to run the CLI. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Cc: Lifang Zhang <lifang.zhang@nokia.com>
2021-09-30use odph_thread_create() instead of odph_odpthreads_create()Jere Leppänen
Use the newer odph_thread_create() and odph_thread_join() functions in examples and tests instead of the deprecated odph_odpthreads_create() and odph_odpthreads_join(). Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-09-30use odph_thread_param_init()Jere Leppänen
Use the new odph_thread_param_init() function to initialize odph_thread_param_t. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-09-30use odph_thread_common_param_init()Jere Leppänen
Use the new odph_thread_common_param_init() function to initialize odph_thread_common_param_t. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-09-29example: ipsec_api: check dest queue capabilityAakash Sasidharan
When the env variable ODP_IPSEC_USE_POLL_QUEUES is set, the application tries to create plain type queues. Otherwise the application goes for scheduled type completion queue. Check if the selected IPsec dest queue type is supported before creating the destination queue. Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2021-08-20example: debug: print multiple queuesPetri Savolainen
Test odp_queue_print_all() and odp_schedule_print() calls with multiple queues created. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-07-13Merge tag 'v1.30.1.0' of https://github.com/OpenDataPlane/odp into odp-dpdkMatias Elo
Signed-off-by: Matias Elo <matias.elo@nokia.com>
2021-07-02Merge tag 'v1.30.0.0' of https://github.com/OpenDataPlane/odp into odp-dpdkMatias Elo
Signed-off-by: Matias Elo <matias.elo@nokia.com>
2021-06-22example: debug: use odp_schedule_print()Petri Savolainen
Use the new scheduler debug print function. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2021-06-17example: ipsec: allow PID file to be created before readingAakash Sasidharan
For IPsec live and router mode tests, the application needs to be killed explicitly once the ping tests are done. The pid of the app is buffered in app_pid file which is later read into the env variable APP_PID. Allow the PID file to be created before reading the file by moving the cat command just before the kill command is invoked. Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2021-06-17example: ipsec_api: enable live and router mode testsAakash Sasidharan
Enable the only remaining tests for ipsec_api in CI. Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2021-06-17example: ipsec_api: update AH run scripts to use SHA1Aakash Sasidharan
Not all implementations may support MD5 auth algorithm for AH mode. Update the run scripts for AH mode tests to use SHA1 auth algorithm instead of MD5. Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2021-06-17example: ipsec: add sha1 and sha256 support in AH modeAakash Sasidharan
Currently AH mode supports only MD5 auth. Enable support for SHA1 and SHA256 auth algorithms. Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2021-06-01helper: cli: add user command functionsJere Leppänen
Allow user to register CLI commands with a name, function, and an optional help text. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-06-01example: timer_accuracy: use new timer set return codesPetri Savolainen
Use the new timer set return codes: ODP_TIMER_TOO_NEAR, ODP_TIMER_TOO_FAR and ODP_TIMER_FAIL. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-06-01example: timer: use new timer set return codesPetri Savolainen
Use the new timer set return codes: ODP_TIMER_TOO_NEAR, ODP_TIMER_TOO_FAR and ODP_TIMER_FAIL. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-05-31test: use default clock source enumPetri Savolainen
Replace ODP_CLOCK_CPU with ODP_CLOCK_DEFAULT on example and performance test applications. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2021-05-31example: timer_accuracy: use new clock source enumPetri Savolainen
Replace ODP_CLOCK_CPU and _EXT with new enums. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2021-05-31example: tm: use TM start and stopNithin Dabilpuram
Use TM start to start the TM system after creation and TM stop to stop it before destroying TM queues. Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2021-05-31example: tm: use commit_rate and peak_rate in shaper paramNithin Dabilpuram
Use commit_rate and peak_rate in shaper params instead of commit_bps and peak_bps. Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2021-05-27Merge tag 'v1.29.0.0' of https://github.com/OpenDataPlane/odp into odp-dpdkMatias Elo
Signed-off-by: Matias Elo <matias.elo@nokia.com>
2021-05-26Merge tag 'v1.28.0.0' of https://github.com/OpenDataPlane/odp into odp-dpdkMatias Elo
Signed-off-by: Matias Elo <matias.elo@nokia.com>
2021-05-25example: debug: fix timer pool configurationPavan Nikhilesh
Currently, the max and min timeout are being configured with the minimum resolution supported by the timer implementation, instead retrieve the resolution and min timeout supported for the given max timeout and configure them accordingly. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-05-25example: ipsec_crypto: enhance runtime scriptsAakash Sasidharan
The network interfaces and configurations required for the application change based on the application mode in which the test is being run. Introduce env variable IPSEC_APP_MODE which will be set by run script. The supported modes are: 0 - standalone mode, 1 - live mode and 2 - router mode. Though linux-gen supports multiple "loop" devices like loop1 and loop2, other ODP implementations may not support multiple loop interfaces. To allow flexibility for other platforms, introduce following env variables in the runtime scripts for standalone mode: * IF_LIST env variable lists all the interfaces used for standalone mode of test. * For outbound tests, stream entry has source interface as IN_IF and destination interface as OUT_IF. * For inbound tests, stream entry has source interface as OUT_IF and destination interface as IN_IF. * Introduce ROUTE_IF_INB and ROUTE_IF_OUTB for routing the IPSEC processed packets in standalone tests. Introduce platform specific pktio_env script to define these environment variables. Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-05-21example: ipsec_api: include inbound ESP test scripts in testsJanne Peltonen
Include inbound ESP tests scripts in tests now that ESP test packet construction has been fixed. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-05-21example: ipsec: fix length field of inner IP header in tunnel modeJanne Peltonen
The length field of the IP header of a tunneled packet was left zero when building IPsec test packets. Fix the issue by setting the length. Suggested-by: Aakash Sasidharan <asasidharan@marvell.com> Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Aakash Sasidharan <asasidharan@marvell.com>
2021-05-21example: ipsec_api: check IPsec operation result after sync opJanne Peltonen
Call odp_ipsec_result() also after synchronous IPsec processing and check if the operation succeeded. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Aakash Sasidharan <asasidharan@marvell.com>