[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0aa8c77f-ab78-141a-c81d-a877cccd6bb1@cogentembedded.com>
Date: Tue, 13 Feb 2018 13:01:04 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Niklas Söderlund
<niklas.soderlund+renesas@...natech.se>,
"David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Cc: linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH] ravb: add support for changing MTU
Hello!
On 02/12/2018 11:00 PM, Niklas Söderlund wrote:
> Allow for chancing the MTU within the limit of the maximum size of a
Changing. :-)
> descriptor (2048 bytes). Add the callback to change MTU from user-space
> and take the configurable MTU into account when configuring the
> hardware.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
[...]
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index c87f57ca44371586..a4870c9e42195802 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -300,9 +300,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];
> - rx_desc->ds_cc = cpu_to_le16(PKT_BUF_SZ);
> + rx_desc->ds_cc = cpu_to_le16(priv->rx_buf_sz);
> dma_addr = dma_map_single(ndev->dev.parent, priv->rx_skb[q][i]->data,
> - PKT_BUF_SZ,
> + le16_to_cpu(rx_desc->ds_cc),
Why not 'priv->rx_buf_sz'?
[...]
> @@ -346,6 +346,10 @@ static int ravb_ring_init(struct net_device *ndev, int q)
> int ring_size;
> int i;
>
> + /* +16 gets room from the status from the card. */
> + priv->rx_buf_sz = (ndev->mtu <= 1492 ? PKT_BUF_SZ : ndev->mtu) +
> + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN + 16;
Mhm, I don't think FCS gets added to the frame buffer... And why add 16?
[...]
MBR, Sergei
Powered by blists - more mailing lists