Skip to content

Commit

Permalink
common/dpaax: add library for PA/VA translation table
Browse files Browse the repository at this point in the history
A common library, valid for dpaaX drivers, which is used to maintain
a local copy of PA->VA translations.

In case of physical addressing mode (one of the option for FSLMC, and
only option for DPAA bus), the addresses of descriptors Rx'd are
physical. These need to be converted into equivalent VA for rte_mbuf
and other similar calls.

Using the rte_mem_virt2iova or rte_mem_virt2phy is expensive. This
library is an attempt to reduce the overall cost associated with
this translation.

A small table is maintained, containing continuous entries
representing a continguous physical range. Each of these entries
stores the equivalent VA, which is fed during mempool creation, or
memory allocation/deallocation callbacks.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
  • Loading branch information
Shreyansh Jain authored and tmonjalo committed Oct 16, 2018
1 parent e74a156 commit 2f3d633
Show file tree
Hide file tree
Showing 11 changed files with 672 additions and 1 deletion.
1 change: 1 addition & 0 deletions MAINTAINERS
Expand Up @@ -428,6 +428,7 @@ F: drivers/bus/ifpga/
NXP buses
M: Hemant Agrawal <hemant.agrawal@nxp.com>
M: Shreyansh Jain <shreyansh.jain@nxp.com>
F: drivers/common/dpaax/
F: drivers/bus/dpaa/
F: drivers/bus/fslmc/

Expand Down
5 changes: 5 additions & 0 deletions config/common_base
Expand Up @@ -139,6 +139,11 @@ CONFIG_RTE_ETHDEV_PROFILE_WITH_VTUNE=n
#
CONFIG_RTE_ETHDEV_TX_PREPARE_NOOP=n

#
# Common libraries, before Bus/PMDs
#
CONFIG_RTE_LIBRTE_COMMON_DPAAX=n

#
# Compile the Intel FPGA bus
#
Expand Down
5 changes: 5 additions & 0 deletions config/common_linuxapp
Expand Up @@ -29,6 +29,11 @@ CONFIG_RTE_PROC_INFO=y
CONFIG_RTE_LIBRTE_VMBUS=y
CONFIG_RTE_LIBRTE_NETVSC_PMD=y

#
# Common libraries, before Bus/PMDs
#
CONFIG_RTE_LIBRTE_COMMON_DPAAX=y

# NXP DPAA BUS and drivers
CONFIG_RTE_LIBRTE_DPAA_BUS=y
CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=y
Expand Down
4 changes: 4 additions & 0 deletions drivers/common/Makefile
Expand Up @@ -14,4 +14,8 @@ ifneq (,$(findstring y,$(MVEP-y)))
DIRS-y += mvep
endif

ifeq ($(CONFIG_RTE_LIBRTE_COMMON_DPAAX),y)
DIRS-y += dpaax
endif

include $(RTE_SDK)/mk/rte.subdir.mk
31 changes: 31 additions & 0 deletions drivers/common/dpaax/Makefile
@@ -0,0 +1,31 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018 NXP
#

include $(RTE_SDK)/mk/rte.vars.mk

#
# library name
#
LIB = librte_common_dpaax.a

CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)

# versioning export map
EXPORT_MAP := rte_common_dpaax_version.map

# library version
LIBABIVER := 1

#
# all source are stored in SRCS-y
#
SRCS-y += dpaax_iova_table.c

LDLIBS += -lrte_eal

SYMLINK-y-include += dpaax_iova_table.h

include $(RTE_SDK)/mk/rte.lib.mk

0 comments on commit 2f3d633

Please sign in to comment.