X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_net%2Frte_ip.h;h=292f63fd743f25033f582d969a0b9be6e8b65ec8;hb=54851ff3375c288c1b7aa470f80f1c46749cf095;hp=1ceb7b79312fa47df7ba680c7941a32fb5c914e0;hpb=6c373e935a34eefb4e3fd76c950e8703b7addbec;p=dpdk.git diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h index 1ceb7b7931..292f63fd74 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -41,7 +41,7 @@ struct rte_ipv4_hdr { rte_be16_t hdr_checksum; /**< header checksum */ rte_be32_t src_addr; /**< source address */ rte_be32_t dst_addr; /**< destination address */ -} __attribute__((__packed__)); +} __rte_packed; /** Create IPv4 address */ #define RTE_IPV4(a, b, c, d) ((uint32_t)(((a) & 0xff) << 24) | \ @@ -267,7 +267,7 @@ rte_ipv4_cksum(const struct rte_ipv4_hdr *ipv4_hdr) { uint16_t cksum; cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr)); - return (cksum == 0xffff) ? cksum : (uint16_t)~cksum; + return (uint16_t)~cksum; } /** @@ -360,7 +360,7 @@ struct rte_ipv6_hdr { uint8_t hop_limits; /**< Hop limits. */ uint8_t src_addr[16]; /**< IP address of source host. */ uint8_t dst_addr[16]; /**< IP address of destination host(s). */ -} __attribute__((__packed__)); +} __rte_packed; /* IPv6 vtc_flow: IPv / TC / flow_label */ #define RTE_IPV6_HDR_FL_SHIFT 0 @@ -371,6 +371,8 @@ struct rte_ipv6_hdr { #define RTE_IPV6_HDR_ECN_MASK (0x03 << RTE_IPV6_HDR_TC_SHIFT) #define RTE_IPV6_HDR_ECN_CE RTE_IPV6_HDR_ECN_MASK +#define RTE_IPV6_MIN_MTU 1280 /**< Minimum MTU for IPv6, see RFC 8200. */ + /** * Process the pseudo-header checksum of an IPv6 header. *