[dpdk-dev] [PATCH v3 3/3] vhost: access VhostUsrMsg via packed struct

Yuanhan Liu yuanhan.liu at linux.intel.com
Fri May 26 07:58:40 CEST 2017


On Wed, May 24, 2017 at 01:12:07PM +0000, Stojaczyk, DariuszX wrote:
> > This is for fixing compile warnings with new clang 4.0?
> > 
> >     http://dpdk.org/ml/archives/dev/2017-April/064089.html
> > 
> > If so, please show the exact warning in the commit log.
> > 
> 
> Everything compiles, but is undefined behavior.

Would you be a bit more informative about the "undefined behavior"? This
patch set (including this one) looks good to me. I just want the commit
log be more informative. Something like "Fixes unaligned access to fields"
is a bit too vague.

Thanks.

	--yliu

>  Accessing packed struct's fields through pointers would have to be done as following:
> e.g vhost_user_set_vring_addr(struct virtio_net *dev, struct vhost_vring_addr *addr __attribute__((aligned(1)))
> Since the code above is unacceptable, this patch makes all functions take pointer to the parent struct (VhostUserMsg)
> 
> > >
> > > Signed-off-by: Daniel Verkamp <daniel.verkamp at intel.com>
> > > Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk at intel.com>
> > > ---
> > > Fixed checkpatch warnings
> > 
> > It's likely it will be easily missed while review. We normally do that:
> > 
> > ---
> > 
> > v3: fix checkpatch warnings
> > 
> > v2: remove gerrit id
> > 
> > 	--yliu
> 
> Thanks, I'll stick with it from now on


More information about the dev mailing list