[v2,8/13] linux-gen: packet: support L4 type No Next Header

Message ID 1519938053-24031-9-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [v2,1/13] linux-gen: packet: implement packet l3/l4 proto types
Related show

Commit Message

Github ODP bot March 1, 2018, 9 p.m.
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: 5da68bf06572d3d0651c37cbba03aa91995ec465
 **/
 platform/linux-generic/include/odp/api/plat/packet_inline_types.h | 1 +
 platform/linux-generic/include/protocols/ip.h                     | 1 +
 platform/linux-generic/odp_packet.c                               | 6 ++++++
 3 files changed, 8 insertions(+)

Patch

diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h
index 2e8efecb6..4b88d3517 100644
--- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h
+++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h
@@ -90,6 +90,7 @@  typedef union {
 		uint64_t tcp:1;       /* TCP */
 		uint64_t sctp:1;      /* SCTP */
 		uint64_t icmp:1;      /* ICMP */
+		uint64_t no_next_hdr:1; /* No Next Header */
 
 		uint64_t color:2;     /* Packet color for traffic mgmt */
 		uint64_t nodrop:1;    /* Drop eligibility status */
diff --git a/platform/linux-generic/include/protocols/ip.h b/platform/linux-generic/include/protocols/ip.h
index f02980693..19aef3dcc 100644
--- a/platform/linux-generic/include/protocols/ip.h
+++ b/platform/linux-generic/include/protocols/ip.h
@@ -167,6 +167,7 @@  typedef struct ODP_PACKED {
 #define _ODP_IPPROTO_AH      0x33 /**< Authentication Header (51) */
 #define _ODP_IPPROTO_ESP     0x32 /**< Encapsulating Security Payload (50) */
 #define _ODP_IPPROTO_ICMPV6  0x3A /**< Internet Control Message Protocol (58) */
+#define _ODP_IPPROTO_NO_NEXT 0x3B /**< No Next Header (59) */
 #define _ODP_IPPROTO_DEST    0x3C /**< IPv6 Destination header (60) */
 #define _ODP_IPPROTO_SCTP    0x84 /**< Stream Control Transmission protocol
 				       (132) */
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index 35b9b59dc..462c8a4c7 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -2225,6 +2225,10 @@  int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr,
 		prs->input_flags.sctp = 1;
 		break;
 
+	case _ODP_IPPROTO_NO_NEXT:
+		prs->input_flags.no_next_hdr = 1;
+		break;
+
 	default:
 		prs->input_flags.l4 = 0;
 		break;
@@ -2530,6 +2534,8 @@  odp_proto_l4_type_t odp_packet_l4_type(odp_packet_t pkt)
 	else if (pkt_hdr->p.input_flags.icmp &&
 		 pkt_hdr->p.input_flags.ipv6)
 		return ODP_PROTO_L4_TYPE_ICMPV6;
+	else if (pkt_hdr->p.input_flags.no_next_hdr)
+		return ODP_PROTO_L4_TYPE_NO_NEXT;
 
 	return ODP_PROTO_L4_TYPE_NONE;
 }