Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp420031ybg; Tue, 22 Oct 2019 23:40:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOj8GAteirI86LHGY4Q/lvVdaJIZZ+L4Ou1nIEaOTM2w3zH8blnwAHsrLfksIidkRMO1wc X-Received: by 2002:a17:906:2584:: with SMTP id m4mr31888967ejb.287.1571812856514; Tue, 22 Oct 2019 23:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571812856; cv=none; d=google.com; s=arc-20160816; b=UizC65YjXuQBCuDXWNNo5IKmiJ/Mij4L19E8MA262d91Gg8YWJm1//rSM+KtAuG5DT BcYQkRevxujlqzwzKJOmxKnT3XGqPFz7NyPGU6PZkXaipbZV01pdF0HdIo8II4gwX4xU lwpA1MmD9/ZNfgDk4nNN3H7obVWphFuqjdXpnrtKQawIQklTBNNaP6b4GLSqD0c/OBkJ vSwSvifH5FPAi7/oW+bLgNEJNmbY+aCBfHrzDhVdLqxx42reHKYri6U3+f34NIy7W2Yd StFyTYTBMnIsNR5uV0Kl0sZbiGhM1rZPYJyKHE0oEoxX0jDUjH91ExJgFsJ0wAg5hjwO loNA== 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=JPoAZ12wvzk0gM/LMQmdcsjRqyc3hj/9X0DxYyB3fTs=; b=EhDfy7y6eUa2gLae4c51xg/TyNyWBbV8tjKTvFpPr5SAsBfFFRubxKEUVFBdxLNcp8 H7JYLZ2ob7aqqqbXllTjwKMDB0KF9/H2Nn1nti6n1GI6+r6OiPKWiXfFlQJmawCNc/50 zZ+UnZWfhSNMattZWnoErK/vDgcHOoaugWqDIttvK8l3DD2K+FY0SagJPpjKQ/Cet4sd fWH+z52BcDkcN6yttaft2DMmM1/N/Bia1bryNzRt7gGq6EqbPt+SrvU48DAu7iU38unH wsQj4zphBLaOUP4fL4ChStY16PMMMDsDuL5G5XW7K1fNhKnu3Bt6W16c9BWs4ivda59X BUQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hVvgTKdc; 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 q30si7328152edb.372.2019.10.22.23.40.32; Tue, 22 Oct 2019 23:40:56 -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=hVvgTKdc; 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 S2388786AbfJWGji (ORCPT + 99 others); Wed, 23 Oct 2019 02:39:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29835 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730402AbfJWGjh (ORCPT ); Wed, 23 Oct 2019 02:39:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571812776; 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=JPoAZ12wvzk0gM/LMQmdcsjRqyc3hj/9X0DxYyB3fTs=; b=hVvgTKdc/bNeH9Wd6Ff8dmsch9XkS8ftV+OW2xaNYTq+d09Og0l3N50DSCJVWDrmDOfwrG ZDu+gOyOaaUT/QkX4Ek0TL3OcwcevVsaegTwgK8nvzuwiJi8LbilbMrkxUO/Cg5ATJjpnw YmfytHTxO9F5TQ30W1xO33jHs4CQA2g= 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-98-pxA18oaXO4G0FL33orpGpw-1; Wed, 23 Oct 2019 02:39:33 -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 5A9AE801E52; Wed, 23 Oct 2019 06:39:31 +0000 (UTC) Received: from [10.72.12.161] (ovpn-12-161.pek2.redhat.com [10.72.12.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BB4A19C70; Wed, 23 Oct 2019 06:39:16 +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> <6588d9f4-f357-ec78-16a4-ccaf0e3768e7@intel.com> From: Jason Wang Message-ID: <02d44f0a-687f-ed87-518b-7a4d3e83c5d3@redhat.com> Date: Wed, 23 Oct 2019 14:39:15 +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: <6588d9f4-f357-ec78-16a4-ccaf0e3768e7@intel.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: pxA18oaXO4G0FL33orpGpw-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/23 =E4=B8=8B=E5=8D=882:19, Zhu, Lingshan wrote: > > On 10/22/2019 9:05 PM, Jason Wang wrote: >> >> 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,=20 >>>>>>> u64 features) >>>>>>> +{ >>>>>>> +=C2=A0=C2=A0=C2=A0 struct ifcvf_adapter *adapter =3D mdev_get_drvd= ata(mdev); >>>>>>> +=C2=A0=C2=A0=C2=A0 struct ifcvf_hw *vf =3D IFC_PRIVATE_TO_VF(adapt= er); >>>>>>> + >>>>>>> +=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,=20 >>>>>>> u16 qid) >>>>>>> +{ >>>>>>> +=C2=A0=C2=A0=C2=A0 struct ifcvf_adapter *adapter =3D mdev_get_drvd= ata(mdev); >>>>>>> +=C2=A0=C2=A0=C2=A0 struct ifcvf_hw *vf =3D IFC_PRIVATE_TO_VF(adapt= er); >>>>>>> + >>>>>>> +=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=20 >>>>> 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=20 >>>> not 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 > > Hi Jason, > > Yes, I mean last_avail_idx. is that correct? > > THanks Yes. Thanks > >> >>