From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 24A2AA0C57; Mon, 1 Nov 2021 10:42:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02CB640DF6; Mon, 1 Nov 2021 10:42:25 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 48DF640040 for ; Mon, 1 Nov 2021 10:42:24 +0100 (CET) Received: from [192.168.1.71] (unknown [188.170.83.209]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 0E95F7F4E2; Mon, 1 Nov 2021 12:42:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 0E95F7F4E2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1635759744; bh=gxuepEHGA+8bnSnRabgesHDk/7KQGC2Gkjkxw3pLuhk=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=I4uhFa9ZBR3QvSIZVazGh3xsdSSQjss0+dNxqK0o8WKKhlWtCaKpki80UFZs1Hf8n 90J6UbrjUUzXn6uRnCdLP3mJy0NWEOHvVTNFAEfVabPoMwRQr1O3+aYzuIVx+g0gG7 0qEy4u+/Ygv5LrkFImz8GyzAR7zk7cUM7WDDMC5A= To: "Jiang, YuX" , "Yigit, Ferruh" , Thomas Monjalon , Ajit Khaparde , Huisong Li , "Ananyev, Konstantin" , "Xu, Rosen" Cc: "dev@dpdk.org" , Ivan Ilchenko References: <20211022101828.649441-1-andrew.rybchenko@oktetlabs.ru> <116518a0-cdb5-b4f0-a9b0-f58864904b7a@oktetlabs.ru> From: Andrew Rybchenko Message-ID: Date: Mon, 1 Nov 2021 12:42:22 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] ethdev: forbid MTU set before device configure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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/1/21 12:39 PM, Jiang, YuX wrote: >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Friday, October 29, 2021 5:22 PM >> To: Andrew Rybchenko ; Jiang, YuX >> ; Thomas Monjalon ; Ajit >> Khaparde ; Huisong Li >> ; Ananyev, Konstantin >> ; Xu, Rosen >> Cc: dev@dpdk.org; Ivan Ilchenko >> Subject: Re: [dpdk-dev] [PATCH] ethdev: forbid MTU set before device >> configure >> >> On 10/29/2021 7:19 AM, Andrew Rybchenko wrote: >>> On 10/29/21 8:58 AM, Jiang, YuX wrote: >>>>> -----Original Message----- >>>>> From: dev On Behalf Of Andrew Rybchenko >>>>> Sent: Friday, October 22, 2021 6:18 PM >>>>> To: Thomas Monjalon ; Yigit, Ferruh >>>>> ; Ajit Khaparde >>>>> ; Huisong Li ; >>>>> Ananyev, Konstantin ; Xu, Rosen >>>>> >>>>> Cc: dev@dpdk.org; Ivan Ilchenko >>>>> Subject: [dpdk-dev] [PATCH] ethdev: forbid MTU set before device >>>>> configure >>>>> >>>>> From: Ivan Ilchenko >>>>> >>>>> rte_eth_dev_configure() always sets MTU to either >>>>> dev_conf.rxmode.mtu or RTE_ETHER_MTU if application doesn't provide >> the value. >>>>> So, there is no point to allow rte_eth_dev_set_mtu() before since >>>>> set value will be overwritten on configure anyway. >>>>> >>>>> Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length") >>>>> >>>>> Signed-off-by: Ivan Ilchenko >>>>> Signed-off-by: Andrew Rybchenko >>>>> --- >>>>>   lib/ethdev/rte_ethdev.c | 7 +++++++ >>>>>   1 file changed, 7 insertions(+) >>>>> >>>>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index >>>>> 4ea5a657e0..0d7dd68dc1 100644 >>>>> --- a/lib/ethdev/rte_ethdev.c >>>>> +++ b/lib/ethdev/rte_ethdev.c >>>>> @@ -3728,6 +3728,13 @@ rte_eth_dev_set_mtu(uint16_t port_id, >>>>> uint16_t >>>>> mtu) >>>>>               return ret; >>>>>       } >>>>> >>>>> +    if (dev->data->dev_configured == 0) { >>>>> +        RTE_ETHDEV_LOG(ERR, >>>>> +            "Port %u must be configured before MTU set\n", >>>>> +            port_id); >>>>> +        return -EINVAL; >>>>> +    } >>>>> + >>>>>       ret = (*dev->dev_ops->mtu_set)(dev, mtu); >>>>>       if (ret == 0) >>>>>           dev->data->mtu = mtu; >>>>> -- >>>>> 2.30.2 >>>> Hi Ivan, >>>> >>>> We meet an issue based on this patch when test dpdk21.11-rc1. >>>> BugID: https://bugs.dpdk.org/show_bug.cgi?id=864, could you pls have a >> look? >>>> >>> >>> Hi, I think the problem is fixed by [1]. >>> >>> [1] >>> https://patches.dpdk.org/project/dpdk/patch/20211024164237.2116166-1- >> a >>> ndrew.rybchenko@oktetlabs.ru/ >> >> That patch is merged to next-net, Yu can you please verify the issue with >> latest next-net? > > Hi Ferruh, > We verify patch https://patches.dpdk.org/project/dpdk/patch/20211024164237.2116166-1-andrew.rybchenko@oktetlabs.ru/ on baseline dpdk main branch 6cc51b1293ceac4a77d4bf7ac91a8bbd59e1f78c > Test failed on nic XXV710 for 25GbE SFP28 158b/os Red Hat Enterprise Linux 8.4. > Need we verify it on next-net? > What exactly goes wrong in the test if the patch is applied? Andrew.