Skip to content

Commit

Permalink
test: l2fwd: fix odp_unlikely() conditions
Browse files Browse the repository at this point in the history
Instead of checking for `odp_unlikely(pkts) == 0`, check for
`odp_unlikely(pkts == 0)` in run functions after extra feature
processing.

Signed-off-by: Tuomas Taipale <[email protected]>
Reviewed-by: Janne Peltonen <[email protected]>
  • Loading branch information
TuomasTaipale committed Jul 29, 2024
1 parent a52858a commit d926872
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/performance/odp_l2fwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ static int run_worker_sched_mode_vector(void *arg)

pkts = process_extra_features(appl_args, pkt_tbl, pkts, stats);

if (odp_unlikely(pkts) == 0) {
if (odp_unlikely(pkts == 0)) {
if (pkt_vec != ODP_PACKET_VECTOR_INVALID)
odp_packet_vector_free(pkt_vec);
continue;
Expand Down Expand Up @@ -928,7 +928,7 @@ static int run_worker_sched_mode(void *arg)

pkts = process_extra_features(appl_args, pkt_tbl, pkts, stats);

if (odp_unlikely(pkts) == 0)
if (odp_unlikely(pkts == 0))
continue;

/* packets from the same queue are from the same interface */
Expand Down Expand Up @@ -1043,7 +1043,7 @@ static int run_worker_plain_queue_mode(void *arg)

pkts = process_extra_features(appl_args, pkt_tbl, pkts, stats);

if (odp_unlikely(pkts) == 0)
if (odp_unlikely(pkts == 0))
continue;

fill_eth_addrs(pkt_tbl, pkts, dst_idx);
Expand Down Expand Up @@ -1137,7 +1137,7 @@ static int run_worker_direct_mode(void *arg)

pkts = process_extra_features(appl_args, pkt_tbl, pkts, stats);

if (odp_unlikely(pkts) == 0)
if (odp_unlikely(pkts == 0))
continue;

fill_eth_addrs(pkt_tbl, pkts, dst_idx);
Expand Down

0 comments on commit d926872

Please sign in to comment.