mbox

[v5,0/5]

Message ID 20181015120156.27793-1-shreyansh.jain@nxp.com (mailing list archive)
Headers

Message

Shreyansh Jain Oct. 15, 2018, 12:01 p.m. UTC
::Background::
After the restructuring of memory in last release(s), one of the
major impact on fslmc/dpaa bus (and its devices) was the performance
drop when using physical addressing.

Previously, it was assumed that physical range was contiguous for
any given request for hugepage memory. That way, whenever a
virtual address was returned, it was easy to fetch physical
equivalent, in almost constant time.
But, with memory hotplug series, that assumption was negated.
Every call that device drivers made for rte_mem_virt2iova or
rte_mem_virt2phy were expensive. (Using IOVA_CONTIG is an app
dependency which is not a practical option).

For fslmc, working on Physical or Virtual (IOMMU supported) address
is an optional thing. For dpaa bus, it is not optional and only
physical addressing is supported. Thus, it impacted dpaa bus
the most.

::DPAAX PA-VA Table::
- A simple table containing entries for all physical memory range
  available on a particular SoC (in this case, NXP's LS104x and
  LS20xx series, which are handled by dpaa and fslmc bus,
  respectively). As of now, this is SoC dependent for fetching
  range.
- We populate the table either through the mempool handler (for
  mempool pinned memory) or through the memory event callbacks
  (for cases where working memory is allocated by application).
- Though aim is only to translate addresses for descriptors
  which are Rx'd from devices, this is a generic layer which
  should work in other cases as well (though, not the target of
  current testing).

::About patches::
Patch 1: There was an issue in existing PA/VA mode reporting being
         done by fslmc bus. This patch fixes it.
Patch 2: Common libraries/commponents can be dependency for the bus
         thus, blocking parallel compilation
Patch 3: Add the library in common/dpaax. This is a single patch
         as functions are mostly inter-linked.
Patch 4~5: Add support in dpaa and fslmc bus, respectively.
         It is not possible to unlink the bus and device drivers,
         thus, these patches have blanket change across all drivers.

::Next Steps::
- Some optimization are required to tune the access pattern of the
  table. These would be posted as additional patches.
- In case there is any possible split of patches, I will post another
  version. But until then, this is the layout.

::Version History::
v4->v5:
 - Fixed a shared build error appearing on CI (couldn't reproduce locally
   so, moved the shared build sections in makefile)

v3->v4:
 - Fixed missing rework against review comment from Pavan: shift the
   IOVA mode detection code in bus/fslmc
 - Rebased over master (abe92131c92)

v2->v3:
 - Added back del operation (update) for mem-events, which was removed
   in v2
 - Change IOMMU(PA) detection for FSLMC Bus (review comment: Pavan)
 - Rebase on master (6673fe0ce2)

v1->v2:
 - Rework of review comments on v1
 - Removed dpaax_iova_table_del API - that is redundant
 - Changed paax_iova_table_add to paax_iova_table_update to make
   it more relevant
 - Previous patch removed an advertised API (rte_dpaa2_memsegs). This is
   fixed. A deprecation notice would now be sent for removal in next
   release.
 - Rebase on master (5f73c2670f); Also verified on net-next/mater (317f8b01f)

Shreyansh Jain (5):
  bus/fslmc: fix physical addressing check
  drivers: common as dependency for bus
  common/dpaax: add library for PA VA translation table
  dpaa: enable dpaax library
  fslmc: enable dpaax library

 config/common_base                            |   5 +
 config/common_linuxapp                        |   5 +
 drivers/Makefile                              |   1 +
 drivers/bus/dpaa/Makefile                     |   1 +
 drivers/bus/dpaa/dpaa_bus.c                   |   4 +
 drivers/bus/dpaa/meson.build                  |   2 +-
 drivers/bus/dpaa/rte_dpaa_bus.h               |   6 +
 drivers/bus/fslmc/Makefile                    |   1 +
 drivers/bus/fslmc/fslmc_bus.c                 |  24 +
 drivers/bus/fslmc/meson.build                 |   2 +-
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h       |  21 +-
 drivers/common/Makefile                       |   4 +
 drivers/common/dpaax/Makefile                 |  31 ++
 drivers/common/dpaax/dpaax_iova_table.c       | 461 ++++++++++++++++++
 drivers/common/dpaax/dpaax_iova_table.h       | 103 ++++
 drivers/common/dpaax/dpaax_logs.h             |  39 ++
 drivers/common/dpaax/meson.build              |  12 +
 .../common/dpaax/rte_common_dpaax_version.map |  11 +
 drivers/common/meson.build                    |   2 +-
 drivers/crypto/dpaa2_sec/Makefile             |   1 +
 drivers/crypto/dpaa_sec/Makefile              |   1 +
 drivers/crypto/dpaa_sec/dpaa_sec.c            |   6 +
 drivers/event/dpaa/Makefile                   |   1 +
 drivers/event/dpaa2/Makefile                  |   1 +
 drivers/mempool/dpaa/Makefile                 |   1 +
 drivers/mempool/dpaa/dpaa_mempool.c           |   4 +
 drivers/mempool/dpaa/dpaa_mempool.h           |   4 +-
 drivers/mempool/dpaa2/Makefile                |   1 +
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c      |  29 +-
 drivers/net/dpaa/Makefile                     |   1 +
 drivers/net/dpaa2/Makefile                    |   1 +
 drivers/raw/dpaa2_cmdif/Makefile              |   1 +
 drivers/raw/dpaa2_qdma/Makefile               |   1 +
 mk/rte.app.mk                                 |   7 +
 34 files changed, 753 insertions(+), 42 deletions(-)
 create mode 100644 drivers/common/dpaax/Makefile
 create mode 100644 drivers/common/dpaax/dpaax_iova_table.c
 create mode 100644 drivers/common/dpaax/dpaax_iova_table.h
 create mode 100644 drivers/common/dpaax/dpaax_logs.h
 create mode 100644 drivers/common/dpaax/meson.build
 create mode 100644 drivers/common/dpaax/rte_common_dpaax_version.map