* [PATCH net-next v2] ravb: Remove rx buffer ALIGN
@ 2016-05-01 15:19 Yoshihiro Kaneko
2016-05-03 16:45 ` David Miller
2016-05-04 11:13 ` Sergei Shtylyov
0 siblings, 2 replies; 3+ messages in thread
From: Yoshihiro Kaneko @ 2016-05-01 15:19 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Sergei Shtylyov, Simon Horman, Magnus Damm,
linux-renesas-soc
From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Aligning the reception data size is not required.
Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
---
This patch is based on the master branch of David Miller's next networking
tree.
v2 [Yoshihiro Kaneko]
* As suggested by Sergei Shtylyov
remove re-formattings which is not related to the subject of this patch.
drivers/net/ethernet/renesas/ravb_main.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 238b56f..34066e0 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -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++) {
/* RX descriptor */
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(ALIGN(PKT_BUF_SZ, 16));
+ rx_desc->ds_cc = cpu_to_le16(PKT_BUF_SZ);
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);
/* We just set the data size to 0 for a failed mapping which
* should prevent DMA from happening...
@@ -558,7 +557,7 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q)
skb = priv->rx_skb[q][entry];
priv->rx_skb[q][entry] = NULL;
dma_unmap_single(ndev->dev.parent, le32_to_cpu(desc->dptr),
- ALIGN(PKT_BUF_SZ, 16),
+ PKT_BUF_SZ,
DMA_FROM_DEVICE);
get_ts &= (q == RAVB_NC) ?
RAVB_RXTSTAMP_TYPE_V2_L2_EVENT :
@@ -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]++) {
entry = priv->dirty_rx[q] % priv->num_rx_ring[q];
desc = &priv->rx_ring[q][entry];
- /* The size of the buffer should be on 16-byte boundary. */
- desc->ds_cc = cpu_to_le16(ALIGN(PKT_BUF_SZ, 16));
+ desc->ds_cc = cpu_to_le16(PKT_BUF_SZ);
if (!priv->rx_skb[q][entry]) {
skb = netdev_alloc_skb(ndev,
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] ravb: Remove rx buffer ALIGN
2016-05-01 15:19 [PATCH net-next v2] ravb: Remove rx buffer ALIGN Yoshihiro Kaneko
@ 2016-05-03 16:45 ` David Miller
2016-05-04 11:13 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-05-03 16:45 UTC (permalink / raw)
To: ykaneko0929
Cc: netdev, sergei.shtylyov, horms, magnus.damm, linux-renesas-soc
From: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Date: Mon, 2 May 2016 00:19:51 +0900
> From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>
> Aligning the reception data size is not required.
>
> Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> Tested-by: Simon Horman <horms+renesas@verge.net.au>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] ravb: Remove rx buffer ALIGN
2016-05-01 15:19 [PATCH net-next v2] ravb: Remove rx buffer ALIGN Yoshihiro Kaneko
2016-05-03 16:45 ` David Miller
@ 2016-05-04 11:13 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2016-05-04 11:13 UTC (permalink / raw)
To: Yoshihiro Kaneko, netdev
Cc: David S. Miller, Simon Horman, Magnus Damm, linux-renesas-soc
Hello.
On 5/1/2016 6:19 PM, Yoshihiro Kaneko wrote:
> From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>
> Aligning the reception data size is not required.
>
> Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> Tested-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> ---
>
> This patch is based on the master branch of David Miller's next networking
> tree.
>
> v2 [Yoshihiro Kaneko]
> * As suggested by Sergei Shtylyov
> remove re-formattings which is not related to the subject of this patch.
>
> drivers/net/ethernet/renesas/ravb_main.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index 238b56f..34066e0 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -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++) {
> /* RX descriptor */
> 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(ALIGN(PKT_BUF_SZ, 16));
> + rx_desc->ds_cc = cpu_to_le16(PKT_BUF_SZ);
> 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);
I'd expect you to make 2 above lines a single line. Oh well...
> /* We just set the data size to 0 for a failed mapping which
> * should prevent DMA from happening...
> @@ -558,7 +557,7 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q)
> skb = priv->rx_skb[q][entry];
> priv->rx_skb[q][entry] = NULL;
> dma_unmap_single(ndev->dev.parent, le32_to_cpu(desc->dptr),
> - ALIGN(PKT_BUF_SZ, 16),
> + PKT_BUF_SZ,
Likewise.
> DMA_FROM_DEVICE);
> get_ts &= (q == RAVB_NC) ?
> RAVB_RXTSTAMP_TYPE_V2_L2_EVENT :
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-04 11:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-01 15:19 [PATCH net-next v2] ravb: Remove rx buffer ALIGN Yoshihiro Kaneko
2016-05-03 16:45 ` David Miller
2016-05-04 11:13 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).