Commit Graph

84 Commits

Author SHA1 Message Date
Thomas Monjalon
e16adf08e5 ethdev: free all common data when releasing port
This is a clean-up of common ethdev data freeing.
All data freeing are moved to rte_eth_dev_release_port()
and done only in case of primary process.

It is probably fixing some memory leaks for PMDs which were
not freeing all data.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Shreyansh Jain
5a7dbb934d dpaa: enable dpaax library
With this patch, dpaa bus and ethernet devices on this bus
would start using the physical-virtual library interfaces.

This patch impacts mempool/dpaa, event/dpaa and net/dpaa as
they are dependent on the bus/dpaa and thus impact linkage of
libraries.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-16 14:54:25 +02:00
Hemant Agrawal
1ee09e39b5 net/dpaa: tune prefetch in Rx path
As part of performance optimization excercise, tuning
the prefetch placement.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
19b4aba204 net/dpaa: separate Rx function for LS1046
This is to avoid the checks in datapath and help in performance.
LS1046 has different data stash settings.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Sunil Kumar Kori
9afce5aa86 net/dpaa: rearrange atomic queue support
This is to align the code with dpaa2 to ease out maintenance
of both driver code bases.

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
079a67c251 net/dpaa: minor debug log enhancements
Improving the debug message for event mode and
reducing the log level for less important log

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Sachin Saxena
c1752a36b0 net/dpaa: fix link speed based on MAC type
The link speed shall be on the basis of mac type.

Fixes: 799db4568c ("net/dpaa: support device info and speed capability")
Cc: shreyansh.jain@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
55576ac26e net/dpaa: support scatter offload
This patch implement the sg support, which can be
enabled/disabled w.r.t configuration.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
deeec8ef57 net/dpaa: fix jumbo buffer config
Set the missing dev data mtu for the correct size.
Set the max supported size in hw, if user is asking for more.

Fixes: 9658ac3a4e ("net/dpaa: set the correct frame size in device MTU")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
f04e713924 net/dpaa: configure frame queue on MAC ID basis
The current code has the hardcoded seq for fq allocation.
It require multiple changes, when some of the interfaces
are assigned to kernel stack. Changing it on the mac
id basis provide the flexibility to assign any interface
to kernel.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Shreyansh Jain
5fb08dd326 drivers/net: remove double assignment of driver
Removing double copy of driver information. 04664e5c83 has shifted
that from driver's probe to bus's probe.

Fixes: 04664e5c83 ("drivers/bus: fill driver reference after NXP probing")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-09-28 18:02:49 +02:00
Ferruh Yigit
323e7b667f ethdev: make default behavior CRC strip on Rx
Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag.
Without any specific Rx offload flag, default behavior by PMDs is to
strip CRC.

PMDs that support keeping CRC should advertise DEV_RX_OFFLOAD_KEEP_CRC
Rx offload capability.

Applications that require keeping CRC should check PMD capability first
and if it is supported can enable this feature by setting
DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure()

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Jan Remes <remes@netcope.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2018-09-14 20:08:41 +02:00
Ferruh Yigit
d1c3ab220a drivers/net: fix crash in secondary process
Calling rte_eth_dev_info_get() on secondary process cause a crash
because eth_dev->device is not set properly.

Fixes: ee27edbe0c ("drivers/net: share vdev data to secondary process")
Cc: stable@dpdk.org

Reported-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2018-07-26 15:00:34 +02:00
Hemant Agrawal
e507498d81 net/dpaa: move the push queue set to global init
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-07-12 14:42:03 +02:00
Hemant Agrawal
1e06b6dc71 net/dpaa: remove experimental tag from PMD API
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-07-12 14:40:22 +02:00
Hemant Agrawal
8d6fc8b67e net/dpaa: support default queue mode
In case DPAA FMAN configuration tool (FMC) is not available,
the system can still work with default queue(1 queue per port).

This patch also fixes some logs related to FQ ids, which were
idetified while testing this support.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-07-12 14:40:14 +02:00
Nipun Gupta
f40d5a53ec bus/dpaa: make vdqcr configurable
This patch add support for configurable vdqcr exact flag.
This boost the performance, however this can give
side effects for some extra packet fetch. Which has been
taken care in the patch as well.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-07-12 14:39:54 +02:00
Hemant Agrawal
9abdad12b8 bus/dpaa: optimize fq callback routine
Avoid array of fq as packets are dq only from a single q.

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-07-12 14:35:33 +02:00
Hemant Agrawal
6fd3639a82 net/dpaa: fix queue error handling and logs
Fixes: 5e74559314 ("net/dpaa: support Rx queue configurations with eventdev")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-07-12 14:32:46 +02: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
Shreyansh Jain
2c01a48a50 net/dpaa: update optimal burst size in device info
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-05-14 22:31:51 +01:00
Shreyansh Jain
0b5deefbe6 net/dpaa: fix max push mode queue
Split default and max push mode queues to 4 and 8, respectively.

Fixes: 0c504f6950 ("net/dpaa: support push mode")
Cc: stable@dpdk.org

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-05-14 22:31:51 +01:00
Ferruh Yigit
04db1d0da7 lib: clear experimental version tag in linker scripts
Remove version tag from experimental block in linker version scripts
(.map files).

That label is not used by linker and information only. It is useful
for version blocks but not useful for experimental block but confusing.
Removing those labels.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2018-05-14 03:37:28 +02:00
Hemant Agrawal
339c1025a8 net/dpaa: fix xstats implementation
Some of the applications are expecting that if n is 0, it shall
return the supported number of stats. e.g. VPP

Fixes: b21ed3e2a1 ("net/dpaa: support extended statistics")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-05-14 00:36:38 +02:00
Hemant Agrawal
1475ad99a0 net/dpaa: fix RSS hash support
Fixes: 4fa5e0bbc5 ("net/dpaa: support hashed RSS")
Cc: stable@dpdk.org

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

Signed-off-by: Sunil Kumar Kori <sunil.kori@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
Sunil Kumar Kori
16e2c27f4f net/dpaa: 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
Akhil Goyal
4b4fc5df8e net/dpaa: update checksum for external pool obj
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2018-04-12 00:20:50 +02:00
Hemant Agrawal
5c3fc73e82 net/dpaa: fix oob access
Coverity issue: 268318
Fixes: b21ed3e2a1 ("net/dpaa: support extended statistics")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-04-12 00:20:36 +02:00
Hemant Agrawal
e4f931cc6e net/dpaa: fix array overrun
Coverity issue: 268342
Fixes: 62f53995ca ("net/dpaa: add frame count based tail drop with CGR")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-04-12 00:20:33 +02:00
Anatoly Burakov
982aa8af52 bus/dpaa: 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:37 +02:00
Ferruh Yigit
1633d3c4c1 net/dpaa: prefer defines for link speed values
Use existing defines instead of hardcoded vales.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-03-30 14:08:44 +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
0e5607e4ad dpaa: prepare for 32-bit build
This patch prepares the dpaa drivers for compilation on 32 bit machine.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-03-15 17:40:54 +01:00
Nipun Gupta
b9083ea5e0 net/dpaa: further push mode optimizations
This patch supports batch processing of multiple packets
in the Rx side

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-31 13:44:56 +01:00
Nipun Gupta
5d944582d0 bus/dpaa: check portal presence in the caller function
In the I/O path we were calling rte_dpaa_portal_init which
internally checks if a portal is affined to the core.
But this lead to calling of that non-static API in every call.

Instead check the portal affinity in the caller itself for
performance reasons

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-31 13:44:54 +01:00
Hemant Agrawal
41c9ee8d11 net/dpaa: use address translation optimizations
Use the optimized routine for phy to virt conversion,
when the mempool is allocated from physical contiguous memory.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-31 13:44:51 +01:00
Neil Horman
77b7b81e32 add experimental tag to appropriate functions
Append the __rte_experimental tag to api calls appearing in the
EXPERIMENTAL section of their libraries version map

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +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
Yong Wang
0ff76833f8 net/dpaa: fix potential memory leak
There are several func calls to rte_zmalloc() which don't do null
pointer check on the return value. And before return, the memory is not
freed. Fix it by adding null pointer check and rte_free().

Fixes: 37f9b54bd3 ("net/dpaa: support Tx and Rx queue setup")
Fixes: 62f53995ca ("net/dpaa: add frame count based tail drop with CGR")
Cc: stable@dpdk.org

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Reviewed-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-01-21 15:51:52 +01:00
Sunil Kumar Kori
5e74559314 net/dpaa: support Rx queue configurations with eventdev
Given ethernet Rx queues can be attached with event queue in
parallel or atomic mode. Patch imlmplements Rx queue
configuration, attachment/detachment with given event queue and their
corresponding callbacks to handle events from respective queues.

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
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
Sunil Kumar Kori
43797e7b47 bus/dpaa: support event dequeue and consumption
To receive events from given event port, corresponding
function needs to be added which receives events
from portal. Also added function to consume received
events based on entry index.

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-19 16:09:56 +01:00
Hemant Agrawal
0c504f6950 net/dpaa: support push mode
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
8c3495f5d2 net/dpaa: support loopback API
PMD specific API is being added as an EXPERIMENTAL API

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
b005d72968 net/dpaa: support Rx queue count
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Nipun Gupta
9ac71da4a0 net/dpaa: optimize Rx path
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Nipun Gupta
5e0789e935 net/dpaa: optimize the Tx burst
Optimize it for best case. Create a function
for TX offloads to be used in multiple legs.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00