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 5E7A1A0547; Tue, 28 Jun 2022 13:06:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DFFB40691; Tue, 28 Jun 2022 13:06:50 +0200 (CEST) Received: from guvercin.ceng.metu.edu.tr (guvercin.ceng.metu.edu.tr [144.122.171.43]) by mails.dpdk.org (Postfix) with ESMTP id C9284400D7; Tue, 28 Jun 2022 13:06:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by guvercin.ceng.metu.edu.tr (Postfix) with ESMTP id 56C792C3AA; Tue, 28 Jun 2022 14:06:36 +0300 (+03) X-Virus-Scanned: Debian amavisd-new at ceng.metu.edu.tr Received: from guvercin.ceng.metu.edu.tr ([127.0.0.1]) by localhost (guvercin.ceng.metu.edu.tr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a3BscDf-NptC; Tue, 28 Jun 2022 14:06:27 +0300 (+03) Received: from roundcube.ceng.metu.edu.tr (kanarya.ceng.metu.edu.tr [144.122.171.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: e1885458) by guvercin.ceng.metu.edu.tr (Postfix) with ESMTPSA id 7EED42C1B6; Tue, 28 Jun 2022 14:06:26 +0300 (+03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ceng.metu.edu.tr; s=mail; t=1656414387; bh=keEHRJk6PHY4oEjEYVhAD7TjRK+Fqa/C3BTNKv1gNwk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jTJDWfdYzz+uE20pV3BOgxO+dFx5fpQ/4hI6rusW09Ko7YJd+VZ+Kb2r2blugrxaR F5tChmqkCe3NKdjxMJ5hHVdcM2aWr1bgZEEkNI4QPtejgsWfp2NEC3Fk6bU4L9uuHH 1H59SUeT9dJr3EFVx+zaNQG7zIp92iWwYR40lm10= MIME-Version: 1.0 Date: Tue, 28 Jun 2022 14:06:26 +0300 From: Omer Yamac To: "Hunt, David" Cc: dev@dpdk.org, stable@dpdk.org Subject: Re: [PATCH] examples/distributor: update dynamic configuration In-Reply-To: References: <20220621201517.76991-1-omer.yamac@ceng.metu.edu.tr> User-Agent: Roundcube Webmail Message-ID: <1316cb8ca17a15f61db96dae18e99856@ceng.metu.edu.tr> X-Sender: omer.yamac@ceng.metu.edu.tr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 Hi David, I have one more question. When I was working on new patch, I just want to make sure what we are doing. On 27.06.2022 18:51, Hunt, David wrote: > Hi Ömer, > > I've a few comments: > > On 21/06/2022 21:15, Abdullah Ömer Yamaç wrote: --clipped-- >> @@ -39,6 +39,7 @@ volatile uint8_t quit_signal_rx; >> volatile uint8_t quit_signal_dist; >> volatile uint8_t quit_signal_work; >> unsigned int power_lib_initialised; >> +bool enable_lcore_rx_distributor; >> static volatile struct app_stats { >> struct { --clipped-- >> @@ -724,7 +794,12 @@ main(int argc, char *argv[]) >> if (ret < 0) >> rte_exit(EXIT_FAILURE, "Invalid distributor parameters\n"); >> - if (rte_lcore_count() < 5) >> + if (enable_lcore_rx_distributor) >> + num_workers = rte_lcore_count() - 3; >> + else >> + num_workers = rte_lcore_count() - 4; >> + > > This could be "num_workers = rte_lcore_count() - (4 - > enable_lcore_rx_distributor)". > For the "if-else" case of enable_lcore_rx_distributor, we will reduce the line of codes; but I am not sure about that change. Because the type of the variable is bool and we are using arithmetic operation on that variable. I think it is a little bit harder for people to understand operation. Am I right? I can suggest one more solution. We may change the data type to "unsigned int" or Is it okay to leave as before? --clipped--