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 0E701A054F; Sat, 11 Jun 2022 00:53:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E528B40222; Sat, 11 Jun 2022 00:53:36 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 072CD40041 for ; Sat, 11 Jun 2022 00:53:35 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 527E420BE6B4; Fri, 10 Jun 2022 15:53:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 527E420BE6B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1654901614; bh=C6Jc0+uKvESJ3e98tW2d9FEN1orSlc4tf/fYWoq0P20=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gAOIMYda8BpitNrD/yBO+q/pc+fclqysuU6Po4w5g1IdS8T0MvGSUGCMY4bh9E1+t gBzQ5w8pdQk4mk8TBEJqHR0Jkfle79KDIxQihl5XJw3m7YIJXcG7uqEut59EefQvP9 UpDCQedl0D/bqWG+SJ87skQwGDlHjzKs/h8+iX3U= Date: Fri, 10 Jun 2022 15:53:34 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org, anatoly.burakov@intel.com Subject: Re: [PATCH] doc/eal: add signal safety warning Message-ID: <20220610225334.GB14494@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20220610152343.38455-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220610152343.38455-1-stephen@networkplumber.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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 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 > --- > 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 ^^^^^^^^^^^^^^^^^^^^^^^^^ above doesn't quite read right for me, maybe a missing word / needs re-wording? > +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