numam-dpdk/doc/guides
Yuanhan Liu 6ba1f63b5a virtio: support specification 1.0
Modern (v1.0) virtio pci device defines several pci capabilities.
Each cap has a configure structure corresponding to it, and the
cap.bar and cap.offset fields tell us where to find it.

Firstly, we map the pci resources by rte_eal_pci_map_device().
We then could easily locate a cfg structure by:

    cfg_addr = dev->mem_resources[cap.bar].addr + cap.offset;

Therefore, the entrance of enabling modern (v1.0) pci device support
is to iterate the pci capability lists, and to locate some configs
we care; and they are:

- common cfg

  For generic virtio and virtqueue configuration, such as setting/getting
  features, enabling a specific queue, and so on.

- nofity cfg

  Combining with `queue_notify_off' from common cfg, we could use it to
  notify a specific virt queue.

- device cfg

  Where virtio_net_config structure is located.

- isr cfg

  Where to read isr (interrupt status).

If any of above cap is not found, we fallback to the legacy virtio
handling.

If succeed, hw->vtpci_ops is assigned to modern_ops, where all
operations are implemented by reading/writing a (or few) specific
configuration space from above 4 cfg structures. And that's basically
how this patch works.

Besides those changes, virtio 1.0 introduces a new status field:
FEATURES_OK, which is set after features negotiation is done.

Last, set the VIRTIO_F_VERSION_1 feature flag.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:50 +01:00
..
contributing doc: fix rendering of design section 2015-12-15 13:50:42 +01:00
cryptodevs doc: fix spellings 2015-12-15 13:50:42 +01:00
faq doc: remove DPDK from guide titles 2015-12-17 16:02:26 +01:00
freebsd_gsg doc: fix -n option in FreeBSD guide 2015-12-15 15:04:39 +01:00
linux_gsg doc: fix missing link target in Linux guide 2015-12-17 16:02:31 +01:00
nics doc: clean up index files 2015-12-15 13:50:42 +01:00
prog_guide doc: clean up index files 2015-12-15 13:50:42 +01:00
rel_notes virtio: support specification 1.0 2016-02-03 16:07:50 +01:00
sample_app_ug doc: clean up index files 2015-12-15 13:50:42 +01:00
testpmd_app_ug doc: clean up index files 2015-12-15 13:50:42 +01:00
xen doc: clean up index files 2015-12-15 13:50:42 +01:00
conf.py doc: fix navigation levels in html sidebar of guides 2016-01-16 09:16:56 +01:00
index.rst doc: fix navigation levels in html sidebar of guides 2016-01-16 09:16:56 +01:00