From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by dpdk.org (Postfix) with ESMTP id 80CF82C27 for ; Wed, 12 Apr 2017 19:04:37 +0200 (CEST) Received: by mail-wr0-f179.google.com with SMTP id o21so21509065wrb.2 for ; Wed, 12 Apr 2017 10:04:37 -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:in-reply-to; bh=ezlXYM0dfZS5eeltcDGXV1wEEDxr7gQhYdbKY72q1k8=; b=VYlylfsdT3oB8mcOw8oQosKki1Q1zw5/6f9U3im33jfDRk01qyGu/gbOYqdQpgqiuD 0IEYqdnIZX6WqSsf8G4ghyT/6pPyjKD0qbRo7E2GvKMJhtfCePyGV3qNqGYHzMBxvvQ5 J8qnzLbnTumvtdShE9Tr9LtptmVfDbE1UnnfePiChUfTKlxI/CnTtrCTetVdggVx7ZBd 8VGdCLDcEjp1FFVEJNCax4/8WY81njGGx807abaYtnbqa5mgQ9uVIK0wOoBTMrY+VFvT h5XcTDSJoLDd7Ve7BVj+SwsG546zPzq3/55Egbno6HQk8yXWd8yOn2GmWM99K1ay9xyS OAEg== 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:in-reply-to; bh=ezlXYM0dfZS5eeltcDGXV1wEEDxr7gQhYdbKY72q1k8=; b=P4dm4FfLR0DaelebMiK40PYxvtxLM2M8eOcVZVwWBxurfYhYD0HHq3mg+f3RPbu5Zv C8n/ODOdH9P4hcR/3w308UNh86ZT3zLR318uf/vN8UaJigjNOOFhwC8siKxi5CbP9psH 9n+r9wbGiTsDETXp0Mz77mm9PKqoECrX6fzE42UNGnVlkSgao1FNNsnJL+Xj8hYz9Rig vMGSRuaSc12NpWlzrLzqe3i09mCNvzVAd/3qr+WJc4RmBJRsWtpwItpcss+pPrXiMKE8 u0p71inD1YK911szc8w5gM7fcv7AKWcbDbOHD296YLkSz6GF1zLaMknFNFcLbDzQbsXB LElg== X-Gm-Message-State: AN3rC/6n+YCWbsoqHa+LDpGb9pGO04dA0xAza/7CHSdnB81YyHpv0JcM27uMuXww09LHx/Dg X-Received: by 10.223.176.13 with SMTP id f13mr4162833wra.124.1492016677225; Wed, 12 Apr 2017 10:04:37 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id a10sm26429222wra.17.2017.04.12.10.04.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Apr 2017 10:04:36 -0700 (PDT) Date: Wed, 12 Apr 2017 19:04:28 +0200 From: Adrien Mazarguil To: Ferruh Yigit Cc: Nelio Laranjeiro , dev@dpdk.org Message-ID: <20170412170428.GC3790@6wind.com> References: <6cc1a018-3d2b-e51b-97f3-737b93dccc26@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6cc1a018-3d2b-e51b-97f3-737b93dccc26@intel.com> Subject: Re: [dpdk-dev] [PATCH 2/2] net/mlx5: panic when destroying a queue in use 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, 12 Apr 2017 17:04:37 -0000 On Wed, Apr 12, 2017 at 05:48:40PM +0100, Ferruh Yigit wrote: > On 4/11/2017 4:21 PM, Nelio Laranjeiro wrote: > > Since the queue release API does not allow failures (return value is void) > > and the flow API does not allow a queue to be released as long as a flow > > rule depends on it, the only rational decision to avoid undefined behavior > > is to panic in this situation. > > > > Signed-off-by: Nelio Laranjeiro > > Acked-by: Adrien Mazarguil > > <...> > > > @@ -1248,6 +1249,9 @@ mlx5_rx_queue_release(void *dpdk_rxq) > > rxq_ctrl = container_of(rxq, struct rxq_ctrl, rxq); > > priv = rxq_ctrl->priv; > > priv_lock(priv); > > + if (priv_flow_rxq_in_use(priv, rxq)) > > + rte_panic("Rx queue %p is still used by a flow and cannot be" > > + " removed\n", (void *)rxq_ctrl); > > Actually, this adds exit code to the PMD, not sure this is good idea. > > There was a patch to remove them from libraries. The exit decision > should be belong to the application, not to the PMD, what do you think? I think rte_panic() makes sense in such cases. It's a voluntary crash similar to assert() (BUG_ON() for kernel folks) to avoids memory corruption and other nasty things which unfortunately can occur when applications happen to do things in the wrong order. In this specific case, it is caused by shortcomings in the current API, namely the lack of a return value for this function, which cannot be changed at this stage. This is not a fix as there is not really a commit to blame. > > > for (i = 0; (i != priv->rxqs_n); ++i) > > if ((*priv->rxqs)[i] == rxq) { > > DEBUG("%p: removing RX queue %p from list", > > > -- Adrien Mazarguil 6WIND