Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48febf7e authored by Giuseppe CAVALLARO's avatar Giuseppe CAVALLARO Committed by David S. Miller
Browse files

stmmac: allow mtu bigger than 1500 in case of normal desc (V4)



This patch allows to set the mtu bigger than 1500
in case of normal descriptors.
This is helping some SPEAr customers.

Signed-off-by: default avatarDeepak SIKRI <deepak.sikri@st.com>
Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51e3137b
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -126,6 +126,7 @@ static void ndesc_init_rx_desc(struct dma_desc *p, unsigned int ring_size,
	for (i = 0; i < ring_size; i++) {
	for (i = 0; i < ring_size; i++) {
		p->des01.rx.own = 1;
		p->des01.rx.own = 1;
		p->des01.rx.buffer1_size = BUF_SIZE_2KiB - 1;
		p->des01.rx.buffer1_size = BUF_SIZE_2KiB - 1;
		p->des01.rx.buffer2_size = BUF_SIZE_2KiB - 1;
		if (i == ring_size - 1)
		if (i == ring_size - 1)
			p->des01.rx.end_ring = 1;
			p->des01.rx.end_ring = 1;
		if (disable_rx_ic)
		if (disable_rx_ic)
@@ -183,6 +184,11 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
				  int csum_flag)
				  int csum_flag)
{
{
	p->des01.tx.first_segment = is_fs;
	p->des01.tx.first_segment = is_fs;

	if (unlikely(len > BUF_SIZE_2KiB)) {
		p->des01.etx.buffer1_size = BUF_SIZE_2KiB - 1;
		p->des01.etx.buffer2_size = len - p->des01.etx.buffer1_size;
	} else
		p->des01.tx.buffer1_size = len;
		p->des01.tx.buffer1_size = len;
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -1412,10 +1412,10 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
		return -EBUSY;
		return -EBUSY;
	}
	}


	if (priv->plat->has_gmac)
	if (priv->plat->enh_desc)
		max_mtu = JUMBO_LEN;
		max_mtu = JUMBO_LEN;
	else
	else
		max_mtu = ETH_DATA_LEN;
		max_mtu = BUF_SIZE_4KiB;


	if ((new_mtu < 46) || (new_mtu > max_mtu)) {
	if ((new_mtu < 46) || (new_mtu > max_mtu)) {
		pr_err("%s: invalid MTU, max MTU is: %d\n", dev->name, max_mtu);
		pr_err("%s: invalid MTU, max MTU is: %d\n", dev->name, max_mtu);