Commit Graph

113 Commits

Author SHA1 Message Date
Shreyansh Jain
346b02d1dc net/dpaa2: change VLAN strip value to offload flag
Fixes: 0ebce6129b ("net/dpaa2: support new ethdev offload APIs")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-05-14 22:32:23 +01:00
Thomas Monjalon
fbe90cdd77 ethdev: add probing finish function
A new hook function is added and called inside the PMDs at the end
of the device probing:
	- in primary process, after allocating, init and config
	- in secondary process, after attaching and local init

This new function is almost empty for now.
It will be used later to add some post-initialization processing.

For the PMDs calling the helpers rte_eth_dev_create() or
rte_eth_dev_pci_generic_probe(), the hook rte_eth_dev_probing_finish()
is called from here, and not in the PMD itself.

Note that the helper rte_eth_dev_create() could be used more,
especially for vdevs, avoiding some code duplication in PMDs.

Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
2018-05-14 22:31:53 +01:00
Wei Dai
a4996bd89c ethdev: new Rx/Tx offloads API
This patch check if a input requested offloading is valid or not.
Any reuqested offloading must be supported in the device capabilities.
Any offloading is disabled by default if it is not set in the parameter
dev_conf->[rt]xmode.offloads to rte_eth_dev_configure() and
[rt]x_conf->offloads to rte_eth_[rt]x_queue_setup().
If any offloading is enabled in rte_eth_dev_configure() by application,
it is enabled on all queues no matter whether it is per-queue or
per-port type and no matter whether it is set or cleared in
[rt]x_conf->offloads to rte_eth_[rt]x_queue_setup().
If a per-queue offloading hasn't be enabled in rte_eth_dev_configure(),
it can be enabled or disabled for individual queue in
ret_eth_[rt]x_queue_setup().
A new added offloading is the one which hasn't been enabled in
rte_eth_dev_configure() and is reuqested to be enabled in
rte_eth_[rt]x_queue_setup(), it must be per-queue type,
otherwise trigger an error log.
The underlying PMD must be aware that the requested offloadings
to PMD specific queue_setup() function only carries those
new added offloadings of per-queue type.

This patch can make above such checking in a common way in rte_ethdev
layer to avoid same checking in underlying PMD.

This patch assumes that all PMDs in 18.05-rc2 have already
converted to offload API defined in 17.11 . It also assumes
that all PMDs can return correct offloading capabilities
in rte_eth_dev_infos_get().

In the beginning of [rt]x_queue_setup() of underlying PMD,
add offloads = [rt]xconf->offloads |
dev->data->dev_conf.[rt]xmode.offloads; to keep same as offload API
defined in 17.11 to avoid upper application broken due to offload
API change.
PMD can use the info that input [rt]xconf->offloads only carry
the new added per-queue offloads to do some optimization or some
code change on base of this patch.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2018-05-14 22:31:51 +01:00
Hemant Agrawal
627b677014 bus/fslmc: improve debug logging
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-05-14 00:35:53 +02:00
Hemant Agrawal
762b275f20 net/dpaa2: add missing device info fields
Add the hashed RSS support info and other fields in device info.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-05-02 19:28:48 +02:00
Sunil Kumar Kori
175fe7d9eb net/dpaa2: fix the ethdev offload checks
Fixes: 0ebce6129b ("net/dpaa2: support new ethdev offload APIs")

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-04-27 17:34:42 +01:00
Bruce Richardson
b67dde5b19 drivers/dpaa: reduce meson dependency lists
Meson build currently tracks the dependencies between libraries, which
can often make things easier, but has the side-effect of slowing down
the initial meson run if too many duplicated dependencies are provided.
Therefore, we remove dependencies from the dpaa items where other
dependencies already depend on those. This provides a noticable speed-up
in meson configuration runs when lots of sample apps are included in the
build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-04-17 16:09:43 +02:00
Hemant Agrawal
3ef648aa48 bus/fslmc: fix build with clang 3.4
error: redefinition of typedef 'dma_addr_t' is a C11 feature
[-Werror,-Wtypedef-redefinition]

Fixes: 4bc5ab88db ("net/dpaa2: fix Tx only mode")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-04-19 18:26:47 +02:00
Sunil Kumar Kori
0ebce6129b net/dpaa2: support new ethdev offload APIs
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
2018-04-14 00:43:30 +02:00
Olivier Matz
caccf8b318 ethdev: return diagnostic when setting MAC address
Change the prototype and the behavior of dev_ops->eth_mac_addr_set(): a
return code is added to notify the caller (librte_ether) if an error
occurred in the PMD.

The new default MAC address is now copied in dev->data->mac_addrs[0]
only if the operation is successful.

The patch also updates all the PMDs accordingly.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-14 00:43:30 +02:00
Nipun Gupta
b3ec974c34 bus/fslmc: configure separate portal for Ethernet Rx
In case of Receive from Ethernet we add a new pull request (prefetch)
but do not fetch the results from that pull request until next
dequeue operation. This keeps the portal in busy mode.

This patch updates the portals bifurcation to have separate portals
to receive packets for Ethernet and all other devices to use a
common portal.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-04-12 00:21:00 +02:00
Hemant Agrawal
876b2c902e net/dpaa2: fix xstats
Fixes: 1d6329b2fc ("net/dpaa2: support extra stats")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-04-12 00:20:52 +02:00
Anatoly Burakov
a6cdf375bc bus/fslmc: move VFIO DMA map into bus probe
fslmc bus needs to map all allocated memory for VFIO before
device probe. This bus doesn't support hotplug, so at the time
of this call, all possible device that could be present, are
present. This will also be the place where we install VFIO
callback, although this change will come in the next patch.

Since rte_fslmc_vfio_dmamap() is now only called at bus probe,
there is no longer any need to check if DMA mappings have been
already done.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
2018-04-11 21:45:56 +02:00
Anatoly Burakov
00bc40e265 bus/fslmc: use iova2virt instead of memseg iteration
Reduce dependency on internal details of EAL memory subsystem, and
simplify code.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
2018-04-11 19:54:40 +02:00
Shreyansh Jain
a10a988a0b net/dpaa2: support dynamic logging
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-04-02 23:42:15 +02:00
Stephen Hemminger
7e2eb5f0d2 net/dpaa2: use link status helper functions
Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-03-30 14:08:43 +02:00
Hemant Agrawal
6ec78c2463 build: add meson support for dpaaX platforms
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-03-15 17:50:02 +01:00
Hemant Agrawal
5ae1edff68 dpaa2: prepare for 32-bit build
This patch prepare the dpaa2 drivers for compilation on 32 bit machine.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-03-15 17:41:35 +01:00
Jerin Jacob
71a915cc2b net/dpaa2: remove unused global variable
Due to the missing __packed definition, compiler treating
it as as global variable.

grep "Allocating common symbols" -A 100 build/app/testacl.map
__packed   0x8  /build/lib/librte_pmd_dpaa2.a(dpaa2_rxtx.o)

Fixes: a5fc38d422 ("net/dpaa2: support Rx packet parsing")
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-02-13 16:42:11 +01:00
Hemant Agrawal
4bc5ab88db net/dpaa2: fix Tx only mode
Fixes: 043b36f621 ("net/dpaa2: support more than 16 burst size in Rx")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-31 20:57:29 +01:00
Nipun Gupta
8fc28889bd net/dpaa2: prefetch the annotation in event processing
This patch adds software prefetching of the annotation which is
accessed by the driver to fetch the parsing results. The changes
also include as many instructions in between prefetching memory
and using it.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-01-31 07:19:05 +01:00
Hemant Agrawal
a1a487f0c9 net/dpaa2: fix BPID offset
Fixes: 774e9ea919 ("net/dpaa2: add support for multi seg buffers")
Fixes: d2ef05d5c1 ("net/dpaa2: optimize Rx/Tx path")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-31 01:36:45 +01:00
Ferruh Yigit
ffc905f3b8 ethdev: separate driver APIs
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.

There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.

More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-22 01:26:49 +01:00
Nipun Gupta
ffb3389cef net/dpaa2: use hash FLCTYPE only for LX2
Enabling hash results in FD requires setting DPNI_FLCTYPE_HASH in
dpni_set_offload API. Setting this FLCTYPE for DPNI sets the FD[SC]
to 0 for LS2 in the hardware thus disabling data/annotation stashing.
For LX2 this is fixed in hardware and thus hash result and parse
results can be received in FD using this option.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-21 15:51:52 +01:00
Hemant Agrawal
c172f85ef2 net/dpaa2: change VLAN filter rule to be called on config
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-21 15:51:52 +01:00
Hemant Agrawal
d2ef05d5c1 net/dpaa2: optimize Rx/Tx path
Merge the offload with parse function to save on instructions.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-21 15:51:52 +01:00
Hemant Agrawal
043b36f621 net/dpaa2: support more than 16 burst size in Rx
This patch enhances the Rx function to support more than
16 burst size.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-21 15:51:52 +01:00
Nipun Gupta
2d37886318 net/dpaa2: support atomic queues
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-19 16:09:56 +01:00
Nipun Gupta
496324d2a5 bus/fslmc: add flag to configure DCA in QBMAN multi Tx
With the current QBMAN multi-tx API, we need to create separate
enqueue descriptors for each of the packet which is required to
be enqueued to the hardware, once we support Atomic Queues
(with DCA) in dpaa2 drivers. Creating enqueue descriptor for
each packet is costly and have significant performance impact.
This patch introduces a flag parameter in the QBMAN multi-tx API,
so that DCA configuration (and later on ORP/ODP for ordered queues)
can be passed using flags and be updated in the EQCR using this flag.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-19 16:09:56 +01:00
Thomas Monjalon
cebe3d7b3d ethdev: remove useless parameter in callback process
The pointer to the user parameter of the callback registration is
automatically pass to the callback function.
There is no point to allow changing this user parameter by a caller.
That's why this parameter is always set to NULL by PMDs and set only
in ethdev layer before calling the callback function.

The history is that the user parameter was initially used
by the callback implementation to pass some information
between the application and the driver:
	c1ceaf3ad0 ("ethdev: add an argument to internal callback function")
Then a new parameter has been added to leave the user parameter
to its standard usage of context given at registration:
	d6af1a13d7 ("ethdev: add return values to callback process API")

The NULL parameter in the internal callback processing function
is now removed. It makes clear that the callback parameter is user
managed and opaque from a DPDK point of view.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-01-16 18:47:49 +01:00
Nipun Gupta
03e87e6e26 net/dpaa2: prefetch the parse results from next fd
As there were less number of CPU cycles in between when we access
the parse results and when we prefetch them, this patch modifies
the prefetch of the next parse result.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-01-16 18:47:49 +01:00
Nipun Gupta
48e7f15609 net/dpaa2: optimize Tx path for best case
This patch handles the non-sg packets in more optimized way.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-01-16 18:47:49 +01:00
Nipun Gupta
7ec5e530f9 net/dpaa2: optimize Rx path packet parsing
Parsing the annotation has multiple if checks in the data path.
These are reduced for common cases like IPv4/IPv6 and UDP/TCP
packets to enhance performance of these generic cases.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-01-16 18:47:49 +01:00
Nipun Gupta
a5852a94ba net/dpaa2: add parse function for LX2 device
Adding support for DPDK packet parsing logic for LX2
platform to accommodate the new FRC format introduced in LX2.

Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
5a307f50ba net/dpaa2: add VLAN insert offload
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Ashish Jain
44ea735587 net/dpaa2: align the frame size in MTU set
Setting correct frame size in dpaa2_dev_mtu_set
api call. Also correcting the correct max frame size
setting in hardware while dev_configure for jumbo frames

Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
f40adb40c1 net/dpaa2: add Rx queue count support
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
e0ded73b5b bus/fslmc: expose platform SoC value register
This patch expose the dpaa2 soc platform family type.
This is required to make some soc variant specific
decision during configuration and runtime.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
92b7e33ef6 net/dpaa2: advertise link status as driver flag
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
f7768afac1 bus/fslmc: support dynamic IOVA
This patch add support for dynamic iova detection for DPAA2
devices and use of virtual address in such cases.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
131a75b6e4 drivers: use SPDX tag in NXP dpaa2 files
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-04 22:41:39 +01:00
Akhil Goyal
f998967365 net/dpaa2: set queues after reconfiguration
if dpaa2_dev_tx_queue_setup is called multiple times, the
assignment of device->data->tx_queues is not done, as a result
tx_queues remain NULL after reconfiguration.

This patch sets the tx_queues from the device private data to the
usable device tx queues.

Fixes: 7ae777d064 ("net/dpaa2: add support for congestion notification")
Cc: stable@dpdk.org

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-11-01 22:17:06 +01:00
Shreyansh Jain
a57bbb68d4 event/dpaa2: fix shared build
Fixes: cbc12b0a96 ("mk: do not generate LDLIBS from directory dependencies")
Fixes: b677d4c6d2 ("net/dpaa2: add API for event Rx adapter")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-26 23:04:54 +02:00
David Harton
289ba0c0f5 ethdev: allow returning error on VLAN offload ops
Some devices may not support or fail setting VLAN offload
configuration based on dynamic circumstances so the
vlan_offload_set_t vector is modified to return an int so
the caller can determine success or not.

rte_eth_dev_set_vlan_offload is updated to return the
value provided by the vector when called along with restoring
the original offload configs on failure.

Existing vlan_offload_set_t vectors are modified to return
an int.  Majority of cases return 0 but a few that actually
can fail now return their failure codes.

Finally, a vlan_offload_set_t vector is added to virtio
to facilitate dynamically turning VLAN strip on or off.

Signed-off-by: David Harton <dharton@cisco.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Olivier Matz
380a7aab1a mbuf: rename deprecated VLAN flags
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while.
As explained in [1], these flags were kept to let the applications and
PMDs move to the new flag. There is also a need to support Rx vlan
offload without vlan strip (at least for the ixgbe driver).

This patch renames the old flags for this feature, knowing that some
PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that
the vlan tci has been saved in the mbuf structure.

It is likely that some PMDs do not set the proper flags when doing vlan
offload, and it would be worth making a pass on all of them.

Link: [1] http://dpdk.org/ml/archives/dev/2017-June/067712.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Nipun Gupta
b677d4c6d2 net/dpaa2: add API for event Rx adapter
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-25 14:03:43 +02:00
Olivier Matz
cbc12b0a96 mk: do not generate LDLIBS from directory dependencies
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz
variable. This is valid when the subdirectory name match the library
name, but it's not always the case, especially for PMDs.

The patches removes this feature and explicitly adds the proper
libraries in LDLIBS.

Some DEPDIRS-xyz variables become useless, remove them.

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2017-10-24 02:14:57 +02:00
Matan Azrad
d5b0924ba6 ethdev: add return value to stats get dev op
The stats_get dev op API doesn't include return value, so PMD cannot
return an error in case of failure at stats getting process time.

Since PCI devices can be removed and there is a time between the
physical removal to the RMV interrupt, the user may get invalid stats
without any indication.

This patch changes the stats_get API return value to be int instead of
void.

All the net PMDs stats_get dev ops are adjusted by this patch.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-12 01:52:49 +01:00
Hemant Agrawal
2bfea039a4 net/dpaa2: improve debug messaging
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
21ce788c83 net/dpaa2: checksum support as per user config
Instead of enabling the RX checksum by default, make it
enable only with user ethernet configuration

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00