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 5BAE5A0553; Sat, 11 Jun 2022 03:37:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0841B40222; Sat, 11 Jun 2022 03:37:07 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 03E1C40041 for ; Sat, 11 Jun 2022 03:37:04 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LKgRF0Qw4zDqn7; Sat, 11 Jun 2022 09:36:41 +0800 (CST) Received: from [127.0.0.1] (10.67.100.224) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 11 Jun 2022 09:37:02 +0800 Subject: Re: [PATCH] doc/eal: add signal safety warning To: Tyler Retzlaff , Stephen Hemminger CC: , References: <20220610152343.38455-1-stephen@networkplumber.org> <20220610234240.GC14494@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> From: fengchengwen Message-ID: Date: Sat, 11 Jun 2022 09:37:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20220610234240.GC14494@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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 On 2022/6/11 7:42, Tyler Retzlaff wrote: > On Fri, Jun 10, 2022 at 08:23:43AM -0700, Stephen Hemminger wrote: >> The DPDK is not designed to be used from a signal handler. >> Add a notice in the documentation describing this limitation, >> similar to Linux signal-safety manual page. >> >> Bugzilla ID: 1030 >> Signed-off-by: Stephen Hemminger > > Acked-by: Tyler Retzlaff Acked-by: Chengwen Feng > >> --- >> doc/guides/prog_guide/env_abstraction_layer.rst | 13 +++++++++++++ >> 1 file changed, 13 insertions(+) >> >> diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst >> index 5f0748fba1c0..36ab4b5ba9b6 100644 >> --- a/doc/guides/prog_guide/env_abstraction_layer.rst >> +++ b/doc/guides/prog_guide/env_abstraction_layer.rst >> @@ -732,6 +732,19 @@ controlled with tools like taskset (Linux) or cpuset (FreeBSD), >> - with affinity restricted to 2-3, the Control Threads will end up on >> CPU 2 (main lcore, which is the default when no CPU is available). >> >> +Signal Safety >> +~~~~~~~~~~~~~ >> + >> +The DPDK functions in general can not be safely called from a signal handler. >> +Most functions are not async-signal-safe because they can acquire locks >> +and other resources that make them nonrentrant. >> + >> +To avoid problems with unsafe functions, can be avoided if required >> +signals are blocked and a mechanism such as signalfd (Linux) is used >> +to convert the asynchronous signals into messages that are processed >> +by a EAL thread. >> + >> + >> .. _known_issue_label: >> >> Known Issues >> -- >> 2.35.1 > > . >