From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wenzhuo Lu Subject: [PATCH] net/i40e: consider QinQ when setting MTU Date: Fri, 28 Apr 2017 09:55:23 +0800 Message-ID: <1493344523-58766-1-git-send-email-wenzhuo.lu@intel.com> Cc: Wenzhuo Lu To: dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id E1E072C18 for ; Fri, 28 Apr 2017 03:54:59 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When counting max packet length from MTU, count VLAN tag length twice for QinQ packets. Signed-off-by: Wenzhuo Lu --- 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; int ret = 0; /* check if mtu is within the allowed range */ diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index cb34023..ac81546 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2688,7 +2688,7 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); struct rte_eth_dev_data *dev_data = vf->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; int ret = 0; /* check if mtu is within the allowed range */ -- 1.9.3