diff mbox series

[API-NEXT,v1,1/11] linux-gen: packet: add odp_packet_l2_type() implementation

Message ID 1519657209-30140-2-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v1,1/11] linux-gen: packet: add odp_packet_l2_type() implementation | expand

Commit Message

Github ODP bot Feb. 26, 2018, 2:59 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 502 (lumag:ipsec-imp-upd)
 ** https://github.com/Linaro/odp/pull/502
 ** Patch: https://github.com/Linaro/odp/pull/502.patch
 ** Base sha: c91eae61d19350dd19aacf18c1148c9491398c14
 ** Merge commit sha: 8c909084626ccef140542645cd34549ce7f4bcde
 **/
 platform/linux-generic/odp_packet.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index 46b11cba1..6fc5f2206 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -2506,6 +2506,16 @@  int odp_packet_has_ref(odp_packet_t pkt)
 	return 0;
 }
 
+odp_proto_l2_type_t odp_packet_l2_type(odp_packet_t pkt)
+{
+	odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);
+
+	if (pkt_hdr->p.input_flags.eth)
+		return ODP_PROTO_L2_TYPE_ETH;
+
+	return ODP_PROTO_L2_TYPE_NONE;
+}
+
 odp_proto_l3_type_t odp_packet_l3_type(odp_packet_t pkt)
 {
 	odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);