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 B5F51A04DD; Wed, 28 Oct 2020 04:05:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 29A7C5953; Wed, 28 Oct 2020 04:05:20 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id D12FB5916 for ; Wed, 28 Oct 2020 04:05:12 +0100 (CET) IronPort-SDR: PnfJ5VcsC3QXKvpj+NM8uRdXpapzFIMNUUrFO4dAXoFdIkyH0mRBTcz0H4FUFOZWJg2kx2VZvS pJ08jhxHKWVA== X-IronPort-AV: E=McAfee;i="6000,8403,9787"; a="232379876" X-IronPort-AV: E=Sophos;i="5.77,425,1596524400"; d="scan'208";a="232379876" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2020 20:05:06 -0700 IronPort-SDR: h4R5KWI9NQEfeKITfBpLrvYEmbSrsKdZc7azBspvMrVkiAjD5acnFrgijSC7GqMBbOzvjH8y5s 9lzDAIYsq2Ww== X-IronPort-AV: E=Sophos;i="5.77,425,1596524400"; d="scan'208";a="536051664" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2020 20:05:03 -0700 From: SteveX Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, konstantin.ananyev@intel.com, beilei.xing@intel.com, wenzhuo.lu@intel.com, bernard.iremonger@intel.com, qiming.yang@intel.com, SteveX Yang Date: Wed, 28 Oct 2020 03:03:34 +0000 Message-Id: <20201028030334.30300-2-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201028030334.30300-1-stevex.yang@intel.com> References: <20201022084851.35134-1-stevex.yang@intel.com> <20201028030334.30300-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v7 1/1] app/testpmd: fix max rx packet length for VLAN packets 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" When the max rx packet length is smaller than the sum of mtu size and ether overhead size, it should be enlarged, otherwise the VLAN packets will be dropped. Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines") Signed-off-by: SteveX Yang --- app/test-pmd/testpmd.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 33fc0fddf..754066950 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1421,6 +1421,7 @@ init_config(void) struct rte_gro_param gro_param; uint32_t gso_types; uint16_t data_size; + uint16_t overhead_len; bool warning = 0; int k; int ret; @@ -1457,6 +1458,25 @@ init_config(void) rte_exit(EXIT_FAILURE, "rte_eth_dev_info_get() failed\n"); + /* Update the max_rx_pkt_len to have MTU as RTE_ETHER_MTU */ + if (port->dev_info.max_rx_pktlen && port->dev_info.max_mtu) + overhead_len = port->dev_info.max_rx_pktlen - + port->dev_info.max_mtu; + else + overhead_len = RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; + + port->dev_conf.rxmode.max_rx_pkt_len = + RTE_ETHER_MTU + overhead_len; + + /* + * Workaround: only adapt to RTE_ETHER_MAX_LEN as + * jumbo frame condition. + */ + if (port->dev_conf.rxmode.max_rx_pkt_len > RTE_ETHER_MAX_LEN) { + port->dev_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; + } + if (!(port->dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)) port->dev_conf.txmode.offloads &= -- 2.17.1