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 06784A0A0F; Mon, 5 Jul 2021 11:50:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C8FA34068C; Mon, 5 Jul 2021 11:50:06 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 2C1B74003C for ; Mon, 5 Jul 2021 11:50:05 +0200 (CEST) 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 AEFA27F463; Mon, 5 Jul 2021 12:50:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru AEFA27F463 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1625478604; bh=TdZw4EdO8GpFYGxRv18NAHFxkxoIVAA3Bzd6+zsOetY=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=NwXk95I8G8d5qLNZGehDEGO9JQr3aZRIzmIMrJ5ByvrKqSCbRm/DBfc64iMkxSYz1 /mi9WSZP5+ncuuvvndDe5vMSkECl/ah87UqmFy57LGO4WoTJe07dPSU+PFYtiuRiQ1 vludT7jXPZQ5jnDrNXZ7+JcIoZeWCB0+rXLpQlS8= To: Huisong Li , "Ananyev, Konstantin" , "Yigit, Ferruh" , "dev@dpdk.org" Cc: Thomas Monjalon References: <1620460836-38506-1-git-send-email-lihuisong@huawei.com> <644f214d-887a-02ae-5476-af8e6d100221@huawei.com> <256aa58e-7455-e861-ee22-eb87ddd2db67@oktetlabs.ru> <15094894-8483-1aef-cdae-700384130fa3@intel.com> <61f83abc-4567-7a42-220d-ccc808a2aaa4@huawei.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: Date: Mon, 5 Jul 2021 12:50:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [RFC] lib/ethdev: add dev configured flag 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 7/5/21 6:03 AM, Huisong Li wrote: > > 在 2021/7/3 19:04, Ananyev, Konstantin 写道: >>> 在 2021/7/2 21:23, Ananyev, Konstantin 写道: >>>>> On 7/2/2021 12:08 PM, Andrew Rybchenko wrote: >>>>>> @Thomas, @Ferruh, I tend to accept it (with minor style fixes), >>>>>> but I need your opinion on it before doing it. >>>>>> >>>>> I guess we were relying on the user/application to have correct >>>>> order up until >>>>> now, it can be good to add this into the API. OK to add it for me. >>>> I don't know do we really need that flag in dev_data or not, >>>> but if we do - probably better to reset it at dev_confgure() >>>> straight before >>>> we start to make any changes in dev_data. >>> Sorry, I don't get you. Some fields in rte_eth_dev_data are initialized >>> firstly in the probe phase. >>> >>> Do you mean to add clear this flag at the beginning of dev_configure()? >> Yes, just before we start to modify things. > > In this patch, this flag has been cleared for all scenarios where the > rte_eth_dev_data modification fails in the dev_configure(). > > And it is set to 1 when dev_configure() is configured successfully. > > Please check the rollback. Thanks😁 I guess Konstantin means the case when user re-configures the device which has been configured before and the operation fails. I'm not 100% what should be the state of the flag when dev_configure callback is executed. I'd say that it should be 0 when the first configure happens and should be 1 in the case of reconfigure. I'll try to review it carefully when non-RFC version of the patch is available.