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 0859AA0568 for ; Tue, 28 Jun 2022 14:06:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE409410EE; Tue, 28 Jun 2022 14:06:27 +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 3EFBB400D7; Tue, 28 Jun 2022 14:06:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by guvercin.ceng.metu.edu.tr (Postfix) with ESMTP id 20CC02C1B6; Tue, 28 Jun 2022 15:06:24 +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 Q95_Q33hyMDj; Tue, 28 Jun 2022 15:06:20 +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 676E42C3AD; Tue, 28 Jun 2022 15:06:19 +0300 (+03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ceng.metu.edu.tr; s=mail; t=1656417980; bh=2BkHMw5laBYbPLsuRnIwu4xF3lgrJ7Gf+h4iz5PJkyc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cw/m63CJVN7wIHuDQtOMceANEiDV1bIkE23VGeJUiY9IVHliGkeRONoraEPINvkXh LAcwWj0cWiwoXx72Hn0hztj3Pw1OJi5UVvaML3FeCPGzyIm2gCxpPqMXfdIMhrXflJ sQ7hz+QPQR2g8mY3x8HDwGD79q8rm3rGJg139cMw= MIME-Version: 1.0 Date: Tue, 28 Jun 2022 15:06:19 +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> <1316cb8ca17a15f61db96dae18e99856@ceng.metu.edu.tr> User-Agent: Roundcube Webmail Message-ID: X-Sender: omer.yamac@ceng.metu.edu.tr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, Here is the final version. If it is ok, I will test the code and publish. if (enable_lcore_rx_distributor){ // rx and distributor combined, 3 fixed function cores (stat, TX, at least 1 worker) min_cores = 4; num_workers = rte_lcore_count() - 3; } else{ // separate rx and distributor, 3 fixed function cores (stat, TX, at least 1 worker) min_cores = 5; num_workers = rte_lcore_count() - 4; } On 28.06.2022 14:25, Hunt, David wrote: > On 28/06/2022 12:06, Omer Yamac wrote: >> 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-- > > > Hi Ömer, > >    You raise a good point about readability. Let's leave it as you had > it originally.  Maybe just add a couple of one-line comments? "rx and > distributor combined, 3 fixed function cores" and "separate rx and > distributor, 4 fixed function cores? > > Rgds, > Dave.