[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D17257A04@AcuExch.aculab.com>
Date: Thu, 5 Jun 2014 08:17:34 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Jeff Kirsher' <jeffrey.t.kirsher@...el.com>,
"davem@...emloft.net" <davem@...emloft.net>
CC: Jesse Brandeburg <jesse.brandeburg@...el.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"gospo@...hat.com" <gospo@...hat.com>,
"sassmann@...hat.com" <sassmann@...hat.com>
Subject: RE: [net-next 06/14] i40e: clamp jumbo frame size
From: Jeff Kirsher
> From: Jesse Brandeburg <jesse.brandeburg@...el.com>
>
> The driver was allowing the user to set larger size MTU
> than the hardware was being configured to support.
>
> The driver was already using VLAN_HLEN when setting the
> hardware max receivable frame size, so just add it to the
> netdev MTU set entry point as well.
...
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -1698,7 +1698,7 @@ static void i40e_sync_filters_subtask(struct i40e_pf *pf)
> static int i40e_change_mtu(struct net_device *netdev, int new_mtu)
> {
> struct i40e_netdev_priv *np = netdev_priv(netdev);
> - int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
> + int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
Personally I'd write that sum as:
int max_frame = ETH_HLEN + VLAN_HLEN + new_mtu + ETH_FCS_LEN;
so that the lengths are in the order the fields appear in the frame.
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists