|
|
@@ -433,13 +433,19 @@ static int build_single_fd(struct dpaa2_eth_priv *priv,
|
|
|
struct dpaa2_fd *fd)
|
|
|
{
|
|
|
struct device *dev = priv->net_dev->dev.parent;
|
|
|
- u8 *buffer_start;
|
|
|
+ u8 *buffer_start, *aligned_start;
|
|
|
struct sk_buff **skbh;
|
|
|
dma_addr_t addr;
|
|
|
|
|
|
- buffer_start = PTR_ALIGN(skb->data -
|
|
|
- dpaa2_eth_needed_headroom(priv, skb),
|
|
|
- DPAA2_ETH_TX_BUF_ALIGN);
|
|
|
+ buffer_start = skb->data - dpaa2_eth_needed_headroom(priv, skb);
|
|
|
+
|
|
|
+ /* If there's enough room to align the FD address, do it.
|
|
|
+ * It will help hardware optimize accesses.
|
|
|
+ */
|
|
|
+ aligned_start = PTR_ALIGN(buffer_start - DPAA2_ETH_TX_BUF_ALIGN,
|
|
|
+ DPAA2_ETH_TX_BUF_ALIGN);
|
|
|
+ if (aligned_start >= skb->head)
|
|
|
+ buffer_start = aligned_start;
|
|
|
|
|
|
/* Store a backpointer to the skb at the beginning of the buffer
|
|
|
* (in the private data area) such that we can release it
|