From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2018 06:38:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,332,1534834800"; d="scan'208";a="77839850" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga007.jf.intel.com with ESMTP; 02 Oct 2018 06:34:23 -0700 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.45]) by IRSMSX154.ger.corp.intel.com ([169.254.12.130]) with mapi id 14.03.0319.002; Tue, 2 Oct 2018 14:34:22 +0100 From: "Ananyev, Konstantin" 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" CC: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" Thread-Topic: [PATCH v12 6/7] eal: add failure handle mechanism for hot-unplug Thread-Index: AQHUWkv5mjhPK3X1tUaPIQ9K3cd+d6UL8+eg 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> In-Reply-To: <1538483726-96411-7-git-send-email-jia.guo@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTc4NTUxNDEtOGEzMi00NWUzLTliZGItZGRmZjI5ODJlOGE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNTNKbEZ3K1BrdDkreElSMWJWalc4YmU4WG5oTVBjUkNkdUlydFhuXC9OTkJkZVFwQjB6ZUJcL0NXbElkOWdTWnhjIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v12 6/7] eal: add failure handle mechanism for hot-unplug X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Oct 2018 13:38:18 -0000 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"); > +}