From: Suanming.Mou <mousuanming@huawei.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>, <dev@dpdk.org>
Cc: <vipin.varghese@intel.com>
Subject: Re: [dpdk-dev] [PATCH v5] app/pdump: add pudmp exits with primary support.
Date: Tue, 30 Apr 2019 19:25:45 +0800 [thread overview]
Message-ID: <49788495-9412-972b-5500-9ff48b36eafe@huawei.com> (raw)
Message-ID: <20190430112545.MhlvOnw7Ass0-WTkOj7x8ToQd8PxUsOPnIge1vIlhMQ@z> (raw)
In-Reply-To: <655f3c30-b277-fad7-6a68-64dd70fd3601@intel.com>
On 2019/4/30 17:42, Burakov, Anatoly wrote:
> On 30-Apr-19 12:35 PM, Suanming.Mou wrote:
>> When primary app exits, the residual running pdump will stop the
>> primary app to restart. Add pdump exits with primary support.
>>
>> Suggested-by: Varghese, Vipin <vipin.varghese@intel.com>
>> Suggested-by: Burakov, Anatoly <anatoly.burakov@intel.com>
>> Signed-off-by: Suanming.Mou <mousuanming@huawei.com>
>> ---
>
> <snip>
>
>> static void
>> +disable_primary_monitor(void)
>> +{
>> + int ret;
>> +
>> + /* Don't worry about it is primary exit case. The alarm cancel
>> + * function will take care about that. */
>> + ret = rte_eal_alarm_cancel(monitor_primary, NULL);
>> + if (ret < 0)
>> + printf("Fail to disable monitor fail:%d\n", ret);
>
> Double fail :)
Ah, yes, sorry for that the code gets worse. :(
>
>> +}
>> +
>> +static void
>> signal_handler(int sig_num)
>> {
>> if (sig_num == SIGINT) {
>> @@ -910,6 +936,19 @@ struct parse_val {
>> ;
>> }
>> +static void
>> +enable_primary_monitor(void)
>> +{
>> + int ret;
>> +
>> + /* Once primary exits, so will pdump. */
>> + ret = rte_eal_alarm_set(MONITOR_INTERVAL, monitor_primary, NULL);
>> + if (ret < 0) {
>> + cleanup_pdump_resources();
>> + rte_exit(EXIT_FAILURE, "Fail to monitor primary:%d\n", ret);
>> + }
>
> Why is this function void, when you could've called rte_exit() in the
> caller on failure? And why is it such a fatal error to set up the
> timer? IMO just a warning would've been enough.
Here comes with two issues:
Q1. The return value of the function:
A1: I'm so sorry that it does not seem to make sense to check the
function's return value. Does it mean if we change the timer set up from
error to warning, then we can use the return value to judge if need to
disable the primary_monitor?
Q2. The choice when rte_eal_alarm_set fail:
A2: OK, agree with that.
>
>> +}
>> +
>> int
>> main(int argc, char **argv)
>> {
>> @@ -950,11 +989,13 @@ struct parse_val {
>> rte_exit(EXIT_FAILURE, "Invalid argument\n");
>> }
>> - /* create mempool, ring and vdevs info */
>> + /* create mempool, ring, vdevs info and primary monitor */
>> create_mp_ring_vdev();
>> enable_pdump();
>> + enable_primary_monitor();
>> dump_packets();
>> + disable_primary_monitor();
>> cleanup_pdump_resources();
>> /* dump debug stats */
>> print_pdump_stats();
>>
>
>
next prev parent reply other threads:[~2019-04-30 11:26 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-25 16:35 [dpdk-dev] [PATCH] app/pdump: exits once primary app exited Suanming.Mou
2019-04-25 15:51 ` Varghese, Vipin
2019-04-25 15:51 ` Varghese, Vipin
2019-04-26 7:11 ` Suanming.Mou
2019-04-26 7:11 ` Suanming.Mou
2019-04-26 10:54 ` Varghese, Vipin
2019-04-26 10:54 ` Varghese, Vipin
2019-04-26 10:56 ` Varghese, Vipin
2019-04-26 10:56 ` Varghese, Vipin
2019-04-26 12:08 ` Suanming.Mou
2019-04-26 12:08 ` Suanming.Mou
2019-04-26 13:46 ` Burakov, Anatoly
2019-04-26 13:46 ` Burakov, Anatoly
2019-04-26 14:32 ` Suanming.Mou
2019-04-26 14:32 ` Suanming.Mou
2019-04-26 14:39 ` Burakov, Anatoly
2019-04-26 14:39 ` Burakov, Anatoly
2019-04-26 14:49 ` Suanming.Mou
2019-04-26 14:49 ` Suanming.Mou
2019-04-26 14:50 ` Burakov, Anatoly
2019-04-26 14:50 ` Burakov, Anatoly
2019-04-25 16:35 ` Suanming.Mou
2019-04-28 4:58 ` [dpdk-dev] [PATCH v2] app/pdump: add exit_with_primary option support Suanming.Mou
2019-04-28 4:58 ` Suanming.Mou
2019-04-28 5:07 ` [dpdk-dev] [PATCH v3] " Suanming.Mou
2019-04-28 5:07 ` Suanming.Mou
2019-04-30 3:39 ` [dpdk-dev] [PATCH v4] app/pdump: add pudmp exits with primary support Suanming.Mou
2019-04-30 2:33 ` Varghese, Vipin
2019-04-30 2:33 ` Varghese, Vipin
2019-04-30 3:43 ` Suanming.Mou
2019-04-30 3:43 ` Suanming.Mou
2019-04-30 5:03 ` Varghese, Vipin
2019-04-30 5:03 ` Varghese, Vipin
2019-04-30 9:34 ` Burakov, Anatoly
2019-04-30 9:34 ` Burakov, Anatoly
2019-04-30 10:37 ` Varghese, Vipin
2019-04-30 10:37 ` Varghese, Vipin
2019-04-30 16:38 ` Burakov, Anatoly
2019-04-30 16:38 ` Burakov, Anatoly
2019-04-30 3:39 ` Suanming.Mou
2019-04-30 11:35 ` [dpdk-dev] [PATCH v5] Make pdump exits with primary Suanming.Mou
2019-04-30 11:35 ` Suanming.Mou
2019-04-30 11:35 ` [dpdk-dev] [PATCH v5] app/pdump: add pudmp exits with primary support Suanming.Mou
2019-04-30 9:42 ` Burakov, Anatoly
2019-04-30 9:42 ` Burakov, Anatoly
2019-04-30 11:25 ` Suanming.Mou [this message]
2019-04-30 11:25 ` Suanming.Mou
2019-04-30 16:39 ` Burakov, Anatoly
2019-04-30 16:39 ` Burakov, Anatoly
2019-05-02 3:07 ` Suanming.Mou
2019-05-02 3:07 ` Suanming.Mou
2019-04-30 11:35 ` Suanming.Mou
2019-04-30 12:44 ` Pattan, Reshma
2019-04-30 12:44 ` Pattan, Reshma
2019-05-02 5:20 ` [dpdk-dev] [PATCH v6] " Suanming.Mou
2019-05-02 5:20 ` Suanming.Mou
2019-05-02 8:04 ` Varghese, Vipin
2019-05-02 8:04 ` Varghese, Vipin
2019-05-02 8:32 ` Suanming.Mou
2019-05-02 8:32 ` Suanming.Mou
2019-05-02 9:12 ` Burakov, Anatoly
2019-05-02 9:12 ` Burakov, Anatoly
2019-05-02 9:22 ` Varghese, Vipin
2019-05-02 9:22 ` Varghese, Vipin
2019-05-02 9:54 ` Pattan, Reshma
2019-05-02 9:54 ` Pattan, Reshma
2019-05-02 10:40 ` Suanming.Mou
2019-05-02 10:40 ` Suanming.Mou
2019-05-02 12:35 ` [dpdk-dev] [PATCH v7] " Suanming.Mou
2019-05-02 11:03 ` Pattan, Reshma
2019-05-02 11:03 ` Pattan, Reshma
2019-05-02 11:31 ` Burakov, Anatoly
2019-05-02 11:31 ` Burakov, Anatoly
2019-05-02 12:35 ` mousuanming
2019-05-02 12:35 ` mousuanming
2019-05-02 12:35 ` Suanming.Mou
2019-05-03 5:48 ` [dpdk-dev] [PATCH v8] " Suanming.Mou
2019-05-03 5:48 ` Suanming.Mou
2019-05-04 21:17 ` Thomas Monjalon
2019-05-04 21:17 ` Thomas Monjalon
2019-05-05 1:20 ` Suanming.Mou
2019-05-05 1:20 ` Suanming.Mou
2019-05-05 9:42 ` Thomas Monjalon
2019-05-05 9:42 ` Thomas Monjalon
2019-05-05 11:13 ` Suanming.Mou
2019-05-05 11:13 ` Suanming.Mou
2019-05-08 8:04 ` Thomas Monjalon
2019-05-08 8:04 ` Thomas Monjalon
2019-05-08 9:37 ` Suanming.Mou
2019-05-08 9:37 ` Suanming.Mou
2019-05-08 10:22 ` Thomas Monjalon
2019-05-08 10:22 ` Thomas Monjalon
2019-05-08 13:14 ` Suanming.Mou
2019-05-08 13:14 ` Suanming.Mou
2019-05-15 5:10 ` [dpdk-dev] [PATCH v9] app/pdump: exit with primary process Suanming.Mou
2019-05-15 5:10 ` Suanming.Mou
2019-06-20 12:32 ` Pattan, Reshma
2019-06-23 22:30 ` Thomas Monjalon
2019-07-10 14:04 ` Suanming Mou
2019-07-10 22:28 ` Thomas Monjalon
2019-04-29 9:14 ` [dpdk-dev] [PATCH v2] app/pdump: add exit_with_primary option support Burakov, Anatoly
2019-04-29 9:14 ` Burakov, Anatoly
2019-04-29 9:43 ` Suanming.Mou
2019-04-29 9:43 ` Suanming.Mou
2019-04-29 10:42 ` Burakov, Anatoly
2019-04-29 10:42 ` Burakov, Anatoly
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49788495-9412-972b-5500-9ff48b36eafe@huawei.com \
--to=mousuanming@huawei.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=vipin.varghese@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).