From: Matias Elo <matias....@nokia.com> Not calling packet_parse_layer() when packet input parsing is disabled removes two unnecessary function calls from fast path.
Signed-off-by: Matias Elo <matias....@nokia.com> --- /** Email created from pull request 287 (matiaselo:fix/dpdk_pktio) ** https://github.com/Linaro/odp/pull/287 ** Patch: https://github.com/Linaro/odp/pull/287.patch ** Base sha: 29c7a054f7151d33795a0d8d7df5594bf4fddb55 ** Merge commit sha: e33bf359781afcf67cf12031feef43a953e506be **/ platform/linux-generic/pktio/dpdk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index d7e9fcd4f..b5a87b829 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -439,7 +439,7 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry, if (pktio_cls_enabled(pktio_entry)) copy_packet_cls_metadata(&parsed_hdr, pkt_hdr); - else + else if (pktio_entry->s.config.parser.layer) packet_parse_layer(pkt_hdr, pktio_entry->s.config.parser.layer); @@ -654,7 +654,7 @@ static inline int mbuf_to_pkt_zero(pktio_entry_t *pktio_entry, if (pktio_cls_enabled(pktio_entry)) copy_packet_cls_metadata(&parsed_hdr, pkt_hdr); - else + else if (pktio_entry->s.config.parser.layer) packet_parse_layer(pkt_hdr, pktio_entry->s.config.parser.layer);