summaryrefslogtreecommitdiff
path: root/lib/librte_ip_frag
diff options
context:
space:
mode:
authorCyril Chemparathy <cchemparathy@ezchip.com>2015-06-22 11:34:19 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-06-24 12:00:41 +0200
commit7621d6a8d0bdb39b58ee7c4176a0f2e920b8113d (patch)
treed2f4d204fb5bf13694fbcd587dd6d4785dbe9190 /lib/librte_ip_frag
parent0052d53df4a407627d58a908bfe348ba5c44d462 (diff)
downloaddpdk-7621d6a8d0bdb39b58ee7c4176a0f2e920b8113d.zip
dpdk-7621d6a8d0bdb39b58ee7c4176a0f2e920b8113d.tar.gz
dpdk-7621d6a8d0bdb39b58ee7c4176a0f2e920b8113d.tar.xz
eal: add and use unaligned integer types
On machines that are strict on pointer alignment, current code breaks on GCC's -Wcast-align checks on casts from narrower to wider types. This patch introduces new unaligned_uint(16|32|64)_t types, which correctly retain alignment in such cases. Strict alignment architectures will need to define CONFIG_RTE_ARCH_STRICT_ALIGN in order to effect these new types. Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Diffstat (limited to 'lib/librte_ip_frag')
-rw-r--r--lib/librte_ip_frag/rte_ipv4_reassembly.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/librte_ip_frag/rte_ipv4_reassembly.c b/lib/librte_ip_frag/rte_ipv4_reassembly.c
index a52f549..dc4d036 100644
--- a/lib/librte_ip_frag/rte_ipv4_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv4_reassembly.c
@@ -120,7 +120,7 @@ rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
{
struct ip_frag_pkt *fp;
struct ip_frag_key key;
- const uint64_t *psd;
+ const unaligned_uint64_t *psd;
uint16_t ip_len;
uint16_t flag_offset, ip_ofs, ip_flag;
@@ -128,7 +128,7 @@ rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
ip_ofs = (uint16_t)(flag_offset & IPV4_HDR_OFFSET_MASK);
ip_flag = (uint16_t)(flag_offset & IPV4_HDR_MF_FLAG);
- psd = (uint64_t *)&ip_hdr->src_addr;
+ psd = (unaligned_uint64_t *)&ip_hdr->src_addr;
/* use first 8 bytes only */
key.src_dst[0] = psd[0];
key.id = ip_hdr->packet_id;