DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Qiu, Michael" <michael.qiu@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: root <root@localhost.localdomain>
Subject: Re: [dpdk-dev] [PATCH] ip_pipeline: Fix compile issue with strict-aliasing
Date: Wed, 9 Dec 2015 08:41:45 +0000	[thread overview]
Message-ID: <533710CFB86FA344BFBF2D6802E6028621B97233@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1449650429-25336-1-git-send-email-michael.qiu@intel.com>

Sorry please ignore this :)

Thanks,
Michael

-----Original Message-----
From: Qiu, Michael 
Sent: Wednesday, December 9, 2015 4:40 PM
To: dev@dpdk.org
Cc: Singh, Jasvinder; Dumitrescu, Cristian; root; Qiu, Michael
Subject: [PATCH] ip_pipeline: Fix compile issue with strict-aliasing

From: root <root@localhost.localdomain>

strict-aliasing

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
 .../ip_pipeline/pipeline/pipeline_routing_be.c     |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/examples/ip_pipeline/pipeline/pipeline_routing_be.c b/examples/ip_pipeline/pipeline/pipeline_routing_be.c
index 4a95c7d..9baabd0 100644
--- a/examples/ip_pipeline/pipeline/pipeline_routing_be.c
+++ b/examples/ip_pipeline/pipeline/pipeline_routing_be.c
@@ -1461,8 +1461,7 @@ pipeline_routing_msg_req_route_add_handler(struct pipeline *p, void *msg)
 		uint64_t macaddr_dst;
 		uint64_t ethertype = ETHER_TYPE_IPv4;
 
-		*((struct ether_addr *) &macaddr_dst) =
-			req->data.ethernet.macaddr;
+		macaddr_dst = *((uint64_t *)&(req->data.ethernet.macaddr));
 		macaddr_dst = rte_bswap64(macaddr_dst << 16);
 
 		entry_arp0.slab[0] =
@@ -1503,8 +1502,7 @@ pipeline_routing_msg_req_route_add_handler(struct pipeline *p, void *msg)
 		uint64_t svlan = req->data.l2.qinq.svlan;
 		uint64_t cvlan = req->data.l2.qinq.cvlan;
 
-		*((struct ether_addr *) &macaddr_dst) =
-			req->data.ethernet.macaddr;
+		macaddr_dst = *((uint64_t *)&(req->data.ethernet.macaddr));
 		macaddr_dst = rte_bswap64(macaddr_dst << 16);
 
 		entry_arp0.slab[0] = rte_bswap64((svlan << 48) | @@ -1563,8 +1561,7 @@ pipeline_routing_msg_req_route_add_handler(struct pipeline *p, void *msg)
 		uint64_t label3 = req->data.l2.mpls.labels[3];
 		uint32_t n_labels = req->data.l2.mpls.n_labels;
 
-		*((struct ether_addr *) &macaddr_dst) =
-			req->data.ethernet.macaddr;
+		macaddr_dst = *((uint64_t *)&(req->data.ethernet.macaddr));
 		macaddr_dst = rte_bswap64(macaddr_dst << 16);
 
 		switch (n_labels) {
@@ -1814,7 +1811,7 @@ pipeline_routing_msg_req_arp_add_handler(struct pipeline *p, void *msg)
 		return rsp;
 	}
 
-	*((struct ether_addr *) &entry.macaddr) = req->macaddr;
+	entry.macaddr = *((uint64_t *)&(req->macaddr));
 	entry.macaddr = entry.macaddr << 16;
 
 	rsp->status = rte_pipeline_table_entry_add(p->p,
--
1.7.1

      reply	other threads:[~2015-12-09  8:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09  8:40 Michael Qiu
2015-12-09  8:41 ` Qiu, Michael [this message]

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=533710CFB86FA344BFBF2D6802E6028621B97233@SHSMSX101.ccr.corp.intel.com \
    --to=michael.qiu@intel.com \
    --cc=dev@dpdk.org \
    --cc=root@localhost.localdomain \
    /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).