From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH v2 10/30] net/mlx5: separate DPDK from Verbs Rx queue objects Date: Fri, 6 Oct 2017 10:52:38 +0200 Message-ID: <20171006085238.GP15330@autoinstall.dev.6wind.com> References: <473a992610787eb996537bf2384cc314561f45f8.1507207731.git.nelio.laranjeiro@6wind.com> <20171006032637.GA19330@yongseok-MBP.local> 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: Yongseok Koh Return-path: Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by dpdk.org (Postfix) with ESMTP id 11E911B28D for ; Fri, 6 Oct 2017 10:52:49 +0200 (CEST) Received: by mail-wr0-f176.google.com with SMTP id r79so7202853wrb.13 for ; Fri, 06 Oct 2017 01:52:49 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20171006032637.GA19330@yongseok-MBP.local> 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 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. Thanks, -- Nélio Laranjeiro 6WIND