From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A1FB1A052A; Wed, 27 Jan 2021 13:17:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CD93140D01; Wed, 27 Jan 2021 13:17:31 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id 290E1140CF3 for ; Wed, 27 Jan 2021 13:17:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611749848; 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=BJ+X2DIh7nUOVAo1DRm859J16IlHIwfe1LbQ/co2hcA=; b=XTBD0RbMs65KuyZAtea4ghETr7iRnVIBW8fYCVlfopp29xmOuU+tnvmLRjb0N18oVbtJQs TaMXMu+ZOhwTsb46rZH3VlIGf+NmUMIkv8SqvrQ+dRLGDR0C3UwGbUN4b2oxkmgJs8+azl IoVQV7ZpgMFks8joNU1yMD8PSGg+bO8= 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-266-JHTq4pywMe60euQ7SvPjFA-1; Wed, 27 Jan 2021 07:17:25 -0500 X-MC-Unique: JHTq4pywMe60euQ7SvPjFA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 137ED107ACFC; Wed, 27 Jan 2021 12:17:17 +0000 (UTC) Received: from [10.36.110.31] (unknown [10.36.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCD6F5D6D3; Wed, 27 Jan 2021 12:17:14 +0000 (UTC) To: Ferruh Yigit , =?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?= Cc: dev@dpdk.org, anatoly.burakov@intel.com, david.marchand@redhat.com, zhihong.wang@intel.com, chenbo.xia@intel.com, grive@u256.net References: <68ecd941-9c56-4de7-fae2-2ad15bdfd81a@alibaba-inc.com> <1603381885-88819-1-git-send-email-huawei.xhw@alibaba-inc.com> <1603381885-88819-4-git-send-email-huawei.xhw@alibaba-inc.com> <18871462-4d25-302a-2716-99ebec65c3ac@alibaba-inc.com> <40e0702d-7847-9dc3-1904-03a7b8e92c2e@alibaba-inc.com> <3c83a06d-c757-e470-441b-a8b7f496a953@redhat.com> <9b614cce-8e41-9ed6-a648-fbbe3fc14807@alibaba-inc.com> <71352868-a699-d876-25c3-b36df4f8649f@redhat.com> <22010641-89a9-15f5-6079-591cfef7dabb@intel.com> From: Maxime Coquelin Message-ID: <08dc4816-4774-0ca0-f529-8ee68b221b93@redhat.com> Date: Wed, 27 Jan 2021 13:17:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <22010641-89a9-15f5-6079-591cfef7dabb@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v5 3/3] PCI: don't use vfio ioctl call to access PIO resource X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/27/21 11:32 AM, Ferruh Yigit wrote: > On 1/26/2021 10:44 AM, Maxime Coquelin wrote: >> >> >> On 1/22/21 8:25 AM, 谢华伟(此时此刻) wrote: >>> >>> On 2021/1/21 23:38, Maxime Coquelin wrote: >>>>> Do you mean we apply or abandon patch 3? I am both OK. The first >>>>> priority to me is to enable MMIO bar support. >>>> OK, so yes, I think we should abandon patch 2 and patch 3. >>>> For patch 1, it looks valid to me, but I'll let Ferruh decide. >>>> >>>> For your device, if my understanding is correct, what we need to do is >>>> to support MMIO for legacy devices. Correct? >>> yes. >>>> If so, the change should be in virtio_pci.c. In vtpci_init(), after >>>> modern detection has failed, we should check the the BAR is PIO or MMIO >>>> based on the flag. the result can be saved in struct virtio_pci_dev. >>>> >>>> >>>> We would introduce new wrappers like vtpci_legacy_read, >>>> vtpci_legacy_write that would either call rte_pci_ioport_read, >>>> rte_pci_ioport_read in case of PIO, or rte_read32, rte_write32 in case >>>> of MMIO. >>> >>> There are two choices. >>> >>> 1, apply patch 2. >>> >>>      IO/MMIO port are mapped and accessed using the same API. Kernel is >>> doing in the same way like the following. >>> >>>              io_addr = pci_iomap >>> >>>                  get PIO directly or ioremap >>> >>>              iowrite16/32(val, io_addr + offset) >>> >>> I think applying patch 2 is a correct choice. It is a fix. Driver had >>> better not know if bar is PIO or MMIO.  ioport in ioport_xx API means >>> IO, not PIO. >>> >>> Btw, it only affects virtio PMD,  not that intrusive. >>> >>>   2, virtio specific change to enable MMIO support. >>> >>> Comparing with choice 1, i feels it is not that clean and pretty. >> >> OK, that makes sense. I am OK with keeping patch 2, but would like >> Ferruh's ACK. >> > > I was waiting for clarification if this can be solved in virtio, which > seems clarified and decided to go with this patch, I am OK to proceed > with patch 1 & 2. > > But first patch changes how PIO address get, it changes the Linux > interface used to get the PIO. > And as far as I can see second patch requires this new interface to be > able to access the MEM resources. > > I have a concern that this interface change may cause issues with > various distros, kernel versions etc.. And prefer it goes through a full > -rc1 validation cycle. While I think the risk for patch 2 is close to zero, I understand your concern on patch 1 (especially with the upcoming holidays in China, which will have an impact on QE capacity). Huawei, do you think patch 2 can be slightly modified to be applied alone, without patch 1? If possible, we may be able to pick patch2 for this release and postpone patch 1 to v21.05? > Huawei, I am aware the patch is around for a while but to play safe, I > suggest considering it for early next release, so it can be tested > enough, instead of getting if for -rc2/3 in this release. > > Thanks, > ferruh > > >> Could you please post v6? >> >> Thanks, >> Maxime >> >>>> >>>> It is not too late for this release, as the change will not be that >>>> intrusive. But if you prepare such patch, please base it on top of my >>>> virtio rework series; To make it easier to you, I added it to the dpdk- >>>> next-virtio tree: >>>> https://git.dpdk.org/next/dpdk-next-virtio/log/?h=virtio_pmd_rework_v2 >>>> >>>> Thanks, >>>> Maxime >>>> >>> >> >