aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp_packet_dpdk.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/include/odp_packet_dpdk.h')
-rw-r--r--platform/linux-generic/include/odp_packet_dpdk.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/platform/linux-generic/include/odp_packet_dpdk.h b/platform/linux-generic/include/odp_packet_dpdk.h
index 7600b57e7..020c2b976 100644
--- a/platform/linux-generic/include/odp_packet_dpdk.h
+++ b/platform/linux-generic/include/odp_packet_dpdk.h
@@ -72,4 +72,24 @@ typedef struct ODP_ALIGNED_CACHE {
dpdk_opt_t opt;
} pkt_dpdk_t;
+/** Packet parser using DPDK interface */
+int dpdk_packet_parse_common(packet_parser_t *pkt_hdr,
+ const uint8_t *ptr,
+ uint32_t pkt_len,
+ uint32_t seg_len,
+ struct rte_mbuf *mbuf,
+ int layer,
+ odp_pktin_config_opt_t pktin_cfg);
+
+static inline int dpdk_packet_parse_layer(odp_packet_hdr_t *pkt_hdr,
+ struct rte_mbuf *mbuf,
+ odp_pktio_parser_layer_t layer,
+ odp_pktin_config_opt_t pktin_cfg)
+{
+ uint32_t seg_len = pkt_hdr->buf_hdr.seg[0].len;
+ void *base = pkt_hdr->buf_hdr.seg[0].data;
+
+ return dpdk_packet_parse_common(&pkt_hdr->p, base, pkt_hdr->frame_len,
+ seg_len, mbuf, layer, pktin_cfg);
+}
#endif