From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 84622F94 for ; Wed, 12 Apr 2017 18:48:43 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 12 Apr 2017 09:48:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,191,1488873600"; d="scan'208";a="88287659" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.122]) ([10.237.220.122]) by fmsmga006.fm.intel.com with ESMTP; 12 Apr 2017 09:48:41 -0700 To: Nelio Laranjeiro , dev@dpdk.org Cc: Adrien Mazarguil References: From: Ferruh Yigit Message-ID: <6cc1a018-3d2b-e51b-97f3-737b93dccc26@intel.com> Date: Wed, 12 Apr 2017 17:48:40 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 16:48:44 -0000 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? > for (i = 0; (i != priv->rxqs_n); ++i) > if ((*priv->rxqs)[i] == rxq) { > DEBUG("%p: removing RX queue %p from list", >