get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/16983/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 16983,
    "url": "https://patches.dpdk.org/api/patches/16983/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/a55f9700134c2b5e83b4806df573aefa0c4bab03.1478703591.git.nelio.laranjeiro@6wind.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<a55f9700134c2b5e83b4806df573aefa0c4bab03.1478703591.git.nelio.laranjeiro@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/a55f9700134c2b5e83b4806df573aefa0c4bab03.1478703591.git.nelio.laranjeiro@6wind.com",
    "date": "2016-11-09T15:04:01",
    "name": "[dpdk-dev] net: introduce big and little endian types",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1a66c57bd71bdc05b0875b2b4127997cb2d79b00",
    "submitter": {
        "id": 243,
        "url": "https://patches.dpdk.org/api/people/243/?format=api",
        "name": "Nélio Laranjeiro",
        "email": "nelio.laranjeiro@6wind.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/a55f9700134c2b5e83b4806df573aefa0c4bab03.1478703591.git.nelio.laranjeiro@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/16983/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/16983/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id AB0192BC7;\n\tWed,  9 Nov 2016 16:04:24 +0100 (CET)",
            "from mail-wm0-f49.google.com (mail-wm0-f49.google.com\n\t[74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 343281E34\n\tfor <dev@dpdk.org>; Wed,  9 Nov 2016 16:04:23 +0100 (CET)",
            "by mail-wm0-f49.google.com with SMTP id f82so247771916wmf.1\n\tfor <dev@dpdk.org>; Wed, 09 Nov 2016 07:04:23 -0800 (PST)",
            "from ping.vm.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net.\n\t[82.239.227.177]) by smtp.gmail.com with ESMTPSA id\n\tm5sm689501wmd.17.2016.11.09.07.04.21\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 09 Nov 2016 07:04:21 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id;\n\tbh=qd5+WLJVg48XA3HMlgCA0wAP1RPtzyvhDd6lxluwgeY=;\n\tb=L3ZLRZw5qlsZG7pGX0ygWTzmcMAF08jstu8QdOEgxLmQEGO6im/BfilFuw3baHKVul\n\t6OaEPANAnlmwfzGbjs2thjclOiCJJhYOiOil5sym62l5qhwB3kR9is+J58JocUbubbKj\n\t1OixsYSCoZjCo7opp0zQBx2MGxiuYX2/5+Bqfe4kobzDT0lanFnSthjWt6EcFbG3Iqmj\n\tcRqZDFBpjsriiC3Na2o+F8Y/jpIH7qdq5K2kMk18U3UvtUdxd4SWCjveZELRjwDloZhJ\n\tRLYVQVaWFkcddtDI73T/0FSygo9zaCwJ9KzYcaLim4PcNOE9mbpO+9YpAEeWr0IFDuYm\n\tE84A==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=qd5+WLJVg48XA3HMlgCA0wAP1RPtzyvhDd6lxluwgeY=;\n\tb=hI7ooD1FacmN0WsqYSOKcnh3aax3I3HCnACpg8TIzNU/qqAE4N3YT2f/WiHhlO0YJS\n\t8S6ukQaAlcsq8sYvOerzveufnnWwwWeicRLRaAN6dhxpKwOAlV3u5pO9QWB1sk0Ef+pr\n\tCtZwKIbpoVr3/5bTqa0t3OjVDVK4IDzRs2zC0GQbCfiDEV0gHerbD75YG8TpSBXNYUi/\n\tL64rc/FriQ7FYc27jTCSBz64+YSXZoIeHaSzLdz/y2HOcqhDP720UZ5oVIdcyYibLksk\n\tW6rKjdDiQX9hqx2wvYzqvSKQdlByE3qfzjKCLZynzPmc2uwWVgW3kblbPQaX3Hrwv5kd\n\tb6gw==",
        "X-Gm-Message-State": "ABUngvcCiQuXyHUpfjks825u0xmRLAOyiYATlNU43EFWaHhjVWWlskhqyJglXQm61LMWr4Tu",
        "X-Received": "by 10.194.74.102 with SMTP id s6mr16510wjv.9.1478703862397;\n\tWed, 09 Nov 2016 07:04:22 -0800 (PST)",
        "From": "Nelio Laranjeiro <nelio.laranjeiro@6wind.com>",
        "To": "dev@dpdk.org,\n\tOlivier Matz <olivier.matz@6wind.com>",
        "Cc": "wenzhuo.lu@intel.com,\n\tAdrien Mazarguil <adrien.mazarguil@6wind.com>",
        "Date": "Wed,  9 Nov 2016 16:04:01 +0100",
        "Message-Id": "<a55f9700134c2b5e83b4806df573aefa0c4bab03.1478703591.git.nelio.laranjeiro@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "Subject": "[dpdk-dev] [PATCH] net: introduce big and little endian types",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This commit introduces new rte_{le,be}{16,32,64}_t types and updates\nrte_{le,be,cpu}_to_{le,be,cpu}_*() and network header structures\naccordingly.\n\nSpecific big/little endian types avoid uncertainty and conversion mistakes.\n\nNo ABI change since these are simply typedefs to the original types.\n\nSigned-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>\n---\n .../common/include/generic/rte_byteorder.h         | 31 +++++++++++-------\n lib/librte_net/rte_arp.h                           | 15 +++++----\n lib/librte_net/rte_ether.h                         | 10 +++---\n lib/librte_net/rte_gre.h                           | 30 ++++++++---------\n lib/librte_net/rte_icmp.h                          | 11 ++++---\n lib/librte_net/rte_ip.h                            | 38 +++++++++++-----------\n lib/librte_net/rte_net.c                           | 10 +++---\n lib/librte_net/rte_sctp.h                          |  9 ++---\n lib/librte_net/rte_tcp.h                           | 19 ++++++-----\n lib/librte_net/rte_udp.h                           |  9 ++---\n 10 files changed, 97 insertions(+), 85 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/include/generic/rte_byteorder.h b/lib/librte_eal/common/include/generic/rte_byteorder.h\nindex e00bccb..059c2a5 100644\n--- a/lib/librte_eal/common/include/generic/rte_byteorder.h\n+++ b/lib/librte_eal/common/include/generic/rte_byteorder.h\n@@ -75,6 +75,13 @@\n #define RTE_BYTE_ORDER RTE_LITTLE_ENDIAN\n #endif\n \n+typedef uint16_t rte_be16_t;\n+typedef uint32_t rte_be32_t;\n+typedef uint64_t rte_be64_t;\n+typedef uint16_t rte_le16_t;\n+typedef uint32_t rte_le32_t;\n+typedef uint64_t rte_le64_t;\n+\n /*\n  * An internal function to swap bytes in a 16-bit value.\n  *\n@@ -143,65 +150,65 @@ static uint64_t rte_bswap64(uint64_t x);\n /**\n  * Convert a 16-bit value from CPU order to little endian.\n  */\n-static uint16_t rte_cpu_to_le_16(uint16_t x);\n+static rte_le16_t rte_cpu_to_le_16(uint16_t x);\n \n /**\n  * Convert a 32-bit value from CPU order to little endian.\n  */\n-static uint32_t rte_cpu_to_le_32(uint32_t x);\n+static rte_le32_t rte_cpu_to_le_32(uint32_t x);\n \n /**\n  * Convert a 64-bit value from CPU order to little endian.\n  */\n-static uint64_t rte_cpu_to_le_64(uint64_t x);\n+static rte_le64_t rte_cpu_to_le_64(uint64_t x);\n \n \n /**\n  * Convert a 16-bit value from CPU order to big endian.\n  */\n-static uint16_t rte_cpu_to_be_16(uint16_t x);\n+static rte_be16_t rte_cpu_to_be_16(uint16_t x);\n \n /**\n  * Convert a 32-bit value from CPU order to big endian.\n  */\n-static uint32_t rte_cpu_to_be_32(uint32_t x);\n+static rte_be32_t rte_cpu_to_be_32(uint32_t x);\n \n /**\n  * Convert a 64-bit value from CPU order to big endian.\n  */\n-static uint64_t rte_cpu_to_be_64(uint64_t x);\n+static rte_be64_t rte_cpu_to_be_64(uint64_t x);\n \n \n /**\n  * Convert a 16-bit value from little endian to CPU order.\n  */\n-static uint16_t rte_le_to_cpu_16(uint16_t x);\n+static uint16_t rte_le_to_cpu_16(rte_le16_t x);\n \n /**\n  * Convert a 32-bit value from little endian to CPU order.\n  */\n-static uint32_t rte_le_to_cpu_32(uint32_t x);\n+static uint32_t rte_le_to_cpu_32(rte_le32_t x);\n \n /**\n  * Convert a 64-bit value from little endian to CPU order.\n  */\n-static uint64_t rte_le_to_cpu_64(uint64_t x);\n+static uint64_t rte_le_to_cpu_64(rte_le64_t x);\n \n \n /**\n  * Convert a 16-bit value from big endian to CPU order.\n  */\n-static uint16_t rte_be_to_cpu_16(uint16_t x);\n+static uint16_t rte_be_to_cpu_16(rte_be16_t x);\n \n /**\n  * Convert a 32-bit value from big endian to CPU order.\n  */\n-static uint32_t rte_be_to_cpu_32(uint32_t x);\n+static uint32_t rte_be_to_cpu_32(rte_be32_t x);\n \n /**\n  * Convert a 64-bit value from big endian to CPU order.\n  */\n-static uint64_t rte_be_to_cpu_64(uint64_t x);\n+static uint64_t rte_be_to_cpu_64(rte_be64_t x);\n \n #endif /* __DOXYGEN__ */\n \ndiff --git a/lib/librte_net/rte_arp.h b/lib/librte_net/rte_arp.h\nindex 1836418..95f123e 100644\n--- a/lib/librte_net/rte_arp.h\n+++ b/lib/librte_net/rte_arp.h\n@@ -40,6 +40,7 @@\n \n #include <stdint.h>\n #include <rte_ether.h>\n+#include <rte_byteorder.h>\n \n #ifdef __cplusplus\n extern \"C\" {\n@@ -50,22 +51,22 @@ extern \"C\" {\n  */\n struct arp_ipv4 {\n \tstruct ether_addr arp_sha;  /**< sender hardware address */\n-\tuint32_t          arp_sip;  /**< sender IP address */\n+\trte_be32_t        arp_sip;  /**< sender IP address */\n \tstruct ether_addr arp_tha;  /**< target hardware address */\n-\tuint32_t          arp_tip;  /**< target IP address */\n+\trte_be32_t        arp_tip;  /**< target IP address */\n } __attribute__((__packed__));\n \n /**\n  * ARP header.\n  */\n struct arp_hdr {\n-\tuint16_t arp_hrd;    /* format of hardware address */\n+\trte_be16_t arp_hrd;  /* format of hardware address */\n #define ARP_HRD_ETHER     1  /* ARP Ethernet address format */\n \n-\tuint16_t arp_pro;    /* format of protocol address */\n-\tuint8_t  arp_hln;    /* length of hardware address */\n-\tuint8_t  arp_pln;    /* length of protocol address */\n-\tuint16_t arp_op;     /* ARP opcode (command) */\n+\trte_be16_t arp_pro;  /* format of protocol address */\n+\tuint8_t    arp_hln;  /* length of hardware address */\n+\tuint8_t    arp_pln;  /* length of protocol address */\n+\trte_be16_t arp_op;   /* ARP opcode (command) */\n #define\tARP_OP_REQUEST    1 /* request to resolve address */\n #define\tARP_OP_REPLY      2 /* response to previous request */\n #define\tARP_OP_REVREQUEST 3 /* request proto addr given hardware */\ndiff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h\nindex ff3d065..159e061 100644\n--- a/lib/librte_net/rte_ether.h\n+++ b/lib/librte_net/rte_ether.h\n@@ -300,7 +300,7 @@ ether_format_addr(char *buf, uint16_t size,\n struct ether_hdr {\n \tstruct ether_addr d_addr; /**< Destination address. */\n \tstruct ether_addr s_addr; /**< Source address. */\n-\tuint16_t ether_type;      /**< Frame type. */\n+\trte_be16_t ether_type;    /**< Frame type. */\n } __attribute__((__packed__));\n \n /**\n@@ -309,8 +309,8 @@ struct ether_hdr {\n  * of the encapsulated frame.\n  */\n struct vlan_hdr {\n-\tuint16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */\n-\tuint16_t eth_proto;/**< Ethernet type of encapsulated frame. */\n+\trte_be16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */\n+\trte_be16_t eth_proto;/**< Ethernet type of encapsulated frame. */\n } __attribute__((__packed__));\n \n /**\n@@ -319,8 +319,8 @@ struct vlan_hdr {\n  * Reserved fields (24 bits and 8 bits)\n  */\n struct vxlan_hdr {\n-\tuint32_t vx_flags; /**< flag (8) + Reserved (24). */\n-\tuint32_t vx_vni;   /**< VNI (24) + Reserved (8). */\n+\trte_be32_t vx_flags; /**< flag (8) + Reserved (24). */\n+\trte_be32_t vx_vni;   /**< VNI (24) + Reserved (8). */\n } __attribute__((__packed__));\n \n /* Ethernet frame types */\ndiff --git a/lib/librte_net/rte_gre.h b/lib/librte_net/rte_gre.h\nindex 46568ff..b651af0 100644\n--- a/lib/librte_net/rte_gre.h\n+++ b/lib/librte_net/rte_gre.h\n@@ -45,23 +45,23 @@ extern \"C\" {\n  */\n struct gre_hdr {\n #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN\n-\tuint16_t res2:4; /**< Reserved */\n-\tuint16_t s:1;    /**< Sequence Number Present bit */\n-\tuint16_t k:1;    /**< Key Present bit */\n-\tuint16_t res1:1; /**< Reserved */\n-\tuint16_t c:1;    /**< Checksum Present bit */\n-\tuint16_t ver:3;  /**< Version Number */\n-\tuint16_t res3:5; /**< Reserved */\n+\tuint16_t res2:4;  /**< Reserved */\n+\tuint16_t s:1;     /**< Sequence Number Present bit */\n+\tuint16_t k:1;     /**< Key Present bit */\n+\tuint16_t res1:1;  /**< Reserved */\n+\tuint16_t c:1;     /**< Checksum Present bit */\n+\tuint16_t ver:3;   /**< Version Number */\n+\tuint16_t res3:5;  /**< Reserved */\n #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN\n-\tuint16_t c:1;    /**< Checksum Present bit */\n-\tuint16_t res1:1; /**< Reserved */\n-\tuint16_t k:1;    /**< Key Present bit */\n-\tuint16_t s:1;    /**< Sequence Number Present bit */\n-\tuint16_t res2:4; /**< Reserved */\n-\tuint16_t res3:5; /**< Reserved */\n-\tuint16_t ver:3;  /**< Version Number */\n+\tuint16_t c:1;     /**< Checksum Present bit */\n+\tuint16_t res1:1;  /**< Reserved */\n+\tuint16_t k:1;     /**< Key Present bit */\n+\tuint16_t s:1;     /**< Sequence Number Present bit */\n+\tuint16_t res2:4;  /**< Reserved */\n+\tuint16_t res3:5;  /**< Reserved */\n+\tuint16_t ver:3;   /**< Version Number */\n #endif\n-\tuint16_t proto;  /**< Protocol Type */\n+\trte_be16_t proto; /**< Protocol Type */\n } __attribute__((__packed__));\n \n #ifdef __cplusplus\ndiff --git a/lib/librte_net/rte_icmp.h b/lib/librte_net/rte_icmp.h\nindex 8b287f6..81bd907 100644\n--- a/lib/librte_net/rte_icmp.h\n+++ b/lib/librte_net/rte_icmp.h\n@@ -74,6 +74,7 @@\n  */\n \n #include <stdint.h>\n+#include <rte_byteorder.h>\n \n #ifdef __cplusplus\n extern \"C\" {\n@@ -83,11 +84,11 @@ extern \"C\" {\n  * ICMP Header\n  */\n struct icmp_hdr {\n-\tuint8_t  icmp_type;   /* ICMP packet type. */\n-\tuint8_t  icmp_code;   /* ICMP packet code. */\n-\tuint16_t icmp_cksum;  /* ICMP packet checksum. */\n-\tuint16_t icmp_ident;  /* ICMP packet identifier. */\n-\tuint16_t icmp_seq_nb; /* ICMP packet sequence number. */\n+\tuint8_t  icmp_type;     /* ICMP packet type. */\n+\tuint8_t  icmp_code;     /* ICMP packet code. */\n+\trte_be16_t icmp_cksum;  /* ICMP packet checksum. */\n+\trte_be16_t icmp_ident;  /* ICMP packet identifier. */\n+\trte_be16_t icmp_seq_nb; /* ICMP packet sequence number. */\n } __attribute__((__packed__));\n \n /* ICMP packet types */\ndiff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h\nindex 4491b86..6f7da36 100644\n--- a/lib/librte_net/rte_ip.h\n+++ b/lib/librte_net/rte_ip.h\n@@ -93,14 +93,14 @@ extern \"C\" {\n struct ipv4_hdr {\n \tuint8_t  version_ihl;\t\t/**< version and header length */\n \tuint8_t  type_of_service;\t/**< type of service */\n-\tuint16_t total_length;\t\t/**< length of packet */\n-\tuint16_t packet_id;\t\t/**< packet ID */\n-\tuint16_t fragment_offset;\t/**< fragmentation offset */\n+\trte_be16_t total_length;\t/**< length of packet */\n+\trte_be16_t packet_id;\t\t/**< packet ID */\n+\trte_be16_t fragment_offset;\t/**< fragmentation offset */\n \tuint8_t  time_to_live;\t\t/**< time to live */\n \tuint8_t  next_proto_id;\t\t/**< protocol ID */\n-\tuint16_t hdr_checksum;\t\t/**< header checksum */\n-\tuint32_t src_addr;\t\t/**< source address */\n-\tuint32_t dst_addr;\t\t/**< destination address */\n+\trte_be16_t hdr_checksum;\t/**< header checksum */\n+\trte_be32_t src_addr;\t\t/**< source address */\n+\trte_be32_t dst_addr;\t\t/**< destination address */\n } __attribute__((__packed__));\n \n /** Create IPv4 address */\n@@ -340,11 +340,11 @@ static inline uint16_t\n rte_ipv4_phdr_cksum(const struct ipv4_hdr *ipv4_hdr, uint64_t ol_flags)\n {\n \tstruct ipv4_psd_header {\n-\t\tuint32_t src_addr; /* IP address of source host. */\n-\t\tuint32_t dst_addr; /* IP address of destination host. */\n-\t\tuint8_t  zero;     /* zero. */\n-\t\tuint8_t  proto;    /* L4 protocol type. */\n-\t\tuint16_t len;      /* L4 length. */\n+\t\trte_be32_t src_addr; /* IP address of source host. */\n+\t\trte_be32_t dst_addr; /* IP address of destination host. */\n+\t\tuint8_t    zero;     /* zero. */\n+\t\tuint8_t    proto;    /* L4 protocol type. */\n+\t\trte_be16_t len;      /* L4 length. */\n \t} psd_hdr;\n \n \tpsd_hdr.src_addr = ipv4_hdr->src_addr;\n@@ -398,12 +398,12 @@ rte_ipv4_udptcp_cksum(const struct ipv4_hdr *ipv4_hdr, const void *l4_hdr)\n  * IPv6 Header\n  */\n struct ipv6_hdr {\n-\tuint32_t vtc_flow;     /**< IP version, traffic class & flow label. */\n-\tuint16_t payload_len;  /**< IP packet length - includes sizeof(ip_header). */\n-\tuint8_t  proto;        /**< Protocol, next header. */\n-\tuint8_t  hop_limits;   /**< Hop limits. */\n-\tuint8_t  src_addr[16]; /**< IP address of source host. */\n-\tuint8_t  dst_addr[16]; /**< IP address of destination host(s). */\n+\trte_be32_t vtc_flow;     /**< IP version, traffic class & flow label. */\n+\trte_be16_t payload_len;  /**< IP packet length - includes sizeof(ip_header). */\n+\tuint8_t    proto;        /**< Protocol, next header. */\n+\tuint8_t    hop_limits;   /**< Hop limits. */\n+\tuint8_t    src_addr[16]; /**< IP address of source host. */\n+\tuint8_t    dst_addr[16]; /**< IP address of destination host(s). */\n } __attribute__((__packed__));\n \n /**\n@@ -427,8 +427,8 @@ rte_ipv6_phdr_cksum(const struct ipv6_hdr *ipv6_hdr, uint64_t ol_flags)\n {\n \tuint32_t sum;\n \tstruct {\n-\t\tuint32_t len;   /* L4 length. */\n-\t\tuint32_t proto; /* L4 protocol - top 3 bytes must be zero */\n+\t\trte_be32_t len;   /* L4 length. */\n+\t\trte_be32_t proto; /* L4 protocol - top 3 bytes must be zero */\n \t} psd_hdr;\n \n \tpsd_hdr.proto = (ipv6_hdr->proto << 24);\ndiff --git a/lib/librte_net/rte_net.c b/lib/librte_net/rte_net.c\nindex a8c7aff..9014ca5 100644\n--- a/lib/librte_net/rte_net.c\n+++ b/lib/librte_net/rte_net.c\n@@ -153,8 +153,8 @@ ptype_inner_l4(uint8_t proto)\n \n /* get the tunnel packet type if any, update proto and off. */\n static uint32_t\n-ptype_tunnel(uint16_t *proto, const struct rte_mbuf *m,\n-\tuint32_t *off)\n+ptype_tunnel(rte_be16_t *proto, const struct rte_mbuf *m,\n+\t     uint32_t *off)\n {\n \tswitch (*proto) {\n \tcase IPPROTO_GRE: {\n@@ -208,8 +208,8 @@ ip4_hlen(const struct ipv4_hdr *hdr)\n \n /* parse ipv6 extended headers, update offset and return next proto */\n static uint16_t\n-skip_ip6_ext(uint16_t proto, const struct rte_mbuf *m, uint32_t *off,\n-\tint *frag)\n+skip_ip6_ext(rte_be16_t proto, const struct rte_mbuf *m, uint32_t *off,\n+\t     int *frag)\n {\n \tstruct ext_hdr {\n \t\tuint8_t next_hdr;\n@@ -261,7 +261,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,\n \tstruct ether_hdr eh_copy;\n \tuint32_t pkt_type = RTE_PTYPE_L2_ETHER;\n \tuint32_t off = 0;\n-\tuint16_t proto;\n+\trte_be16_t proto;\n \n \tif (hdr_lens == NULL)\n \t\thdr_lens = &local_hdr_lens;\ndiff --git a/lib/librte_net/rte_sctp.h b/lib/librte_net/rte_sctp.h\nindex 688e126..8c646c7 100644\n--- a/lib/librte_net/rte_sctp.h\n+++ b/lib/librte_net/rte_sctp.h\n@@ -81,15 +81,16 @@ extern \"C\" {\n #endif\n \n #include <stdint.h>\n+#include <rte_byteorder.h>\n \n /**\n  * SCTP Header\n  */\n struct sctp_hdr {\n-\tuint16_t src_port; /**< Source port. */\n-\tuint16_t dst_port; /**< Destin port. */\n-\tuint32_t tag;      /**< Validation tag. */\n-\tuint32_t cksum;    /**< Checksum. */\n+\trte_be16_t src_port; /**< Source port. */\n+\trte_be16_t dst_port; /**< Destin port. */\n+\trte_be32_t tag;      /**< Validation tag. */\n+\trte_le32_t cksum;    /**< Checksum. */\n } __attribute__((__packed__));\n \n #ifdef __cplusplus\ndiff --git a/lib/librte_net/rte_tcp.h b/lib/librte_net/rte_tcp.h\nindex 28b61e6..545d4ab 100644\n--- a/lib/librte_net/rte_tcp.h\n+++ b/lib/librte_net/rte_tcp.h\n@@ -77,6 +77,7 @@\n  */\n \n #include <stdint.h>\n+#include <rte_byteorder.h>\n \n #ifdef __cplusplus\n extern \"C\" {\n@@ -86,15 +87,15 @@ extern \"C\" {\n  * TCP Header\n  */\n struct tcp_hdr {\n-\tuint16_t src_port;  /**< TCP source port. */\n-\tuint16_t dst_port;  /**< TCP destination port. */\n-\tuint32_t sent_seq;  /**< TX data sequence number. */\n-\tuint32_t recv_ack;  /**< RX data acknowledgement sequence number. */\n-\tuint8_t  data_off;  /**< Data offset. */\n-\tuint8_t  tcp_flags; /**< TCP flags */\n-\tuint16_t rx_win;    /**< RX flow control window. */\n-\tuint16_t cksum;     /**< TCP checksum. */\n-\tuint16_t tcp_urp;   /**< TCP urgent pointer, if any. */\n+\trte_be16_t src_port;  /**< TCP source port. */\n+\trte_be16_t dst_port;  /**< TCP destination port. */\n+\trte_be32_t sent_seq;  /**< TX data sequence number. */\n+\trte_be32_t recv_ack;  /**< RX data acknowledgement sequence number. */\n+\tuint8_t    data_off;  /**< Data offset. */\n+\tuint8_t    tcp_flags; /**< TCP flags */\n+\trte_be16_t rx_win;    /**< RX flow control window. */\n+\trte_be16_t cksum;     /**< TCP checksum. */\n+\trte_be16_t tcp_urp;   /**< TCP urgent pointer, if any. */\n } __attribute__((__packed__));\n \n #ifdef __cplusplus\ndiff --git a/lib/librte_net/rte_udp.h b/lib/librte_net/rte_udp.h\nindex bc5be4a..89fdded 100644\n--- a/lib/librte_net/rte_udp.h\n+++ b/lib/librte_net/rte_udp.h\n@@ -77,6 +77,7 @@\n  */\n \n #include <stdint.h>\n+#include <rte_byteorder.h>\n \n #ifdef __cplusplus\n extern \"C\" {\n@@ -86,10 +87,10 @@ extern \"C\" {\n  * UDP Header\n  */\n struct udp_hdr {\n-\tuint16_t src_port;    /**< UDP source port. */\n-\tuint16_t dst_port;    /**< UDP destination port. */\n-\tuint16_t dgram_len;   /**< UDP datagram length */\n-\tuint16_t dgram_cksum; /**< UDP datagram checksum */\n+\trte_be16_t src_port;    /**< UDP source port. */\n+\trte_be16_t dst_port;    /**< UDP destination port. */\n+\trte_be16_t dgram_len;   /**< UDP datagram length */\n+\trte_be16_t dgram_cksum; /**< UDP datagram checksum */\n } __attribute__((__packed__));\n \n #ifdef __cplusplus\n",
    "prefixes": [
        "dpdk-dev"
    ]
}