Commit Graph

18 Commits

Author SHA1 Message Date
Ioana Radulescu
d4b3763d38 staging: fsl-dpaa2/eth: Always call napi_gro_receive()
The function itself checks whether GRO support is enabled
and acts accordingly, so we don't need to verify it in the
driver as well.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu
e40ef9e48f staging: fsl-dpaa2/eth: Don't use GFP_DMA
Don't use GFP_DMA when allocating memory for the hash key,
as we don't actually need to allocate from the lowest zone.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu
d87d5baf64 staging: fsl-dpaa2/eth: Minor cleanup in dpaa2_eth_set_hash
We already have a variable for the DMA mapping device,
so use that directly.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu
77160af37c staging: fsl-dpaa2/eth: Add error message newlines
A few error/warning messages lacked a newline at the end
of the text. Add it for improved consistency and cosmetics.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu
e202c82c90 staging: fsl-dpaa2/eth: Remove incorrect error path
Not having Rx hashing distribution enabled for an
interface is a valid configuration and shouldn't be
treated as an error.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu
c433db403b staging: fsl-dpaa2/eth: Fix return type of ndo_start_xmit
ndo_start_xmit() returns a value of type netdev_tx_t. Update
our ndo function to use the correct type.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu
8dffaf8a17 staging: fsl-dpaa2/eth: Initialize variable before use
In dpni_get_irq_status(), status is both in and out parameter,
so initialize before use.
Issue found through static analysis tool.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:53 +02:00
Ioana Radulescu
acbff8e31e staging: fsl-dpaa2/eth: Add "static" keyword where needed
Make a couple of locally used functions and structures static.
Issue found through static analysis tool.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:53 +02:00
Ioana Radulescu
1e5fa9e260 staging: fsl-dpaa2/eth: Map Tx buffers as bidirectional
WRIOP hardware may need to write to the hardware annotation
area of Tx buffers (e.g. frame status bits) and also to
the data area (e.g. L4 checksum in frame header).

Map these buffers as DMA_BIDIRECTIONAL, otherwise the
write transaction through SMMU will not be allowed.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:57:20 +02:00
Ioana Radulescu
08eb23974e staging: fsl-dpaa2/eth: Fix address translations
Use the correct mechanisms for translating a DMA-mapped IOVA
address into a virtual one. Without this fix, once SMMU is
enabled on Layerscape platforms, the Ethernet driver throws
IOMMU translation faults.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:57:20 +02:00
Arnd Bergmann
b72d745120 staging: fsl-dpaa2/eth: add ETHERNET dependency
The new driver cannot link correctly when the netdevice infrastructure
is disabled:

ERROR: "netdev_info" [drivers/staging/fsl-dpaa2/ethernet/fsl-dpaa2-eth.ko] undefined!
ERROR: "skb_to_sgvec" [drivers/staging/fsl-dpaa2/ethernet/fsl-dpaa2-eth.ko] undefined!
ERROR: "napi_disable" [drivers/staging/fsl-dpaa2/ethernet/fsl-dpaa2-eth.ko] undefined!
ERROR: "napi_schedule_prep" [drivers/staging/fsl-dpaa2/ethernet/fsl-dpaa2-eth.ko] undefined!
ERROR: "__napi_schedule_irqoff" [drivers/staging/fsl-dpaa2/ethernet/fsl-dpaa2-eth.ko] undefined!
ERROR: "netif_carrier_on" [drivers/staging/fsl-dpaa2/ethernet/fsl-dpaa2-eth.ko] undefined!

This adds a dependency on NETDEVICES and ETHERNET.

Fixes: 0352d1d852 ("staging: fsl-dpaa2/eth: Add APIs for DPNI objects")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-16 14:23:31 +02:00
Ioana Radulescu
4704b4df32 staging: fsl-dpaa2/eth: Add TODO file
Add a list of TODO items for the Ethernet driver

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28 14:25:17 +02:00
Ioana Radulescu
5636187b60 staging: fsl-dpaa2/eth: Add trace points
Add trace events in significant places of the data path.
Useful for debuggging.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28 14:25:17 +02:00
Ioana Radulescu
85047abd06 staging: fsl-dpaa2/eth: Add driver specific stats
Add custom statistics to be reported via ethtool -S. These include
driver specific per-cpu statistics as well as queue and channel
counters.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28 14:25:17 +02:00
Ioana Radulescu
341967401e staging: fsl-dpaa2/eth: Add ethtool support
Add support for several ethtool operations: show hardware statistics,
get/set link settings, get hash configuration.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28 14:25:17 +02:00
Ioana Radulescu
6e2387e8f1 staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver
Introduce the DPAA2 Ethernet driver, which manages Datapath
Network Interface (DPNI) objects discovered on the MC bus.

In addition to DPNIs, the Ethernet driver uses several other
MC objects to build a network interface abstraction: buffer
pools (DPBPs), I/O Portals (DPIOs) and concentrators (DPCONs).

A more detailed description of the driver can be found in the
associated README file.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28 14:25:17 +02:00
Ioana Radulescu
0352d1d852 staging: fsl-dpaa2/eth: Add APIs for DPNI objects
Add the command build/parse APIs for operating on DPNI objects through
the DPAA2 Management Complex.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28 14:25:17 +02:00
Ioana Radulescu
9425f00e62 staging: fsl-dpaa2/eth: Add Ethernet driver overview document
Add a README file describing the driver architecture, components
and I/O interface.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28 14:25:17 +02:00