From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id E1A7B1B366; Thu, 18 Jan 2018 17:13:10 +0100 (CET) Received: from lfbn-lil-1-110-231.w90-45.abo.wanadoo.fr ([90.45.197.231] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ecCoT-0007xO-TZ; Thu, 18 Jan 2018 17:13:15 +0100 Received: by droids-corp.org (sSMTP sendmail emulation); Thu, 18 Jan 2018 17:13:08 +0100 Date: Thu, 18 Jan 2018 17:13:08 +0100 From: Olivier Matz To: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Cc: dev@dpdk.org, Adrien Mazarguil , Yongseok Koh , stable@dpdk.org Message-ID: <20180118161308.26ssahokrsu4e2rn@platinum> References: <20180118130043.31773-1-olivier.matz@6wind.com> <20180118160427.4fokyhq7koux6ga6@laranjeiro-vm.dev.6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180118160427.4fokyhq7koux6ga6@laranjeiro-vm.dev.6wind.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 1/2] net/mlx5: fix return value of start operation 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: Thu, 18 Jan 2018 16:13:11 -0000 On Thu, Jan 18, 2018 at 05:04:27PM +0100, Nélio Laranjeiro wrote: > On Thu, Jan 18, 2018 at 02:00:42PM +0100, Olivier Matz wrote: > > On error, mlx5_dev_start() does not return a negative value > > as it is supposed to do. The consequence is that the application > > (ex: testpmd) does not notice that the port is not started > > and begins the rxtx on an uninitialized port, which crashes. > > > > Fixes: e1016cb73383 ("net/mlx5: fix Rx interrupts management") > > Cc: stable@dpdk.org > > > > Signed-off-by: Olivier Matz > > --- > > drivers/net/mlx5/mlx5_trigger.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c > > index 1a20967a2..44f702daa 100644 > > --- a/drivers/net/mlx5/mlx5_trigger.c > > +++ b/drivers/net/mlx5/mlx5_trigger.c > > @@ -166,6 +166,7 @@ mlx5_dev_start(struct rte_eth_dev *dev) > > ERROR("%p: an error occurred while configuring control flows:" > > " %s", > > (void *)priv, strerror(err)); > > + err = -err; > > goto error; > > } > > err = priv_flow_start(priv, &priv->flows); > > @@ -173,6 +174,7 @@ mlx5_dev_start(struct rte_eth_dev *dev) > > ERROR("%p: an error occurred while configuring flows:" > > " %s", > > (void *)priv, strerror(err)); > > + err = -err; > > goto error; > > } > > err = priv_rx_intr_vec_enable(priv); > > @@ -196,7 +198,7 @@ mlx5_dev_start(struct rte_eth_dev *dev) > > priv_rxq_stop(priv); > > priv_flow_delete_drop_queue(priv); > > priv_unlock(priv); > > - return -err; > > + return err; > > } > > > > /** > > err in the function is handled with positives errno's, adding only those > two and returning err will make the other positive. I tried to check the return value of all functions called by mlx5_dev_start() (negative or positive). Do you see something wrong?