From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 0921C2952 for ; Mon, 26 Dec 2016 09:26:15 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 26 Dec 2016 00:26:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,404,1477983600"; d="scan'208";a="1076331244" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 26 Dec 2016 00:26:08 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 26 Dec 2016 00:26:07 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by shsmsx102.ccr.corp.intel.com ([169.254.2.88]) with mapi id 14.03.0248.002; Mon, 26 Dec 2016 16:26:04 +0800 From: "Tan, Jianfeng" To: Yuanhan Liu CC: "dev@dpdk.org" , "Yigit, Ferruh" , "Liang, Cunming" Thread-Topic: [PATCH v2 2/7] net/virtio_user: postpone DRIVER OK notification Thread-Index: AQHSXOwh6zatXPD7HUaAIgPd2FwGzaEZQkKAgACJ2YD//5ClAIAAjD9A Date: Mon, 26 Dec 2016 08:26:03 +0000 Message-ID: References: <1480689075-66977-1-git-send-email-jianfeng.tan@intel.com> <1482477266-39199-1-git-send-email-jianfeng.tan@intel.com> <1482477266-39199-3-git-send-email-jianfeng.tan@intel.com> <20161226062719.GA19288@yliu-dev.sh.intel.com> <20161226080208.GG19288@yliu-dev.sh.intel.com> In-Reply-To: <20161226080208.GG19288@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 2/7] net/virtio_user: postpone DRIVER OK notification X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 08:26:16 -0000 As discussed offline, this will lead to many DRIVER OK among dev_stop()/dev= _start(). I'll remove this patch. Thanks, Jianfeng > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Monday, December 26, 2016 4:02 PM > To: Tan, Jianfeng > Cc: dev@dpdk.org; Yigit, Ferruh; Liang, Cunming > Subject: Re: [PATCH v2 2/7] net/virtio_user: postpone DRIVER OK notificat= ion >=20 > On Mon, Dec 26, 2016 at 06:55:16AM +0000, Tan, Jianfeng wrote: > > > > > > > -----Original Message----- > > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > > Sent: Monday, December 26, 2016 2:27 PM > > > To: Tan, Jianfeng > > > Cc: dev@dpdk.org; Yigit, Ferruh; Liang, Cunming > > > Subject: Re: [PATCH v2 2/7] net/virtio_user: postpone DRIVER OK > notification > > > > > > On Fri, Dec 23, 2016 at 07:14:21AM +0000, Jianfeng Tan wrote: > > > > In driver probe phase, we obtain device information; and then virti= o > > > > driver will initialize device and stores info, like negotiated > > > > features, in vhost_user layer; finally, vhost_user gets DRIVER_OK > > > > notification from virtio driver, and then sync with backend device. > > > > > > > > Previously, DRIVER_OK could be sent twice: 1. when ether layer > invokes > > > > eth_device_init to initialize device; 2. when user configures it wi= th > > > > different configuration from that of previous. > > > > > > Yes, but that's wrong. Now only 1) will be taken. > > > > >From code in virtio_dev_configure() as below, if hw_ip_checksum or > enable_lro is configured, the device will be reset and re-initialized. > > if (rxmode->hw_ip_checksum) > > req_features |=3D (1ULL << VIRTIO_NET_F_GUEST_CSUM); > > if (rxmode->enable_lro) > > req_features |=3D > > (1ULL << VIRTIO_NET_F_GUEST_TSO4) | > > (1ULL << VIRTIO_NET_F_GUEST_TSO6); > > > > /* if request features changed, reinit the device */ > > if (req_features !=3D hw->req_guest_features) { > > ret =3D virtio_init_device(dev, req_features); > > if (ret < 0) > > return ret; > > } >=20 > Yes, I know. But virtio_init_device() will call vtpci_reinit_complete() > at the end, doesn't it? >=20 > > > > Since we can only depend on DRIVER_OK notification to sync with > backend > > > > device, we postpone it to virtio_dev_start when everything is settl= ed. > > > > > > I don't quite understand what you were going to fix here; you don't > > > state it in the commit log after all. Normally, when everything is > > > negotiated (when DRIVER_OK is set), we should not set it again, unles= s > > > a reset has been happened. > > > > I agree that DRIVER_OK should be set only if everything is settled. Und= er > the case of hw_ip_checksum or enable_lro, a reset will be sent and the > device will be re-initialized. > > > > So my point is that since the configuration might be changed in > dev_configure(), why not just send DRIVER_OK after everything is done. > > > > > > > > If you look at QEMU, qemu will simply ignore it once vhost has alread= y > > > started. > > > > It does not apply here. The configuration is changed, and it cannot be > ignored. >=20 > Why it doesn't apply here? What makes virtio_user special? If it works > to QEMU and it doesn't to virtio_user, it basically means the virtio_user > is broken ... >=20 > --yliu