Skip to content

Commit

Permalink
i40e: add double of VLAN header when computing the max MTU
Browse files Browse the repository at this point in the history
stable inclusion
from stable-v5.10.169
commit 23974088fd6a57922abc80ac7d6219572cd48a4f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7V9QX

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=23974088fd6a57922abc80ac7d6219572cd48a4f

----------------------------------------------------

commit ce45ffb upstream.

Include the second VLAN HLEN into account when computing the maximum
MTU size as other drivers do.

Fixes: 0c8493d ("i40e: add XDP support for pass and drop actions")
Signed-off-by: Jason Xing <kernelxing@tencent.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: zhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
  • Loading branch information
JasonXing authored and zhaoxiaoqiang11 committed Aug 23, 2023
1 parent 5fa68c5 commit 8135e63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2788,7 +2788,7 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)
struct i40e_pf *pf = vsi->back;

if (i40e_enabled_xdp_vsi(vsi)) {
int frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
int frame_size = new_mtu + I40E_PACKET_HDR_PAD;

if (frame_size > i40e_max_xdp_frame_size(vsi))
return -EINVAL;
Expand Down

0 comments on commit 8135e63

Please sign in to comment.