summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
AgeCommit message (Collapse)Author
2018-11-28dpaa2-eth: Add support for XDP_TXIoana Ciocoi Radulescu
Send frames back on the same port for XDP_TX action. Since the frame buffers have been allocated by us, we can recycle them directly into the Rx buffer pool instead of requesting a confirmation frame upon transmission complete. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-28dpaa2-eth: Release buffers back to pool on XDP_DROPIoana Ciocoi Radulescu
Instead of freeing the RX buffers, release them back into the pool. We wait for the maximum number of buffers supported by a single release command to accumulate before issuing the command. Also, don't unmap the Rx buffers at the beginning of the Rx routine anymore, since that would require remapping them before release. Instead, just do a DMA sync at first and only unmap if the frame is meant for the stack. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-28dpaa2-eth: Add basic XDP supportIoana Ciocoi Radulescu
We keep one XDP program reference per channel. The only actions supported for now are XDP_DROP and XDP_PASS. Until now we didn't enforce a maximum size for Rx frames based on MTU value. Change that, since for XDP mode we must ensure no scatter-gather frames can be received. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Acked-by: Camelia Groza <camelia.groza@nxp.com> Reviewed-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-16dpaa2-eth: bql supportIoana Ciocoi Radulescu
Add support for byte queue limit. On NAPI poll, we save the total number of Tx confirmed frames/bytes and register them with bql at the end of the poll function. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-16dpaa2-eth: Update callback signatureIoana Ciocoi Radulescu
Change the frame consume callback signature: * the entire FQ structure is passed to the callback instead of just the queue index * the NAPI structure can be easily obtained from the channel it is associated to, so we don't need to pass it explicitly Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-16dpaa2-eth: Don't use multiple queues per channelIoana Ciocoi Radulescu
The DPNI object on which we build a network interface has a certain number of {Rx, Tx, Tx confirmation} frame queues as resources. The default hardware setup offers one queue of each type, as well as one DPCON channel, for each core available in the system. There are however cases where the number of queues is greater than the number of cores or channels. Until now, we configured and used all the frame queues associated with a DPNI, even if it meant assigning multiple queues of one type to the same channel. Update the driver to only use a number of queues equal to the number of channels, ensuring each channel will contain exactly one Rx and one Tx confirmation queue. >From the user viewpoint, this change is completely transparent. Performance wise there is no impact in most scenarios. In case the number of queues is larger than and not a multiple of the number of channels, Rx hash distribution offers now better load balancing between cores, which can have a positive impact on overall system performance. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-10-08dpaa2-eth: Don't account Tx confirmation frames on NAPI pollIoana Ciocoi Radulescu
Until now, both Rx and Tx confirmation frames handled during NAPI poll were counted toward the NAPI budget. However, Tx confirmations are lighter to process than Rx frames, which can skew the amount of work actually done inside one NAPI cycle. Update the code to only count Rx frames toward the NAPI budget and set a separate threshold on how many Tx conf frames can be processed in one poll cycle. The NAPI poll routine stops when either the budget is consumed by Rx frames or when Tx confirmation frames reach this threshold. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-10-02dpaa2-eth: Add ethtool support for flow classificationIoana Radulescu
Add support for inserting and deleting Rx flow classification rules through ethtool. We support classification based on some header fields for flow-types ether, ip4, tcp4, udp4 and sctp4. Rx queues are core affine, so the action argument effectively selects on which cpu the matching frame will be processed. Discarding the frame is also supported. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-10-02dpaa2-eth: Configure Rx flow classification keyIoana Radulescu
For firmware versions that support it, configure an Rx flow classification key at probe time. Hardware expects all rules in the classification table to share the same key. So we setup a key containing all supported fields at driver init and when a user adds classification rules through ethtool, we will just mask out the unused header fields. Since the key composition process is the same for flow classification and hashing, reuse existing code where possible. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-10-02dpaa2-eth: Rename structureIoana Radulescu
Since the array of supported header fields will be used for Rx flow classification as well, rename it from "hash_fields" to the more inclusive "dist_fields". Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-10-02dpaa2-eth: Use new API for Rx flow hashingIoana Radulescu
The Management Complex (MC) firmware initially allowed the configuration of a single key to be used both for Rx flow hashing and flow classification. This prevented us from supporting Rx flow classification through ethtool. Starting with version 10.7.0, the Management Complex(MC) offers a new set of APIs for separate configuration of Rx hashing and classification keys. Update the Rx flow hashing support to use the new API, if available. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-24dpaa2-eth: Make Rx flow hash key configurableIoana Ciocoi Radulescu
Until now, the Rx flow hash key was a 5-tuple (IP src, IP dst, IP nextproto, L4 src port, L4 dst port) fixed value that we configured at probe. Add support for configuring this hash key at runtime. We support all standard header fields configurable through ethtool, but cannot differentiate between flow types, so the same hash key is applied regardless of protocol. We also don't support the discard option. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-01dpaa2-eth: Move DPAA2 Ethernet driver from staging to drivers/netIoana Radulescu
The DPAA2 Ethernet driver supports Freescale/NXP SoCs with DPAA2 (DataPath Acceleration Architecture v2). The driver manages network objects discovered on the fsl-mc bus. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>