From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2017 11:33:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,501,1500966000"; d="scan'208";a="908256389" Received: from unknown (HELO [10.241.225.162]) ([10.241.225.162]) by FMSMGA003.fm.intel.com with ESMTP; 09 Oct 2017 11:33:46 -0700 To: Nelio Laranjeiro , dev@dpdk.org Cc: adrien.mazarguil@6wind.com, yskoh@mellanox.com References: <02443b4938aa8ffeada37efca7c25535a44ce8e0.1507207731.git.nelio.laranjeiro@6wind.com> From: Ferruh Yigit Message-ID: <1d6bfd69-902f-fed0-020a-96fde64bd2c3@intel.com> Date: Mon, 9 Oct 2017 19:33:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <02443b4938aa8ffeada37efca7c25535a44ce8e0.1507207731.git.nelio.laranjeiro@6wind.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 12/30] net/mlx5: add reference counter on DPDK Tx queues 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: Mon, 09 Oct 2017 18:33:48 -0000 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.