Skip to content

Commit

Permalink
Merge ODP v1.41.1.0
Browse files Browse the repository at this point in the history
Merge ODP linux-generic v1.41.1.0 into linux-dpdk.
  • Loading branch information
MatiasElo authored Aug 8, 2023
2 parents 2b359fc + 1200684 commit de97121
Show file tree
Hide file tree
Showing 123 changed files with 10,166 additions and 6,317 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci-pipeline-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,25 @@ jobs:
if: ${{ failure() }}
run: find . -name config.log -exec cat {} \;

Build_gcc_u23:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
runs-on: [self-hosted, ARM64]
env:
OS: ubuntu_23.04
strategy:
fail-fast: false
matrix:
cc_ver: [13]
conf: ['', '--enable-abi-compat']
steps:
- uses: OpenDataPlane/action-clean-up@main
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/build_${ARCH}.sh
- name: Failure log
if: ${{ failure() }}
run: find . -name config.log -exec cat {} \;

Build_out-of-tree:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
runs-on: [self-hosted, ARM64]
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,23 @@ jobs:
if: ${{ failure() }}
run: find . -name config.log -exec cat {} \;

Build_gcc_u23:
runs-on: ubuntu-20.04
env:
OS: ubuntu_23.04
strategy:
fail-fast: false
matrix:
cc_ver: [13]
conf: ['', '--enable-abi-compat']
steps:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- name: Failure log
if: ${{ failure() }}
run: find . -name config.log -exec cat {} \;

Build_out-of-tree:
runs-on: ubuntu-20.04
steps:
Expand Down
65 changes: 65 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
== OpenDataPlane (1.41.1.0)

=== Backward compatible API changes
==== DMA
* Add `odp_dma_compl_user_area()` function which returns pointer to the user
area configured with DMA completion event pool parameters.
* Clarify that DMA session names don't need to be unique.

==== Event
* Add `odp_event_user_area()` function which returns a pointer to the user area
associated with the event.

==== Init
* Add `odp_term_abnormal()` function that can be used to abnormally terminate
an ODP application after a non-recoverable error. Depending on the
implementation, this function may attempt to dump stack and other memory areas,
clean up and stop HW operations and/or perform other actions helpful in
postmortem analysis.

==== Packet
* Extend packet transmit completion (`odp_packet_tx_compl_request()`) with poll
mode. When enabled, packet transmit completion status can be checked with
`odp_packet_tx_compl_done()`.
* Add `odp_packet_free_ctrl_set()` function for controlling packet output
interface to not free a packet after transmitting it.
* Add `odp_packet_free_ctrl()` function for reading packet's free control
option value.

==== Pool
* Relax `odp_pool_stats()` specification to allow implementations to have some
delay until pool statistics are updated.
* Add new function `odp_pool_stats_selected()` for reading only selected pool
statistic(s).

==== Timer
* Split `odp_timer_cancel()` failure reason into timing related and other
failures.
* Rename `odp_timer_set_t` to `odp_timer_retval_t` as it is used now for start,
restart, and cancel operations. `odp_timer_set_t` remains as a typedef for
backward compatibility.
* Add `odp_timer_sample_ticks()` function that samples tick value of multiple
timer pools simultaneously.
* Allow implementation to place the first timer as close as it can to one period
when starting a periodic timer with `first_tick` set to 0.
* Clarify that periodic timer base frequency uses fractional numbers the same
way as timer tick info (`odp_timer_tick_info_t`). Integer part specifies full
hertz and fractional part specifies parts of a hertz.
* Clarify that `odp_timer_periodic_capability()` call does not overwrite the
base frequency value when 1 is returned.
* Clarify that some implementations may support only certain periodic timer base
frequencies and those depend on source clock frequency.

=== Performance Tests
==== bench_timer
* Add new test application for measuring call latency of small functions in the
timer API.

==== dma_perf
* Refactor DMA test application to support multiple worker threads. The number
of in-flight transfers can be configured and workers will always try to keep
that many transfers active through single or per-worker DMA session.

==== ipsecfwd
* Add support for running the application in process mode.

== OpenDataPlane (1.41.0.0)

=== Backward incompatible API changes
Expand Down
50 changes: 16 additions & 34 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,8 @@ Prerequisites for building the OpenDataPlane (ODP) API

3.6 AF_XDP socket based packet I/O support (optional)

Use AF_XDP socket for packet I/O. At the moment, only zero-copy variant is
supported, requiring a kernel version 5.4 or higher. Additionally, if packet
pools are to be shared between packet I/Os, kernel version of 5.10 or higher
is required.
Use AF_XDP socket for packet I/O. A kernel version of 5.10 or higher is
required, older kernels may or may not work.

More information about XDP and AF_XDP can be found here:
https://www.kernel.org/doc/Documentation/networking/af_xdp.rst
Expand All @@ -256,7 +254,9 @@ Prerequisites for building the OpenDataPlane (ODP) API
combinations that would otherwise conform to reported capabilities.

Note that, currently, AF_XDP socket packet I/O cannot be instantiated if
DPDK zero-copy is enabled.
DPDK zero-copy is enabled. Additionally, RSS hash key and flow hash
configuration is done based on the NIC/driver default values and should be
manually reconfigured with e.g. ethtool if changes are required.

3.6.1 AF_XDP socket packet I/O requirements

Expand All @@ -283,45 +283,27 @@ Prerequisites for building the OpenDataPlane (ODP) API
3.6.2 Build ODP with AF_XDP socket packet I/O support

After building and installing libxdp and libbpf, ODP can be configured to be
built with AF_XDP support (pass PKG_CONFIG_PATH if needed).
built with AF_XDP support (modify PKG_CONFIG_PATH as needed).

$ ./configure --enable-xdp

3.6.3 Running ODP with AF_XDP socket packet I/O
3.6.3 Running ODP with AF_XDP socket packet I/O with Mellanox NICs

AF_XDP socket packet I/Os bind to TRX-combined queues. Based on the packet
prosessing needs, NIC(s) of the environment should be configured
accordingly.

$ ethtool -L <if name> combined <count>

For example, with four (4) TRX queues, packet processing can be divided to
four (4) processing cores.

Additionally, with some NICs (e.g. Mellanox), when zero-copy XDP is in use,
the queue configuration is adjusted by the NIC with additional queues on top
of the configured amount of TRX queues which are then used as the actual
queues. This will require additional forwarding rules as otherwise packets
do not get forwarded to the zero-copy queues.
AF_XDP socket packet I/Os bind to NIC TRX-combined queues. Steering packets
to correct input sockets is configured via NIC RSS. With some NICs
(e.g. Mellanox), the driver queue configuration is adjusted by the NIC with
additional queues on top of the configured amount of TRX queues which are
then used as the actual queues. This will require additional forwarding
rules as RSS is not possible to be configured programmatically in this case.
Otherwise packets do not get forwarded to the correct queues.

For example:

ethtool -N <if name> flow-type ether dst <mac of if> action 5

Would forward Ethernet frames with a given destination address to queue 5,
which should be one of the zero-copy queues, i.e. queue index on top of the
amount configured with "ethtool -L" option.

Which queues to bind to a given interface can be controlled with an
environment variable when starting an ODP executable:

$ ODP_PKTIO_XDP_PARAMS="<if name>:<queue index> <if name>:<queue index> ..." ./<odp executable> ...

parameter being a string of interface-queue index pairs, where interface and
queue are separated by a colon and pairs separated by a whitespace. The queue
index dictates the starting queue in case of multiple TRX queues per packet
I/O. If no environment variable is passed, zero (0) starting queue is chosen
for all AF_XDP interfaces.
which would be the first actual queue in case 5 regular combined queues
were configured (zero-indexing).

4.0 Packages needed to build API tests

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AC_PREREQ([2.5])
##########################################################################
m4_define([odp_version_generation], [1])
m4_define([odp_version_major], [41])
m4_define([odp_version_minor], [0])
m4_define([odp_version_minor], [1])
m4_define([odp_version_patch], [0])

m4_define([odp_version_api],
Expand Down
57 changes: 54 additions & 3 deletions example/timer/odp_timer_accuracy.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ typedef struct timer_ctx_t {
odp_event_t event;
uint64_t nsec;
uint64_t count;
uint64_t first_period;
} timer_ctx_t;

typedef struct {
Expand All @@ -45,6 +46,8 @@ typedef struct {
uint64_t nsec_after_max;
uint64_t nsec_after_max_idx;

int tmo_tick;
int64_t first_tmo_diff;
int64_t nsec_final;

uint64_t num_before;
Expand Down Expand Up @@ -653,7 +656,7 @@ static int start_timers(test_global_t *test_global)
num_tmo = 1;

for (i = 0; i < num_tmo; i++) {
odp_timer_set_t retval;
odp_timer_retval_t retval;

for (j = 0; j < burst; j++) {
timer_ctx_t *ctx = &test_global->timer_ctx[idx];
Expand All @@ -671,6 +674,9 @@ static int start_timers(test_global_t *test_global)
ctx->nsec = start_ns + nsec;

ctx->count = 0;
ctx->first_period = start_tick +
odp_timer_ns_to_tick(timer_pool,
test_global->period_dbl + 0.5);
start_param.freq_multiplier = test_global->opt.multiplier;
start_param.first_tick = 0;
if (nsec)
Expand Down Expand Up @@ -803,6 +809,14 @@ static void print_stat(test_global_t *test_global)
print_nsec_error("min", stat->nsec_before_min, res_ns, stat->nsec_before_min_idx);
print_nsec_error("max", stat->nsec_before_max, res_ns, stat->nsec_before_max_idx);
print_nsec_error("ave", ave_before, res_ns, UINT64_MAX);

if (test_global->opt.mode == MODE_PERIODIC && !test_global->opt.offset_ns) {
printf(" first timeout difference to one period (nsec):\n");
printf(" %12" PRIi64 " / %.3fx resolution, based on %s\n",
stat->first_tmo_diff, (double)stat->first_tmo_diff / res_ns,
stat->tmo_tick ? "timeout tick" : "time");
}

printf(" final timeout error (nsec):\n");
printf(" %12" PRIi64 " / %.3fx resolution\n",
stat->nsec_final, (double)stat->nsec_final / res_ns);
Expand Down Expand Up @@ -858,6 +872,7 @@ static void run_test(test_global_t *test_global)
test_log_t *log = test_global->log;
enum mode_e mode = test_global->opt.mode;
double period_dbl = test_global->period_dbl;
odp_timer_pool_t tp = test_global->timer_pool;

num = 0;
next_tmo = 1;
Expand All @@ -873,16 +888,53 @@ static void run_test(test_global_t *test_global)
tmo = odp_timeout_from_event(ev);
ctx = odp_timeout_user_ptr(tmo);
tmo_ns = ctx->nsec;

if (mode == MODE_PERIODIC) {
if (!ctx->count && !test_global->opt.offset_ns) {
/*
* If first_tick is zero, the API allows the implementation to
* place the timer where it can, so we have to adjust our
* expectation of the timeout time.
*/

uint64_t tmo_tick = odp_timeout_tick(tmo);

if (tmo_tick) {
/*
* Adjust by the difference between one period after start
* time and the timeout tick.
*/
stat->tmo_tick = 1;
stat->first_tmo_diff =
(int64_t)odp_timer_tick_to_ns(tp, tmo_tick) -
(int64_t)odp_timer_tick_to_ns(tp, ctx->first_period);
tmo_ns += stat->first_tmo_diff;
} else {
/*
* Timeout tick is not provided, so the best we can do is
* to just take the current time as a baseline.
*/
stat->first_tmo_diff = (int64_t)time_ns - (int64_t)tmo_ns;
tmo_ns = ctx->nsec = time_ns;
}

ctx->nsec = tmo_ns;
}

/* round to closest integer number */
tmo_ns += ctx->count * period_dbl + 0.5;
ctx->count++;
}

if (i == test_global->warmup_timers) {
int tmo_tick = stat->tmo_tick;
int64_t first_tmo_diff = stat->first_tmo_diff;

memset(stat, 0, sizeof(*stat));
stat->nsec_before_min = UINT64_MAX;
stat->nsec_after_min = UINT64_MAX;
stat->tmo_tick = tmo_tick;
stat->first_tmo_diff = first_tmo_diff;
}

stat->nsec_final = (int64_t)time_ns - (int64_t)tmo_ns;
Expand Down Expand Up @@ -928,9 +980,8 @@ static void run_test(test_global_t *test_global)
/* Reset timer for next period */
odp_timer_t tim;
uint64_t nsec, tick;
odp_timer_set_t ret;
odp_timer_retval_t ret;
unsigned int j;
odp_timer_pool_t tp = test_global->timer_pool;
unsigned int retries = test_global->opt.early_retry;
uint64_t start_ns = test_global->start_ns;
uint64_t period_ns = test_global->opt.period_ns;
Expand Down
4 changes: 2 additions & 2 deletions example/timer/odp_timer_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef struct {
} test_globals_t;

/** @private Timer set status ASCII strings */
static const char *timerset2str(odp_timer_set_t val)
static const char *timerset2str(odp_timer_retval_t val)
{
switch (val) {
case ODP_TIMER_SUCCESS:
Expand Down Expand Up @@ -120,7 +120,7 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls)
while (1) {
int wait = 0;
odp_event_t ev;
odp_timer_set_t rc;
odp_timer_retval_t rc;
odp_timer_start_t start_param;

if (ttp) {
Expand Down
2 changes: 1 addition & 1 deletion helper/include/odp/helper/ipsec.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ODP_STATIC_ASSERT(sizeof(odph_ahhdr_t) == ODPH_AHHDR_LEN,
* @retval 0 on success
* @retval <0 on failure
*/
int odph_ipsec_alg_check(odp_ipsec_capability_t capa,
int odph_ipsec_alg_check(const odp_ipsec_capability_t *capa,
odp_cipher_alg_t cipher_alg,
uint32_t cipher_key_len,
odp_auth_alg_t auth_alg,
Expand Down
Loading

0 comments on commit de97121

Please sign in to comment.