From: Shiri Kuzin <shirik@nvidia.com>
To: dev@dpdk.org
Cc: viacheslavo@nvidia.com, adrien.mazarguil@6wind.com, rasland@nvidia.com
Subject: [dpdk-dev] [RFC 1/6] ethdev: update GTP headers
Date: Wed, 16 Dec 2020 16:25:06 +0200 [thread overview]
Message-ID: <20201216142511.13660-2-shirik@nvidia.com> (raw)
In-Reply-To: <20201216142511.13660-1-shirik@nvidia.com>
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
This patch introduces the GTP header individual flag bit fields
and the header optional word with N-PDU number, Sequence Number
and Next Extension Header type.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
lib/librte_net/rte_gtp.h | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/lib/librte_net/rte_gtp.h b/lib/librte_net/rte_gtp.h
index 104384cc53..6a6f9b238d 100644
--- a/lib/librte_net/rte_gtp.h
+++ b/lib/librte_net/rte_gtp.h
@@ -27,13 +27,40 @@ extern "C" {
* 16-bit payload length after mandatory header, 32-bit TEID.
* No optional fields and next extension header.
*/
+__extension__
struct rte_gtp_hdr {
- uint8_t gtp_hdr_info; /**< GTP header info */
+ union {
+ uint8_t gtp_hdr_info; /**< GTP header info */
+ struct {
+#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
+ uint8_t pn:1; /**< N-PDU Number present bit */
+ uint8_t s:1; /**< Sequence Number Present bit */
+ uint8_t e:1; /**< Extension Present bit */
+ uint8_t res1:1; /**< Reserved */
+ uint8_t pt:1; /**< Protocol Type bit */
+ uint8_t ver:3; /**< Version Number */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+ uint8_t ver:3; /**< Version Number */
+ uint8_t pt:1; /**< Protocol Type bit */
+ uint8_t res1:1; /**< Reserved */
+ uint8_t e:1; /**< Extension Present bit */
+ uint8_t s:1; /**< Sequence Number Present bit */
+ uint8_t pn:1; /**< N-PDU Number present bit */
+#endif
+ };
+ };
uint8_t msg_type; /**< GTP message type */
- uint16_t plen; /**< Total payload length */
- uint32_t teid; /**< Tunnel endpoint ID */
+ rte_be16_t plen; /**< Total payload length */
+ rte_be32_t teid; /**< Tunnel endpoint ID */
} __rte_packed;
+/* Optional word of GTP header, present if any of E, S, PN is set. */
+struct rte_gtp_hdr_ext_word {
+ rte_be16_t sqn; /**< Sequence Number. */
+ uint8_t npdu; /**< N-PDU number. */
+ uint8_t next_ext; /**< Next Extension Header Type. */
+} __rte_packed;
+
/** GTP header length */
#define RTE_ETHER_GTP_HLEN \
(sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))
--
2.21.0
next prev parent reply other threads:[~2020-12-16 14:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 7:39 [dpdk-dev] [RFC v2] ethdev: introduce GENEVE header extension item Shiri Kuzin
2020-10-01 16:25 ` Ferruh Yigit
2020-10-05 12:44 ` Shiri Kuzin
2020-10-05 13:10 ` Ferruh Yigit
2020-12-16 13:02 ` [dpdk-dev] [RFC v3 0/8] ethdev: introduce GENEVE header TLV option item Shiri Kuzin
2020-12-16 13:02 ` [dpdk-dev] [RFC v3 1/8] lib/librte_ethdev: " Shiri Kuzin
2020-12-16 13:02 ` [dpdk-dev] [RFC v3 2/8] app/testpmd: add GENEVE option item support Shiri Kuzin
2021-01-14 20:08 ` Ajit Khaparde
2021-01-17 8:31 ` Shiri Kuzin
2020-12-16 13:02 ` [dpdk-dev] [RFC v3 3/8] common/mlx5: check GENEVE TLV support in HCA attributes Shiri Kuzin
2020-12-16 13:02 ` [dpdk-dev] [RFC v3 4/8] common/mlx5: create GENEVE TLV option object with DevX Shiri Kuzin
2020-12-16 13:02 ` [dpdk-dev] [RFC v3 5/8] net/mlx5: create GENEVE TLV option management Shiri Kuzin
2020-12-16 13:02 ` [dpdk-dev] [RFC v3 6/8] net/mlx5: add GENEVE TLV option flow validation Shiri Kuzin
2020-12-16 13:02 ` [dpdk-dev] [RFC v3 7/8] net/mlx5: add GENEVE TLV option flow translation Shiri Kuzin
2020-12-16 13:02 ` [dpdk-dev] [RFC v3 8/8] doc: update GENEVE TLV option support Shiri Kuzin
2020-12-16 14:25 ` [dpdk-dev] [RFC 0/6] add GTP PSC extension header support Shiri Kuzin
2020-12-16 14:25 ` Shiri Kuzin [this message]
2020-12-16 14:25 ` [dpdk-dev] [RFC 2/6] app/testpmd: add GTP PSC option support in raw sets Shiri Kuzin
2020-12-16 14:25 ` [dpdk-dev] [RFC 3/6] common/mlx5: add matcher fields for GTP extensions Shiri Kuzin
2020-12-16 14:25 ` [dpdk-dev] [RFC 4/6] net/mlx5: add GTP PSC flow validation Shiri Kuzin
2020-12-16 14:25 ` [dpdk-dev] [RFC 5/6] net/mlx5: add GTP PSC item translation Shiri Kuzin
2020-12-16 14:25 ` [dpdk-dev] [RFC 6/6] doc: update GTP extension header support Shiri Kuzin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201216142511.13660-2-shirik@nvidia.com \
--to=shirik@nvidia.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=rasland@nvidia.com \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).