From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <nelio.laranjeiro@6wind.com>
Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65])
 by dpdk.org (Postfix) with ESMTP id 55EE97F14
 for <dev@dpdk.org>; Tue,  5 Jun 2018 08:52:21 +0200 (CEST)
Received: by mail-wm0-f65.google.com with SMTP id r15-v6so2665599wmc.1
 for <dev@dpdk.org>; Mon, 04 Jun 2018 23:52:21 -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=ldRNZNh0DuWFvzFr5M8k2T6eDsBAf5uo9ZDaYZmCP0c=;
 b=IJv7W/m2xY7H28A1rUZf3K0wxvNkENeCb2IM6wxTobFLRPPeHW5ynJJvNDGwOBvma2
 ptlKlQrH2NUIpX3Ou7W8SXet/l52/k+N0Nqo6hVS3UvlPt6tq9YOh1fsvU/IUSHdNOuR
 dL3890DN9Igr7HRYeNnzXKYsYGK3aRm7l5ZRzrBIyTkYNlsp7hO/m+HOjeoUCBD3qHTk
 Asb6uHm2CSvmNF3vM1Zu6kwh14HgPxXVrvzCMrHVMkTRXR+t6sMWkG2dSVEjn0gVRSRv
 KeOx/n9Gsq1ya+nggaPjjJ9jDkntDdLM1KcLV/kX39ZAU/E4PsrtkYgwQYnYCx+BFlay
 0LRg==
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=ldRNZNh0DuWFvzFr5M8k2T6eDsBAf5uo9ZDaYZmCP0c=;
 b=AEaJP9u+kGF9551j9+LkbdUrikLTcEjUG9SiFtd078vjCq9bx/ZCKS149vMYVl4eUL
 XuWsppVJgKLLySTjW/5g4D9Q2qWrDl1JL1zTgOpiUZw7P2U+yE9KR8xuEr565FTQI/Z8
 QIoJbAxVESYzCbrPUNZKdaPxqO1mOq2ZRZQ3QXn+XQGhoTG/HKjGeTwbGyFklLMyuonT
 QNfUyN3O51nMQ6kdS6aOG+fDxX6OGKAyUrzJ9L9jk43yhe9DQIfcBXJ2LNgAZFVPPHj+
 DPvZTC7+4FQQJ9gCgyI6eJg0mhIJQewXt9fwAEjSju/pXm25xteEAL4R9bp31AC5K+Sk
 j3jA==
X-Gm-Message-State: APt69E1w0UjSmdy5VCEjU/J6eh09Fb57SG64VXYWDLd4+N14l1A5uMSJ
 exndcKyg2UUs0EMf7ty9sOCY
X-Google-Smtp-Source: ADUXVKJfLqnvZgHO3fINOcuqRXUlNllSXVr6O/oJ0KFqu/r/6/Tbzlv1soPe+L2d1BY8LGRvpIw+jw==
X-Received: by 2002:a1c:ad50:: with SMTP id
 w77-v6mr1244492wme.54.1528181541030; 
 Mon, 04 Jun 2018 23:52:21 -0700 (PDT)
Received: from laranjeiro-vm.dev.6wind.com
 (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78])
 by smtp.gmail.com with ESMTPSA id c11-v6sm28697072wri.49.2018.06.04.23.52.19
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 04 Jun 2018 23:52:20 -0700 (PDT)
Date: Tue, 5 Jun 2018 08:52:46 +0200
From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro <nelio.laranjeiro@6wind.com>
To: Yongseok Koh <yskoh@mellanox.com>
Cc: adrien.mazarguil@6wind.com, dev@dpdk.org, shahafs@mellanox.com,
 stable@dpdk.org
Message-ID: <20180605065246.mw7xnk24cfwxy4an@laranjeiro-vm.dev.6wind.com>
References: <20180604173731.29125-1-yskoh@mellanox.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20180604173731.29125-1-yskoh@mellanox.com>
User-Agent: NeoMutt/20170113 (1.7.2)
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix error number handling
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jun 2018 06:52:21 -0000

On Mon, Jun 04, 2018 at 10:37:31AM -0700, Yongseok Koh wrote:
> rte_errno should be saved only if error has occurred because rte_errno
> could have garbage value.
> 
> Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 994be05be..eaffe7495 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -3561,7 +3561,8 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev,
>  		/* The flow does not match. */
>  		continue;
>  	}
> -	ret = rte_errno; /* Save rte_errno before cleanup. */
> +	if (ret)
> +		ret = rte_errno; /* Save rte_errno before cleanup. */
>  	if (flow)
>  		mlx5_flow_list_destroy(dev, &priv->flows, flow);
>  exit:
> -- 
> 2.11.0

This patch is not enough, the returned value being -rte_errno if no
error is detected by the function it cannot set rte_errno nor return it.

Thanks,

-- 
Nélio Laranjeiro
6WIND