From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH] net/mlx5: fix xstats functions unlock missing Date: Wed, 23 Aug 2017 17:09:20 +0200 Message-ID: <20170823150920.GG12995@autoinstall.dev.6wind.com> References: <1502710344-28013-1-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Adrien Mazarguil , dev@dpdk.org, Shahaf Shuler , stable@dpdk.org To: Matan Azrad Return-path: Received: from mail-wr0-f173.google.com (mail-wr0-f173.google.com [209.85.128.173]) by dpdk.org (Postfix) with ESMTP id 87F617D5B for ; Wed, 23 Aug 2017 17:09:31 +0200 (CEST) Received: by mail-wr0-f173.google.com with SMTP id f8so1306830wrf.3 for ; Wed, 23 Aug 2017 08:09:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1502710344-28013-1-git-send-email-matan@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Aug 14, 2017 at 02:32:24PM +0300, Matan Azrad wrote: > The corrupted code didn't unlock the spinlock in xstats > get and reset functions error flow. > > Hence, if these errors happaned, the device spinlock was > left locked and many mlx5 device functionalities were blocked. > > The fix unlocks the spinlock in the missed places. > > Fixes: e62bc9e70608 ("net/mlx5: fix extended statistics") > > Signed-off-by: Matan Azrad > Cc: stable@dpdk.org > --- > drivers/net/mlx5/mlx5_stats.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c > index 703f48c..33997af 100644 > --- a/drivers/net/mlx5/mlx5_stats.c > +++ b/drivers/net/mlx5/mlx5_stats.c > @@ -442,8 +442,10 @@ mlx5_xstats_get(struct rte_eth_dev *dev, > > priv_lock(priv); > stats_n = priv_ethtool_get_stats_n(priv); > - if (stats_n < 0) > + if (stats_n < 0) { > + priv_unlock(priv); > return -1; > + } > if (xstats_ctrl->stats_n != stats_n) > priv_xstats_init(priv); > ret = priv_xstats_get(priv, stats); > @@ -468,10 +470,11 @@ mlx5_xstats_reset(struct rte_eth_dev *dev) > priv_lock(priv); > stats_n = priv_ethtool_get_stats_n(priv); > if (stats_n < 0) > - return; > + goto unlock; > if (xstats_ctrl->stats_n != stats_n) > priv_xstats_init(priv); > priv_xstats_reset(priv); > +unlock: > priv_unlock(priv); > } > > -- > 2.7.4 > Acked-by: Nelio Laranjeiro -- Nélio Laranjeiro 6WIND