From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19C5263B8 for ; Mon, 20 Feb 2023 13:50:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 961BEC433D2; Mon, 20 Feb 2023 13:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1676901032; bh=9UbrwpKXZlR+8JDKfzG5Nt3iXh1quS0sWl4rbZlify0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L2QabQNMM1x1+4ZqOdfAEg0ydQbEGoaPedSBZ/PMHGam9bB2XrV5f+kBtmjvzLdL0 XnoVAJ/GQLyempKrOdxM+UA5UikiWA/E9Pl5SAskYp61+Lw+1nUn52GMtk7DVVZNSs Dzgq5+P27TLVfeLOqCstGaMHBsbZe89LnRq5labk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jason Xing , Alexander Duyck , Tony Nguyen , Chandan Kumar Rout Subject: [PATCH 5.4 139/156] i40e: add double of VLAN header when computing the max MTU Date: Mon, 20 Feb 2023 14:36:23 +0100 Message-Id: <20230220133608.437396177@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230220133602.515342638@linuxfoundation.org> References: <20230220133602.515342638@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Jason Xing commit ce45ffb815e8e238f05de1630be3969b6bb15e4e upstream. Include the second VLAN HLEN into account when computing the maximum MTU size as other drivers do. Fixes: 0c8493d90b6b ("i40e: add XDP support for pass and drop actions") Signed-off-by: Jason Xing Reviewed-by: Alexander Duyck Tested-by: Chandan Kumar Rout (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -2702,7 +2702,7 @@ static int i40e_change_mtu(struct net_de 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;