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 14C8AA0553; Sat, 11 Jun 2022 18:50:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A515B4021E; Sat, 11 Jun 2022 18:50:09 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id ACE7C40150 for ; Sat, 11 Jun 2022 18:50:07 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 4BDE539C5 for ; Sat, 11 Jun 2022 18:50:07 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 2318A37FE; Sat, 11 Jun 2022 18:50:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=ALL_TRUSTED, AWL, NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.6 X-Spam-Score: -2.6 Received: from [192.168.1.59] (unknown [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id B17BD35FA; Sat, 11 Jun 2022 18:50:06 +0200 (CEST) Message-ID: <2388f64e-6287-c930-7d2f-5644b855671b@lysator.liu.se> Date: Sat, 11 Jun 2022 18:50:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] doc/eal: add signal safety warning Content-Language: en-US To: Stephen Hemminger , dev@dpdk.org Cc: anatoly.burakov@intel.com References: <20220610152343.38455-1-stephen@networkplumber.org> From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= In-Reply-To: <20220610152343.38455-1-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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-06-10 17:23, 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 > --- > 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. > + Should we instead actually try to figure out what part of the API is and should remain async-signal-safe? And then say "nothing else is". Without an exhaustive list, we will leave the user to guessing, or going into the current implementation to find out if a particular function is currently async-signal-safe. When that code changes in a future supposed-to-be-backward-compatible DPDK release, the application will break. > + > .. _known_issue_label: > > Known Issues