[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment
Tetsuya Mukawa
mukawa at igel.co.jp
Thu Jan 28 03:44:08 CET 2016
On 2016/01/27 19:03, Xie, Huawei wrote:
> On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote:
>> + /* Set BAR region */
>> + for (i = 0; i < NB_BAR; i++) {
>> + switch (dev->bar[i].type) {
>> + case QTEST_PCI_BAR_IO:
>> + case QTEST_PCI_BAR_MEMORY_UNDER_1MB:
>> + case QTEST_PCI_BAR_MEMORY_32:
>> + qtest_pci_outl(s, bus, device, 0, dev->bar[i].addr,
>> + dev->bar[i].region_start);
>> + PMD_DRV_LOG(INFO, "Set BAR of %s device: 0x%lx - 0x%lx\n",
>> + dev->name, dev->bar[i].region_start,
>> + dev->bar[i].region_start + dev->bar[i].region_size);
>> + break;
>> + case QTEST_PCI_BAR_MEMORY_64:
>> + qtest_pci_outq(s, bus, device, 0, dev->bar[i].addr,
>> + dev->bar[i].region_start);
>> + PMD_DRV_LOG(INFO, "Set BAR of %s device: 0x%lx - 0x%lx\n",
>> + dev->name, dev->bar[i].region_start,
>> + dev->bar[i].region_start + dev->bar[i].region_size);
>> + break;
> Hasn't the bar resource already been allocated? Is it the app's
> responsibility to allocate the bar resource in qtest mode? The app
> couldn't have that knowledge.
Yes. In qtest mode, the app should register above values.
(Without it, default values are 0)
Usually, this will be done by BIOS or uEFI. But in qtest mode, these
will not be invoked.
So we need to define above values, and also need to enable PCI devices.
In this release, I just register hard coded values except for one of
ivshmem BAR.
In next release, I will describe memory map in comment.
Tetsuya
More information about the dev
mailing list