All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] e1000e: Correctly include VLAN_HLEN when changing interface MTU
@ 2014-04-04 20:48 Vlad Yasevich
  2014-04-04 22:22 ` Jeff Kirsher
  0 siblings, 1 reply; 2+ messages in thread
From: Vlad Yasevich @ 2014-04-04 20:48 UTC (permalink / raw)
  To: netdev; +Cc: Vlad Yasevich, e1000-devel

When changing the interface mtu, the driver starts with a value
that doesn't include VLAN_HLEN.  Later tests in the driver
set the rx_buffer_len based on the mtu.  As a result, when
the user increases the mtu to 1504 (to support 802.1AD for example),
the driver rx_buffer_len does not change and frames longer
the 1522 bytes are rejected as too long.

Include VLAN_HLEN from the start so that an user mtu greater then
1500 bytes is correctly reflected in the driver rx_buffer_len.

CC: e1000-devel@lists.sourceforge.net
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 6d91933..492a136 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -5654,7 +5654,7 @@ struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
 static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
 {
 	struct e1000_adapter *adapter = netdev_priv(netdev);
-	int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
+	int max_frame = new_mtu + VLAN_HLEN + ETH_HLEN + ETH_FCS_LEN;
 
 	/* Jumbo frame support */
 	if ((max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) &&
-- 
1.8.5.3


------------------------------------------------------------------------------
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] e1000e: Correctly include VLAN_HLEN when changing interface MTU
  2014-04-04 20:48 [PATCH net] e1000e: Correctly include VLAN_HLEN when changing interface MTU Vlad Yasevich
@ 2014-04-04 22:22 ` Jeff Kirsher
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Kirsher @ 2014-04-04 22:22 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: netdev, e1000-devel

[-- Attachment #1: Type: text/plain, Size: 875 bytes --]

On Fri, 2014-04-04 at 16:48 -0400, Vlad Yasevich wrote:
> When changing the interface mtu, the driver starts with a value
> that doesn't include VLAN_HLEN.  Later tests in the driver
> set the rx_buffer_len based on the mtu.  As a result, when
> the user increases the mtu to 1504 (to support 802.1AD for example),
> the driver rx_buffer_len does not change and frames longer
> the 1522 bytes are rejected as too long.
> 
> Include VLAN_HLEN from the start so that an user mtu greater then
> 1500 bytes is correctly reflected in the driver rx_buffer_len.
> 
> CC: e1000-devel@lists.sourceforge.net
> CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
> ---
>  drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks Vlad, I will add the patch to my queue.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-04 22:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-04 20:48 [PATCH net] e1000e: Correctly include VLAN_HLEN when changing interface MTU Vlad Yasevich
2014-04-04 22:22 ` Jeff Kirsher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.