From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yongseok Koh Subject: Re: [PATCH v2 10/30] net/mlx5: separate DPDK from Verbs Rx queue objects Date: Fri, 6 Oct 2017 15:57:08 -0700 Message-ID: <20171006225708.GB20117@yongseok-MBP.local> References: <473a992610787eb996537bf2384cc314561f45f8.1507207731.git.nelio.laranjeiro@6wind.com> <20171006032637.GA19330@yongseok-MBP.local> <20171006085238.GP15330@autoinstall.dev.6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, adrien.mazarguil@6wind.com, ferruh.yigit@intel.com To: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Return-path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00081.outbound.protection.outlook.com [40.107.0.81]) by dpdk.org (Postfix) with ESMTP id 7FFA01AEE9 for ; Sat, 7 Oct 2017 00:57:34 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20171006085238.GP15330@autoinstall.dev.6wind.com> 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 Fri, Oct 06, 2017 at 10:52:38AM +0200, Nélio Laranjeiro wrote: > On Thu, Oct 05, 2017 at 08:26:38PM -0700, Yongseok Koh wrote: > > On Thu, Oct 05, 2017 at 02:49:42PM +0200, Nelio Laranjeiro wrote: > > [...] > > > +struct mlx5_rxq_ibv* > > > +mlx5_priv_rxq_ibv_get(struct priv *priv, uint16_t idx) > > > +{ > > > + struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[idx]; > > > + struct mlx5_rxq_ctrl *rxq_ctrl; > > > + > > > + if (idx >= priv->rxqs_n) > > > + return NULL; > > > + if (!rxq_data) > > > + return NULL; > > > + rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq); > > > + if (rxq_ctrl->ibv) { > > > + priv_mr_get(priv, rxq_data->mp); > > > > One rxq_ibv has one mr as one rxq has one mp. As long as rxq_ibv exist, the mr > > can't be released. So, it looks unnecessary to increase refcnt of the mr here. > >[...] > > But on MP can be shared among several queues, (see eth_rx_queue_setup() > and eth_tx_queue_setup()), which means that a queue is not the single > owner of the Memory pool and thus the memory region. > > As the Memory region can be shared among several queues, it is necessary > to increase/decrease the ref count accordingly. Here again, as mr->refcnt is increased when it firstly referenced/created in mlx5_priv_rxq_ibv_new(), I thought it was redundant. If so, priv_mr_release() can also be called once when rxq_ibv is really destroyed. Thanks, Yongseok