aboutsummaryrefslogtreecommitdiff
path: root/example
AgeCommit message (Collapse)Author
2022-11-01example: sysinfo: print all supported crypto algorithmsJanne Peltonen
The sysinfo example does not check the support for all crypto algorithms defined in the ODP API. Add the missing ones. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2022-11-01example: sysinfo: reduce code duplication in crypto capa checkingJanne Peltonen
Put the iteration over cipher and auth capability bits in their own functions that call a provided function for each supported algorithm. This way the mapping from capability bits to algorithm IDs needs to be done in one place only. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2022-10-20example: classifier: use default priority for all queuesJere Leppänen
Use default priority for all queues. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: add burst size optionJere Leppänen
Add an option to set packet burst size. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: schedule and send packet burstsJere Leppänen
Use odp_schedule_multi() to receive packet bursts, and also send the packets back in bursts. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: in drop mode, don't swap addressesJere Leppänen
There's no point in swapping source and destination addresses in drop mode. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: increase default pool size to 10000Jere Leppänen
Increase default pool size to 10000 packets. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: add pool size optionJere Leppänen
Add an option to set packet pool size. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: add dedicated pools optionJere Leppänen
Add an option to choose between one packet pool, or dedicated pools for pktio and all CoSes. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: change help text from "ICMP mode" to "echo mode"Jere Leppänen
Change the help text for the -m option from "ICMP mode" to "echo mode". Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: create a dedicated pktout queue for each workerJere Leppänen
Create a dedicated pktout queue for each worker. Print a message if queues have to be shared because the pktout doesn't support that many queues. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: print packet rateJere Leppänen
Print packet rate in Mpps. Print statistics for every interval on a new line, instead of updating a single line. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: print MAC addressJere Leppänen
Print MAC address when creating pktio, so that it's easier to configure the other side. Also clean up the existing "created pktio" print. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: add parse layer optionJere Leppänen
Add option to set parse layer. Default is to parse all layers. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: add option to disable classifierJere Leppänen
Add option to disable classifier. This can be used for example to compare packet rate with and without classifier. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-10-20example: classifier: don't require PMRJere Leppänen
Run the application even if no PMR has been given on the command line. This enables testing with default CoS only. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-09-14example: check pktio promisc mode status before enabling itMatias Elo
Some pktio devices may not support changing promisc mode but have it permanently enabled. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2022-09-09test: link statically unless --disable-static-applications is givenJere Leppänen
test/Makefile.inc is missing the -static option when linking should be static. Add it to AM_LDFLAGS. Also, remove -L$(LIB). It's not needed since libraries in $(LIB) are linked with path. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2022-09-09configure: use ODP_*FLAGS instead of *FLAGSJere Leppänen
Instead of setting CFLAGS (and CXXFLAGS, LDFLAGS) in configure, use ODP_CFLAGS instead. Then, in main level Makefile.inc, set AM_CFLAGS based on ODP_CFLAGS. Consequently, program_CFLAGS will work as intended. Also, don't do AC_SUBST([LIBS]). LIBS is handled automatically, since it's a preset variable. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2022-07-14example: debug: add stash print optionPetri Savolainen
Added new option -a which calls odp_stash_print(). Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2022-07-04example: ping: add promiscuous mode and timeout optionsPetri Savolainen
Added -p option enable promiscuous mode on the interfaces. Added -t option to control how long application runs in maximum (e.g. when no packets are received). Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2022-06-27example: timer_accuracy: shorten test time in make checkJanne Peltonen
Run the timer accuracy example through a shell script in make check to use a shorter timer period and a reduced number of periods. This speeds up make check without really reducing test coverage since the accuracy result is not actually checked. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-06-23example: ping: use helper macro for error printsMatias Elo
Use ODPH_ERR() helper macro for application error prints for additional debug info. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2022-06-23example: ping: fix odp_packet_input_index() usageMatias Elo
The indexes returned by odp_pktio_index() may not start from zero. Add a lookup table to handle this. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2022-04-13test: use uint32_t for number of queuesPetri Savolainen
Update number of packet IO queue variables to uint32_t in test applications. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2022-04-12example: ipsec_api: fix esp tunnel mode testAakash Sasidharan
Add tunnel parameter to odp_ipsec_api_run_esp_tun_out.sh test script. Reported-by: Pradyumna Achyuthuni <pachyuthuni@marvell.com> Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2022-03-21example: ipfragreass: remove unused but set variableMatias Elo
Fixes compilation error with Clang 14 about unused but set variable. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2022-03-21example: ipsec: ignore warnings from deprecated openssl APIsMatias Elo
For now, ignore warnings about APIs deprecated in OpenSSL 3.0. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2022-03-02example: remove usage of deprecated schedule priority definesMatias Elo
Replace usage of deprecated schedule priority defines with matching functions. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-02-25example: ipsec_crypto: support bit mode algorithm implementations tooJanne Peltonen
Do not give up if the underlying ODP supports an algorithm in bit mode but scale the range parameter as appropriate. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2022-02-25example: ipsec_crypto: fix crypto capability checkingJanne Peltonen
Check that the used algorithm as well as key length etc are supported before trying to create a crypto session. Give up if the used ODP implementation supports the algorithm in bit mode since the code expects byte mode and would pass incorrect auth_range to an implementation which works in bit mode. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2022-02-17example: sysinfo: add new capability printsPetri Savolainen
Added classifier, compression, DMA, and stash capability prints. Updated shm, pool, scheduler, timer, crypto, and IPSEC API capability prints. 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>
2022-02-17example: sysinfo: reformat printf linesPetri Savolainen
Current maximum line length is 100 chars, pack variables to the same line when possible. Shorten printf lines by not using PRIu32 as uint32_t is in practice equivalent to unsigned int. 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>
2022-02-03example: reduce example application run times in make checkJanne Peltonen
Run various example applications for a shorter time when run through the scripts used by make check. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2022-02-03example: classifier: print statistics at a better timeJanne Peltonen
Print statistics output after the sleep that waits for packets to arrive. Previously the statistics were printed out before the sleep, causing the statistics of the last wait period not to be printed. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2022-02-03example: l3fwd: print stats and check elapsed time more oftenJanne Peltonen
Shorten the sleep time in the loop that prints statistics and checks if elapsed time has exceeded the requested duration. This shortens execution time closer to the requested duration. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2022-02-03example: ipsec: Sleep for shorter periods to finish stream test fasterJanne Peltonen
Sleep for shorter periods in ipsec_api and ipsec_crypto examples when waiting for stream test completion. This reduces unnecessary wait and speeds up make check. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@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-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-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>