Skip to content

Commit 2bbea0a

Browse files
AlbanBedeldavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d543a76 commit 2bbea0a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/realtek/8139too.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
#include <linux/io.h>
113113
#include <linux/uaccess.h>
114114
#include <linux/gfp.h>
115+
#include <linux/if_vlan.h>
115116
#include <asm/irq.h>
116117

117118
#define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION
@@ -182,13 +183,13 @@ static int debug = -1;
182183
/* Number of Tx descriptor registers. */
183184
#define NUM_TX_DESC 4
184185

185-
/* max supported ethernet frame size -- must be at least (dev->mtu+14+4).*/
186+
/* max supported ethernet frame size -- must be at least (dev->mtu+18+4).*/
186187
#define MAX_ETH_FRAME_SIZE 1792
187188

188189
/* max supported payload size */
189-
#define MAX_ETH_DATA_SIZE (MAX_ETH_FRAME_SIZE - ETH_HLEN - ETH_FCS_LEN)
190+
#define MAX_ETH_DATA_SIZE (MAX_ETH_FRAME_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN)
190191

191-
/* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
192+
/* Size of the Tx bounce buffers -- must be at least (dev->mtu+18+4). */
192193
#define TX_BUF_SIZE MAX_ETH_FRAME_SIZE
193194
#define TX_BUF_TOT_LEN (TX_BUF_SIZE * NUM_TX_DESC)
194195

0 commit comments

Comments
 (0)