bus: get IOMMU class
authorSantosh Shukla <santosh.shukla@caviumnetworks.com>
Fri, 6 Oct 2017 11:03:41 +0000 (16:33 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 6 Oct 2017 18:39:07 +0000 (20:39 +0200)
commit39bef5cb98aab92cd6be69929b183854ccdb0f39
treea644b08ce7519bdc00d678e472c4ae2ca4c80389
parent815c7deaed2d9e325968e82cb599984088a5c55a
bus: get IOMMU class

API(rte_bus_get_iommu_class) helps to automatically detect and select
appropriate iova mapping scheme for iommu capable device on that bus.

Algorithm for iova scheme selection for bus:
0. Iterate through bus_list.
1. Collect each bus iova mode value and update into 'mode' var.
2. Mode selection scheme is:
if mode == 0 then iova mode is _pa,
if mode == 1 then iova mode is _pa,
if mode == 2 then iova mode is _va,
if mode == 3 then iova mode ia _pa.

So mode !=2  will be default iova mode (_pa).

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
lib/librte_eal/bsdapp/eal/rte_eal_version.map
lib/librte_eal/common/eal_common_bus.c
lib/librte_eal/common/eal_common_pci.c
lib/librte_eal/common/include/rte_bus.h
lib/librte_eal/linuxapp/eal/rte_eal_version.map