Commit Graph

234 Commits

Author SHA1 Message Date
Nipun Gupta
3f881f8d6e net/dpaa2: support raw flow classification
Add support for raw flow, which can be used for any
protocol rules.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
3b1477b78b net/dpaa2: configure per-class distribution size
TC distribution size is set with dist_queues or

nb_rx_queues % dist_queues in order of TC priority.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
40f8402531 net/dpaa2: support flow API FS miss action configuration
1) dpni_set_rx_hash_dist and dpni_set_rx_fs_dist used for TC
   configuration instead of dpni_set_rx_tc_dist. Otherwise,
   re-configuration of default TC of QoS fails.

2) Default miss action is to drop.  "export
   DPAA2_FLOW_CONTROL_MISS_FLOW=flow_id" is used receive the missed
   packets from flow with flow ID specified.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
59303cdf2e net/dpaa2: modify flow API QoS setup to follow FS setup
In HW/MC logical, QoS setup should follow FS setup.
In addition, Skip QoS setup if MAX TC number of DPNI is set 1.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
bac4a29663 net/dpaa2: add flow data sanity check
Check flow attributions and actions before creating flow.
Otherwise, the QoS table and FS table need to re-build
if checking fails.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
cf707c0ffd net/dpaa2: support index of queue action for flow
Make more sense to use RXQ index for queue distribution

instead of flow ID.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
271f5aee8b net/dpaa2: support distribution size set on multiple TCs
Default distribution size of TC is 1, which is limited by MC. We have to
set the distribution size for each TC to support multiple RXQs per TC.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
f44f55b3e4 net/dpaa2: differentiate IPv4/IPv6 in IP flow setup
Discriminate between IPv4 and IPv6 in generic IP flow setup.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
f5ed2ea0ce net/dpaa2: add logging of flow extracts and rules
This patch add support for logging the flow rules.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
d0a77dc3d9 net/dpaa2: define size of table entry
If entry size is not bigger than 27, MC alloc one TCAM entry,
otherwise, alloc 2 TCAM entries.
Extracts size by HW must be not bigger than TCAM entry size(27 or 54).
So define the flow entry size as 54.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
4ce58f8a18 net/dpaa2: support QoS or FS table entry indexing
Calculate QoS/FS entry index by group and priority of flow.

1)The less index of entry, the higher priority of flow.
2)Verify if the flow with same group and priority has been added before
  creating flow.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
627fb636db net/dpaa2: free flow rule memory
Free rule memory when the flow is destroyed.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
926c127907 net/dpaa2: add sanity check for flow extracts
Define extracts support for each protocol and check the fields of each
pattern before building extracts of QoS/FS table.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
5f17672873 net/dpaa2: support key extracts of flow API
1) Support QoS extracts and TC extracts for multiple TCs.

2) Protocol type of L2 extract is used to parse L3.
   Next protocol of L3 extract is used to parse L4.

3) generic IP key extracts instead of IPv4 and IPv6 respectively.

4) Special for IP address extracts:
   Put IP(v4/v6) address extract(s)/rule(s) at the end of extracts array
   to make rest fields at fixed position.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Jun Yang
4e445633a1 net/dpaa2: support dynamic flow control
Dynamic flow used instead of layout defined.

The actual key/mask size depends on protocols and(or) fields
of patterns specified.
Also, the key and mask should start from the beginning of IOVA.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
Gagandeep Singh
7eaf13231b net/dpaa2: enable timestamp for Rx offload case
This patch enables the packet timestamping
conditionally when Rx offload is enabled for timestamp.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-11 06:18:52 +02:00
David Marchand
1022ff0c33 drivers: drop workaround for internal libraries version
Now that all libraries have a single version, we can drop the empty
stable blocks that had been added when moving symbols from stable to
internal ABI.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-07-07 12:48:59 +02:00
Jerin Jacob
9c99878aa1 log: introduce logtype register macro
Introduce the RTE_LOG_REGISTER macro to avoid the code duplication
in the logtype registration process.

It is a wrapper macro for declaring the logtype, registering it and
setting its level in the constructor context.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-03 15:52:51 +02:00
Thomas Monjalon
43e73483a4 devtools: forbid variable declaration inside for
Some compilers raise an error when declaring a variable
in the middle of a function. This is a C99 allowance.
Even if DPDK switches globally to C99 or C11 standard,
the coding rules are for declarations at the beginning
of a block:
http://doc.dpdk.org/guides/contributing/coding_style.html#local-variables

This coding style is enforced by adding a check of
the common patterns like "for (int i;"

The occurrences of the checked pattern are fixed:
	'for *(\(char\|u\?int\|unsigned\|s\?size_t\)'
In the file dpaa2_sparser.c, the fix is to remove the unused macros.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-07-03 10:04:15 +02:00
Hemant Agrawal
a6a5f4b48b bus/fslmc: add accessor for MCP
Currently rte_mcp_ptr_list is being shared as a variable
across libs. This is only used in control path.
This patch change it to a exported function based access.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-19 15:49:53 +02:00
Hemant Agrawal
6b6ca75191 drivers: mark internal NXP symbols
This patch moves the internal symbols to INTERNAL sections
so that any change in them is not reported as ABI breakage.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-19 15:49:53 +02:00
Hemant Agrawal
7e2c3f1436 net/dpaa2: support additional link speeds
This patch adds the support for additional link speed
supported by LX2160A platforms.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Jun Yang
7a3a9d5660 net/dpaa2: fix congestion ID for multiple traffic classes
When using a single TC, flow id is same as congestion group id.
However in case of multiple traffic classes, same flow id values
are used within each traffic class, which causes incorrect
traffic behavior e.g. halting of traffic.
This patches changes to use the cgid as the index which works
for single as well as multiple traffic classes.

Fixes: 13b856ac02 ("net/dpaa2: support taildrop on frame count basis")
Cc: stable@dpdk.org

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
46dca1d544 net/dpaa2: reduce logs in Rx queue count
Changing them to DP as it is impacting l3fwd-power apps

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Nipun Gupta
7a5823182d net/dpaa2: support UDP destination port based muxing
This change adds DPDMUX support to bifurcate traffic on
the basis of UDP destination port.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Nipun Gupta
d527f5d9bb drivers: enhance DPAA2 portal allocation error logs
Update the portal allocation failure log to print the thread id
as well.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
e35ead3379 net/dpaa2: add default Rx/Tx configuration
This patch adds default/preferred rx/tx params in dev info,
specially the advertised burst size.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Nipun Gupta
2f41c93034 net/dpaa2: do not prefetch annotation for physical mode
When IOVA is physical address do not prefetch the annotation
of the next frame, as there is a cost involved there to convert
the physical address to virtual address.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Rohit Raj
7e6ecac281 net/dpaa2: fix 10G port negotiation
Fixed 10G port negotiation issue with another 10G/non 10G port.

When running testpmd with 10G interfaces on 10BaseT interface
on LS2088ARDB, the ports were showing link as down.

This was identified to be caused by the setting of link as down
during config.
Also, the line rate was not being updated in device link params,
thus having the incorrect link speed in status (as 0).

Fixes: c5acbb5ea2 ("net/dpaa2: support link status event")
Cc: stable@dpdk.org

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Luca Boccassi
611faa5f46 fix various typos found by Lintian
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
2020-04-25 19:53:47 +02:00
Thomas Monjalon
e3866e7355 replace hot attributes
The new macro __rte_hot, for compiler hinting,
is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:30:58 +02:00
Thomas Monjalon
f2fc83b40f replace unused attributes
There is a common macro __rte_unused, avoiding warnings,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:30:58 +02:00
Thomas Monjalon
d0ac7bb577 replace no-inline attributes
There is a macro __rte_noinline, preventing function to be inlined,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:16:46 +02:00
Thomas Monjalon
ef5baf3486 replace packed attributes
There is a common macro __rte_packed for packing structs,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:16:46 +02:00
Pavan Nikhilesh
acec04c4b2 build: disable experimental API check internally
Remove setting ALLOW_EXPERIMENTAL_API individually for each Makefile and
meson.build. Instead, enable ALLOW_EXPERIMENTAL_API flag across app, lib
and drivers.
This changes reduces the clutter across the project while still
maintaining the functionality of ALLOW_EXPERIMENTAL_API i.e. warning
external applications about experimental API usage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-04-14 16:22:34 +02:00
Sachin Saxena
f513f62059 drivers: update copyright for NXP files
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-11-28 16:03:54 +01:00
Pawel Modrak
85ff364f3b build: align symbols with global ABI version
Merge all versions in linker version script files to DPDK_20.0.

This commit was generated by running the following command:

:~/DPDK$ buildtools/update-abi.sh 20.0

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-11-20 23:05:39 +01:00
Anatoly Burakov
fbaf943887 build: remove individual library versions
Since the library versioning for both stable and experimental ABI's is
now managed globally, the LIBABIVER and version variables no longer
serve any useful purpose, and can be removed.

The replacement in Makefiles was done using the following regex:

	^(#.*\n)?LIBABIVER\s*:=\s*\d+\n(\s*\n)?

(LIBABIVER := numbers, optionally preceded by a comment and optionally
succeeded by an empty line)

The replacement for meson files was done using the following regex:

	^(#.*\n)?version\s*=\s*\d+\n(\s*\n)?

(version = numbers, optionally preceded by a comment and optionally
succeeded by an empty line)

[David]: those variables are manually removed for the files:
- drivers/common/qat/Makefile
- lib/librte_eal/meson.build
[David]: the LIBABIVER is restored for the external ethtool example
library.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-11-20 23:05:39 +01:00
Sachin Saxena
0d20cda8a9 net/dpaa2: fix Rx offload flags on jumbo MTU set
The JUMBO frame handling in dpaa2_dev_mtu_set api was not correct.
When frame_size is greater than RTE_ETHER_MAX_LEN, the
intention is to add JUMBO flag in rx offload while it was resetting
all other flags other than JUMBO as AND operator was used instead of OR.

Fixes: 0ebce6129b ("net/dpaa2: support new ethdev offload APIs")
Cc: stable@dpdk.org

Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Reviewed-by: Gagandeep Singh <g.singh@nxp.com>
2019-11-11 17:25:31 +01:00
Pavan Nikhilesh
8b945a7f7d drivers/net: update Rx RSS hash offload capabilities
Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-11 16:15:37 +01:00
Andrzej Ostruszka
7bbc7dc431 net/dpaa2: fix possible use of uninitialized vars
This patch fixes 'maybe-uninitialized' warnings reported by compiler
when using LTO.

Compiler warning pointing to this error (with LTO enabled):
error: ‘kg_cfg.extracts[0].masks[0].mask’ may be used uninitialized in
this function [-Werror=maybe-uninitialized]
    extr->masks[j].mask = cfg->extracts[i].masks[j].mask;

Fixes: 16bbc98a3e ("bus/fslmc: update MC to 10.3.x")
Cc: stable@dpdk.org

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
2019-11-08 15:23:41 +01:00
Nipun Gupta
ce4fd609b4 net/dpaa2: add retry and timeout in packet enqueue API
In the packet transmit, if the QBMAN is not able to process the
packets, the Tx function loops infinitely to send the packet out.
This patch changes the logic retry for some time (count) and then
return.

Fixes: cd9935cec8 ("net/dpaa2: enable Rx and Tx operations")
Fixes: 16c4a3c46a ("bus/fslmc: add enqueue response read in qbman")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
2019-11-06 01:14:00 +01:00
Nipun Gupta
005d943e57 net/dpaa2: set port in mbuf
This patch sets the port in mbuf for event scenarios as well

Fixes: b677d4c6d2 ("net/dpaa2: add API for event Rx adapter")
Fixes: 2d37886318 ("net/dpaa2: support atomic queues")
Fixes: 16c4a3c46a ("bus/fslmc: add enqueue response read in qbman")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-23 16:43:09 +02:00
Hemant Agrawal
8c83f28cc8 common/dpaax: move OF library from DPAA bus
This code is being shared by more than 1 type of driver.
Common is most appropriate place for it.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-23 16:43:08 +02:00
Sachin Saxena
96f7bfe828 net/dpaa2: update MC firmware version
MC firmware is the core component of FSLMC bus and net/DPAA2 devices.

Prior to this patch, MC firmware supported 10.14.x version. This
patch bumps the min supported version to 10.18.x.

Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-23 16:43:08 +02:00
Nipun Gupta
3835cc228f event/dpaa2: set priority as per DPCON device
This patch sets the priority of the dpcon dev, such that it is
within the supported range of dpcon

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-18 10:03:09 +02:00
Sunil Kumar Kori
72ec7a678e net/dpaa2: add soft parser driver
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-08 12:14:31 +02:00
Sunil Kumar Kori
a712067d84 net/dpaa2: support soft parser in MC
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
2019-10-08 12:14:31 +02:00
Shreyansh Jain
81c42c843b net/dpaa2: support separate MC portal per process
Earlier, there was a single MCP handle which was available across
complete DPAA2 driver as well as part of the dev_private which was
shared by the secondary process.

For secondary, that is not valid and it would require to open its
own handle for the MC. This is eventually used as part of the DPNI
configuration.

By using the process_private member of the rte_eth_dev, it is
possible to keep separate handles per process. Without worry of
overwriting when secondary process accesses the dev_private.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
2019-10-08 12:14:31 +02:00
Priyanka Jain
bc767866a3 net/dpaa2: add PTP driver
This patch adds the support for PTP driver for
DPAA2 devices.

To enable set
CONFIG_RTE_LIBRTE_IEEE1588=y in
config/defconfig_arm64-dpaa2-linuxapp-gc

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-08 12:14:31 +02:00