Commit Graph

92 Commits

Author SHA1 Message Date
Shreyansh Jain
1459585888 bus/dpaa: fix memory allocation during scan
With the IOVA auto detection changes, bus scan is performed before
memory initialization. DPAA bus scan must not use rte_malloc in
its path.

Fixes: cf408c2247 ("eal: auto detect IOVA mode")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-10 15:30:44 +02:00
Shreyansh Jain
1eb3ba846c bus/fslmc: add devices in sorted order
Before this patch, the devices discovered from VFIO layer were
being added in the device list in the order received from directory
scan. This causes an issue in case devices are reordered.

This patch makes all the devices inserted in the device list in
sorted order according to their name.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 03:26:58 +02:00
Hemant Agrawal
04dfa63404 bus/fslmc: improve debug log messages
enable the printing of objects during debuging.
use RTE_LOG to avoid function name printing for object name.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:26:44 +02:00
Hemant Agrawal
a2e53a11fe bus/fslmc: enable link status interrupt
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
01d0df35e7 bus/fslmc: cleanup the dpaa2 interrupt support
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
2facdbae87 bus/fslmc: support check of dpbp presence
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Ashish Jain
c2e1975429 bus/fslmc: support LX2160 platform
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
d95bdc093b bus/fslmc: clean the QBMAN support code
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:16 +02:00
Hemant Agrawal
4ab87e3881 bus/fslmc: cleanup compat file
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:16 +02:00
Hemant Agrawal
69293c7762 bus/fslmc: remove unused funcs and align names in QBMAN
name alignment for check command and result functions
putting them as separate functions instead of changing the original
functions.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:16 +02:00
Haiying Wang
f739d6f8f2 bus/fslmc: enhance the QBMAN CENA mode
Signed-off-by: Haiying Wang <haiying.wang@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:23:57 +02:00
Haiying Wang
07d862ea1e bus/fslmc: support up to 32 frames in one volatile dequeue
QMan5.0 supports up to 32 frames in one volatile dequeue
command. For the older Qman versions which only support
up to 16 frames, the highest bit in NUMF will be ignored.

Signed-off-by: Haiying Wang <haiying.wang@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:23:02 +02:00
Haiying Wang
43f7ff9de4 bus/fslmc: add QBMAN API to do enqueue with multiple frames
Clean it up and update the prototype.

Signed-off-by: Haiying Wang <haiying.wang@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:21:57 +02:00
Hemant Agrawal
cb3bfcbb21 bus/fslmc: remove the export for QBMAN version
This func is not required to be used outside of the qbman driver.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:21:06 +02:00
Haiying Wang
8b87090577 bus/fslmc: replace word copy with memcpy in QBMAN
The word_copy is not as efficient as expected, so remove it from
this driver.

Signed-off-by: Haiying Wang <haiying.wang@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:20:40 +02:00
Shreyansh Jain
a960306c06 bus/dpaa: add DPAA PMD logging macros
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
d881b20a19 bus/dpaa: add DPAA mempool logging macros
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
139732a088 bus/dpaa: integrate DPAA bus with hardware blocks
Now that QBMAN (QMAN, BMAN) and FMAN drivers are available, this patch
integrates the DPAA Bus driver for using the drivers for scanning
devices and calling the PMD registered probe callbacks.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
a5d2650f07 bus/dpaa: add fman flow control threshold setting
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
f38f61e982 bus/dpaa: add BMAN hardware interfaces
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
847ee3bd0d bus/dpaa: support FMAN frame queue lookup
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
f09ede6c8f bus/dpaa: add BMAN driver core
The Buffer Manager (BMan) is a hardware buffer pool management block that
allows software and accelerators on the datapath to acquire and release
buffers in order to build frames.

This patch adds the core routines.

Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
c47ff048b9 bus/dpaa: add QMAN driver core routines
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
f6fadc3e63 bus/dpaa: add QMAN interface driver
The Queue Manager (QMan) is a hardware queue management block that
allows software and accelerators on the datapath to enqueue and dequeue
frames in order to communicate.

This part of QBMAN DPAA Block.

Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
65ebc1be3c bus/dpaa: add routines for managing a RB tree
QMAN frames are managed over a RB tree data structure.
This patch introduces necessary routines for implementing a RB tree.

Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
90632b7592 bus/dpaa: add layer for interrupt emulation using pthread
An interrupt manager is implemented by emulating over pthreads.
Handlers are registered by QBMAN layer for being notified about
any interrupt request from DPAA blocks in userspace.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
23df396099 bus/dpaa: enable DPAA IOCTL portal driver
Userspace applications interact with DPAA blocks using this IOCTL driver.

Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
6d6b4f49a1 bus/dpaa: add FMAN hardware operations
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
5b22cf7446 bus/dpaa: introducing FMan configurations
FMan or Frame Manager, inspects traffic, splits it into queueson ingress.
It is also responsible for directing traffic on queues on egress.

This patch introduces FMan configurational interfaces. This layer is
used by Bus driver for configuring the hardware block.

Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Shreyansh Jain
2183c6f69d bus/dpaa: add OF parser for device scanning
This layer is used by Bus driver's scan function. Devices are parsed
using OF parser and added to DPAA device list.

Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 02:49:50 +02:00
Hemant Agrawal
39f373cf01 bus/dpaa: add compatibility and helper macros
Linked list, bit operations and compatibility macros.

Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 02:49:49 +02:00
Shreyansh Jain
919eeaccb2 bus/dpaa: introduce NXP DPAA bus driver skeleton
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 02:49:49 +02:00
Shreyansh Jain
16bbc98a3e bus/fslmc: update MC to 10.3.x
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 01:26:00 +02:00
Shreyansh Jain
828d51d8fc bus/fslmc: refactor scan and probe functions
Scan now searches for devices through sysfs interface and adds them
to a list for later initialization. During probe, each device is
initialized accroding to its property.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 01:08:58 +02:00
Shreyansh Jain
10f1614f36 drivers: refactor DPAA2 object definition
Initially, DPAA2 objects (except ETH and CRYPTO) were defined from VFIO
layer. This patch moves that into Bus definition.
This patch also realigns the object types with the new device types.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 01:08:46 +02:00
Shreyansh Jain
bd8e994ef3 bus/fslmc: introduce new device type enumerator
Existing devices and drivers depended on device ID rather than type.
A new enumerator for all DPAA2 devices is introduced in this patch.

At this point, the probe would not be able to link DPAA2 devices
with the driver and I/O would not work. Subsequent patches will
fix this.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 01:08:23 +02:00
Shreyansh Jain
c1b1b9b902 bus/fslmc: support only single group and container
Currently DPAA2 code doesn't support multiple groups and containers.
Remove such provision in code to simplify code.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 01:07:48 +02:00
Hemant Agrawal
b4d75d98f5 bus/fslmc: remove workaround for smmu mapping
This is not required any more for A72 based dpaa2 systems.
(A57 based platform is not in production anymore)

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-19 08:26:08 +03:00
Stephen Hemminger
ba9219fe42 drivers/dpaa2: remove duplicate includes
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-16 17:30:06 +02:00
Hemant Agrawal
d62d95bcb6 bus/fslmc: align object name log to real resource name
the DPAA2 resources are named with ".", so changing
"-" with "."

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-14 15:56:39 +02:00
Hemant Agrawal
de85636da0 bus/fslmc: set the dpaa2 device name
rte_eth_dev_allocated expect the device name to be filled.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-14 15:55:18 +02:00
Hemant Agrawal
c4138d89eb bus/fslmc: fix debug build
Fixes: 9ccb76b24c ("bus/fslmc: enable portal interrupt handling")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-14 15:53:57 +02:00
Hemant Agrawal
441ea8899e bus/fslmc: fix missing brace
Fixes: c7fe1eea8a ("bus: simplify finding starting point")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-11 11:22:03 +02:00
Shreyansh Jain
fcee050aa1 update NXP copyright headers
NXP Copyright has been wrongly worded with '(c)' at various places.
This patch removes these extra characters. It also removes
"All rights reserved".

Only NXP copyright syntax is changed. Freescale copyright is not
modified.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-07-10 12:26:40 +02:00
Thomas Monjalon
8d73e58f0b bus: fix driver registration
The bus name was stored with embedded double quotes.
Indeed the bus name is given with a string in a macro,
which is not used elsewhere.
These macros are useless because the buses are drivers,
so they must not have any API for the application writer.
The registration can be done with a hardcoded value without quotes.

There is another (small) benefit of not using macros for driver names:
it is to have a meaningful constructor function name.
For instance, it was businitfn_PCI_BUS_NAME instead of businitfn_pci.

The bus registration macro is also changed to use
the new RTE_INIT_PRIO macro, similar to RTE_INIT used for other drivers.
The priority is the highest (101) in order to be sure that the bus driver
is registered before its device drivers.

Fixes: 0fd1a0eaae ("pci: add bus driver")
Fixes: fea892e35f ("bus/vdev: use standard bus registration")
Fixes: 7e7df6d0a4 ("bus/fslmc: introduce fsl-mc bus driver")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-07-08 22:27:01 +02:00
Stephen Hemminger
c7fe1eea8a bus: simplify finding starting point
A separate boolean variable is not necessary when searching for
starting point in find_device. Just use the passed argument
as its own flag value.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-07-08 19:28:58 +02:00
Nipun Gupta
9ccb76b24c bus/fslmc: enable portal interrupt handling
Eventdev requires portal interrupts to handle timeout in the
event dequeue. This patch provides mechanism to enable the
portal interrupts.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:27:49 +02:00
Nipun Gupta
9acdd08541 bus/fslmc: add interrupt enabling routine
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:27:39 +02:00
Nipun Gupta
6070ce4334 bus/fslmc: change argument to const to avoid warning
qbman_get_dqrr_idx() API is required with constant dqrr entry
in the eventdev driver. Also, this routine is not updating the
dqrr. So, this patch updates its input argument to a const type.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:27:17 +02:00
Nipun Gupta
7223bd02ee bus/fslmc: add callback per queue to enable
Dequeue from event device needs to process the event on
the basis of the hardware queue from which it is dequeued.
A callback is added into dpaa2_queue structure, to enable
event dequeue functionality to call that processing routine.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:27:06 +02:00