From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by dpdk.org (Postfix) with ESMTP id 7A3CE1B5D3 for ; Fri, 26 Apr 2019 09:11:30 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B4A6DCEDA342A206EA32 for ; Fri, 26 Apr 2019 15:11:28 +0800 (CST) Received: from [127.0.0.1] (10.177.131.206) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Fri, 26 Apr 2019 15:11:26 +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> From: Suanming.Mou Message-ID: <25e85f37-231e-d303-8d7a-e3addd6534d5@huawei.com> Date: Fri, 26 Apr 2019 15:11:06 +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: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33DEB0@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: 7bit 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 07:11:30 -0000 On 2019/4/25 23:51, Varghese, Vipin wrote: > Hi, > > snipped >> @@ -847,6 +847,10 @@ struct parse_val { >> pdump_rxtx(pt->rx_ring, pt->rx_vdev_id, &pt->stats); >> if (pt->dir & RTE_PDUMP_FLAG_TX) >> pdump_rxtx(pt->tx_ring, pt->tx_vdev_id, &pt->stats); >> + >> + /* Once primary exits, so will I. */ >> + if (!rte_eal_primary_proc_alive(NULL)) >> + quit_signal = 1; >> } > 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. > 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. Maybe another async method should be introduced to monitor the primary status. > 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. > > 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. >> static int >> -- >> 1.7.12.4 > > 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 331C9A05D3 for ; Fri, 26 Apr 2019 09:11:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6597A1B5EB; Fri, 26 Apr 2019 09:11:32 +0200 (CEST) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by dpdk.org (Postfix) with ESMTP id 7A3CE1B5D3 for ; Fri, 26 Apr 2019 09:11:30 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B4A6DCEDA342A206EA32 for ; Fri, 26 Apr 2019 15:11:28 +0800 (CST) Received: from [127.0.0.1] (10.177.131.206) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Fri, 26 Apr 2019 15:11:26 +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> From: Suanming.Mou Message-ID: <25e85f37-231e-d303-8d7a-e3addd6534d5@huawei.com> Date: Fri, 26 Apr 2019 15:11:06 +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: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D33DEB0@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: 7bit 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: <20190426071106.9Ewm5SnJcfUhsnfSFAVLepttYryz4S8g2nZdZ5yu8Zg@z> On 2019/4/25 23:51, Varghese, Vipin wrote: > Hi, > > snipped >> @@ -847,6 +847,10 @@ struct parse_val { >> pdump_rxtx(pt->rx_ring, pt->rx_vdev_id, &pt->stats); >> if (pt->dir & RTE_PDUMP_FLAG_TX) >> pdump_rxtx(pt->tx_ring, pt->tx_vdev_id, &pt->stats); >> + >> + /* Once primary exits, so will I. */ >> + if (!rte_eal_primary_proc_alive(NULL)) >> + quit_signal = 1; >> } > 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. > 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. Maybe another async method should be introduced to monitor the primary status. > 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. > > 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. >> static int >> -- >> 1.7.12.4 > >