All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Xie, Huawei" <huawei.xie@intel.com>
To: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH] examples/vhost: fix strict aliasing error on gcc 4.4.7
Date: Wed, 9 Dec 2015 09:12:53 +0000	[thread overview]
Message-ID: <C37D651A908B024F974696C65296B57B4BB83588@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: 1449573835-149947-1-git-send-email-pablo.de.lara.guarch@intel.com

On 12/8/2015 7:24 PM, De Lara Guarch, Pablo wrote:
> Fixes following error on gcc 4.4.7:
>
> make: Entering directory `/tmp/dpdk-tmp/examples/vhost'
>   CC main.o
> cc1: warnings being treated as errors
> /tmp/dpdk-tmp/examples/vhost/main.c: In function ‘new_device’:
> /tmp/dpdk-tmp/x86_64-native-linuxapp-gcc/include/rte_ring.h:740: error:
>     dereferencing pointer ‘mbuf.486’ does break strict-aliasing rules
> /tmp/dpdk-tmp/examples/vhost/main.c:1503: note: initialized from here
> ...
> /tmp/dpdk-tmp/examples/vhost/main.c:1503: note: initialized from here
> /tmp/dpdk-tmp/x86_64-native-linuxapp-gcc/include/rte_ring.h:740: error:
>     dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules
> /tmp/dpdk-tmp/examples/vhost/main.c:1804: note: initialized from here
> make[1]: *** [main.o] Error 1
>
> Fixes: d19533e8 ("examples/vhost: copy old vhost example")
>
> Reported-by: Qian Xu <qian.q.xu@intel.com>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
>  examples/vhost/main.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
[...]
>  
> -	rte_ring_sc_dequeue(vpool->ring, (void **)&mbuf);
> +	rte_ring_sc_dequeue(vpool->ring, (void **)&obj);
> +	mbuf = (struct rte_mbuf *)obj;
Is rte_ring_sc_dequeue(vpool->ring, &obj) enough? Applied to the later
enqueue as well.
>  	if (unlikely(mbuf == NULL)) {
[...]
> -		rte_ring_sp_enqueue(vpool->ring, (void *)mbuf);
> +		rte_ring_sp_enqueue(vpool->ring, obj);
>  		return;
>  	}
>  
> @@ -1789,7 +1791,8 @@ virtio_tx_route_zcp(struct virtio_net *dev, struct rte_mbuf *m,
>  {
>  	
[...]
>  	vpool = &vpool_array[MAX_QUEUES + vmdq_rx_q];
> -	rte_ring_sc_dequeue(vpool->ring, (void **)&mbuf);
> +	rte_ring_sc_dequeue(vpool->ring, (void **)&obj);
> +	mbuf = (struct rte_mbuf *) obj;
>  	if (unlikely(mbuf == NULL)) {
>  		struct vhost_virtqueue *vq = dev->virtqueue[VIRTIO_TXQ];
>  		RTE_LOG(ERR, VHOST_DATA,


  reply	other threads:[~2015-12-09  9:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 11:23 [PATCH] examples/vhost: fix strict aliasing error on gcc 4.4.7 Pablo de Lara
2015-12-09  9:12 ` Xie, Huawei [this message]
2015-12-09  9:39 ` [PATCH v2] " Pablo de Lara
2015-12-09 10:32   ` Bruce Richardson
2015-12-09 10:45   ` Xie, Huawei
2015-12-09 10:52     ` De Lara Guarch, Pablo
2015-12-09 11:09   ` [PATCH v3] " Pablo de Lara
2015-12-09 12:20     ` [PATCH v4] Fixes following error on gcc 4.4.7: Pablo de Lara
2015-12-09 13:28       ` Xie, Huawei
2015-12-09 14:01         ` De Lara Guarch, Pablo
2015-12-09 14:12           ` Xie, Huawei
2015-12-09 14:26       ` [PATCH v5] examples/vhost: fix strict aliasing error on gcc 4.4.7 Pablo de Lara
2015-12-09 14:33         ` Xie, Huawei
2015-12-09 20:54           ` Thomas Monjalon

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=C37D651A908B024F974696C65296B57B4BB83588@SHSMSX103.ccr.corp.intel.com \
    --to=huawei.xie@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.