diff options
author | Jere Leppänen <jere.leppanen@nokia.com> | 2022-09-27 14:38:58 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2022-10-20 12:17:21 +0300 |
commit | c94120e4ca7bddfe91023e803c54360f7b56fdc9 (patch) | |
tree | d81063e130ccf02d7e9a82446333005e92ab9f94 /example | |
parent | 0f2ad6aad398cb4fff18a5c85b6692a42f861ae2 (diff) |
example: classifier: in drop mode, don't swap addresses
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>
Diffstat (limited to 'example')
-rw-r--r-- | example/classifier/odp_classifier.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 9551c0c23..4cf9d43c5 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -397,8 +397,6 @@ static int pktio_receive_thread(void *arg) pool = odp_packet_pool(pkt); - /* Swap Eth MACs and possibly IP-addrs before sending back */ - swap_pkt_addrs(&pkt, 1); for (i = 0; i < MAX_PMR_COUNT; i++) { stats = &appl->stats[i]; if (queue == stats->queue) @@ -412,6 +410,9 @@ static int pktio_receive_thread(void *arg) continue; } + /* Swap Eth MACs and possibly IP-addrs before sending back */ + swap_pkt_addrs(&pkt, 1); + if (odp_pktout_send(pktout, &pkt, 1) < 1) { ODPH_ERR(" [%i] Packet send failed\n", thr); odp_packet_free(pkt); |