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 3F484A0547; Fri, 29 Oct 2021 08:19:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 680BD41136; Fri, 29 Oct 2021 08:19:44 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 7A3CF41135 for ; Fri, 29 Oct 2021 08:19:43 +0200 (CEST) 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) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 6C15F7F50B; Fri, 29 Oct 2021 09:19:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 6C15F7F50B DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1635488382; bh=Tm2TLNCv5RNYb2HZrYn7IhXrjf57enJ21WkCt7IjYUQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=HoSLHfz/cotyj2rNuSqCGeE+fXDrWqe1Rxr7aoXjOg1cAtm6XPt+XmepWYDllQrPr L6tjjuTBIvoSaRl+L/GbLbbrycipA4xAkpg/V10UrgOeGMz0P0FCqfSz5aEnDx6fal OtjKUTYkWD15ml8f8vAoFaQKdh9OthX+zsj8faMw= To: "Jiang, YuX" , Thomas Monjalon , "Yigit, Ferruh" , Ajit Khaparde , Huisong Li , "Ananyev, Konstantin" , "Xu, Rosen" Cc: "dev@dpdk.org" , Ivan Ilchenko References: <20211022101828.649441-1-andrew.rybchenko@oktetlabs.ru> From: Andrew Rybchenko Message-ID: <116518a0-cdb5-b4f0-a9b0-f58864904b7a@oktetlabs.ru> Date: Fri, 29 Oct 2021 09:19:41 +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: 7bit 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 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-andrew.rybchenko@oktetlabs.ru/