|
@@ -54,7 +54,6 @@
|
|
|
#include <linux/reset.h>
|
|
|
|
|
|
#define STMMAC_ALIGN(x) L1_CACHE_ALIGN(x)
|
|
|
-#define JUMBO_LEN 9000
|
|
|
|
|
|
/* Module parameters */
|
|
|
#define TX_TIMEO 5000
|
|
@@ -93,7 +92,7 @@ static int tc = TC_DEFAULT;
|
|
|
module_param(tc, int, S_IRUGO | S_IWUSR);
|
|
|
MODULE_PARM_DESC(tc, "DMA threshold control value");
|
|
|
|
|
|
-#define DMA_BUFFER_SIZE BUF_SIZE_2KiB
|
|
|
+#define DMA_BUFFER_SIZE BUF_SIZE_4KiB
|
|
|
static int buf_sz = DMA_BUFFER_SIZE;
|
|
|
module_param(buf_sz, int, S_IRUGO | S_IWUSR);
|
|
|
MODULE_PARM_DESC(buf_sz, "DMA buffer size");
|
|
@@ -994,6 +993,8 @@ static int init_dma_desc_rings(struct net_device *dev)
|
|
|
if (bfsize < BUF_SIZE_16KiB)
|
|
|
bfsize = stmmac_set_bfsize(dev->mtu, priv->dma_buf_sz);
|
|
|
|
|
|
+ priv->dma_buf_sz = bfsize;
|
|
|
+
|
|
|
if (netif_msg_probe(priv))
|
|
|
pr_debug("%s: txsize %d, rxsize %d, bfsize %d\n", __func__,
|
|
|
txsize, rxsize, bfsize);
|
|
@@ -1023,7 +1024,6 @@ static int init_dma_desc_rings(struct net_device *dev)
|
|
|
}
|
|
|
priv->cur_rx = 0;
|
|
|
priv->dirty_rx = (unsigned int)(i - rxsize);
|
|
|
- priv->dma_buf_sz = bfsize;
|
|
|
buf_sz = bfsize;
|
|
|
|
|
|
/* Setup the chained descriptor addresses */
|
|
@@ -1624,7 +1624,7 @@ static int stmmac_hw_setup(struct net_device *dev)
|
|
|
priv->plat->bus_setup(priv->ioaddr);
|
|
|
|
|
|
/* Initialize the MAC Core */
|
|
|
- priv->hw->mac->core_init(priv->ioaddr);
|
|
|
+ priv->hw->mac->core_init(priv->ioaddr, dev->mtu);
|
|
|
|
|
|
/* Enable the MAC Rx/Tx */
|
|
|
stmmac_set_mac(priv->ioaddr, true);
|
|
@@ -2274,6 +2274,9 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
|
|
|
else
|
|
|
max_mtu = SKB_MAX_HEAD(NET_SKB_PAD + NET_IP_ALIGN);
|
|
|
|
|
|
+ if (priv->plat->maxmtu < max_mtu)
|
|
|
+ max_mtu = priv->plat->maxmtu;
|
|
|
+
|
|
|
if ((new_mtu < 46) || (new_mtu > max_mtu)) {
|
|
|
pr_err("%s: invalid MTU, max MTU is: %d\n", dev->name, max_mtu);
|
|
|
return -EINVAL;
|