From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id AE7642C2B; Fri, 10 May 2019 05:14:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2019 20:14:30 -0700 X-ExtLoop1: 1 Received: from kmsmsx155.gar.corp.intel.com ([172.21.73.106]) by orsmga008.jf.intel.com with ESMTP; 09 May 2019 20:14:28 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.111]) by KMSMSX155.gar.corp.intel.com ([169.254.15.135]) with mapi id 14.03.0415.000; Fri, 10 May 2019 11:14:27 +0800 From: "Zhao1, Wei" To: wangyunjian , "dev@dpdk.org" CC: "i.maximets@samsung.com" , "xudingke@huawei.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/ixgbe: fix cancel link handler when port is being removed Thread-Index: AQHVBZzg8pC4KM8MqEizW7Arf7A3JaZjqAPQ Date: Fri, 10 May 2019 03:14:27 +0000 Message-ID: References: <1557319898-9588-1-git-send-email-wangyunjian@huawei.com> In-Reply-To: <1557319898-9588-1-git-send-email-wangyunjian@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix cancel link handler when port is being removed 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: Fri, 10 May 2019 03:14:32 -0000 Hi, wangyunjian May I ask some more info about it? Sure, we may this handler in ixgbe_dev_link_update_share (), but we have = "rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev)"=20 in function ixgbe_dev_stop() and ixgbevf_dev_stop() to cancel this handler= . If you want to remove dev, you will call ixgbe_dev_stop() first, RIGHT? Maybe there is an accidental situation that some interrupt like LSC trigger= ixgbe_dev_link_update() to set setup_link_alarm_handler just after dev sto= p? Then we need to cancel it in eth_ixgbe_dev_uninit(). Is you issue the same as above or other? > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wangyunjian > Sent: Wednesday, May 8, 2019 8:52 PM > To: dev@dpdk.org > Cc: i.maximets@samsung.com; xudingke@huawei.com; Yunjian Wang > ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/ixgbe: fix cancel link handler when port = is > being removed >=20 > From: Yunjian Wang >=20 > The nic's interrupt source has some active handler, which maybe call > ixgbe_dev_link_update() to set link handler. We should cancel the link ha= ndler > before remove dev to prevent executing the link handler. > It triggers segfault. >=20 > Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update= ") > Cc: stable@dpdk.org >=20 > Signed-off-by: Yunjian Wang > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > b/drivers/net/ixgbe/ixgbe_ethdev.c > index 975fa47..2470c89 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -1344,6 +1344,9 @@ struct rte_ixgbe_xstats_name_off { > /* cancel the delay handler before remove dev */ > rte_eal_alarm_cancel(ixgbe_dev_interrupt_delayed_handler, eth_dev); >=20 > + /* cancel the link handler before remove dev */ > + rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, eth_dev); > + > /* uninitialize PF if max_vfs not zero */ > ixgbe_pf_host_uninit(eth_dev); >=20 > -- > 1.8.3.1 >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 9030DA0096 for ; Fri, 10 May 2019 05:14:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E85AB4C74; Fri, 10 May 2019 05:14:34 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id AE7642C2B; Fri, 10 May 2019 05:14:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2019 20:14:30 -0700 X-ExtLoop1: 1 Received: from kmsmsx155.gar.corp.intel.com ([172.21.73.106]) by orsmga008.jf.intel.com with ESMTP; 09 May 2019 20:14:28 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.111]) by KMSMSX155.gar.corp.intel.com ([169.254.15.135]) with mapi id 14.03.0415.000; Fri, 10 May 2019 11:14:27 +0800 From: "Zhao1, Wei" To: wangyunjian , "dev@dpdk.org" CC: "i.maximets@samsung.com" , "xudingke@huawei.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/ixgbe: fix cancel link handler when port is being removed Thread-Index: AQHVBZzg8pC4KM8MqEizW7Arf7A3JaZjqAPQ Date: Fri, 10 May 2019 03:14:27 +0000 Message-ID: References: <1557319898-9588-1-git-send-email-wangyunjian@huawei.com> In-Reply-To: <1557319898-9588-1-git-send-email-wangyunjian@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix cancel link handler when port is being removed 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190510031427.M870AazO6w635GNI7fcxLGlr-w92q1AKq4Zy76rXdDw@z> Hi, wangyunjian May I ask some more info about it? Sure, we may this handler in ixgbe_dev_link_update_share (), but we have = "rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev)"=20 in function ixgbe_dev_stop() and ixgbevf_dev_stop() to cancel this handler= . If you want to remove dev, you will call ixgbe_dev_stop() first, RIGHT? Maybe there is an accidental situation that some interrupt like LSC trigger= ixgbe_dev_link_update() to set setup_link_alarm_handler just after dev sto= p? Then we need to cancel it in eth_ixgbe_dev_uninit(). Is you issue the same as above or other? > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wangyunjian > Sent: Wednesday, May 8, 2019 8:52 PM > To: dev@dpdk.org > Cc: i.maximets@samsung.com; xudingke@huawei.com; Yunjian Wang > ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/ixgbe: fix cancel link handler when port = is > being removed >=20 > From: Yunjian Wang >=20 > The nic's interrupt source has some active handler, which maybe call > ixgbe_dev_link_update() to set link handler. We should cancel the link ha= ndler > before remove dev to prevent executing the link handler. > It triggers segfault. >=20 > Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update= ") > Cc: stable@dpdk.org >=20 > Signed-off-by: Yunjian Wang > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > b/drivers/net/ixgbe/ixgbe_ethdev.c > index 975fa47..2470c89 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -1344,6 +1344,9 @@ struct rte_ixgbe_xstats_name_off { > /* cancel the delay handler before remove dev */ > rte_eal_alarm_cancel(ixgbe_dev_interrupt_delayed_handler, eth_dev); >=20 > + /* cancel the link handler before remove dev */ > + rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, eth_dev); > + > /* uninitialize PF if max_vfs not zero */ > ixgbe_pf_host_uninit(eth_dev); >=20 > -- > 1.8.3.1 >=20