diff mbox series

[v1,3/13] linux-gen: packet: add odp_packet_l2_type() implementation

Message ID 1519923609-31634-4-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v1,1/13] linux-gen: packet: implement packet l3/l4 proto types | expand

Commit Message

Github ODP bot March 1, 2018, 4:59 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


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

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 505 (muvarov:devel/master_merge_api-next)
 ** https://github.com/Linaro/odp/pull/505
 ** Patch: https://github.com/Linaro/odp/pull/505.patch
 ** Base sha: 284f52d72ec19df3774c7409780f1f9eea33b8e6
 ** Merge commit sha: e8f50fefcd57a92e0971dc1172c5402c56b8370a
 **/
 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 8a5833ded..35b9b59dc 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -2486,6 +2486,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);