From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 25A2DC5BA for ; Fri, 29 Jan 2016 09:57:01 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 29 Jan 2016 00:57:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,363,1449561600"; d="scan'208";a="736451868" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 29 Jan 2016 00:57:00 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 29 Jan 2016 00:56:59 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 29 Jan 2016 00:56:59 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.215]) by shsmsx102.ccr.corp.intel.com ([169.254.2.172]) with mapi id 14.03.0248.002; Fri, 29 Jan 2016 16:56:58 +0800 From: "Xie, Huawei" To: Tetsuya Mukawa , "dev@dpdk.org" , "yuanhan.liu@linux.intel.com" , "Tan, Jianfeng" Thread-Topic: [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment Thread-Index: AdFY6gezAunQ5LVPT++h9TW0MGQ/9A== Date: Fri, 29 Jan 2016 08:56:57 +0000 Message-ID: References: <1453108389-21006-2-git-send-email-mukawa@igel.co.jp> <1453374478-30996-6-git-send-email-mukawa@igel.co.jp> <56A98078.3030708@igel.co.jp> 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] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 08:57:01 -0000 On 1/28/2016 10:44 AM, Tetsuya Mukawa wrote:=0A= > On 2016/01/27 19:03, Xie, Huawei wrote:=0A= >> On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote:=0A= >>> + /* Set BAR region */=0A= >>> + for (i =3D 0; i < NB_BAR; i++) {=0A= >>> + switch (dev->bar[i].type) {=0A= >>> + case QTEST_PCI_BAR_IO:=0A= >>> + case QTEST_PCI_BAR_MEMORY_UNDER_1MB:=0A= >>> + case QTEST_PCI_BAR_MEMORY_32:=0A= >>> + qtest_pci_outl(s, bus, device, 0, dev->bar[i].addr,=0A= >>> + dev->bar[i].region_start);=0A= >>> + PMD_DRV_LOG(INFO, "Set BAR of %s device: 0x%lx - 0x%lx\n",=0A= >>> + dev->name, dev->bar[i].region_start,=0A= >>> + dev->bar[i].region_start + dev->bar[i].region_size);=0A= >>> + break;=0A= >>> + case QTEST_PCI_BAR_MEMORY_64:=0A= >>> + qtest_pci_outq(s, bus, device, 0, dev->bar[i].addr,=0A= >>> + dev->bar[i].region_start);=0A= >>> + PMD_DRV_LOG(INFO, "Set BAR of %s device: 0x%lx - 0x%lx\n",=0A= >>> + dev->name, dev->bar[i].region_start,=0A= >>> + dev->bar[i].region_start + dev->bar[i].region_size);=0A= >>> + break;=0A= >> Hasn't the bar resource already been allocated? Is it the app's=0A= >> responsibility to allocate the bar resource in qtest mode? The app=0A= >> couldn't have that knowledge.=0A= > Yes. In qtest mode, the app should register above values.=0A= > (Without it, default values are 0)=0A= > Usually, this will be done by BIOS or uEFI. But in qtest mode, these=0A= > will not be invoked.=0A= > So we need to define above values, and also need to enable PCI devices.= =0A= >=0A= > In this release, I just register hard coded values except for one of=0A= > ivshmem BAR.=0A= > In next release, I will describe memory map in comment.=0A= =0A= I think ideally this app should do the whole PCI system=0A= initialization(and also the north/south bridge) using the DFS algorithm=0A= on behalf of the BIOS, to allocate resource for all bridge and devices.=0A= Otherwise if QEMU follows the hardware platform's behavior to route=0A= MMIO/IO access, if we only allocate resources for part of the devices,=0A= the transactions could not be routed correctly.=0A= Anyway we shouldn't bother us. It is OK as long as it works.=0A= =0A= =0A= >=0A= > Tetsuya=0A= >=0A= >=0A= =0A=