diff options
author | Jere Leppänen <jere.leppanen@nokia.com> | 2022-08-31 11:03:05 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2022-10-20 12:17:21 +0300 |
commit | 747b52cda64c9d729649c686a5e7e45ac905259e (patch) | |
tree | fef8bf45a730c8351d215bdf612b9b4eb0f8b29c /example | |
parent | d46af42449b414efc04a95f0097eaf73299a56af (diff) |
example: classifier: print MAC address
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>
Diffstat (limited to 'example')
-rw-r--r-- | example/classifier/odp_classifier.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index f64df711e..297e28620 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -287,11 +287,17 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool) } } - printf(" created pktio:%02" PRIu64 - ", dev:%s, queue mode (ATOMIC queues)\n" - " \tdefault pktio%02" PRIu64 "\n", - odp_pktio_to_u64(pktio), dev, - odp_pktio_to_u64(pktio)); + printf("created pktio:%" PRIu64 ", dev:%s", odp_pktio_to_u64(pktio), dev); + + odph_ethaddr_t mac; + + if (odp_pktio_mac_addr(pktio, &mac, sizeof(mac)) == sizeof(mac)) { + printf(", mac"); + for (int c = 0; c < (int)sizeof(mac); c++) + printf(":%02x", mac.addr[c]); + } + + printf("\n"); odp_pktio_config_init(&cfg); cfg.parser.layer = appl_args_gbl->parse_layer; |