Skip to content

Commit

Permalink
cxgb3: FIx VLAN over Jumbo frames
Browse files Browse the repository at this point in the history
The mac is expected to auto-inflate the Maximum Frame size for VLAN
tagged frames. It however does not work with jumbo frames.
Work around the bug adding 4 to the Maximum Frame for MTUs
greater than 1536.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Divy Le Ray authored and David S. Miller committed Feb 16, 2010
1 parent d41a5b7 commit 38a8fc0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/cxgb3/xgmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu)
* packet size register includes header, but not FCS.
*/
mtu += 14;
if (mtu > 1536)
mtu += 4;

if (mtu > MAX_FRAME_SIZE - 4)
return -EINVAL;
t3_write_reg(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, mtu);
Expand Down

0 comments on commit 38a8fc0

Please sign in to comment.