From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id E86CD1B273 for ; Fri, 26 Apr 2019 14:09:20 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 79BA92AB2379AF83D3B2 for ; Fri, 26 Apr 2019 20:09:18 +0800 (CST) Received: from [127.0.0.1] (10.177.131.206) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Fri, 26 Apr 2019 20:08:41 +0800 To: "Varghese, Vipin" , "Pattan, Reshma" CC: "'dev@dpdk.org'" References: <1556210141-43153-1-git-send-email-mousuanming@huawei.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33DEB0@BGSMSX101.gar.corp.intel.com> <25e85f37-231e-d303-8d7a-e3addd6534d5@huawei.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33E2C8@BGSMSX101.gar.corp.intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33E2E3@BGSMSX101.gar.corp.intel.com> From: Suanming.Mou Message-ID: Date: Fri, 26 Apr 2019 20:08:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33E2E3@BGSMSX101.gar.corp.intel.com> Content-Language: en-US X-Originating-IP: [10.177.131.206] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] app/pdump: exits once primary app exited X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 12:09:22 -0000 On 2019/4/26 18:56, Varghese, Vipin wrote: > > I will leave this suggestion open for comments from the maintainer. > Hi, Thanks for your suggestion. I have also tried to add an slave core to monitor the primary status this afternoon.  It works. I doubt if it can be add an new option as you suggested, but which will also require people who complain the exiting to add an extra slave core for that. Please waiting for the new patch in one or two days. > snipped > > Hi, > > Looks like something in email format setting is affecting the style. > Please find my replies below > > snipped > > As per the current suggested code flow check is added to while loop in function `dump_packets'. > > Thanks for the reply. Since want to make it clean, the code was here. > However, it seems need to take care of the performance impact first. > Response> thanks for acknowledging the same. > > Questions: > > 1. What is impact in performance with and without patch? > > A1. Do a little trick as the patch below to tested the impact in the single core mode on Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz with no pkts. > diff --git a/app/pdump/main.c b/app/pdump/main.c > index 3d208548fa13..804011b187c4 100644 > --- a/app/pdump/main.c > +++ b/app/pdump/main.c > @@ -141,7 +141,7 @@ struct parse_val { > >  static int num_tuples; > static struct rte_eth_conf port_conf_default; > -static volatile uint8_t quit_signal; > +static volatile uint32_t quit_signal; > static uint8_t multiple_core_capture; > >  /**< display usage */ > @@ -868,6 +868,7 @@ struct parse_val { > dump_packets(void) > { >       int i; > +      uint64_t start, end; >       uint32_t lcore_id = 0; > >        if (!multiple_core_capture) { > @@ -880,10 +881,20 @@ struct parse_val { >                              pdump_t[i].device_id, >                              pdump_t[i].queue); > > -              while (!quit_signal) { > +              /* make it hot */ > +              rte_eal_primary_proc_alive(NULL); > +              rte_eal_primary_proc_alive(NULL) > + > +              start = rte_rdtsc(); > +              while (quit_signal < 50000) { > +                     /* Just testing with and w/o the 'if' line below */ > +                     if (rte_eal_primary_proc_alive(NULL)) > +                             quit_signal++; >                      for (i = 0; i < num_tuples; i++) >                              pdump_packets(&pdump_t[i]); >               } > +              end = rte_rdtsc(); > +              printf("Totally count:%u, cost tsc:%lu\n", quit_signal, end - start); > >                return; >       } > The total tsc cost is about 338809671 with rte_eal_primary_proc_alive(). > And the tsc cost is just about 513573 without rte_eal_primary_proc_alive(). > The dpdk-pdump had also used taskset to bind to specify isolate core. > So it seems the patch do a great performance impact. > Response> thanks for confirming the suspicion. > Maybe another async method should be introduced to monitor the primary status. > Response> yes, without affecting the capture thread. > > 2. For various packet sizes and port speed what are delta in drops for packet capture? > > A2. Refer to A1, it's not needed anymore. > Response> A1 there is performance impact. > Note: If pdump application is still alive when primary is not running, primary cannot be started. Is this a cue that pdump is still alive and has to be terminated? > Yes, some guys complained that the residual dpdk-pdump impact the restart of the primary app and refuse to add other mechanisms e.g. to kill the dpdk-pdump in the app to avoid that case. > So the patch was created. > Is there any other ways to avoid that. > Response> in my humble opinion, best way around is add user option > like ‘--exit’; which then will add periodic rte_timer for user desired > seconds ‘0.1, 0.5, 1.0, 5.0’. The timer callback can run on master > core which sets ‘quit_signal’ once primary is no longer alive. In case > of ‘multi thread’ capture master thread is not involved in > dump_packets thus avoiding any packet drops or performance issue.. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 31257A05D3 for ; Fri, 26 Apr 2019 14:09:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BBC1F1B398; Fri, 26 Apr 2019 14:09:23 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id E86CD1B273 for ; Fri, 26 Apr 2019 14:09:20 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 79BA92AB2379AF83D3B2 for ; Fri, 26 Apr 2019 20:09:18 +0800 (CST) Received: from [127.0.0.1] (10.177.131.206) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Fri, 26 Apr 2019 20:08:41 +0800 To: "Varghese, Vipin" , "Pattan, Reshma" CC: "'dev@dpdk.org'" References: <1556210141-43153-1-git-send-email-mousuanming@huawei.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33DEB0@BGSMSX101.gar.corp.intel.com> <25e85f37-231e-d303-8d7a-e3addd6534d5@huawei.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33E2C8@BGSMSX101.gar.corp.intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33E2E3@BGSMSX101.gar.corp.intel.com> From: Suanming.Mou Message-ID: Date: Fri, 26 Apr 2019 20:08:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33E2E3@BGSMSX101.gar.corp.intel.com> Content-Language: en-US X-Originating-IP: [10.177.131.206] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] app/pdump: exits once primary app exited X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Message-ID: <20190426120825.KQJpA-WPdacUWgr7MXT3NZ5gnAWJHR88iQ9kGBXQ-sk@z> On 2019/4/26 18:56, Varghese, Vipin wrote: > > I will leave this suggestion open for comments from the maintainer. > Hi, Thanks for your suggestion. I have also tried to add an slave core to monitor the primary status this afternoon.  It works. I doubt if it can be add an new option as you suggested, but which will also require people who complain the exiting to add an extra slave core for that. Please waiting for the new patch in one or two days. > snipped > > Hi, > > Looks like something in email format setting is affecting the style. > Please find my replies below > > snipped > > As per the current suggested code flow check is added to while loop in function `dump_packets'. > > Thanks for the reply. Since want to make it clean, the code was here. > However, it seems need to take care of the performance impact first. > Response> thanks for acknowledging the same. > > Questions: > > 1. What is impact in performance with and without patch? > > A1. Do a little trick as the patch below to tested the impact in the single core mode on Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz with no pkts. > diff --git a/app/pdump/main.c b/app/pdump/main.c > index 3d208548fa13..804011b187c4 100644 > --- a/app/pdump/main.c > +++ b/app/pdump/main.c > @@ -141,7 +141,7 @@ struct parse_val { > >  static int num_tuples; > static struct rte_eth_conf port_conf_default; > -static volatile uint8_t quit_signal; > +static volatile uint32_t quit_signal; > static uint8_t multiple_core_capture; > >  /**< display usage */ > @@ -868,6 +868,7 @@ struct parse_val { > dump_packets(void) > { >       int i; > +      uint64_t start, end; >       uint32_t lcore_id = 0; > >        if (!multiple_core_capture) { > @@ -880,10 +881,20 @@ struct parse_val { >                              pdump_t[i].device_id, >                              pdump_t[i].queue); > > -              while (!quit_signal) { > +              /* make it hot */ > +              rte_eal_primary_proc_alive(NULL); > +              rte_eal_primary_proc_alive(NULL) > + > +              start = rte_rdtsc(); > +              while (quit_signal < 50000) { > +                     /* Just testing with and w/o the 'if' line below */ > +                     if (rte_eal_primary_proc_alive(NULL)) > +                             quit_signal++; >                      for (i = 0; i < num_tuples; i++) >                              pdump_packets(&pdump_t[i]); >               } > +              end = rte_rdtsc(); > +              printf("Totally count:%u, cost tsc:%lu\n", quit_signal, end - start); > >                return; >       } > The total tsc cost is about 338809671 with rte_eal_primary_proc_alive(). > And the tsc cost is just about 513573 without rte_eal_primary_proc_alive(). > The dpdk-pdump had also used taskset to bind to specify isolate core. > So it seems the patch do a great performance impact. > Response> thanks for confirming the suspicion. > Maybe another async method should be introduced to monitor the primary status. > Response> yes, without affecting the capture thread. > > 2. For various packet sizes and port speed what are delta in drops for packet capture? > > A2. Refer to A1, it's not needed anymore. > Response> A1 there is performance impact. > Note: If pdump application is still alive when primary is not running, primary cannot be started. Is this a cue that pdump is still alive and has to be terminated? > Yes, some guys complained that the residual dpdk-pdump impact the restart of the primary app and refuse to add other mechanisms e.g. to kill the dpdk-pdump in the app to avoid that case. > So the patch was created. > Is there any other ways to avoid that. > Response> in my humble opinion, best way around is add user option > like ‘--exit’; which then will add periodic rte_timer for user desired > seconds ‘0.1, 0.5, 1.0, 5.0’. The timer callback can run on master > core which sets ‘quit_signal’ once primary is no longer alive. In case > of ‘multi thread’ capture master thread is not involved in > dump_packets thus avoiding any packet drops or performance issue..