From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ferruh.yigit@intel.com>
Received: from mga05.intel.com (mga05.intel.com [192.55.52.43])
 by dpdk.org (Postfix) with ESMTP id F04FB9E3
 for <dev@dpdk.org>; Fri, 28 Apr 2017 07:55:27 +0200 (CEST)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by fmsmga105.fm.intel.com with ESMTP; 27 Apr 2017 22:55:25 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="79926876"
Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.252.172.161])
 ([10.252.172.161])
 by orsmga002.jf.intel.com with ESMTP; 27 Apr 2017 22:55:24 -0700
To: Wenzhuo Lu <wenzhuo.lu@intel.com>, dev@dpdk.org
References: <1493344523-58766-1-git-send-email-wenzhuo.lu@intel.com>
From: Ferruh Yigit <ferruh.yigit@intel.com>
Message-ID: <cd481aaf-cd6a-05cb-69c3-38ef928073bd@intel.com>
Date: Fri, 28 Apr 2017 06:55:23 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
 Thunderbird/52.0.1
MIME-Version: 1.0
In-Reply-To: <1493344523-58766-1-git-send-email-wenzhuo.lu@intel.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH] net/i40e: consider QinQ when setting MTU
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Apr 2017 05:55:28 -0000

On 4/28/2017 2:55 AM, Wenzhuo Lu wrote:
> When counting max packet length from MTU, count
> VLAN tag length twice for QinQ packets.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c    | 2 +-
>  drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 3fa25dc..74041ae 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -10593,7 +10593,7 @@ static void i40e_set_default_mac_addr(struct rte_eth_dev *dev,
>  	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
>  	struct rte_eth_dev_data *dev_data = pf->dev_data;
>  	uint32_t frame_size = mtu + ETHER_HDR_LEN
> -			      + ETHER_CRC_LEN + I40E_VLAN_TAG_SIZE;
> +			      + ETHER_CRC_LEN + I40E_VLAN_TAG_SIZE * 2;

Hi Wenzhuo,

Shouldn't we check if QinQ enabled before taking size account?