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 90071A052A; Mon, 25 Jan 2021 12:07:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1AD75140EFE; Mon, 25 Jan 2021 12:07:20 +0100 (CET) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id CE7B3140EEE for ; Mon, 25 Jan 2021 12:07:18 +0100 (CET) Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DPRqb0sFYzMPfk for ; Mon, 25 Jan 2021 19:05:47 +0800 (CST) Received: from [10.67.103.119] (10.67.103.119) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Mon, 25 Jan 2021 19:07:16 +0800 To: References: <20200826055233.26075-1-rohit.raj@nxp.com> <20201008153048.19369-1-rohit.raj@nxp.com> <20201008153048.19369-2-rohit.raj@nxp.com> From: oulijun Message-ID: <0c5203ec-2497-0be0-925a-834aa95fcc5a@huawei.com> Date: Mon, 25 Jan 2021 19:07:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.119] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v4 2/5] examples/multi_process: cleanup bus objects while terminating app 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 Sender: "dev" 在 2020/10/18 17:25, David Marchand 写道: > On Thu, Oct 8, 2020 at 5:31 PM wrote: >> >> From: Rohit Raj >> >> Certain bus objects may need to be closed and re-acquired >> while terminating and rerunning the client application. >> Hence a signal handler is required to catch the termination >> of the App and hence closing the bus objects. >> >> This patch adds the missing signal handler in the client >> app and closes the Bus objects in both client and server >> applications when the signal Handler is called. >> >> Signed-off-by: Rohit Raj >> --- >> .../multi_process/client_server_mp/mp_client/client.c | 11 +++++++++++ >> .../multi_process/client_server_mp/mp_server/main.c | 4 +++- >> 2 files changed, 14 insertions(+), 1 deletion(-) >> >> diff --git a/examples/multi_process/client_server_mp/mp_client/client.c b/examples/multi_process/client_server_mp/mp_client/client.c >> index 361d90b54..c37516b4c 100644 >> --- a/examples/multi_process/client_server_mp/mp_client/client.c >> +++ b/examples/multi_process/client_server_mp/mp_client/client.c >> @@ -11,6 +11,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -196,6 +197,14 @@ handle_packet(struct rte_mbuf *buf) >> >> } >> >> +static void >> +signal_handler(int signal) >> +{ >> + if (signal == SIGINT) >> + rte_eal_cleanup(); >> + exit(0); >> +} > > Calling rte_eal_cleanup from a signal handler is a bad idea. > In most cases, you are racing with other threads still using DPDK resources. > https://git.dpdk.org/dpdk/commit?id=2c434431f4 > https://git.dpdk.org/dpdk/commit?id=613ce6691c > > This might not be a problem in this multi_process example, but let's > keep a consistent way across all examples. > Thanks. Hi, I want to know why you don't think he's a problem. recently, we use the patch https://patchwork.dpdk.org/patch/86988/ startup with multiprocess. Use the tester to send traffic and kill the slave process repeatedly. The coredump exception occurs. According to my analysis, the cause is that resources are not released after the slave process is killed. Thanks Lijun Ou >