From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 2FD156CA3 for ; Wed, 9 May 2018 13:49:39 +0200 (CEST) Received: by mail-wm0-f54.google.com with SMTP id t11so24212329wmt.0 for ; Wed, 09 May 2018 04:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=fxtJcrLtMagJW9BC1PbTNKuZAKzvS6Os/dxQY82eNjk=; b=E/463bZ1BLii6XahXBhNtSdHaaWGGwgj6oliArnBADsa47rGCHORLpeja9d1WwgIdc +tbGlGwDk7LBzzqg9hQ4pa/4Pi6/+YREFZeQYnczBbdWRf7cSeYKNKg4QrGB3vtgJQIF 1WUVRpB2alguHQqByVAMWTAmzNCPdGwDqlLvXcsK188KF7JK7eLrK0mY+644Y9US6hzU HKg++ue1vFKl0nZ0yYlrJ/7FdECQVX1FBtJ+yuzG7+fpk4hBy1Nnfj9Iw11brZmGVMjH gYVPaBRZxDPD/5N1orREK50EVC1fy+jRs8zFEi4jBr/XzSjzBIl069FAoQcBTNnysto+ lYtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=fxtJcrLtMagJW9BC1PbTNKuZAKzvS6Os/dxQY82eNjk=; b=AHqYIvuCeAY9XaNykEid4yUVByHULf23eRuFX3HFtPBHz/lloJNWRL1x3rj+lViRbw VIOuVKs0iAeBHtpIoKO8zcwgBgGhskwUURJmR5Mv7FMJW3pajSq/YE+2UHTeJhx1jG+W 12zy4WjKTEKzcyVSL5ZhQ7K4f395WOB+ALm/cXNZYZC5BLvVMMUQxzygva+e7s4X1EQS YL2qizsFnB3BSCIDJy/NIuFYiIUSLpsJATOBryTSPlm3mtvOdKvwUVEh26DhQaqZ42Bj HmEfZJxE7l/RvFM/9tpfp5T3nWpaj1q5FGUmUkLS+ICtwR6N9LmxsKor17D5uX+cLLoQ P/zg== X-Gm-Message-State: ALQs6tBozwQBB/BIPwvOORGNvdqpX0v04dn7j6EDL8U7M8Ky0+oNZvkC RpmIVBGbAN2SN7I8Bx+Zp++kYQ== X-Google-Smtp-Source: AB8JxZrUV9r80QxGDijMS4hB8ryBbchgmHdwnXKBn/0Wc/Ze2iFWh95qROE8WDDsqbr57WvXXteslA== X-Received: by 2002:a50:aca4:: with SMTP id x33-v6mr59762052edc.270.1525866578927; Wed, 09 May 2018 04:49:38 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id p36-v6sm16506778eda.43.2018.05.09.04.49.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 May 2018 04:49:38 -0700 (PDT) Date: Wed, 9 May 2018 13:49:23 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Raslan Darawsheh Cc: dev@dpdk.org, matan@mellanox.com, thomas@monjalon.net, ophirmu@mellanox.com, stable@dpdk.org Message-ID: <20180509114923.2f7j3oe6m5bt5je2@bidouze.vm.6wind.com> References: <1525782013-17527-1-git-send-email-rasland@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1525782013-17527-1-git-send-email-rasland@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) 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: Wed, 09 May 2018 11:49:39 -0000 Hello Raslan, On Tue, May 08, 2018 at 03:20:13PM +0300, Raslan Darawsheh wrote: > The hot-plug alarm mechanism is responsible to practically execute both > plug in and out operations. It periodically tries to detect missed > sub-devices to be reconfigured and clean the resources of the removed > sub-devices. > > The hot-plug alarm is started by the failsafe probe function, and it's > wrongly 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. > > Uninstall the hot-plug alarm in case of error in probe function. > > Fixes: a46f8d58 ("net/failsafe: add fail-safe PMD") > Cc: stable@dpdk.org > > Signed-off-by: Raslan Darawsheh > > --- > v2 changes: > Reword the commit log. > > v3 changes: > Reword the commit log. Sorry I replied to the v3 instead, my comment on the v2 still stands. The v2 was not superseded in patchwork and the commit title changed, making me think it was two different fixes. > --- > --- > drivers/net/failsafe/failsafe.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.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 = RTE_INTR_HANDLE_EXT, > }; > return 0; > +cancel_alarm: > + failsafe_hotplug_alarm_cancel(dev); > free_args: > failsafe_args_free(dev); > free_subs: > -- > 2.7.4 > -- Gaëtan Rivet 6WIND