Commit Graph

158 Commits

Author SHA1 Message Date
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
Nipun Gupta
33ae0a2915 bus/fslmc: support enqueue with multiple descriptors
This patch adds the QBMAN API which support multiple enqueue
descriptors.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:26:55 +02:00
Nipun Gupta
3844bdd14d bus/fslmc: support static dequeue from portal
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:26:33 +02:00
Nipun Gupta
71e50d4069 bus/fslmc: adding cpu support in stashing config
Stashing can also be configured by other drivers (for instance
event driver) passing cpu_id as an argument. This change
facilitates the same.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:26:11 +02:00
Nipun Gupta
15be42b688 bus/fslmc: register dpci as dpaa2 device for bus scan
Registering dpci as dpaa2 type device handling initialization,
allocation and freeing of the device

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:25:59 +02:00
Nipun Gupta
08464d2935 bus/fslmc: adding basic dpci support
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:25:47 +02:00
Hemant Agrawal
b981f26e9f bus/fslmc: export qbman dqrr funcs for eventdev usages
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-07 09:25:24 +02:00
Nipun Gupta
92c28aa457 bus/fslmc: add basic dpcon support
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:25:13 +02:00
Nipun Gupta
6e1f055d79 bus/fslmc: integrate dpio and dpbp to object framework
This patch removes the existing static call for dpio and dpbp
create and add them to object registration framework.

This patch also changes the vfio mc object processing to use
the framework.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:25:02 +02:00
Hemant Agrawal
f6af0de58e bus/fslmc: generic framework for mc object creation
There are muliple help mc object, which are not an independent
device, but they are required for dpaa2 based devices.
This framework allows registration and handling of all such
mc devices.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-07-07 09:24:51 +02:00
Akhil Goyal
81d587188a bus/fslmc: add macros to get/set FLE context
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-07-06 22:26:50 +02:00
Hemant Agrawal
774e9ea919 net/dpaa2: add support for multi seg buffers
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-06 15:00:56 +02:00
Shreyansh Jain
24a170cd30 bus/fslmc: add check for memseg availability
Cleanup the DMA map logic for memsegs. Earlier, in case
DMA mapping reaching end of segment, it reports a spurious error.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-07-06 15:00:56 +02:00
Hemant Agrawal
e401e2c95a bus/fslmc: fix the failure loop condition
Correct the while condition for cleanup in case of failure.

Fixes: a0d5c9caf0 ("bus/fslmc: add frame queue based dq storage")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-06 15:00:56 +02:00
Jan Blunck
9188a3f596 bus/fslmc: implement method to find device
Signed-off-by: Jan Blunck <jblunck@infradead.org>
2017-07-04 01:08:25 +02:00
Jerin Jacob
98a7ea332b fix typos using codespell utility
Fixing typos across dpdk source code using codespell utility.
Skipped the ethdev driver's base code fixes to keep the base
code intact.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-06-14 23:54:13 +02:00
Hemant Agrawal
fd0c3f136d bus/fslmc: reduce the debug log messages
Reducing the amount of logging and making the err statement
as a single line statements.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
e24b05bfd2 bus/fslmc: add support to detect SoC version
This is required to configure the stashing destination
based on the cluster size.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
0ccb1bef96 bus/fslmc: update TAILQ usages in dpaa2 objects
This patch updates the usages of malloc and TAILQ in
dpbp and dpio objects.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
7ae777d064 net/dpaa2: add support for congestion notification
In case of HW egress FQ is congested, skip further
transmission of frames.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
250aabc098 bus/fslmc: export qbman results in map file
In order to check the congestion state of Egress FQs,
this qbman function will be used by the DPAA2 Ethernet PMD.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
312b82f275 bus/fslmc: support for parallel Rx DQ requests
DPAA2 hardware support the option to configure
multiple memories for Rx recv buffer (DPAA2-DQRR).
Each Rx request executing is called as 'DQ' request.
This patch adds routines to get information w.r.t each DQ request.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Hemant Agrawal
9464dbe9c9 net/dpaa2: stop using software annotation
The DPAA2 driver is not using the DPAA2 frame descriptor
software annotation area. This patch reduces the
PTA length to zero and adjust the RX Buffer Layout
accordingly.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-06-12 10:41:26 +01:00
Akhil Goyal
ce8126838b bus/fslmc: add packet frame list entry definitions
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-04-20 11:32:45 +02:00
Hemant Agrawal
a0d5c9caf0 bus/fslmc: add frame queue based dq storage
This patch adds generic functions for allowing dq storage
for the frame queues.
As the frame queues are common resource for different drivers
this is helpful.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
352db38111 bus/fslmc: support DMA mapping for ARM SMMU
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
df0011c923 bus/fslmc: add physical-virtual address translation helpers
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
d64abecf57 bus/fslmc: add packet FLE definitions
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
3d6a286ca6 bus/fslmc: define VLAN header length
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
d08e662a4b bus/fslmc: introduce true and false macros
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
beb2a7865d bus/fslmc: define hardware annotation area size
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
73cddc740c bus/fslmc: define queues for DPAA2 devices
Before DPAA2 devices can communicate using hardware queues, this patch
adds queue definitions in the FSLMC bus which the DPAA2 devices would
instantiate.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
d93818e1d1 bus/fslmc: affine dpio to crypto threads
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
3981b74fc7 bus/fslmc: support hardware mempool object
Each mempool instance is represented by a DPBP object
from the FSL-MC bus.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
5374e50f10 bus/fslmc: add dpio portal driver
The portal driver is bound to DPIO objects discovered on the fsl-mc bus and
provides services that:
- allow other drivers, such as the Ethernet driver, to enqueue and dequeue
  frames for their respective objects

A system will typically allocate 1 DPIO object per CPU to allow queuing
operations to happen simultaneously across all CPUs.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
52d4f4c765 bus/fslmc: support debug log
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
14ec4ddd2e bus/fslmc: scan for net and crypto device
This patch will add support in fslmc vfio process to
scan and parse the dpni and dpseci object for net and crypto
devices. It will add the scanned devices to the fslmc bus.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
70e58cf74c bus/fslmc: support VFIO
Add support for using VFIO for dpaa2 based fsl-mc bus.

There are some differences in the way vfio used for fsl-mc bus
from the eal vfio.
 - The scanning of bus for individual objects on the basis of
   the DPRC container.
 - The use and mapping of MC portal for object access

With the evolution of bus model, they can be further aligned with
eal vfio code.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
7ee4686401 bus/fslmc: support MC dpbp object
DPBP object represent a hw based buffer pool instance
in the DPAA2 hardware.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
2c63db040e bus/fslmc: support MC dpio object
This patch adds the DPIO object support in MC driver.

DPIO - Data Path Input Output represent the processing
context to access the QBMAN HW for packet I/O.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
3af733ba8d bus/fslmc: introduce MC object functions
This patch introduces the DPAA2 MC(Management complex Driver).

This is a minimal set of low level functions to send and
receive commands to the fsl-mc. It includes support for basic
management commands and commands to manipulate MC objects.

This is common to be used by various DPAA2 PMDs. e.g.net, crypto
and other drivers.

This is a low level library also used in kernel.

Signed-off-by: Cristian Sovaiala <cristian.sovaiala@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
531b17a780 bus/fslmc: add QBMAN driver to bus
QBMAN, is a hardware block which interfaces with the other
accelerating hardware blocks (For e.g., WRIOP) on NXP's DPAA2
SoC for queue, buffer and packet scheduling.

This patch introduces a userspace driver for interfacing with
the QBMAN hw block.

The qbman-portal component provides APIs to do the low level
hardware bit twiddling for operations such as:
  -initializing Qman software portals
  -building and sending portal commands
  -portal interrupt configuration and processing

This same/similar code is used in kernel and compat file is used
to make it working in user space.

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>
2017-04-19 15:37:37 +02:00
Hemant Agrawal
7e7df6d0a4 bus/fslmc: introduce fsl-mc bus driver
The fslmc bus driver is a rte_bus driver which scans the fsl-mc bus
for NXP DPAA2 SoCs.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-19 15:37:37 +02:00