Received: by 10.192.165.148 with SMTP id m20csp477980imm; Fri, 27 Apr 2018 02:13:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoaiqfL7bRAfgiHAll9TW9bXxzyfwDorW8jRPq/UkAnymSMN1wq16fFQu69cOcH72YTr9DL X-Received: by 2002:a17:902:7684:: with SMTP id m4-v6mr1569512pll.340.1524820396262; Fri, 27 Apr 2018 02:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524820396; cv=none; d=google.com; s=arc-20160816; b=w6XCbnFH/jELAYytJDMaTDOkxSe+QdQeTUUBom4eO5W40qmeDmWosiXYBUTsBHMQfq YBory57gFkPjWwKjPmXt7j97Z45tircjCS2fYnlQphydLAWCTYh03IpQpTryaYunpENf 5btgVItrOZwVoD37Fi2d35up19bZYQpjjcsRFADzoWL9dQNKN0NMEz6VS87JtkQfil4Q P3ehTBbT4ixd73qm4DcUL9gETOj7s5Q3LXmtufF46l4/JrFxeMSzm7bRGzhdCexT7p9u 2q2JxBPJgP0XjI2q9a8nQQ7IZIg3Rvs6np1pl92ctKxGWq0urOQD1l0iYuUnV0zEM0eH kC6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=8Vfv8lNBjhejnKBWFpoolKTNDwfHqgxzUdDMUv/9ClM=; b=HVevZS3CTa+bPiHvgoXqnjkoCuIfR/QEM2T/tR+Bj6AMOliB8nrT95eupDhgYaxQQ0 jgVnu3z8y3BaySVb1W4RcxY1lm9tXIoiF9aHmlkVn28aiwSPJl8rBxHvJcxGHVeSYKuO KP/FcEqA5SijVW7YYNTItdFZIrGmVj2SPeMzORWCIIhOQ7A4S+UWO0a6M1UhKw0hk6Zr dFHMCKpHWEhtsVDYN36VUNIQ9PJvhxf5EPFrxTDDxkpdgxuB/eE9iyn/mtSvJNj/Q+sk LIfHxoGHclHLkbLV2HJXCFsOl/r64hKd0RE8dYhY4sWwSDmgjBW1To/ltmbaUoD5cFsI Oc2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186si921666pfl.155.2018.04.27.02.13.02; Fri, 27 Apr 2018 02:13:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932471AbeD0JLy (ORCPT + 99 others); Fri, 27 Apr 2018 05:11:54 -0400 Received: from mga01.intel.com ([192.55.52.88]:61521 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932430AbeD0JLu (ORCPT ); Fri, 27 Apr 2018 05:11:50 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 02:11:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,334,1520924400"; d="scan'208";a="194829847" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.164]) by orsmga004.jf.intel.com with ESMTP; 27 Apr 2018 02:11:48 -0700 Date: Fri, 27 Apr 2018 17:12:34 +0800 From: Tiwei Bie To: Jason Wang Cc: "Michael S. Tsirkin" , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, wexu@redhat.com, jfreimann@redhat.com Subject: Re: [RFC v3 0/5] virtio: support packed ring Message-ID: <20180427091234.n6vr3wcnbnqxd3so@debian> References: <20180425051550.24342-1-tiwei.bie@intel.com> <5ad1ca01-1e5c-7105-f303-7e8d42f6a068@redhat.com> <20180427071725-mutt-send-email-mst@kernel.org> <5c712aa2-f00e-b472-cdfc-48175aea790d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5c712aa2-f00e-b472-cdfc-48175aea790d@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 27, 2018 at 02:17:51PM +0800, Jason Wang wrote: > On 2018年04月27日 12:18, Michael S. Tsirkin wrote: > > On Fri, Apr 27, 2018 at 11:56:05AM +0800, Jason Wang wrote: > > > On 2018年04月25日 13:15, Tiwei Bie wrote: > > > > Hello everyone, > > > > > > > > This RFC implements packed ring support in virtio driver. > > > > > > > > Some simple functional tests have been done with Jason's > > > > packed ring implementation in vhost: > > > > > > > > https://lkml.org/lkml/2018/4/23/12 > > > > > > > > Both of ping and netperf worked as expected (with EVENT_IDX > > > > disabled). But there are below known issues: > > > > > > > > 1. Reloading the guest driver will break the Tx/Rx; > > > Will have a look at this issue. > > > > > > > 2. Zeroing the flags when detaching a used desc will > > > > break the guest -> host path. > > > I still think zeroing flags is unnecessary or even a bug. At host, I track > > > last observed avail wrap counter and detect avail like (what is suggested in > > > the example code in the spec): > > > > > > static bool desc_is_avail(struct vhost_virtqueue *vq, __virtio16 flags) > > > { > > >        bool avail = flags & cpu_to_vhost16(vq, DESC_AVAIL); > > > > > >        return avail == vq->avail_wrap_counter; > > > } > > > > > > So zeroing wrap can not work with this obviously. > > > > > > Thanks > > I agree. I think what one should do is flip the available bit. > > > > But is this flipping a must? > > Thanks Yeah, that's my question too. It seems to be a requirement for driver that, the only change to the desc status that a driver can do during running is to mark the desc as avail, and any other changes to the desc status are not allowed. Similarly, the device can only mark the desc as used, and any other changes to the desc status are also not allowed. So the question is, are there such requirements? Based on below contents in the spec: """ Thus VIRTQ_DESC_F_AVAIL and VIRTQ_DESC_F_USED bits are different for an available descriptor and equal for a used descriptor. Note that this observation is mostly useful for sanity-checking as these are necessary but not sufficient conditions """ It seems that, it's necessary for devices to check whether the AVAIL bit and USED bit are different. Best regards, Tiwei Bie