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 36B9441B9B; Wed, 1 Feb 2023 09:40:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D45AF4113F; Wed, 1 Feb 2023 09:40:20 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 18D194021F for ; Wed, 1 Feb 2023 09:40:20 +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 (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 379B05D; Wed, 1 Feb 2023 11:40:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 379B05D DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1675240819; bh=6vL1/bLqWAxds4/gDvTAWU7r05ZxK0H3v3fjdv9fA0k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ibBWJuW7hDTdC8hUhNcehbtCmJRmofHkFqdCovhZscLgeJsbqDQsSuNiNJc6Ns3U/ /7IT76EXwD660u69urDph7EL479S2oUIvqSbfBelsB9KCmyunlNBOm/yT+Cnk2vQQh kliW53cztNelAMpqTpuKaQuLKnJqHnt9+IetWGok= Message-ID: Date: Wed, 1 Feb 2023 11:40:18 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v4 2/3] ethdev: add standby state for live migration Content-Language: en-US To: Thomas Monjalon , Rongwei Liu Cc: dev@dpdk.org, matan@nvidia.com, viacheslavo@nvidia.com, orika@nvidia.com, jerinjacobk@gmail.com, stephen@networkplumber.org, rasland@nvidia.com, Ferruh Yigit , jerinj@marvell.com References: <20221221090017.3715030-2-rongweil@nvidia.com> <20230118154447.595231-3-rongweil@nvidia.com> <798721cd-92b8-3ee1-0aaa-20a63bb1cd67@oktetlabs.ru> <2738874.BEx9A2HvPv@thomas> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <2738874.BEx9A2HvPv@thomas> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 2/1/23 11:27, Thomas Monjalon wrote: > 01/02/2023 08:52, Andrew Rybchenko: >> On 1/18/23 18:44, Rongwei Liu wrote: >>> + * When configuring the device from a standby process, >>> + * it has no effect except for below situations: >>> + * - traffic not handled by the active process configuration >>> + * - no active process >>> + * >>> + * When a process is changed from a standby to an active role, >>> + * all preceding configurations that are queued by hardware >>> + * should become effective immediately. >>> + * Before role transition, all the traffic handling configurations >>> + * set by the active process should be flushed first. >>> + * >>> + * In summary, the operations are expected to happen in this order >>> + * in "old" and "new" applications: >>> + * device: already configured by the old application >>> + * new: start as active >>> + * new: probe the same device >>> + * new: set as standby >>> + * new: configure the device >>> + * device: has configurations from old and new applications >>> + * old: clear its device configuration >>> + * device: has only 1 configuration from new application >>> + * new: set as active >>> + * device: downtime for connecting all to the new application >>> + * old: shutdown >>> + * >>> + * @param standby >>> + * Role active if false, standby if true. >> >> Typically API with boolean parameters is bad. May be in this >> particular case it is better to have two functions: >> rte_eth_process_set_active() and rte_eth_process_set_standby(). > > Why? > It could be an enum as well. It is simply hard to read (what is set_role(true)???) and not extensible. enum instead of boolean is an acceptable alternative of many functions.