Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5678697ybg; Tue, 22 Oct 2019 06:54:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOdk1bx8NPzZPyyDx3koBkifx/u4OPQnoxTSnMGJeTi64DyTU5GoNWo0ZXndHacDV63P2N X-Received: by 2002:a17:906:4448:: with SMTP id i8mr26664798ejp.298.1571752452871; Tue, 22 Oct 2019 06:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571752452; cv=none; d=google.com; s=arc-20160816; b=r3cV7Nas/cSmh/puWMoobSETfo0U8Aty/qPfkxVcb9fsrGenNDqj4C00ctB9IAe8qw XjidhZOPgRfP9tTM3hJNJZ59656xnchL1iw7BEZQOGEO5XMJektEhCtWgVUrmVMFm3AR vpkWSzKkEwE/Rgt9y0lhCVqDO7tOzPUBe1OuwRNh8celbRDl8nJj4SF65Dr2WEmp1MlR nIx8s5iAeeeJBl8ZbkXfilklvdLRtWnGytvUWhNwAiMEaSDe8GiU+IsYvaukI4mZq955 gx5nwlRl9flCvYxpT3LD2++7AhmeHRgMEdmCU0Eh+CAV98IqgPoWV0TDh0/K3SFufSsD WzRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Syfd0H8D/BZLCngMYW2+8Gfqpo3syPeWg7AigfxOHa0=; b=okFtnu+6j1Xyld/tBkVUkuf//DDcSc3CyTY15vdvR/guToTgTirJ1XDWLoDIGMfdY/ NCZ7iogcY8RECDbx6hT4hIOGDeG14+E9N7KX3LFTwKlSU5ge1+e2Np8KvSpo5QD6dNNt PqVtf+oqGO2wzj3iRNfgu3C80OB+4mQeOfKgYYPu0VPD3e1aQZlGLYiyXUxtwzycPw4O 4E8J3Phe+ZxFVozCcKL2rhkp1iVDFMTy6gJLrD50sSTsPtx3fgNcpMd4/w2H44+0BgR9 wQuzamcH6tEZFRzamw5sfOXysx0FDgCYDfLGyzgxDRYulefTRWEUPybR6l5/TwqyAbvJ McDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T7IdaOvN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b28si3797884edn.230.2019.10.22.06.53.48; Tue, 22 Oct 2019 06:54:12 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T7IdaOvN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731971AbfJVNG2 (ORCPT + 99 others); Tue, 22 Oct 2019 09:06:28 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58313 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731804AbfJVNG1 (ORCPT ); Tue, 22 Oct 2019 09:06:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571749585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Syfd0H8D/BZLCngMYW2+8Gfqpo3syPeWg7AigfxOHa0=; b=T7IdaOvNunr1wNsBP9ffS7PduaqV/tkwfalTxTZHSFu2y5t0mfQs8spb0eri7IZW8uUrtV rrb+UFDXuLjq9C914hc/Qfh3z7NWwhFOM7psQZVi80IMd0wQq7xXT9sKS+HmyyHwrji21v YGXIuhVoFUdobL2AKLepAiu27t238w4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-71H0vHNaOHmN2MZTv4qjeg-1; Tue, 22 Oct 2019 09:06:22 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABD6B800D4E; Tue, 22 Oct 2019 13:06:20 +0000 (UTC) Received: from [10.72.12.23] (ovpn-12-23.pek2.redhat.com [10.72.12.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 514B819C69; Tue, 22 Oct 2019 13:06:00 +0000 (UTC) Subject: Re: [RFC 2/2] vhost: IFC VF vdpa layer To: Zhu Lingshan , "Zhu, Lingshan" , mst@redhat.com, alex.williamson@redhat.com Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, netdev@vger.kernel.org, dan.daly@intel.com, cunming.liang@intel.com, tiwei.bie@intel.com, jason.zeng@intel.com, zhiyuan.lv@intel.com References: <20191016013050.3918-1-lingshan.zhu@intel.com> <20191016013050.3918-3-lingshan.zhu@intel.com> <9495331d-3c65-6f49-dcd9-bfdb17054cf0@redhat.com> <1cae60b6-938d-e2df-2dca-fbf545f06853@redhat.com> From: Jason Wang Message-ID: Date: Tue, 22 Oct 2019 21:05:57 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: 71H0vHNaOHmN2MZTv4qjeg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/10/22 =E4=B8=8B=E5=8D=882:53, Zhu Lingshan wrote: > > On 10/21/2019 6:19 PM, Jason Wang wrote: >> >> On 2019/10/21 =E4=B8=8B=E5=8D=885:53, Zhu, Lingshan wrote: >>> >>> On 10/16/2019 6:19 PM, Jason Wang wrote: >>>> >>>> On 2019/10/16 =E4=B8=8A=E5=8D=889:30, Zhu Lingshan wrote: >>>>> This commit introduced IFC VF operations for vdpa, which complys to >>>>> vhost_mdev interfaces, handles IFC VF initialization, >>>>> configuration and removal. >>>>> >>>>> Signed-off-by: Zhu Lingshan >>>>> --- [...] >> >> >>> >>>> >>>> >>>>> +} >>>>> + >>>>> +static int ifcvf_mdev_set_features(struct mdev_device *mdev, u64=20 >>>>> features) >>>>> +{ >>>>> +=C2=A0=C2=A0=C2=A0 struct ifcvf_adapter *adapter =3D mdev_get_drvdat= a(mdev); >>>>> +=C2=A0=C2=A0=C2=A0 struct ifcvf_hw *vf =3D IFC_PRIVATE_TO_VF(adapter= ); >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 vf->req_features =3D features; >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 return 0; >>>>> +} >>>>> + >>>>> +static u64 ifcvf_mdev_get_vq_state(struct mdev_device *mdev, u16=20 >>>>> qid) >>>>> +{ >>>>> +=C2=A0=C2=A0=C2=A0 struct ifcvf_adapter *adapter =3D mdev_get_drvdat= a(mdev); >>>>> +=C2=A0=C2=A0=C2=A0 struct ifcvf_hw *vf =3D IFC_PRIVATE_TO_VF(adapter= ); >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 return vf->vring[qid].last_avail_idx; >>>> >>>> >>>> Does this really work? I'd expect it should be fetched from hw=20 >>>> since it's an internal state. >>> for now, it's working, we intend to support LM in next version drivers. >> >> >> I'm not sure I understand here, I don't see any synchronization=20 >> between the hardware and last_avail_idx, so last_avail_idx should not=20 >> change. >> >> Btw, what did "LM" mean :) ? > > I can add bar IO operations here, LM =3D live migration, sorry for the=20 > abbreviation. Just make sure I understand here, I believe you mean reading=20 last_avail_idx through IO bar here? Thanks