Commit 325db9c6 authored by Cosmin Ratiu's avatar Cosmin Ratiu Committed by Jakub Kicinski
Browse files

net/mlx5e: Use multiple CQ doorbells



Channel doorbells are now also used by all channel CQs.

A new 'uar' parameter is added to 'struct mlx5e_create_cq_param',
which is then used in mlx5e_alloc_cq.

A single UAR page has two TX doorbells and a single CQ doorbell, so
every consecutive pair of 'struct mlx5_sq_bfreg' (TX doorbells)
uses the same underlying 'struct mlx5_uars_page' (CQ doorbell).
So by using c->bfreg->up, CQs from every consecutive channel pair will
share the same CQ doorbell.

Non-channel associated CQs keep using the global CQ doorbell.

Signed-off-by: default avatarCosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 71fb4832
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1062,6 +1062,7 @@ struct mlx5e_create_cq_param {
	struct mlx5e_ch_stats *ch_stats;
	int node;
	int ix;
	struct mlx5_uars_page *uar;
};

struct mlx5e_cq_param;
+1 −0
Original line number Diff line number Diff line
@@ -611,6 +611,7 @@ void mlx5e_build_create_cq_param(struct mlx5e_create_cq_param *ccp, struct mlx5e
		.ch_stats = c->stats,
		.node = cpu_to_node(c->cpu),
		.ix = c->vec_ix,
		.uar = c->bfreg->up,
	};
}

+2 −0
Original line number Diff line number Diff line
@@ -578,6 +578,7 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c,
	ccp.ch_stats = c->stats;
	ccp.napi     = &c->napi;
	ccp.ix       = MLX5E_PTP_CHANNEL_IX;
	ccp.uar      = c->bfreg->up;

	cq_param = &cparams->txq_sq_param.cqp;

@@ -627,6 +628,7 @@ static int mlx5e_ptp_open_rx_cq(struct mlx5e_ptp *c,
	ccp.ch_stats = c->stats;
	ccp.napi     = &c->napi;
	ccp.ix       = MLX5E_PTP_CHANNEL_IX;
	ccp.uar      = c->bfreg->up;

	cq_param = &cparams->rq_param.cqp;

+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ static int mlx5e_open_trap_rq(struct mlx5e_priv *priv, struct mlx5e_trap *t)
	ccp.ch_stats = t->stats;
	ccp.napi     = &t->napi;
	ccp.ix       = 0;
	ccp.uar      = mdev->priv.bfreg.up;
	err = mlx5e_open_cq(priv->mdev, trap_moder, &rq_param->cqp, &ccp, &rq->cq);
	if (err)
		return err;
+1 −1
Original line number Diff line number Diff line
@@ -2238,7 +2238,7 @@ static int mlx5e_alloc_cq(struct mlx5_core_dev *mdev,
	param->eq_ix            = ccp->ix;

	err = mlx5e_alloc_cq_common(mdev, ccp->netdev, ccp->wq,
				    mdev->priv.bfreg.up, param, cq);
				    ccp->uar, param, cq);

	cq->napi     = ccp->napi;
	cq->ch_stats = ccp->ch_stats;