summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
Commit message (Collapse)AuthorAgeFilesLines
* staging: fsl-dpaa2/eth: Use affine DPIO servicesIoana Radulescu2018-01-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the newly added DPIO service API to map cpu-affine DPIO services to channels. The DPAA2 Ethernet driver already had mappings of frame queues and channels to cpus, but had no control over the DPIOs used. We can now ensure full affinity of hotpath hardware resources to cores, which improves performance and almost eliminates some resource contentions (e.g. enqueue/dequeue busy counters should be close to zero from now on). Making the pull channel operation core affine brings the most significant benefits. This ensures the same DPIO service will be used for all dequeue commands issued for a certain frame queue, which is in line with the way hardware is optimized. Additionally, we also use affine DPIOs for the frame enqueue and buffer release operations in order to avoid resource contention. dpaa2_io_service_register() and dpaa2_io_service_rearm() functions receive an affine DPIO as argument mostly for uniformity, but this doesn't change the previous functionality. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Flow affinity for IP forwardingIoana Radulescu2017-12-211-1/+2
| | | | | | | | | | | | | | | | The driver xmit function chooses an egress FQ based on the current core id. The network stack itself sets a mapping field in the skb based on many things - the default one being a hash on packet fields, which the current driver ignores. This patch saves the ingress frame flow affinity information in the skb. In case of forwarded frames, this info will then be used for Tx and Tx confirmation hardware queue selection, ensuring all processing of the given frame is done on a single core. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Make Tx buffer alignment optionalIoana Radulescu2017-12-081-1/+1
| | | | | | | | | | | | | | Aligning the Tx buffers at 64B is a performance optimization recommendation, not a hard requirement. Make optional the alignment of Tx FD buffers, without enforcing a reallocation in case there is not enough headroom for it. On Rx, we keep allocating buffers with enough headroom to allow Tx alignment of forwarded frames. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Compute needed headroom per frameIoana Radulescu2017-12-081-3/+8
| | | | | | | | | | | | For non-linear skbs we build scatter-gather frames and allocate a new buffer for the S/G table in which we reserve the required headroom, so the actual skb headroom size doesn't matter. Rather than use a one-size-fits-all approach, decide when to enforce headroom requirements on a frame by frame basis. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Don't enable FAS on TxIoana Radulescu2017-12-081-6/+0Star
| | | | | | | | | | | | | | | | | | | For Tx confirmed frames that have an error indication in the frame descriptor, we look at the Frame Annotation Status field (in the buffer headroom) for details on the root cause and then print a debug message with that information. While useful in initial development stages, it doesn't bring enough added value to justify reserving 64B of headroom for all Tx frames (FAS is only 8B long, but we must reserve chunks of 64B from the hardware annotation area). If we remove the need for FAS field from egress frames, we can renounce hardware annotation completely, since FAS is the only HWA field we currently use. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Add counter for skb reallocsIoana Radulescu2017-12-081-0/+1
| | | | | | | | Add a counter for the number of egress frames that need to be realloc'ed due to insufficient headroom space. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Don't set netdev->needed_headroomIoana Radulescu2017-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | Commit 4b2d9fe87950 ("staging: fsl-dpaa2/eth: Extra headroom in RX buffers") tried to avoid the performance penalty of doing skb reallocations in the network stack for IP forwarded frames between two DPAA2 Ethernet interfaces. This led to a (too) complicated formula that relies on the stack's internal implementation. Instead, it's safer and easier to just not request any guarantee from the stack. We already double check in the driver the required headroom size of egress frames and realloc the skb if needed, so we don't need to add any extra code. On forwarding between two of our own interfaces, there is no functional change; for traffic forwarded from a different device or generated on the core, skb realloc operations are moved from the stack to our driver, with no visible impact on performance. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Fix access to FAS fieldIoana Radulescu2017-12-081-4/+9
| | | | | | | | | | | | | | | | | | | Commit 4b2d9fe87950 ("staging: fsl-dpaa2/eth: Extra headroom in RX buffers") removes the software annotation (SWA) area from the RX buffer layout, as it's not used by anyone, but fails to update the macros for accessing hardware annotation (HWA) fields, which is right after the SWA in the buffer headroom. This may lead to some frame annotation status fields (e.g. indication if L3/L4 checksum is valid) to be read incorrectly. Turn the accessor macros into inline functions and add a bool param to specify if SWA is present or not. Fixes: 4b2d9fe87950 ("staging: fsl-dpaa2/eth: Extra headroom in RX buffers") Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Extra headroom in RX buffersBogdan Purcareata2017-11-031-13/+26
| | | | | | | | | | | | | | | | | | | | The needed headroom that we ask the stack to reserve for us in TX skbs is larger than the headroom available in RX frames, which leads to skb reallocations in forwarding scenarios involving two DPNI interfaces. Configure the hardware to reserve some extra space in the RX frame headroom to avoid this situation. The value is chosen based on the Tx frame data offset, the Rx buffer alignment value and the netdevice required headroom. The network stack will take care to reserve space for HH_DATA_MOD when building the skb, so there's no need to account for it in the netdevice needed headroom. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Change RX buffer alignmentBogdan Purcareata2017-11-031-8/+19
| | | | | | | | | | | | | | The WRIOP hardware block v1.0.0 (found on LS2080A board) requires data in RX buffers to be aligned to 256B, but newer revisions (e.g. on LS2088A, LS1088A) only require 64B alignment. Check WRIOP version and decide at runtime which alignment requirement to configure for ingress buffers. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: fix off-by-one FD ctrl bitmaksHoria Geantă2017-09-011-2/+2
| | | | | | | | | | Fix the values of DPAA2_FD_CTRL_FSE and DPAA2_FD_CTRL_FAERR, which are shifted off by one bit. Fixes: 39163c0ce0f48 ("staging: fsl-dpaa2/eth: Errors checking update") Cc: <stable@vger.kernel.org> Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Errors checking updateIoana Radulescu2017-06-131-2/+15
| | | | | | | | | | On the egress path, frame errors are reported using both a FD control field and the frame annotation status. The current code only handles FAS errors. Update to look at both fields when accounting Tx errors. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Only store bpid in priv structIoana Radulescu2017-06-131-1/+1
| | | | | | | | | We only need to know the buffer pool id, so save exactly that in the device's private structure, instead of the entire DPBP attributes struct. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Remove unused fields from priv structIoana Radulescu2017-06-131-5/+0Star
| | | | | | | | | Remove the dpni_id and buffer_layout fields from device's private structure. They're only used at probe so we don't need to store them for further use. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Add accessor for FAS fieldIoana Radulescu2017-06-131-0/+6
| | | | | | | | Introduce a helper macro for accessing the frame annotation status field in a frame buffer. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fsl-dpaa2/eth: Add "static" keyword where neededIoana Radulescu2017-06-131-2/+0Star
| | | | | | | | 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>
* staging: fsl-dpaa2/eth: Fix address translationsIoana Radulescu2017-05-291-0/+1
| | | | | | | | | | | 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>
* staging: fsl-dpaa2/eth: Add trace pointsIoana Radulescu2017-04-281-0/+2
| | | | | | | | 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>
* staging: fsl-dpaa2/eth: Add driver specific statsIoana Radulescu2017-04-281-0/+36
| | | | | | | | | 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>
* staging: fsl-dpaa2/eth: Add ethtool supportIoana Radulescu2017-04-281-0/+6
| | | | | | | | | 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>
* staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driverIoana Radulescu2017-04-281-0/+304
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>