From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20041.outbound.protection.outlook.com [40.107.2.41]) by dpdk.org (Postfix) with ESMTP id BD53F7D0E; Tue, 8 May 2018 14:24:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=pDR66fA2+6xVcl9Yv4EoZvpckKf4OYC0XeOiQbPHpnY=; b=g4jREb+GADgr0nqKl8M/ItJqEQQc6kMs07YRtNu9Ku2N2YSy0CElQJAJV8mdaoK8nzfC6jfALf/Goo6+uo2HsA7XH1uIY6/c4W4JK5Q3ixbW+9c0XkLcOLxEiE0gzya5rDtTaCIFobyeD0tB3eBtEgVgHvph6ap6CM5n8DPgXsA= Received: from VI1PR0501MB2608.eurprd05.prod.outlook.com (10.168.137.20) by VI1PR0501MB2093.eurprd05.prod.outlook.com (10.167.196.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.17; Tue, 8 May 2018 12:24:48 +0000 Received: from VI1PR0501MB2608.eurprd05.prod.outlook.com ([fe80::49ca:b540:8f36:c063]) by VI1PR0501MB2608.eurprd05.prod.outlook.com ([fe80::49ca:b540:8f36:c063%17]) with mapi id 15.20.0735.019; Tue, 8 May 2018 12:24:48 +0000 From: Matan Azrad To: Raslan Darawsheh , "gaetan.rivet@6wind.com" CC: "dev@dpdk.org" , Thomas Monjalon , Ophir Munk , "stable@dpdk.org" Thread-Topic: [PATCH v3] net/failsafe: fix probe cleanup Thread-Index: AQHT5sby7gI1YWP8WkW0MWXPjXzMq6QlwS6A Date: Tue, 8 May 2018 12:24:48 +0000 Message-ID: References: <1525782013-17527-1-git-send-email-rasland@mellanox.com> In-Reply-To: <1525782013-17527-1-git-send-email-rasland@mellanox.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0501MB2093; 7:/I0N0hGp+OQFGaWwHX6bpEuzj81aykMY31dl1PbW5SlflCvSXAE+qMsLUnN45qdrV/6rCp5oMQpz8u30QR055tX+TnHWS+hTX3wEC4r4qHjaK2PklRMv7ETZ2jOyJSu19P21cc1YkAzLJza3oIj+6a7KmOtCGmANBYaqvqc7MXf0kMbJqUaiqi/drJLdM4gTz8QXVTNSy7YtZC1R+LBMweLYfJG8WeC358BaHbbBRB9CCzP/+eu1EGWq40sU1Xm3 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2093; x-ms-traffictypediagnostic: VI1PR0501MB2093: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR0501MB2093; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2093; x-forefront-prvs: 0666E15D35 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(396003)(39380400002)(39860400002)(189003)(199004)(26005)(110136005)(6346003)(3846002)(6116002)(53936002)(6246003)(3660700001)(54906003)(478600001)(316002)(8936002)(81166006)(7696005)(81156014)(2906002)(14454004)(74316002)(8676002)(5660300001)(33656002)(76176011)(7736002)(4326008)(106356001)(476003)(9686003)(102836004)(2501003)(6506007)(105586002)(486006)(97736004)(68736007)(305945005)(2900100001)(99286004)(5250100002)(86362001)(66066001)(59450400001)(6436002)(11346002)(3280700002)(55016002)(25786009)(446003)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2093; H:VI1PR0501MB2608.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-microsoft-antispam-message-info: vlA8sGNPikTYDFmmdPwPlPFDfjmBjGaCOuOcoZSRyxvtRs29yD3KGroPQzXXoG5aFVqK4Y0rFPU1VH4+W6fzwhfc2l/CFQ+Wl5gW7/eIGiWidIkM3tqTL3XXiqKvRK6r6+dl2cdDvvFg/4Z68p7zGZvQudSkJC7usQNuAKOL6cG16JLVt1OrMBxoQjLErkAN spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 9e7e8472-233f-4c6c-774a-08d5b4deb0b7 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e7e8472-233f-4c6c-774a-08d5b4deb0b7 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2018 12:24:48.1939 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2093 Subject: Re: [dpdk-dev] [PATCH v3] net/failsafe: fix probe cleanup 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, 08 May 2018 12:24:51 -0000 From: Raslan Darawsheh=FA Tuesday, May 8, 2018 3:20 PM > The hot-plug alarm mechanism is responsible to practically execute both p= lug > in and out operations. It periodically tries to detect missed sub-devices= to be > reconfigured and clean the resources of the removed sub-devices. >=20 > The hot-plug alarm is started by the failsafe probe function, and it's wr= ongly > not stopped if failsafe instance got an error. for example when starting = failsafe > with a MAC option, and giving it an invalid MAC address this will lead to= a NULL > pointer for the dev private field. Then when the hotplug alarm is called = it will > try to access this pointer, which will lead to a segmentation fault. >=20 > Uninstall the hot-plug alarm in case of error in probe function. >=20 > Fixes: a46f8d58 ("net/failsafe: add fail-safe PMD") > Cc: stable@dpdk.org >=20 > Signed-off-by: Raslan Darawsheh Acked-by: Matan Azrad >=20 > --- > v2 changes: > Reword the commit log. >=20 > v3 changes: > Reword the commit log. > --- > --- > drivers/net/failsafe/failsafe.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/fails= afe.c index > 5e7a8ba..3a747c2 100644 > --- a/drivers/net/failsafe/failsafe.c > +++ b/drivers/net/failsafe/failsafe.c > @@ -226,7 +226,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev) > mac); > if (ret) { > ERROR("Failed to set default MAC address"); > - goto free_args; > + goto cancel_alarm; > } > } > } else { > @@ -260,6 +260,8 @@ fs_eth_dev_create(struct rte_vdev_device *vdev) > .type =3D RTE_INTR_HANDLE_EXT, > }; > return 0; > +cancel_alarm: > + failsafe_hotplug_alarm_cancel(dev); > free_args: > failsafe_args_free(dev); > free_subs: > -- > 2.7.4