[dpdk-dev] [PATCH v2 10/30] net/mlx5: separate DPDK from Verbs Rx queue objects

Nélio Laranjeiro nelio.laranjeiro at 6wind.com
Fri Oct 6 10:52:38 CEST 2017


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


More information about the dev mailing list