Commit 094e43d5 authored by Kazuya Mizuguchi's avatar Kazuya Mizuguchi Committed by David S. Miller

ravb: Remove rx buffer ALIGN

Aligning the reception data size is not required.
Signed-off-by: default avatarKazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: default avatarYoshihiro Kaneko <ykaneko0929@gmail.com>
Tested-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ede00a5c
...@@ -246,10 +246,9 @@ static void ravb_ring_format(struct net_device *ndev, int q) ...@@ -246,10 +246,9 @@ static void ravb_ring_format(struct net_device *ndev, int q)
for (i = 0; i < priv->num_rx_ring[q]; i++) { for (i = 0; i < priv->num_rx_ring[q]; i++) {
/* RX descriptor */ /* RX descriptor */
rx_desc = &priv->rx_ring[q][i]; rx_desc = &priv->rx_ring[q][i];
/* The size of the buffer should be on 16-byte boundary. */ rx_desc->ds_cc = cpu_to_le16(PKT_BUF_SZ);
rx_desc->ds_cc = cpu_to_le16(ALIGN(PKT_BUF_SZ, 16));
dma_addr = dma_map_single(ndev->dev.parent, priv->rx_skb[q][i]->data, dma_addr = dma_map_single(ndev->dev.parent, priv->rx_skb[q][i]->data,
ALIGN(PKT_BUF_SZ, 16), PKT_BUF_SZ,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
/* We just set the data size to 0 for a failed mapping which /* We just set the data size to 0 for a failed mapping which
* should prevent DMA from happening... * should prevent DMA from happening...
...@@ -558,7 +557,7 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q) ...@@ -558,7 +557,7 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q)
skb = priv->rx_skb[q][entry]; skb = priv->rx_skb[q][entry];
priv->rx_skb[q][entry] = NULL; priv->rx_skb[q][entry] = NULL;
dma_unmap_single(ndev->dev.parent, le32_to_cpu(desc->dptr), dma_unmap_single(ndev->dev.parent, le32_to_cpu(desc->dptr),
ALIGN(PKT_BUF_SZ, 16), PKT_BUF_SZ,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
get_ts &= (q == RAVB_NC) ? get_ts &= (q == RAVB_NC) ?
RAVB_RXTSTAMP_TYPE_V2_L2_EVENT : RAVB_RXTSTAMP_TYPE_V2_L2_EVENT :
...@@ -588,8 +587,7 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q) ...@@ -588,8 +587,7 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q)
for (; priv->cur_rx[q] - priv->dirty_rx[q] > 0; priv->dirty_rx[q]++) { for (; priv->cur_rx[q] - priv->dirty_rx[q] > 0; priv->dirty_rx[q]++) {
entry = priv->dirty_rx[q] % priv->num_rx_ring[q]; entry = priv->dirty_rx[q] % priv->num_rx_ring[q];
desc = &priv->rx_ring[q][entry]; desc = &priv->rx_ring[q][entry];
/* The size of the buffer should be on 16-byte boundary. */ desc->ds_cc = cpu_to_le16(PKT_BUF_SZ);
desc->ds_cc = cpu_to_le16(ALIGN(PKT_BUF_SZ, 16));
if (!priv->rx_skb[q][entry]) { if (!priv->rx_skb[q][entry]) {
skb = netdev_alloc_skb(ndev, skb = netdev_alloc_skb(ndev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment