From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 0E804374F for ; Tue, 2 May 2017 08:45:23 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id n198so11754395wmg.0 for ; Mon, 01 May 2017 23:45:22 -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=D761arszjRboXsQrldkXaPJRzJzQHU/iwbmTZA6gpns=; b=CvzkY9Y/eYxH+awlN6IBpReL9W1e/0X10+nHeTQWQzBfh2cdi9g4Cx+ZckMFutcFXr 7WKRwEyUkXucTYpwDU9Kgiccjb7GAtKETxEFgUWdgPUSun10+AvTz3E7fGSp/NHZ0QF9 DKeDe9Kos2B/JqikLEMcvErTF7iDZhjZxOQGd9I0aY9qr7clKHxXL0/+q9eTqm3W5d9B bdFRD/3zRVH0kI4OIa4NdoiN4Ci/KbV02oOkSYLNtXfGdI9o8EoSBxvzok34kBljKW21 uq0g7SQfxhBWo2qM0G56Ags2LqkEC0mpCyos0+0WsU955EqzakxvcUWAcLotXdRkM16+ 7fUg== 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=D761arszjRboXsQrldkXaPJRzJzQHU/iwbmTZA6gpns=; b=RR+f0beVX/p663wkdKnm8Om344euF9g+MX17OiTt3oFe4kDtKVwL4nSe28ZdIWs5jb FHp9vb7g7wHkj/AladPQnU25iC0IIAwOis3i4K/mn61Ht8JLQwp6MZWC/iuKIweWKe56 kbew0MP7hIT6603rl4dRQxOat4PIiSpSw3RZPCRYiL3n5Lkv2DkaYlkwVjAQfpyobYs1 1u4GclJsmRkyN1F518Axm2+dBWh88gLB3NnuQjPsNZKTR0gmeRL+zvfSLF84QuGXIgbM B24zVvIoXW471nwqPJ6kvjX0Zpz9FKj4OtNwSoAQqL2bHQvCPiV4RsiYNn3Xuv/GW246 Xi2A== X-Gm-Message-State: AN3rC/7Bt+TR51KNdhETJpjY/8h7PzVnpWBZOXYwydQ7OGmc0Yt5ZKxh y4SdF76eynYLeHGT X-Received: by 10.28.52.197 with SMTP id b188mr917971wma.31.1493707522649; Mon, 01 May 2017 23:45:22 -0700 (PDT) Received: from autoinstall.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id w18sm10256494wra.34.2017.05.01.23.45.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 May 2017 23:45:22 -0700 (PDT) Date: Tue, 2 May 2017 08:45:15 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Yongseok Koh Cc: ferruh.yigit@intel.com, dev@dpdk.org, adrien.mazarguil@6wind.com Message-ID: <20170502064515.GE31330@autoinstall.dev.6wind.com> References: <20170501210542.5032-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: <20170501210542.5032-1-yskoh@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix crash on deleting flow drop queue 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, 02 May 2017 06:45:23 -0000 On Mon, May 01, 2017 at 02:05:42PM -0700, Yongseok Koh wrote: > If mlx5_dev_start() fails, it tries to rollback data structures related to > rte_flow including drop queue. The destruction code doesn't assume the > structures are created but priv_flow_delete_drop_queue() never does sanity > check. This can cause a crash. > > Fixes: 028761059aeb ("net/mlx5: use an RSS drop queue") > > Signed-off-by: Yongseok Koh > --- > drivers/net/mlx5/mlx5_flow.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index cd3e5daf3..adcbe3f52 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -1465,13 +1465,18 @@ priv_flow_delete_drop_queue(struct priv *priv) > struct rte_flow_drop *fdq = priv->flow_drop_queue; > unsigned int i; > > - claim_zero(ibv_destroy_qp(fdq->qp)); > - claim_zero(ibv_exp_destroy_rwq_ind_table(fdq->ind_table)); > + if (!fdq) > + return; > + if (fdq->qp) > + claim_zero(ibv_destroy_qp(fdq->qp)); > + if (fdq->ind_table) > + claim_zero(ibv_exp_destroy_rwq_ind_table(fdq->ind_table)); > for (i = 0; i != MLX5_DROP_WQ_N; ++i) { > - assert(fdq->wqs[i]); > - claim_zero(ibv_exp_destroy_wq(fdq->wqs[i])); > + if (fdq->wqs[i]) > + claim_zero(ibv_exp_destroy_wq(fdq->wqs[i])); > } > - claim_zero(ibv_destroy_cq(fdq->cq)); > + if (fdq->cq) > + claim_zero(ibv_destroy_cq(fdq->cq)); > rte_free(fdq); > priv->flow_drop_queue = NULL; > } > -- > 2.11.0 Acked-by: Nelio Laranjeiro -- Nélio Laranjeiro 6WIND