From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ananyev, Konstantin" Subject: Re: [PATCH v12 6/7] eal: add failure handle mechanism for hot-unplug Date: Tue, 2 Oct 2018 13:34:22 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580102FE0C4F@IRSMSX106.ger.corp.intel.com> References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1538483726-96411-1-git-send-email-jia.guo@intel.com> <1538483726-96411-7-git-send-email-jia.guo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" To: "Guo, Jia" , "stephen@networkplumber.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "gaetan.rivet@6wind.com" , "Wu, Jingjing" , "thomas@monjalon.net" , "motih@mellanox.com" , "matan@mellanox.com" , "Van Haaren, Harry" , "Zhang, Qi Z" , "He, Shaopeng" , "Iremonger, Bernard" , "arybchenko@solarflare.com" , "Lu, Wenzhuo" , "Burakov, Anatoly" , "jerin.jacob@caviumnetworks.com" Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 6147D7CCA for ; Tue, 2 Oct 2018 15:38:17 +0200 (CEST) In-Reply-To: <1538483726-96411-7-git-send-email-jia.guo@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Jeff, Looks ok to me in general, just one thing I missed before: > +static void sigbus_handler(int signum, siginfo_t *info, > + void *ctx __rte_unused) > +{ > + int ret; > + > + RTE_LOG(INFO, EAL, "Thread[%d] catch SIGBUS, fault address:%p\n", > + (int)pthread_self(), info->si_addr); > + > + rte_spinlock_lock(&failure_handle_lock); > + ret =3D rte_bus_sigbus_handler(info->si_addr); > + rte_spinlock_unlock(&failure_handle_lock); > + if (ret =3D=3D -1) { > + rte_exit(EXIT_FAILURE, > + "Failed to handle SIGBUS for hot-unplug, " > + "(rte_errno: %s)!", strerror(rte_errno)); > + } else if (ret =3D=3D 1) { > + if (sigbus_action_old.sa_handler) > + (*(sigbus_action_old.sa_handler))(signum); Shouldn't we check sigbus_action_old.sa_flags here,and based on that invoke either sa_handler() or sa_sigaction()? Konstantin > + else > + rte_exit(EXIT_FAILURE, > + "Failed to handle generic SIGBUS!"); > + } > + > + RTE_LOG(INFO, EAL, "Success to handle SIGBUS for hot-unplug!\n"); > +}