From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 93E752B88 for ; Mon, 9 May 2016 11:14:44 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 09 May 2016 02:14:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,600,1455004800"; d="scan'208";a="975601204" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 09 May 2016 02:14:43 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 May 2016 02:14:43 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.58]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Mon, 9 May 2016 17:14:41 +0800 From: "Tan, Jianfeng" To: Yuanhan Liu CC: David Marchand , "dev@dpdk.org" , "Xie, Huawei" Thread-Topic: [PATCH v2] virtio: fix modify drv_flags for specific device Thread-Index: AQHRoXkOSRSTv67GGUCDbE8fFMm1wZ+mW+2AgAKRgYCAB3WZ0A== Date: Mon, 9 May 2016 09:14:41 +0000 Message-ID: References: <1461637474-110602-1-git-send-email-jianfeng.tan@intel.com> <1461866939-38689-1-git-send-email-jianfeng.tan@intel.com> <20160504231819.GS5641@yliu-dev.sh.intel.com> In-Reply-To: <20160504231819.GS5641@yliu-dev.sh.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] virtio: fix modify drv_flags for specific device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2016 09:14:45 -0000 Hi David and Yuanhan, > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Thursday, May 5, 2016 7:18 AM > To: Tan, Jianfeng > Cc: David Marchand; dev@dpdk.org; Xie, Huawei > Subject: Re: [PATCH v2] virtio: fix modify drv_flags for specific device >=20 > 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 > wrote: > > > Issue: virtio's drv_flags are decided by devices types (modern vs leg= acy), > > > and which kernel driver is used, and the negotiated features (especia= lly > > > VIRTIO_NET_STATUS) with backend, which makes it possible to multiple > > > virtio devices have different versions of drv_flags, but this variabl= e > > > is currently shared by each virtio device. > > > > The wording is a bit strange, maybe the sentence is a bit too long. >=20 > Agreed. >=20 > 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. >=20 > > But the rest looks good to me. > > > > Acked-by: David Marchand >=20 > Thanks for the review. >=20 > --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. =20 How to fix: change to set and refer dev_flags, which stores device-specific flags. Thanks, Jianfeng