app/testpmd: fix eth packet dump for small buffers
authorDavid Marchand <david.marchand@redhat.com>
Wed, 24 Jul 2019 10:58:56 +0000 (12:58 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 29 Jul 2019 21:30:33 +0000 (23:30 +0200)
commit3e6b0d5f69da2130e60b535e57fd065746b932a8
treea19aa349fd0c92da0b00ac1b80f696b5b87b8471
parent96c343868dd15ebdc74371a9dea2288b30ce13ea
app/testpmd: fix eth packet dump for small buffers

In the rather unlikely case where the first segment is too small to
contain an ethernet header, we can't go and directly dereference the
mbuf data buffer.

Using rte_pktmbuf_read is a little more expensive but this is still
acceptable for a debugging feature.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
app/test-pmd/util.c