[dpdk-dev] [PATCH v2] virtio: fix modify drv_flags for specific device

Tan, Jianfeng jianfeng.tan at intel.com
Mon May 9 11:14:41 CEST 2016


Hi David and Yuanhan,

> -----Original Message-----
> From: Yuanhan Liu [mailto:yuanhan.liu at linux.intel.com]
> Sent: Thursday, May 5, 2016 7:18 AM
> To: Tan, Jianfeng
> Cc: David Marchand; dev at dpdk.org; Xie, Huawei
> Subject: Re: [PATCH v2] virtio: fix modify drv_flags for specific device
> 
> On Tue, May 03, 2016 at 10:05:01AM +0200, David Marchand wrote:
> > Hello Tan,
> >
> > On Thu, Apr 28, 2016 at 8:08 PM, Jianfeng Tan <jianfeng.tan at intel.com>
> wrote:
> > > Issue: virtio's drv_flags are decided by devices types (modern vs legacy),
> > > and which kernel driver is used, and the negotiated features (especially
> > > VIRTIO_NET_STATUS) with backend, which makes it possible to multiple
> > > virtio devices have different versions of drv_flags, but this variable
> > > is currently shared by each virtio device.
> >
> > The wording is a bit strange, maybe the sentence is a bit too long.
> 
> Agreed.
> 
> Besides that, it just described the fact that we are sharing one
> flag for all virtio devices, but it didn't state what's wrong with
> it, and what's the per-device flag for. From this point of view,
> I don't think you are actually solving an "issue", as I don't see
> one from your description.
> 
> > But the rest looks good to me.
> >
> > Acked-by: David Marchand <david.marchand at 6wind.com>
> 
> Thanks for the review.
> 
> 	--yliu

Thank you for review and comment. How about change the commit message like this:

   The virtio PMD's drv_flags, which is shared by all virtio devices,
    is set and referred for per-device purpose. One side, we should not
    arbitrarily set drv_flags when each virtio device is initialized.
    This disobeys the semantics of _shared_. On the other side, we
    refer drv_flags instead of dev_flags for per-device purpose. When
    two virtio devices have different flags, it may lead to wrong
    result. Then some unexpected behaviors happen, such as virtio would
    set irq config when it's not supported.
    
    How to fix: change to set and refer dev_flags, which stores
    device-specific flags.

Thanks,
Jianfeng


More information about the dev mailing list