From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2 12/30] net/mlx5: add reference counter on DPDK Tx queues Date: Mon, 9 Oct 2017 19:33:46 +0100 Message-ID: <1d6bfd69-902f-fed0-020a-96fde64bd2c3@intel.com> References: <02443b4938aa8ffeada37efca7c25535a44ce8e0.1507207731.git.nelio.laranjeiro@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: adrien.mazarguil@6wind.com, yskoh@mellanox.com To: Nelio Laranjeiro , dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id CE1F81B219 for ; Mon, 9 Oct 2017 20:33:47 +0200 (CEST) In-Reply-To: <02443b4938aa8ffeada37efca7c25535a44ce8e0.1507207731.git.nelio.laranjeiro@6wind.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/5/2017 1:49 PM, Nelio Laranjeiro wrote: > Use the same design for DPDK queue as for Verbs queue for symmetry, this > also helps in fixing some issues like the DPDK release queue API which is > not expected to fail. With such design, the queue is released when the > reference counters reaches 0. > > Signed-off-by: Nelio Laranjeiro <...> > +struct mlx5_txq_ctrl* > +mlx5_priv_txq_get(struct priv *priv, uint16_t idx) > +{ > + struct mlx5_txq_ctrl *ctrl = NULL; > + > + if ((*priv->txqs)[idx]) { > + ctrl = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, > + txq); > + unsigned int i; > + > + mlx5_priv_txq_ibv_get(priv, idx); > + for (i = 0; i != MLX5_PMD_TX_MP_CACHE; ++i) { > + struct mlx5_mr *mr; While applying slightly updated as following to fix icc warning: struct mlx5_mr *mr = NULL; Please let me know if you disagree with update.