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 D793FA09E0; Fri, 13 Nov 2020 15:55:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C5CAC8B2; Fri, 13 Nov 2020 15:53:26 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by dpdk.org (Postfix) with ESMTP id 23A69C8B0 for ; Fri, 13 Nov 2020 15:53:24 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 6C1FD7F503; Fri, 13 Nov 2020 17:53:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 6C1FD7F503 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1605279202; bh=01aBo9/PDt9fJhCJbVra5CGU4VCvtqW60Pj1Onii4hk=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=JNWVzHIV3SMxm3/StvZVIy/PPBsRTOlEq5SRyDg/oZ/xm68nuz9RijrC/McsoEOak mWrs/oGlO3PGc01vCKWpgGAo/WtMq28sDsaKqPk+e2ujXJ8cKiqTKuAmKUJCs+f3Jn GqlUUAah3pP8xeX3nqSNbO2Og5SaNw2uaf+yhubo= To: Ferruh Yigit , Wenzhuo Lu , Beilei Xing , Bernard Iremonger Cc: dev@dpdk.org, Qi Zhang , Steve Yang , Thomas Monjalon , Konstantin Ananyev , Olivier Matz , Lance Richardson , Igor Romanov References: <20201105180942.2938152-1-ferruh.yigit@intel.com> <20201113114400.3356527-1-ferruh.yigit@intel.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <336c632d-a0b0-464d-09a1-881c2b3f74ff@oktetlabs.ru> Date: Fri, 13 Nov 2020 17:53:22 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201113114400.3356527-1-ferruh.yigit@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix MTU after device configure 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 11/13/20 2:44 PM, Ferruh Yigit wrote: > In 'rte_eth_dev_configure()', if 'DEV_RX_OFFLOAD_JUMBO_FRAME' is not set > the max frame size is limited to 'RTE_ETHER_MAX_LEN' (1518). > This is mistake because for the PMDs that has frame size bigger than > "RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN" (18 bytes), the MTU becomes > less than 1500, causing a valid frame with 1500 bytes payload to be > dropped. > > Since 'rte_eth_dev_set_mtu()' works as expected, it is called after > 'rte_eth_dev_configure()' to fix the MTU. > It may look redundant to set MTU after 'rte_eth_dev_configure()', both > with default values, but it is not, the resulting MTU config can be > different in the device based on frame overhead of the PMD. > > And instead of setting the MTU to default value, it is first get via > 'rte_eth_dev_get_mtu()' and set again, this is to cover cases MTU > changed from testpmd command line. > > 'rte_eth_dev_set_mtu()', '-ENOTSUP' error is ignored to prevent > irrelevant warning messages for the virtual PMDs. > > Signed-off-by: Ferruh Yigit > Reviewed-by: Qi Zhang Acked-by: Andrew Rybchenko Tested-by: Igor Romanov