From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4A16A3201 for ; Mon, 21 Oct 2019 04:48:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 912B229D2; Mon, 21 Oct 2019 04:48:03 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id B6B222AB; Mon, 21 Oct 2019 04:48:01 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2019 19:48:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,321,1566889200"; d="scan'208";a="227173518" Received: from npg-dpdk-zhangxiao.sh.intel.com ([10.67.110.190]) by fmsmga002.fm.intel.com with ESMTP; 20 Oct 2019 19:47:59 -0700 From: Xiao Zhang To: dev@dpdk.org Cc: ktraynor@redhat.com, ian.stokes@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com, Xiao Zhang , stable@dpdk.org Date: Mon, 21 Oct 2019 10:44:51 +0800 Message-Id: <1571625891-8986-1-git-send-email-xiao.zhang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1571039632-5524-1-git-send-email-xiao.zhang@intel.com> References: <1571039632-5524-1-git-send-email-xiao.zhang@intel.com> Subject: [dpdk-dev] [v2] net/i40e: fix vlan packets drop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Vlan packets with ip length bigger then 1496 will not be received by i40e/i40evf due to wrong packets size checking. This patch fixes the issue by correcting the maximum frame size during checking. Fixes: 43e5488c0ac6 ("net/i40e: support MTU configuration") Cc: stable@dpdk.org Signed-off-by: Xiao Zhang --- v2 add fix for i40evf and correct the checking when using the max_pkt_len. --- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 8 +++++--- drivers/net/i40e/i40e_rxtx.c | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 2ca14da..156d67b 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -12103,7 +12103,7 @@ i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) return -EBUSY; } - if (frame_size > RTE_ETHER_MAX_LEN) + if (frame_size > RTE_ETHER_MAX_LEN + I40E_VLAN_TAG_SIZE * 2) dev_data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; else diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 5dba092..bc825e2 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1782,12 +1782,14 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq) } } else { if (rxq->max_pkt_len < RTE_ETHER_MIN_LEN || - rxq->max_pkt_len > RTE_ETHER_MAX_LEN) { + rxq->max_pkt_len > RTE_ETHER_MAX_LEN + + I40E_VLAN_TAG_SIZE * 2) { PMD_DRV_LOG(ERR, "maximum packet length must be " "larger than %u and smaller than %u, as jumbo " "frame is disabled", (uint32_t)RTE_ETHER_MIN_LEN, - (uint32_t)RTE_ETHER_MAX_LEN); + (uint32_t)RTE_ETHER_MAX_LEN + + I40E_VLAN_TAG_SIZE * 2); return I40E_ERR_CONFIG; } } @@ -2747,7 +2749,7 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) return -EBUSY; } - if (frame_size > RTE_ETHER_MAX_LEN) + if (frame_size > RTE_ETHER_MAX_LEN + I40E_VLAN_TAG_SIZE * 2) dev_data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; else diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index ff6eb4a..0c178e3 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -2634,12 +2634,14 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) } } else { if (rxq->max_pkt_len < RTE_ETHER_MIN_LEN || - rxq->max_pkt_len > RTE_ETHER_MAX_LEN) { + rxq->max_pkt_len > RTE_ETHER_MAX_LEN + + I40E_VLAN_TAG_SIZE * 2) { PMD_DRV_LOG(ERR, "maximum packet length must be " "larger than %u and smaller than %u, " "as jumbo frame is disabled", (uint32_t)RTE_ETHER_MIN_LEN, - (uint32_t)RTE_ETHER_MAX_LEN); + (uint32_t)RTE_ETHER_MAX_LEN + + I40E_VLAN_TAG_SIZE * 2); return I40E_ERR_CONFIG; } } -- 2.7.4