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 E7D05A04B5; Thu, 29 Oct 2020 09:41:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4E805BE65; Thu, 29 Oct 2020 09:41:14 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 810C5BE5F for ; Thu, 29 Oct 2020 09:41:12 +0100 (CET) IronPort-SDR: 0CL3qNuiMc0xPi17SWtvxCrhhOjZSDo9kEeBc6BrG6m7PDwmqPtR0lm1GbAmUCEqyv6HMWXZaB 1soQ2AmseTNw== X-IronPort-AV: E=McAfee;i="6000,8403,9788"; a="155367244" X-IronPort-AV: E=Sophos;i="5.77,429,1596524400"; d="scan'208";a="155367244" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2020 01:41:10 -0700 IronPort-SDR: d2IBcdQWyTTg9E8uSJ8pFyO5XU+gwulM839fmy7J+rzfUAoK3YsBFTUi8Vku173fgiT5OY1dEI PU2dCDJThybA== X-IronPort-AV: E=Sophos;i="5.77,429,1596524400"; d="scan'208";a="536583158" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.251.183]) ([10.213.251.183]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2020 01:41:08 -0700 To: SteveX Yang , dev@dpdk.org Cc: konstantin.ananyev@intel.com, beilei.xing@intel.com, wenzhuo.lu@intel.com, bernard.iremonger@intel.com, qiming.yang@intel.com References: <20201022084851.35134-1-stevex.yang@intel.com> <20201028030334.30300-1-stevex.yang@intel.com> <20201028030334.30300-2-stevex.yang@intel.com> From: Ferruh Yigit Message-ID: <37dbc4ab-1ce2-7aac-695f-0e92bbe49df7@intel.com> Date: Thu, 29 Oct 2020 08:41:05 +0000 MIME-Version: 1.0 In-Reply-To: <20201028030334.30300-2-stevex.yang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [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" On 10/28/2020 3:03 AM, SteveX Yang wrote: > 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; > + } I think this jumbo frame set can be dropped, above just set the frame size as "RTE_ETHER_MTU + overhead_len", so it can't be jumbo frame, right?