summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Bedel <albeu@free.fr>2014-11-23 13:07:54 +0100
committerDavid S. Miller <davem@davemloft.net>2014-11-24 21:26:41 +0100
commit2bbea0a885079a095c252a927a174a0bfec9e3e9 (patch)
tree6c42d8b32f5da4e8bbcd5c6b0369e2f2f9671afe
parentnet: fec: init maximum receive buffer size for ring1 and ring2 (diff)
downloadlinux-2bbea0a885079a095c252a927a174a0bfec9e3e9.tar.xz
linux-2bbea0a885079a095c252a927a174a0bfec9e3e9.zip
8139too: The maximum MTU should allow for VLAN headers
As pointed out by Ben Hutchings drivers that allow using VLAN have to provide enough headroom for the VLAN tags. Signed-off-by: Alban Bedel <albeu@free.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/realtek/8139too.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
index e157541b842b..63dc0f95d050 100644
--- a/drivers/net/ethernet/realtek/8139too.c
+++ b/drivers/net/ethernet/realtek/8139too.c
@@ -112,6 +112,7 @@
#include <linux/io.h>
#include <linux/uaccess.h>
#include <linux/gfp.h>
+#include <linux/if_vlan.h>
#include <asm/irq.h>
#define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION
@@ -182,13 +183,13 @@ static int debug = -1;
/* Number of Tx descriptor registers. */
#define NUM_TX_DESC 4
-/* max supported ethernet frame size -- must be at least (dev->mtu+14+4).*/
+/* max supported ethernet frame size -- must be at least (dev->mtu+18+4).*/
#define MAX_ETH_FRAME_SIZE 1792
/* max supported payload size */
-#define MAX_ETH_DATA_SIZE (MAX_ETH_FRAME_SIZE - ETH_HLEN - ETH_FCS_LEN)
+#define MAX_ETH_DATA_SIZE (MAX_ETH_FRAME_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN)
-/* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
+/* Size of the Tx bounce buffers -- must be at least (dev->mtu+18+4). */
#define TX_BUF_SIZE MAX_ETH_FRAME_SIZE
#define TX_BUF_TOT_LEN (TX_BUF_SIZE * NUM_TX_DESC)